Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@mojito-inc/core-service
Advanced tools
šØāš» React components for the Mojito Platform, Reference App and third-party projects, including Mojito's core service
Version: 1.0.0
create .npmrc file from root dir and copy & paste following code,
If you have Personal follow step 2
Create Personal token: https://github.com/settings/tokens
Copy the personal token and replace to <PROFILE_TOKEN>
@mojitoinc:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<PROFILE_TOKEN>
You can install this project with one of these commands:
npm install --save @mojitoinc/core-service
yarn add @mojitoinc/core-service
Once the package is installed, you can import the library using import;
Two way of integration Core API provider uri or apollo client, if pass both param priority is client only.
import { CoreServiceProvider } from "@mojitoinc/core-service";
<CoreServiceProvider uri={ 'https://api.dev.graphql.com' } token={ 'Bearer <Token>' }>
{ children }
</CoreServiceProvider>
Param | type | Description |
---|---|---|
uri | string | skip this param, if client param passed |
client | Apollo Client | skip this param, if uri param passed |
token | string | Optional |
After setup with CoreServiceProvider, API can be access via hooks
following the api are
It will provide a message that should be used for in signing process
import { useClaims, Response, GetSignatureData } from "@mojitoinc/core-service";
const { getSignatureMessage } = useClaims();
const response: Response<GetSignatureData> = await getSignatureMessage({
orgId: <ORG_ID>,
networkID: <NETWORK_ID>,
walletAddress: <WALLET_ADDRESS>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
networkID | UUID1 | ā | |
walletAddress | string | ā |
{
"data: {
"getSignatureMessage": "This message is used for signature validation for organization caa and wallet address 0x6588ec22a85d611c8c3cd254d0c063d0be78a6c1 at 2023-02-22T04:39:23Z"
}
}
The request receiver retrieves the Signature security token
import { useClaims, Response, LoginWithSignatureData } from "@mojitoinc/core-service";
const { loginWithSignature } = useClaims();
const response: Response<LoginWithSignatureData> = await loginWithSignature({
challenge: <GET_SIGNATURE_MESSAGE>,
signature: <CROSS_MINT_SIGNATURE>,
signer: <SIGNER_ADDRESS>,
chainId: <CHAIN_ID>,
orgId: <ORG_ID>,
});
Param | type | Required | Description |
---|---|---|---|
challenge | String | ā | |
signature | String | ā | |
signer | String | ā | |
chainId | Int | ā | Int can represent values between -(2^31) and 2^31 - 1 |
orgId | UUID1 | ā |
{
"data": {
"loginWithSignature": {
"token": "344fbc51-b6d4-4428-9783-b09dd9df95fb"
}
}
}
Redeem a claimable code
import { useClaims, Response, RedeemClaimableCodeData } from "@mojitoinc/core-service";
const { redeemClaimableCode } = useClaims();
const response: Response<RedeemClaimableCodeData> = await redeemClaimableCode({
code: discountCode,
destAddr: address,
});
Param | type | Required | Description |
---|---|---|---|
code | string | ā | |
destAddr | string | ā |
{
"data": {
"redeemClaimableCode": {
"success": true
}
}
}
will receives 1 unit crypto equivalent USD price
import { useConversion, Response, USDConversionData } from '@mojitoinc/core-service';
const { getUSDConversion } = useConversion();
const response: Response<USDConversionData> = await getUSDConversion({ cryptoCurrencyCode: <cryptoCurrencyCode> });
Param | type | Required | Description |
---|---|---|---|
cryptoCurrencyCode | enum | ā | CryptoCurrencyCode |
Enum Variable | value |
---|---|
ETH | ETH |
MATIC | MATIC |
WETH | WETH |
WMATIC | WMATIC |
{
"data": {
"getUSDPrice": {
"amount": "1799.34",
"currency": "USD",
"base": "ETH",
}
}
}
will receives list of supported currency by id
import { useConversion, Response, GetSupportedCurrenciesData } from '@mojitoinc/core-service';
const { getSupportedCurrency, GetSupportedCurrenciesData } = useConversion();
const response: Response<GetSupportedCurrenciesData> = await getSupportedCurrency({ nftTokenId: '514fedfe-165b-451b-b2f6-63667e66c096', orgId: 'f2f5c627-5421-4c40-9913-edfd09dd98b3' });
Param | type | Required | Description |
---|---|---|---|
nftTokenId | UUID | ā | |
orgId | UUID | ā |
{
"data": {
"getSupportedCurrencies": [
{
"id": "8b2343d6-8a8b-11ed-9e0a-42010a940031",
"name": "ETH",
"networkId": "c41db347-0ee3-4212-943a-ca213b8e0ea8",
"symbol": "ETH",
"contractAddress": "0x0000000000000000000000000000000000000000",
"secondaryMarketplaceContractAddress": "0xB658b650F0B2Dacd90aF58Ad78b3a6F8eb9BdF21",
"network": {
"id": "c41db347-0ee3-4212-943a-ca213b8e0ea8",
"name": "Goerli Testnet",
"chainID": 5,
"wethAddress": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
"paymentCurrency": "WETH"
}
},
]
}
}
Auction Details and Auction History
import { useAuction } from '@mojitoinc/core-service';
const { auctionDetails } = useAuction();
const response: Response<AuctionData> = await auctionDetails({ id: <ID> });
Param | type | Required | Description |
---|---|---|---|
id | UUID | ā |
{
"data": {
"collectionItemById": {
"id": "8ed1783c-c4c4-47f1-9384-5ff64f2ebc97",
"name": "POCA During Sale 2",
"artist": null,
"status": "Active",
"description": null,
"details": {
"id": "68d2fee2-db56-48f4-9e10-e703e9054ae6",
"startingBid": 0.0001,
"startDate": "2023-03-22T05:00:00Z",
"endDate": "2023-03-22T11:00:00Z",
"currentBid": {
"userId": "afca6cad-782c-4338-b71d-9193b14b736d",
"currentBid": 0.0002,
"isMine": false,
"walletAddress": "0x669dbFF9c68CAC7b52C4B789f5Ebc3b5293D0a73",
"marketplaceUser": {
"id": "afca6cad-782c-4338-b71d-9193b14b736d",
"username": null,
"avatar": null,
},
},
"myBid": null,
"bids": [
{
"id": "9b407667-fc96-4022-a892-8c5d2fea4e52",
"amount": 0.0002,
"createdAt": "2023-03-22T09:32:15Z",
"maximumBid": null,
"marketplaceAuctionLotId": "68d2fee2-db56-48f4-9e10-e703e9054ae6",
"walletAddress": "0x669dbFF9c68CAC7b52C4B789f5Ebc3b5293D0a73",
"txHash": "0xa6d9d6474e759134bd85d9111376366a3e8360f93eafc723646967c63d675422",
"marketplaceUser": {
"id": "afca6cad-782c-4338-b71d-9193b14b736d",
"username": null,
"avatar": null,
},
}
],
},
}
}
}
Receive tax and contract address
import { useAuction, OnChainBidResponse } from '@mojitoinc/core-service';
const { verifyOnChainBid } = useAuction();
const response: Response<OnChainBidResponse> = await verifyOnChainBid({
lotID=<lotID>,
orgID=<orgID>,
walletAddress=<walletAddress>,
amount: <amount>, });
Param | type | Required | Description |
---|---|---|---|
lotID | UUID | ā | |
orgID | UUID | ā | |
walletAddress | string | ā | |
amount | Int | ā |
{
"data": {
"verifyOnchainBid": {
"amount": 0.0003,
"tax": 0.000055575933397801415,
"onChainAuctionContractAddress": "0xeed7f3e16a6018d65dffd63bc30ac252c034edc1",
"commissionFee": 0.000005999999999999999,
"platformFee": 0.000005999999999999999,
"__typename": "OnChainBidResponse"
}
}
}
Auction submit
import { confirmOnChainBid, BidsItemData } from '@mojitoinc/core-service';
const { confirmOnChainBid } = useAuction();
const response: Promise<Response<BidsItemData>> = await confirmOnChainBid({
lotID=<lotID>
orgID=<orgID>
walletAddress=<walletAddress>
amount=<amount>
tax=<tax>
txhash=<txhash>
commissionFee=<commissionFee>
platformFee<platformFee<> });
{
"data": {
"confirmOnchainBid": {
"amount": 0.0005,
"tax": 0.00007216969871926542,
"__typename": "MarketplaceAuctionBid"
}
}
}
User API can be access via hooks
following the api are
It will provide a active user data
import { useUser, GetUserData } from "@mojitoinc/mojito-core-service";
const { currentUser } = useUser();
const response: Response<GetUserData> = await currentUser({
orgId: <ORG_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā |
{
"data: {
"me": {
"id": "d1a59f7e-8626-46f9-b0ca-b70477910c8c",
"userOrgs": [
{
"id": "30ec5163-90bc-4b6a-a0a1-8696cc19c327",
"role": "Admin",
"organizationId": "d086ea16-d40d-454c-84a4-64b5e940670a",
"organization": {
"purchaseLimitWithoutKYC": 0
},
"kycStatus": "Clear",
"w8Form": true,
"isBlacklisted": false,
"bidAllowed": true,
"avatar": null,
"username": "020704f2-cb16-4c26-bed0-4ac0dbdf67bb",
"settings": null,
"reason": ""
}
]
}
}
}
It can able to update the user details
import { useUser, updateUserOrgSettingsData } from "@mojitoinc/mojito-core-service";
const { updateUserOrgSettings } = useUser();
const response: Response<updateUserOrgSettingsData> = await updateUserOrgSettings({
userOrgId: <USER_ORG_ID>,
username: <USER_NAME>,
avatar: <AVATAR>,
settingsJson: <SETTING_JSON>,
profilePic: <PROFILE_PIC>
});
Param | type | Required | Description |
---|---|---|---|
userOrgId | UUID1 | ā | |
username | String | ā | |
avatar | String | ā | |
settingsJson | String | ||
profilePic | String |
{
"data: {
"updateUserOrgSettings": {
"id": "d1a59f7e-8626-46f9-b0ca-b70477910c8c",
"username": "test",
"avatar": "U0BpDFXLEKmMNPly",
}
}
}
KYC API can be access via hooks
following the api are
It can able to create form to complete KYC
import { useKYC } from "@mojitoinc/mojito-core-service";
const { createApplicant } = useKYC();
const response: Response<CreateApplicantData> = await createApplicant({
orgID: <ORG_ID>,
input: {
firstName: <FIRST_NAME>,
lastName: <LAST_NAME>,
dob: <DATE_OF_BIRTH>,
address: {
country: <COUNTRY>,
state: <STATE>,
town: <TOWN>,
postcode: <POSTAL_CODE>
}
},
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
input | ApplicantRequest | ā |
{
"data: {
"createApplicant": {
"id": "7578afa6-cb7e-45cc-82ef-5c5821ebec42",
"firstName": "test",
"lastName": "test",
"email": "",
"dob": "1998-12-22",
"href": "/v3.2/applicants/7578afa6-cb7e-45cc-82ef-5c5821ebec42",
"idNumbers": null,
"address": {
"flatNumber": null,
"buildingNumber": "12",
"buildingName": null,
"street": "test road",
"subStreet": null,
"town": "new york",
"postcode": "12345",
"country": "US",
"line1": null,
"line2": null,
"line3": null,
"state": "new york"
}
}
}
}
It can able to check the details
import { useKYC } from "@mojitoinc/mojito-core-service";
const { createCheck } = useKYC();
const response: Response<CreateCheckData> = await createCheck({
applicantID: <APPLICANT_ID>,
});
Param | type | Required | Description |
---|---|---|---|
applicantID | UUID1 | ā |
{
"data: {
"createCheck": {
"id": "c2854107-93b6-4200-a1f7-ad28beaa9d1d",
"success": true
}
}
}
It can able to get user kyc details
import { useKYC } from "@mojitoinc/mojito-core-service";
const { getApplicant } = useKYC();
const response: Response<GetApplicantData> = await getApplicant({
organizationID: <ORGANIZATION_ID>,
});
Param | type | Required | Description |
---|---|---|---|
organizationID | UUID1 | ā |
{
"data: {
"getApplicant": {
"id": "262f085c-474b-44be-8568-e1b58a16c97f",
"firstName": "test",
"lastName": "test",
"email": "",
"dob": "1998-12-22",
"href": "/v3.2/applicants/7578afa6-cb7e-45cc-82ef-5c5821ebec42",
"idNumbers": null,
"address": {
"flatNumber": null,
"buildingNumber": "12",
"buildingName": null,
"street": "test road",
"subStreet": null,
"town": "new york",
"postcode": "12345",
"country": "US",
"line1": null,
"line2": null,
"line3": null,
"state": "new york"
}
}
}
}
It can able to get sdk token
import { useKYC } from "@mojitoinc/mojito-core-service";
const { getSDKToken } = useKYC();
const response: Response<GetSDKTokenData> = await getSDKToken({
applicantID: <APPLICANT_ID>,
referrer: <REFERRER>,
});
Param | type | Required | Description |
---|---|---|---|
applicantID | UUID1 | ā | |
referrer | String | ā |
{
"data: {
"getSDKToken": {
"token": "eyJhbGciOiJFUzUxMiJ9.eyJleHAiOjE2ODExMTgzNjEsInBheWxvYWQiOnsiYXBwIjoiNzU3OGFmYTYtY2I3ZS00NWNjLTgyZWYtNWM1ODIxZWJlYzQyIiwiY2xpZW50X3V1aWQiOiIyMmQyYzQ1NC0zNzMxLTQ4N2UtYmUzYS05N2I4NmQ4NWYzOWMiLCJpc19zYW5kYm94Ijp0cnVlLCJpc19zZWxmX3NlcnZpY2VfdHJpYWwiOmZhbHNlLCJpc190cmlhbCI6ZmFsc2UsInJlZiI6Imh0iHBzOi8vd2hpc2tleWV4Y2hhbmdlLWRldi5uZXRsaWZ5LmFwcC8iLCJzYXJkaW5lX3Nlc3Npb24iOiI1NzkxMGUyMC0yMTljLTQxZTItOTUzOS1lYjJhYjFmZDdiZTQifSwidXVpZCI6InBsYXRmb3JtX3N0YXRpY19hcGlfdG9rZW5fdXVpZCIsInVybHMiOnsiZGV0ZWN0X2RvY3VtZz50X3VybCI6Imh0dHBzOi8vc2RrLnVzLm9uZmlkby5jb20iLCJzeW5jX3VybCI6Imh0dHBzOi8vc3luYy5vbmZpZG8uY29tIiwiaG9zdGVkX3Nka191cmwiOiJodHRwczovL2lkLm9uZmlkby5jb20iLCJhdXRoX3VybCI6Imh0dHBzOi8vYXBpLnVzLm9uZmlkby5jb20iLCJvbmZpZG9fYXBpX3VybCI6Imh0dHBzOi8vYXBpLnVzLm9uZmlkby5jb20iLCJ0ZWxlcGhvbnlfdXJsIjoiaHR0cHM6Ly9hcGkudXMub25maWRvLmNvbSJ9fQ.MIGIAkIAtiM1UkIpaTKIGeTn6sYfX3GR4fTWPq_AeU1RxwQDQu5S7K3NM1z5hzh01sTo3KK_elpMh27XC0mhR9MkLt3kkroCQgG9gAW4w0vO1k1dXJKzbq3WDpklTqXtjT3plDbe5_bM8QujgjlbaW7nkASg68BYqa7P5UHOI5p-_QBayflaU3wXa"
}
}
}
It can able to update the user kyc details
import { useKYC } from "@mojitoinc/mojito-core-service";
const { updateApplicant } = useKYC();
const response: Response<UpdateApplicantData> = await updateApplicant({
orgID: <ORG_ID>,
input: {
firstName: <FIRST_NAME>,
lastName: <LAST_NAME>,
dob: <DATE_OF_BIRTH>,
address: {
country: <COUNTRY>,
state: <STATE>,
town: <TOWN>,
postcode: <POSTAL_CODE>
}
},
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
input | ApplicantRequest | ā |
{
"data: {
"updateApplicant": {
"id": "7578afa6-cb7e-45cc-82ef-5c5821ebec42",
"firstName": "test",
"lastName": "test",
"email": "",
"dob": "1998-12-22",
"href": "/v3.2/applicants/7578afa6-cb7e-45cc-82ef-5c5821ebec42",
"idNumbers": null,
"address": {
"flatNumber": null,
"buildingNumber": "12",
"buildingName": null,
"street": "test road",
"subStreet": null,
"town": "new york",
"postcode": "12345",
"country": "US",
"line1": null,
"line2": null,
"line3": null,
"state": "new york"
}
}
}
}
Connect wallet API can be access via hooks
following the api are
It can able to connect wallet
import { useConnectWallet, ConnectExternalWalletData } from "@mojitoinc/mojito-core-service";
const { connectExternalWallet } = useConnectWallet();
const response: Response<ConnectExternalWalletData> = await connectExternalWallet({
signature: <SIGNATURE>,
message: <MESSAGE>,
address: <ADDRESS>,
orgID: <ORG_ID>,
networkID: <NETWORK_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
networkID | UUID1 | ā | |
message | String | ā | |
signature | String | ā | |
address | String | ā |
{
"data": {
"connectExternalWallet": true
}
}
It can able to get wallet data
import { useConnectWallet, GetActiveWalletsContentData } from "@mojitoinc/mojito-core-service";
const { getActiveWalletsContent } = useConnectWallet();
const response: Response<GetActiveWalletsContentData> = await getActiveWalletsContent({
orgID: <ORG_ID>,
networkId: <NETWORK_ID>,
walletAddress: <WALLET_ADDRESS>,
filters: <FILTERS>,
refreshCache: <REFRESH_CACHE>,
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
networkId | UUID1 | ā | |
walletAddress | String | ā | |
filters | ActiveWalletFilterInput | ||
refreshCache | Boolean |
{
"data": {
"getActiveWalletsContent": {
"tokens": [
{
"contractAddress": "0xd0e2fd21764f643fa32b06a4c7d7924f43138d90",
"id": "6",
"network": "Goerli Testnet",
"tokenType": "ERC1155",
"title": "BasedHead #6",
"tokenURI": "https://drops.api.topdogstudios.io/basedAf/token/6",
"nftTokenId": "5bc739a6-f5d3-4417-b4af-91687e0af525",
"mintedAt": "2023-01-25T14:18:02Z",
"status": "SALE_PENDING",
"metadata": {
"name": "BasedHead #6",
"description": "This PFP will be affiliated to the Fraz corporation.\n\nFraz is believed to have begun in the mid-1800s as the JP Fraz and Sons Tinctures and Cure-all Company. However, the lack of any supporting evidence that TrashLand existed before the 1980s suggests that this may not be factually correct. Fraz makes a variety of different food items, all alcoholic beverages, which are distilled from edible shore drift sourced on the island. In 2022, Fraz was announced as the official drink of the Metaverse.\n\n[Download V0 BasedHead](https://ipfs.io/ipfs/QmWiDG1zG7vncPYXMEVSkRYcn2gsujAACSyUsbXvD33ezC)",
"image": "https://ipfs.io/ipfs/QmQJBFoLqcgxDogd5pLgbMKn6u4RPiu1djUfecuZxMhdzk",
"animationURL": "",
"openSeaImageURL": ""
},
"contractName": "test",
"artistName": "Test",
},
]
}
}
}
It can able to get the supported networks list
import { useConnectWallet, GetSupportedNetworksData } from "@mojitoinc/mojito-core-service";
const { getSupportedNetworks } = useConnectWallet();
const response: Response<GetSupportedNetworksData> = await getSupportedNetworks({
orgId: <ORG_ID>,
includeTestnets: <INCLUDE_TESTNETS>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
includeTestnets | Boolean |
{
"data": {
"getSupportedNetworks": [
{
"id": "f7babe75-2dfc-434a-9e3b-a28e101c4863",
"name": "Ethereum Mainnet",
"chainID": 1,
"isTestnet": false
},
{
"id": "c41db347-0ee3-4212-943a-ca213b8e0ea8",
"name": "Goerli Testnet",
"chainID": 5,
"isTestnet": true
},
]
}
}
List item API can be access via hooks
following the api are
It can able to create list item for sale
import { useListItem, CreateSignatureToListNFTForSaleData } from "@mojitoinc/mojito-core-service";
const { createSignatureToListNFTForSale } = useListItem();
const response: Response<CreateSignatureToListNFTForSaleData> = await createSignatureToListNFTForSale({
orgId: <ORG_ID>,
nftTokenId: <NFT_TOKEN_ID>,
tokenType: <TOKEN_TYPE>,
quantity: <QUANTITY>,
nftOwnerAddress: <NFT_OWNER_ADDRESS>,
fixedPrice: <FIXED_PRICE>,
paymentToken: <PAYMENT_TOKEN>,
currencyId: <CURRENCY_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
nftTokenId | UUID1 | ā | |
tokenType | TokenType | ā | |
quantity | Int | ā | |
nftOwnerAddress | String | ā | |
fixedPrice | Float | ā | |
paymentToken | String | ā | |
currencyId | UUID1 | ā |
{
"data": {
"createSignatureToListNFTForSale": {
"messageToSign": "0xc061ed6367ab12e87d93ac081487f069e4c8ba3b6bc100fec2a1afffd937f632",
"order": {
"id":"32dc6e44-79f3-4d2f-8068-94639e543a6e"
"nftTokenId":"6bd80dcd-9cc8-4078-a7e2-02c5164d7ab4"
"tokenContract":"0xd0e2fd21764f643fa32b06a4c7d7924f43138d90"
"tokenId":"15"
"tokenType":"ERC1155"
"quantity":1
"nftOwnerAddress":"0xC7e893488A039A341d935959E52f86085976F865"
"fixedPrice":0.04
"paymentToken":"0x0000000000000000000000000000000000000000"
"orderType":"LISTING"
}
}
}
}
It can able to remove listing an item
import { useListItem, RemoveListingData } from "@mojitoinc/mojito-core-service";
const { createSignatureToListNFTForSale } = useListItem();
const response: Response<RemoveListingData> = await removeListing({
orgID: <ORG_ID>,
nftTokenId: <NFT_TOKEN_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
nftTokenId | UUID1 | ā |
{
"data": {
"removeListing": "Listing removed."
}
}
It can able to submit approval for listing an item
import { useListItem, SubmitProofOfApprovalData } from "@mojitoinc/mojito-core-service";
const { submitProofOfApproval } = useListItem();
const response: Response<SubmitProofOfApprovalData> = await submitProofOfApproval({
orgID: <ORG_ID>,
nftTokenId: <NFT_TOKEN_ID>,
signature: <SIGNATURE>,
quantity: <QUANTITY>,
fixedPrice: <FIXED_PRICE>,
paymentToken: <PAYMENT_TOKEN>,
currencyId: <CURRENCY_ID>,
creatorFee: <CREATOR_FEE>,
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
nftTokenId | UUID1 | ā | |
signature | String | ā | |
quantity | Int | ||
fixedPrice | Float | ||
paymentToken | String | ||
currencyId | UUID1 | ||
creatorFee | TokenType |
{
"data": {
"submitProofOfApproval":"Signature updated."
}
}
Tax and fee API can be access via hooks
following the api are
It can able to get tax and fee data
import { useFee, EstimateTaxAndRoyaltyFeeData } from "@mojitoinc/mojito-core-service";
const { estimateTaxAndRoyaltyFee } = useFee();
const response: Response<EstimateTaxAndRoyaltyFeeData> = await estimateTaxAndRoyaltyFee({
orgId: <ORG_ID>,
estimateType: <ESTIMATE_TYPE>,
nftTokenId: <NFT_TOKEN_ID>,
orderId: <ORDER_ID>,
price: <PRICE>,
country: <COUNTRY>,
postalCode: <POSTAL_CODE>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
estimateType | TaxEstimateType | ā | |
nftTokenId | UUID1 | ||
orderId | UUID1 | ||
price | Float | ||
country | String | ||
postalCode | String |
{
"data": {
"estimateTaxAndRoyaltyFee": {
"taxPercentage": 0,
"royaltyFee": 0,
"platformFee": 2.5,
"taxResponse": {
"cryptoTaxPrice": 0,
"cryptoTotalPrice": 1,
"USDUnitprice": 1920.88,
"taxPercentage": 0
}
}
}
}
It can able to get tax and fee data
import { useFee, GetTaxQuoteData } from "@mojitoinc/mojito-core-service";
const { getTaxQuote } = useFee();
const response: Response<GetTaxQuoteData> = await getTaxQuote({
orgID: <ORG_ID>,
taxablePrice: <TAXABLE_PRICE>,
street1: <STREET>,
city: <CITY>,
state: <STATE>,
postalCode: <POSTAL_CODE>,
country: <COUNTRY>,
currencyCode: <CURRENCY_CODE>,
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
taxablePrice | Float | ā | |
street1 | String | ā | |
city | String | ā | |
state | String | ā | |
postalCode | String | ā | |
country | String | ā | |
currencyCode | String |
{
"data": {
"getTaxQuote": {
"verifiedAddress": {
"street1": "",
"state": "Tamil Nadu",
"postalCode": "",
"country": "IN",
"currencyCode": "USD"
},
"taxablePrice": 76.6724,
"totalTaxedPrice": 76.6724,
"totalTaxAmount": 0
}
}
}
NFT API can be access via hooks
following the api are
It can able to get favorite NFT list
import { useNFT, GetNFTFavoriteListByUserData } from "@mojitoinc/mojito-core-service";
const { getNFTFavoriteListByUser } = useNFT();
const response: Response<GetNFTFavoriteListByUserData> = await getNFTFavoriteListByUser({
orgId: <ORG_ID>,
searchKey: <SEARCH_KEY>,
filter: <FILTER>,
limit: <LIMIT>,
offset: <OFFSET>,
buyerAddress: <BUYER_ADDRESS>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
searchKey | Number | ||
filter | enum | SavedNFTFilterInput | |
limit | Int | ||
offset | Int | ||
buyerAddress | String |
Enum Variable | value |
---|---|
recently_listed | recently_listed |
recently_minted | recently_minted |
initially_minted | initially_minted |
price_low_to_high | price_low_to_high |
most_saved | most_saved |
purchased_from_org | purchased_from_org |
{
"data": {
"getNFTFavouriteListByUser": {
"totalCount": 1,
"data": [
{
"id":"6"
"title":"BasedHead #6"
"status":"OPEN_FOR_SALE"
"network":"Goerli Testnet"
"networkID":"c41db347-0ee3-4212-943a-ca213b8e0ea8"
"tokenURI":"https://drops.api.topdogstudios.io/basedAf/token/6"
}
]
}
}
}
It can able to add NFT to favorite
import { useNFT, AddNFTToFavoriteData } from "@mojitoinc/mojito-core-service";
const { addNFTToFavorite } = useNFT();
const response: Response<AddNFTToFavoriteData> = await addNFTToFavorite({
orgID: <ORG_ID>,
tokenId: <TOKEN_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
tokenId | UUID1 | ā |
{
"data": {
"addNFTToFavourite": true,
}
}
It can able to remove NFT from favorite
import { useNFT, RemoveNFTFromFavoriteData } from "@mojitoinc/mojito-core-service";
const { removeNFTFromFavorite } = useNFT();
const response: Response<RemoveNFTFromFavoriteData> = await removeNFTFromFavorite({
orgID: <ORG_ID>,
tokenId: <TOKEN_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
tokenId | UUID1 | ā |
{
"data": {
"removeNFTFromFavourite": true,
}
}
It can able to get NFT list
import { useNFT, GetAllRegistryTokensData } from "@mojitoinc/mojito-core-service";
const { getAllRegistryTokens } = useNFT();
const response: Response<GetAllRegistryTokensData> = await getAllRegistryTokens({
orgID: <ORG_ID>,
searchKey: <SEARCH_KEY>,
filter: <FILTER>,
limit: <LIMIT>,
offset: <OFFSET>,
marketplaceID: <MARKETPLACE_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgID | UUID1 | ā | |
searchKey | Number | ||
filter | enum | RegistryTokenFilterInput | |
limit | Int | ||
offset | Int | ||
buyerAddress | String | ||
sort | RegistryTokenSortInput | ||
artistID | UUID1 | ||
registryID | UUID1 | ||
categorySlug | String | ||
artistSlug | String |
Enum Variable | value |
---|---|
recently_listed | recently_listed |
recently_minted | recently_minted |
initially_minted | initially_minted |
price_low_to_high | price_low_to_high |
price_high_to_low | price_high_to_low |
{
"data": {
"getAllRegistryTokens": {
"totalCount": 1,
"data": [
{
"ID":"7992bcb2-1d34-4158-b07b-e8725016b1d1"
"TokenName":"BasedHead #15"
"TokenID":"15"
"Status":"OPEN_FOR_SALE"
"TokenURI":"https://drops.api.topdogstudios.io/basedAf/token/15"
"NFTTokenID":"6bd80dcd-9cc8-4078-a7e2-02c5164d7ab4"
}
]
}
}
}
It can able to get NFT list
import { useNFT, GetNFTDetailsData } from "@mojitoinc/mojito-core-service";
const { getNFTDetails } = useNFT();
const response: Response<GetNFTDetailsData> = await getNFTDetails({
orgId: <ORG_ID>,
contractAddress: <CONTRACT_ADDRESS>,
onChainTokenID: <ONCHAIN_TOKEN_ID>,
ownerAddress: <OWNER_ADDRESS>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
contractAddress | String | ||
onChainTokenID | BigInt | ||
ownerAddress | String | ||
buyerAddress | String | ||
editionNumber | Int | ||
nftTokenId | UUID1 | ||
networkId | UUID1 |
{
"data": {
"getNFTDetails": {
"contractAddress":"0xd0e2fd21764f643fa32b06a4c7d7924f43138d90"
"tokenId":"7"
"network":"Goerli Testnet"
"networkID":"c41db347-0ee3-4212-943a-ca213b8e0ea8"
"contractName":"test"
"tokenType":"ERC1155"
"mintedAt":"2023-01-25T06:40:22Z"
"status":"SALE_PENDING"
}
}
}
It can able to get NFT history
import { useNFT, GetNFTHistoryData } from "@mojitoinc/mojito-core-service";
const { getNFTHistory } = useNFT();
const response: Response<GetNFTHistoryData> = await getNFTHistory({
orgId: <ORG_ID>,
contractAddress: <CONTRACT_ADDRESS>,
tokenId: <TOKEN_ID>,
networkId: <NETWORK_ID>,
ownerAddress: <OWNER_ADDRESS>,
nftTokenId: <NFT_TOKEN_ID>,
limit: <LIMIT>,
offset: <OFFSET>
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
contractAddress | String | ā | |
networkId | UUID1 | ā | |
tokenId | BigInt | ā | |
nftTokenId | UUID1 | ||
ownerAddress | String | ||
limit | Int | ||
offset | Int |
{
"data": {
"getNFTHistoryV2": {
"totalCount": 30,
"data": [
{
"hash":"0xd3cc350c9020a32f699bea54824b90aa5adad6fbc5e09a0dbc2b78ce1415ae03",
"from":"0xa77915a574e1f9b88db152525ceBfEAA8c71bAa4",
"to":"test"
"blockTimestamp":"2023-01-27T12:41:23Z"
"eventType":"Sale"
"fromUserAvatar":"qvx3wQZawwkDtws2"
}
]
}
}
}
It can able to get NFT Traits
import { useNFT, GetNFTAttributesRarityData } from "@mojitoinc/mojito-core-service";
const { getNFTAttributesRarity } = useNFT();
const response: Response<GetNFTAttributesRarityData> = await getNFTAttributesRarity({
contractAddress: <CONTRACT_ADDRESS>,
tokenID: <TOKEN_ID>,
networkID: <NETWORK_ID>,
refreshCatch: <REFRESH_CACHE>,
});
Param | type | Required | Description |
---|---|---|---|
contractAddress | String | ā | |
networkID | UUID1 | ā | |
tokenID | BigInt | ā | |
refreshCatch | Boolean |
{
"data": {
"getNFTAttributesRarity": [
{
"traitType":"Brand",
"displayType":"",
"maxValue":0,
"prevalance":0,
"value": {
"__typename":"AttributeValueString",
"stringValue":"DGAF"
}
}
]
}
}
It can able to get order details
import { useNFT, InitiateBuyNFTData } from "@mojitoinc/mojito-core-service";
const { initiateBuyNFT } = useNFT();
const response: Response<InitiateBuyNFTData> = await initiateBuyNFT({
nftTokenId: <NFT_TOKEN_ID>,
buyerAddress: <BUYER_ADDRESS>,
orgId: <ORG_ID>,
country: <COUNTRY>,
postalCode: <POSTAL_CODE>,
currencyId: <CURRENCY_ID>,
cryptoTax: <CRYPTO_TAX>,
taxAddress: <TAX_ADDRESS>
});
Param | type | Required | Description |
---|---|---|---|
nftTokenId | UUID1 | ā | |
buyerAddress | String | ā | |
orgId | UUID1 | ā | |
country | String | ||
postalCode | String | ||
currencyId | UUID1 | ||
cryptoTax | CryptoTax | ||
taxAddress | TaxAddressInput |
{
"data": {
"initiateBuyNFT": {
"proofOfApproval":"0x28a9e439e3c091e737ff6209a1aa6f6022d8e7d16d738b2cbbc2fe8fad86630c341602d2653fcda2d02034278aee2a4fce9d6a48b7662ab67c5893c0fd857cf01c"
}
}
}
It can able to update the transaction hash
import { useNFT, UpdateTransactionHashData } from "@mojitoinc/mojito-core-service";
const { updateTransactionHash } = useNFT();
const response: Response<UpdateTransactionHashData> = await updateTransactionHash({
nftTokenId: <NFT_TOKEN_ID>,
orgId: <ORG_ID>,
buyerAddress: <BUYER_ADDRESS>,
transactionHash: <TRANSACTION_HASH>,
orderId: <ORDER_ID>,
});
Param | type | Required | Description |
---|---|---|---|
nftTokenId | UUID1 | ā | |
orgId | UUID1 | ā | |
buyerAddress | String | ā | |
transactionHash | String | ā | |
orderId | UUID1 |
{
"data": {
"updateTransactionHash": {
"success":false,
"newNFTID":"2bb1fec0-94be-499c-989c-1a2a75ceb478"
}
}
}
It will give a url to download invoice as a PDF format
import { useNFT, GenerateSecondaryInvoiceData } from "@mojitoinc/mojito-core-service";
const { generateSecondaryInvoice } = useNFT();
const response: Response<GenerateSecondaryInvoiceData> =
await generateSecondaryInvoice({
invoiceID: <INVOICE_ID>,
orderID: <ORDER_ID>,
activityName: <ACTIVITY_NAME>,
invoiceResType: <INVOICE_RES_TYPE>,
});
Param | type | Required | Description |
---|---|---|---|
invoiceID | UUID1 | ā | |
orderID | UUID1 | ā | |
activityName | enum | ā | ActivityName |
invoiceResType | enum | ā | InvoiceResType |
Enum Variable | value |
---|---|
Listed_Item | Listed_Item |
Listed_Item_Removed | Listed_Item_Removed |
Sold_Item | Sold_Item |
Offered | Offered |
Offer_Cancelled | Offer_Cancelled |
Offer_Rejected | Offer_Rejected |
Offer_Expired | Offer_Expired |
Bought_Item | Bought_Item |
Enum Variable | value |
---|---|
base64 | base64 |
{
"data: {
"generateSecondaryInvoice": "https://storage.googleapis.com/mojito-dev-public/organizations/8fb128bd-f55d-4bcc-8b6c-0beb684e4d4e/invoices/208af15b-ae03-47c7-aa79-27ce453bcb2d_buyer.pdf"
}
}
It will provide a user order activity data
import { useUser, UserOrderActivityData } from "@mojitoinc/mojito-core-service";
const { userOrderActivity } = useUser();
const response: Response<UserOrderActivityData> = await userOrderActivity({
orgId: <ORG_ID>,
filter: <FILTER>,
limit: <LIMIT>,
offset: <OFFSET>
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
filter | enum | ā | OrderActivityFilters |
limit | Int | ā | |
offset | Int | ā |
Enum Variable | value |
---|---|
LATEST_TO_OLDEST | LATEST_TO_OLDEST |
LATEST_TO_OLDEST | LATEST_TO_OLDEST |
{
"data: {
"getUserOrderActivity": {
"totalCount": 529,
"data": [
{
"CreatedAt": "2023-03-29T10:52:18Z",
"nftImageUrl": "https://ipfs.io/ipfs/Qmf3YhCWVyansFPqunCfpCfKz9xNGzeMwYze7b359JR5xU",
"ActivityName": "Offered",
"TokenName": "BasedHead #8",
"TokenID": "8",
"NFTTokenID": "527ef338-2e68-4b62-a5d3-d1cb1ec81b30",
"ContractName": "test",
"ContractAddress": "0xd0e2fd21764f643fa32b06a4c7d7924f43138d90",
"Price": [
{
"value": 72.5217,
"unit": "USD"
},
{
"value": 0.04,
"unit": "WETH"
}
],
"NetworkID": "c41db347-0ee3-4212-943a-ca213b8e0ea8",
"TransactionHash": "",
"FromUserName": "rajesh1",
"ToUserName": "mainnet3",
"FromUserAvatar": "U0BpDFXLEKmMNPly",
"ToUserAvatar": "Ph9sz1la6hyMY3sd",
"FromWallet": {
"id": "4e89c916-3663-4d53-b549-1767c1e1a8d1",
"name": "rajesh account wallet",
"address": "0xc7e893488a039a341d935959e52f86085976f865"
},
"ToWallet": {
"id": "02eb2545-1c70-4f68-a856-aa7ed25bd013",
"name": "",
"address": "0xeAE67de0b3e913Ecb1Fae4d3bB936CD8dc282dD8"
},
"InvoiceURL": "",
"InvoiceID": null,
"OrderID": "c24a1370-9350-4516-82ab-6312b8ee571a",
"Status": "EXPIRED",
"cryptoTax": {
"cryptoTaxPrice": 0,
"cryptoTotalPrice": 0.04,
"USDUnitprice": 0.5,
"taxPercentage": 0
},
"order": {
"platformFee": 0.001,
"creatorFee": 0
}
}
]
}
}
}
Offer API can be access via hooks
following the api are
It can able to accept offer for an NFT
import { useOffer, AcceptOfferData } from "@mojitoinc/mojito-core-service";
const { acceptOffer } = useOffer();
const response: Response<AcceptOfferData> = await acceptOffer({
orgId: <ORG_ID>,
orderId: <ORDER_ID>,
transactionHash: <TRANSACTION_HASH>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
orderId | UUID1 | ā | |
transactionHash | String | ā |
{
"data": {
"acceptOffer": {
"success":false
"newNFTID":"5bc739a6-f5d3-4417-b4af-91687e0af525"
}
}
}
It can able to cancel offer for an NFT
import { useOffer, CancelOfferData } from "@mojitoinc/mojito-core-service";
const { cancelOffer } = useOffer();
const response: Response<CancelOfferData> = await cancelOffer({
orgId: <ORG_ID>,
orderId: <ORDER_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
orderId | UUID1 | ā |
{
"data": {
"cancelOffer": "Offer cancelled."
}
}
It can able to create offer for an NFT
import { useOffer, CreateOfferData } from "@mojitoinc/mojito-core-service";
const { createOffer } = useOffer();
const response: Response<CreateOfferData> = await createOffer({
orgId: <ORG_ID>,
nftTokenId: <NFT_TOKEN_ID>,
buyerAddress: <BUYER_ADDRESS>,
offerPrice: <OFFER_PRICE>,
expiryDate: <EXPIRY_DATE>,
paymentToken: <PAYMENT_TOKEN>,
currencyId: <CURRENCY_ID>,
cryptoTax: <CRYPTO_TAX>,
taxAddress: <TAX_ADDRESS>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
nftTokenId | UUID1 | ā | |
buyerAddress | String | ā | |
offerPrice | Number | ā | |
expiryDate | String | ā | |
paymentToken | String | ā | |
currencyId | String | ||
cryptoTax | CryptoTax | ||
taxAddress | TaxAddressInput |
{
"data": {
"createOffer": {
"messageToSign":"0xf94d966f32828f3313c3aaa72559ee78bd4c784a6c1b0c4763c297e20f720a96",
"order": {
"id":"ac444a12-703a-4495-8e99-b5634bab63ea"
"nftTokenId":"1942008c-3329-405f-980e-48b2f0ee9a08"
"tokenId":"10"
"tokenContract":"0xd0e2fd21764f643fa32b06a4c7d7924f43138d90"
"quantity":1
"nftOwnerAddress":"0xf724aE0B5662b8ad6D155D50522eb097247271cB"
"fixedPrice":0.04
}
}
}
}
It can able to get offers list for an NFT
import { useOffer, GetOffersData } from "@mojitoinc/mojito-core-service";
const { getOffers } = useOffer();
const response: Response<GetOffersData> = await getOffers({
orgId: <ORG_ID>,
nftTokenId: <NFT_TOKEN_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
nftTokenId | UUID1 | ā |
{
"data": {
"getOffers": [
{
"id": "ac444a12-703a-4495-8e99-b5634bab63ea"
"offerExpiryDate": "2023-04-14T10:40:00Z"
"nftOwnerAddress": "0xf724aE0B5662b8ad6D155D50522eb097247271cB"
"tokenType": "ERC1155"
"tokenId": "10"
"tokenContract": "0xd0e2fd21764f643fa32b06a4c7d7924f43138d90"
"orderStatus": "PENDING"
"buyerTax": 0
"buyerAddress": "0xC7e893488A039A341d935959E52f86085976F865"
"fixedPrice": 0.04
"updatedAt": "2023-04-13T10:40:55Z"
"createdAt": "2023-04-13T10:40:51Z"
}
]
}
}
It can able to get signature approval data for an NFT
import { useOffer, GetSignatureForOfferApprovalData } from "@mojitoinc/mojito-core-service";
const { getSignatureForOfferApproval } = useOffer();
const response: Response<GetSignatureForOfferApprovalData> = await getSignatureForOfferApproval({
orgId: <ORG_ID>,
orderId: <ORDER_ID>,
creatorFee: <CREATOR_FEE>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
orderId | UUID1 | ā | |
creatorFee | Int |
{
"data": {
"getSignatureForOfferApproval": {
"proofOfApproval":"0xaf6e0275ba209ae723fdfe1b5411bebdf51f376d103ff9b227cedcc7b317974d09e698d1b9aea58e698a3724acd2fc8d3352eef96cb634bd735898f56f945da21c",
"order": {
"id":"d7bef205-2938-4443-b5b9-7f55db25da9a"
"nftTokenId":"5bc739a6-f5d3-4417-b4af-91687e0af525"
"tokenId":"6"
"tokenType":"ERC1155"
"quantity":1
"nftOwnerAddress":"0xc7e893488a039a341d935959e52f86085976f865"
"fixedPrice":0.04
}
}
}
}
It can able to reject offer for an NFT
import { useOffer, RejectOfferData } from "@mojitoinc/mojito-core-service";
const { rejectOffer } = useOffer();
const response: Response<RejectOfferData> = await rejectOffer({
orgId: <ORG_ID>,
orderId: <ORDER_ID>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
orderId | UUID1 | ā |
{
"data": {
"rejectOffer": "Offer rejected."
}
}
It can able to submit proof of offer for an NFT
import { useOffer, SubmitProofOfOfferData } from "@mojitoinc/mojito-core-service";
const { submitProofOfOffer } = useOffer();
const response: Response<SubmitProofOfOfferData> = await submitProofOfOffer({
orgId: <ORG_ID>,
orderId: <ORDER_ID>,
signature: <SIGNATURE>,
});
Param | type | Required | Description |
---|---|---|---|
orgId | UUID1 | ā | |
orderId | UUID1 | ā | |
signature | String | ā |
{
"data": {
"submitProofOfOffer":"Signature updated."
}
}
FAQs
Mojito Core API service for auction, payment, token
The npm package @mojito-inc/core-service receives a total of 218 weekly downloads. As such, @mojito-inc/core-service popularity was classified as not popular.
We found that @mojito-inc/core-service demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.