1.0.8-beta.22 • Published 24 days ago

@mojito-inc/core-service v1.0.8-beta.22

Weekly downloads
-
License
MIT
Repository
github
Last release
24 days ago

Using this library in your project Core Service

You can install this project with one of these commands: npm i @mojito-inc/core-service

yarn add @mojito-inc/core-service

In order to use this package you must install this dependency

You can install the package with one of these commands:

npm i graphql

yarn add graphql

Two way of integration Core API provider uri or apollo client, if pass both param priority is client only.

For development URL

baseURL = https://api.mojito.xyz/query

For production URL

baseURL = https://api-dev.mojito.xyz/query

    import { CoreServiceProvider } from "@mojito-inc/core-service";


    <CoreServiceProvider uri={ baseURL } token={ 'Bearer <Token>' }>
         { children }
    </CoreServiceProvider>
ParamtypeDescription
uristringskip this param, if client param passed
clientApollo Clientskip this param, if uri param passed
tokenstringOptional

After setup with CoreServiceProvider, API can be access via hooks

following the api are 1. GetSignature Message 2. LoginWithSignature 3. RedeemClaimable Code 4. Redeem Earnable Item 5. getInvoiceDetails 6. Redeem Earnable Code 7. SignUpWithSignature 8. get Contract Details 9. complete Onchain Claim

GetSignatureMessage

It will provide a message that should be used for in signing process

import { useClaims, Response, GetSignatureData } from "@mojito-inc/core-service";

  const { getSignatureMessage } = useClaims();

  const response: Response<GetSignatureData> = await getSignatureMessage({
          orgId: <ORG_ID>,
          networkID: <NETWORK_ID>,
          walletAddress: <WALLET_ADDRESS>,
        });
ParamtypeRequiredDescription
orgIdUUID1
networkIDUUID1
walletAddressstring
Response
 {
    "data:   {
        "getSignatureMessage": "This message is used for signature validation for organization caa and wallet address 0x6588ec22a85d611c8c3cd254d0c063d0be78a6c1 at 2023-02-22T04:39:23Z"
     }
 }
Error
  • error getting organization by id: record not found

LoginWithSignature

The request receiver retrieves the Signature security token

import { useClaims, Response, LoginWithSignatureData } from "@mojito-inc/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>
        });
ParamtypeRequiredDescription
challengeString
signatureString
signerString
chainIdIntInt can represent values between -(2^31) and 2^31 - 1
orgIdUUID1
Response
 {
    "data": {
          "loginWithSignature": {
            "token": "344fbc51-b6d4-4428-9783-b09dd9df95fb"
          }
        }
 }
Error
  • Challenge is too old, please request a new one

RedeemClaimableCode

Redeem a claimable code

import { useClaims, Response, RedeemClaimableCodeData } from "@mojito-inc/core-service";

  const { redeemClaimableCode } = useClaims();

  const response: Response<RedeemClaimableCodeData> = await redeemClaimableCode({
                            code: discountCode,
                            destAddr: address,
                         });
ParamtypeRequiredDescription
codestring
destAddrstring
Response
 {
     "data": {
          "redeemClaimableCode": {
            "success": true
          }
        }
 }
Error
  • Challenge is too old, please request a new one

redeemEarnableItem

Redeem Earnable Item.

import { useClaims, RedeemEarnableItemData, Response } from '@mojito-inc/core-service';
const { redeemEarnableItem } = useClaims();
const response: Response<RedeemEarnableItemData> = await redeemEarnableItem({
   claimableItemId: claimableItemId,
   destAddr: destAddr,
   gating: gating
 });
ParamtypeRequiredDescription
claimableItemIdstring
destAddrstring
gatingobjectgating

gating

ParamtypeRequiredDescription
ruleIdstring
contractAddressstring
tokenIdstring
ownerWalletstring
Error
  • Invalid claimableItemId.

getInvoiceDetails

Get the Invoice detail of the Given invoice id.

import { useClaims, Response, GetClaimInvoiceDetailData } from '@mojito-inc/core-service';
const { getInvoiceDetails } = useClaims();
const response: Response<GetClaimInvoiceDetailData> = await getInvoiceDetails({
  invoiceID: invoiceID
});
ParamtypeRequiredDescription
invoiceIDstring

error

  • Invalid Invoice id

redeemEarnableCode

Redeem a claimable code

import { useClaims, Response, RedeemEarnableCodeData } from "@mojito-inc/core-service";

  const { redeemEarnableCode } = useClaims();

  const response: Response<RedeemEarnableCodeData> = await redeemEarnableCode({
                            code: discountCode,
                            destAddr: address,
                         });
ParamtypeRequiredDescription
codestring
destAddrstring
Response
 {
     "data": {
          "redeemEarnableCode": {
            "redeemInitiated": true,
            "invoiceID": "278806fb-d82c-4d9c-bda0-ace148452c00"
          }
        }
 }
Error
  • Invalid code

SignUpWithSignature

The request receiver retrieves the Signature security token

import { useClaims, Response, SignUpWithSignatureData } from "@mojito-inc/core-service";

  const { signUpWithSignature } = useClaims();

  const response: Response<SignUpWithSignatureData> = await signUpWithSignature({
          challenge: <GET_SIGNATURE_MESSAGE>,
          signature: <CROSS_MINT_SIGNATURE>,
          signer: <SIGNER_ADDRESS>,
          chainId: <CHAIN_ID>,
          orgId: <ORG_ID>,
          firstName: <FIRST_NAME>,
          lastName: <LAST_NAME>,
          email: <EMAIL>
        });
ParamtypeRequiredDescription
challengeString
signatureString
signerString
chainIdIntInt can represent values between -(2^31) and 2^31 - 1
orgIdUUID1
firstNameString
lastNameString
emailString
Response
 {
    "data": {
          "signUpWithSignature": {
            "token": "344fbc51-b6d4-4428-9783-b09dd9df95fb"
          }
        }
 }
Error
  • Challenge is too old, please request a new one

getContractDetails

It will provide a contract details

import { useClaims, Response, GetContractDetailsData } from "@mojito-inc/core-service";

  const { getContractDetails } = useClaims();

  const response: Response<GetContractDetailsData> = await getContractDetails({
          orgId: <ORG_ID>,
          networkId: <NETWORK_ID>,
          contractType: <CONTRACT_TYPE>,
        });
ParamtypeRequiredDescription
orgIdUUID1
networkIdUUID1
contractTypestring
Response
 {
    "data:   {
        "getContractDetails": {
          "id": "",
        }
     }
 }
Error
  • error getting organization by id: record not found

completeOnchainClaim

Complete onchain claim

import { useClaims, Response, CompleteOnchainClaimData } from "@mojito-inc/core-service";

  const { completeOnchainClaim } = useClaims();

  const response: Response<CompleteOnchainClaimData> = await completeOnchainClaim({
                            invoiceId: <invoiceId>,
                            txHash: <txHash>,
                         });
ParamtypeRequiredDescription
invoiceIdstring
txHashstring
Response
 {
     "data": {
          "completeOnchainClaim": true
        }
 }
Error
  • error getting invoice by id: record not found

GetUsdConversion

will receives 1 unit crypto equivalent USD price

import { useConversion, Response, USDConversionData } from '@mojito-inc/core-service';

const { getUSDConversion } = useConversion();

const response: Response<USDConversionData> = await getUSDConversion({ cryptoCurrencyCode: <cryptoCurrencyCode> });
ParamtypeRequiredDescription
cryptoCurrencyCodeenumCryptoCurrencyCode
CryptoCurrencyCode
enum
Enum Variablevalue
ETHETH
MATICMATIC
WETHWETH
WMATICWMATIC
Response
{
  "data": {
    "getUSDPrice": {
      "amount": "1799.34",
      "currency": "USD",
      "base": "ETH",
    }
  }
}
Error
  • Expected type CryptoCurrenyCode!, found "".

    GetSupportedCurrency

    will receives list of supported currency by id

import { useConversion, Response, GetSupportedCurrenciesData } from '@mojito-inc/core-service';

const { getSupportedCurrency, GetSupportedCurrenciesData } = useConversion();

const response: Response<GetSupportedCurrenciesData> = await getSupportedCurrency({ nftTokenId: '514fedfe-165b-451b-b2f6-63667e66c096', orgId: 'f2f5c627-5421-4c40-9913-edfd09dd98b3' });
ParamtypeRequiredDescription
nftTokenIdUUID
orgIdUUID
Response
{
  "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"
        }
      },
    ]
  }
}
Error
  • error getting token by ID: record not found.

    AuctionDetails

    Auction Details and Auction History

import { useAuction } from '@mojito-inc/core-service';

const { auctionDetails } = useAuction();

const response: Response<AuctionData> = await auctionDetails({ id: <ID> });
ParamtypeRequiredDescription
idUUID
Response
{
 "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,
           },
         }
       ],
     },
   }
 }
}
Error
  • uuid: incorrect UUID length.

    VerifyOnchainBid

    Receive tax and contract address

import { useAuction, OnChainBidResponse } from '@mojito-inc/core-service';

const { verifyOnChainBid } = useAuction();

const response: Response<OnChainBidResponse> = await verifyOnChainBid({ 
          lotID=<lotID>,
          orgID=<orgID>,
          walletAddress=<walletAddress>,
          amount: <amount>, });
ParamtypeRequiredDescription
lotIDUUID
orgIDUUID
walletAddressstring
amountInt
Response
{
 "data": {
   "verifyOnchainBid": {
     "amount": 0.0003,
     "tax": 0.000055575933397801415,
     "onChainAuctionContractAddress": "0xeed7f3e16a6018d65dffd63bc30ac252c034edc1",
     "commissionFee": 0.000005999999999999999,
     "platformFee": 0.000005999999999999999,
     "__typename": "OnChainBidResponse"
   }
 }
}
Error
  • jwt token invalid or has been expired
  • uuid: incorrect UUID length
  • error fetching user wallet: wallet by address by not found: record not found
  • amount is less then current bid + min increment

confirmOnchainBid

Auction submit

import { confirmOnChainBid, BidsItemData } from '@mojito-inc/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<> });
Response
{
 "data": {
   "confirmOnchainBid": {
     "amount": 0.0005,
     "tax": 0.00007216969871926542,
     "__typename": "MarketplaceAuctionBid"
   }
 }
}
Error
  • jwt token invalid or has been expired
  • uuid: incorrect UUID length
  • error fetching user wallet: wallet by address by not found: record not found
  • error creating marketplace auction bid: bid amount is below the current bid

createMarketplaceAuctionBid

Create Auction Bid

import { createMarketplaceAuctionBid, CreateMarketplaceAuctionBidData } from '@mojito-inc/core-service';

const { createMarketplaceAuctionBid } = useAuction();

const response: Promise<Response<CreateMarketplaceAuctionBidData> = await createMarketplaceAuctionBid({     
    marketplaceAuctionLotId=<marketplaceAuctionLotId>
    amount=<amount> });
Response
{
 "data": {
   "createMarketplaceAuctionBid": {
     "id": "95962a20-2194-493e-ba2d-7abc5cea93bf",
     "marketplaceAuctionLotId": "95962a20-2194-493e-ba2d-7abc5cea93bf",
     "amount": 0.0005,
   }
 }
}
Error
  • jwt token invalid or has been expired
  • uuid: incorrect UUID length
  • error creating marketplace auction bid: bid amount is below the current bid

User API can be access via hooks

following the api are 1. me 2. updateUserOrgSettings

me

It will provide a active user data

import { useUser, GetUserData } from "@mojito-inc/core-service";

  const { currentUser } = useUser();

  const response: Response<GetUserData> = await currentUser({
          orgId: <ORG_ID>,
        });
ParamtypeRequiredDescription
orgIdUUID1
Response
 {
    "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": ""
          }
        ]
      }
    }
 }
Error
  • access denied

updateUserOrgSettings

It can able to update the user details

import { useUser, updateUserOrgSettingsData } from "@mojito-inc/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>
        });
ParamtypeRequiredDescription
userOrgIdUUID1
usernameString
avatarString
settingsJsonString
profilePicString
Response
 {
    "data: {
      "updateUserOrgSettings": {
        "id": "d1a59f7e-8626-46f9-b0ca-b70477910c8c",
        "username": "test",
        "avatar": "U0BpDFXLEKmMNPly",
      }
    }
 }
Error
  • user is not authorized to update record within userOrgID

KYC API can be access via hooks

following the api are 1. createApplicant 2. createCheck 3. getApplicant 4. getSDKToken 5. updateApplicant

createApplicant

It can able to create form to complete KYC

import { useKYC } from "@mojito-inc/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>
            }
          },
        });
ParamtypeRequiredDescription
orgIDUUID1
inputApplicantRequest
Response
 {
    "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"
        }
      }
    }
 }
Error
  • error getting user organization KYC by applicant id: record not found

    createCheck

    It can able to check the details

import { useKYC } from "@mojito-inc/core-service";

  const { createCheck } = useKYC();

  const response: Response<CreateCheckData> = await createCheck({
          applicantID: <APPLICANT_ID>,
        });
ParamtypeRequiredDescription
applicantIDUUID1
Response
 {
    "data: {
      "createCheck": {
        "id": "c2854107-93b6-4200-a1f7-ad28beaa9d1d",
        "success": true
      }
    }
 }
Error
  • error getting user organization KYC by applicant id: record not found

getApplicant

It can able to get user kyc details

import { useKYC } from "@mojito-inc/core-service";

  const { getApplicant } = useKYC();

  const response: Response<GetApplicantData> = await getApplicant({
          organizationID: <ORGANIZATION_ID>,
        });
ParamtypeRequiredDescription
organizationIDUUID1
Response
 {
    "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"
        }
      }
    }
 }
Error
  • error getting user organization KYC by applicant id: record not found

getSDKToken

It can able to get sdk token

import { useKYC } from "@mojito-inc/core-service";

  const { getSDKToken } = useKYC();

  const response: Response<GetSDKTokenData> = await getSDKToken({
          applicantID: <APPLICANT_ID>,
          referrer: <REFERRER>,
        });
ParamtypeRequiredDescription
applicantIDUUID1
referrerString
Response
 {
    "data: {
      "getSDKToken": {
        "token": "eyJhbGciOiJFUzUxMiJ9.eyJleHAiOjE2ODExMTgzNjEsInBheWxvYWQiOnsiYXBwIjoiNzU3OGFmYTYtY2I3ZS00NWNjLTgyZWYtNWM1ODIxZWJlYzQyIiwiY2xpZW50X3V1aWQiOiIyMmQyYzQ1NC0zNzMxLTQ4N2UtYmUzYS05N2I4NmQ4NWYzOWMiLCJpc19zYW5kYm94Ijp0cnVlLCJpc19zZWxmX3NlcnZpY2VfdHJpYWwiOmZhbHNlLCJpc190cmlhbCI6ZmFsc2UsInJlZiI6Imh0iHBzOi8vd2hpc2tleWV4Y2hhbmdlLWRldi5uZXRsaWZ5LmFwcC8iLCJzYXJkaW5lX3Nlc3Npb24iOiI1NzkxMGUyMC0yMTljLTQxZTItOTUzOS1lYjJhYjFmZDdiZTQifSwidXVpZCI6InBsYXRmb3JtX3N0YXRpY19hcGlfdG9rZW5fdXVpZCIsInVybHMiOnsiZGV0ZWN0X2RvY3VtZz50X3VybCI6Imh0dHBzOi8vc2RrLnVzLm9uZmlkby5jb20iLCJzeW5jX3VybCI6Imh0dHBzOi8vc3luYy5vbmZpZG8uY29tIiwiaG9zdGVkX3Nka191cmwiOiJodHRwczovL2lkLm9uZmlkby5jb20iLCJhdXRoX3VybCI6Imh0dHBzOi8vYXBpLnVzLm9uZmlkby5jb20iLCJvbmZpZG9fYXBpX3VybCI6Imh0dHBzOi8vYXBpLnVzLm9uZmlkby5jb20iLCJ0ZWxlcGhvbnlfdXJsIjoiaHR0cHM6Ly9hcGkudXMub25maWRvLmNvbSJ9fQ.MIGIAkIAtiM1UkIpaTKIGeTn6sYfX3GR4fTWPq_AeU1RxwQDQu5S7K3NM1z5hzh01sTo3KK_elpMh27XC0mhR9MkLt3kkroCQgG9gAW4w0vO1k1dXJKzbq3WDpklTqXtjT3plDbe5_bM8QujgjlbaW7nkASg68BYqa7P5UHOI5p-_QBayflaU3wXa"
      }
    }
 }
Error
  • error getting user organization KYC by applicant id: record not found

updateApplicant

It can able to update the user kyc details

import { useKYC } from "@mojito-inc/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>
            }
          },
        });
ParamtypeRequiredDescription
orgIDUUID1
inputApplicantRequest
Response
 {
    "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"
        }
      }
    }
 }
Error
  • error getting user organization KYC by applicant id: record not found

Connect wallet API can be access via hooks

following the api are 1. connectExternalWallet 2. getActiveWalletsContent 3. getSupportedNetworks

connectExternalWallet

It can able to connect wallet

import { useConnectWallet, ConnectExternalWalletData } from "@mojito-inc/core-service";

  const { connectExternalWallet } = useConnectWallet();

  const response: Response<ConnectExternalWalletData> = await connectExternalWallet({
          signature: <SIGNATURE>,
          message: <MESSAGE>,
          address: <ADDRESS>,
          orgID: <ORG_ID>,
          networkID: <NETWORK_ID>,
        });
ParamtypeRequiredDescription
orgIDUUID1
networkIDUUID1
messageString
signatureString
addressString
Response
 {
  "data": {
    "connectExternalWallet": true
  }
}
Error
  • challenge is too old, please request a new one

getActiveWalletsContent

It can able to get wallet data

import { useConnectWallet, GetActiveWalletsContentData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIDUUID1
networkIdUUID1
walletAddressString
filtersActiveWalletFilterInput
refreshCacheBoolean
Response
 {
  "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",
        },
      ]
    }
  }
}
Error
  • wallet by address by id not found: record not found

getSupportedNetworks

It can able to get the supported networks list

import { useConnectWallet, GetSupportedNetworksData } from "@mojito-inc/core-service";

  const { getSupportedNetworks } = useConnectWallet();

  const response: Response<GetSupportedNetworksData> = await getSupportedNetworks({
          orgId: <ORG_ID>,
          includeTestnets: <INCLUDE_TESTNETS>,
        });
ParamtypeRequiredDescription
orgIdUUID1
includeTestnetsBoolean
Response
 {
  "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
      },
    ]
  }
}
Error
  • encoding/hex: invalid byte: U+002D '-'

List item API can be access via hooks

following the api are 1. createSignatureToListNFTForSale 2. removeListing 3. submitProofOfApproval

createSignatureToListNFTForSale

It can able to create list item for sale

import { useListItem, CreateSignatureToListNFTForSaleData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIdUUID1
nftTokenIdUUID1
tokenTypeTokenType
quantityInt
nftOwnerAddressString
fixedPriceFloat
paymentTokenString
currencyIdUUID1
Response
 {
  "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"
      }
    }
  }
}
Error
  • error getting organization by id: record not found

removeListing

It can able to remove listing an item

import { useListItem, RemoveListingData } from "@mojito-inc/core-service";

  const { createSignatureToListNFTForSale } = useListItem();

  const response: Response<RemoveListingData> = await removeListing({
          orgID: <ORG_ID>,
          nftTokenId: <NFT_TOKEN_ID>,
        });
ParamtypeRequiredDescription
orgIDUUID1
nftTokenIdUUID1
Response
 {
  "data": {
    "removeListing": "Listing removed."
  }
}
Error
  • error getting organization by id: record not found

submitProofOfApproval

It can able to submit approval for listing an item

import { useListItem, SubmitProofOfApprovalData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIDUUID1
nftTokenIdUUID1
signatureString
quantityInt
fixedPriceFloat
paymentTokenString
currencyIdUUID1
creatorFeeTokenType
Response
 {
  "data": {
    "submitProofOfApproval":"Signature updated."
  }
}
Error
  • error getting organization by id: record not found

Tax and fee API can be access via hooks

following the api are 1. estimateTaxAndRoyaltyFee 2. getTaxQuote

estimateTaxAndRoyaltyFee

It can able to get tax and fee data

import { useFee, EstimateTaxAndRoyaltyFeeData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIdUUID1
estimateTypeTaxEstimateType
nftTokenIdUUID1
orderIdUUID1
priceFloat
countryString
postalCodeString
Response
 {
  "data": {
    "estimateTaxAndRoyaltyFee": {
      "taxPercentage": 0,
      "royaltyFee": 0,
      "platformFee": 2.5,
      "taxResponse": {
        "cryptoTaxPrice": 0,
        "cryptoTotalPrice": 1,
        "USDUnitprice": 1920.88,
        "taxPercentage": 0
      }
    }
  }
}
Error
  • error getting organization by id: record not found

getTaxQuote

It can able to get tax and fee data

import { useFee, GetTaxQuoteData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIDUUID1
taxablePriceFloat
street1String
cityString
stateString
postalCodeString
countryString
currencyCodeString
Response
{
  "data": {
    "getTaxQuote": {
      "verifiedAddress": {
        "street1": "",
        "state": "Tamil Nadu",
        "postalCode": "",
        "country": "IN",
        "currencyCode": "USD"
      },
      "taxablePrice": 76.6724,
      "totalTaxedPrice": 76.6724,
      "totalTaxAmount": 0
    }
  }
}
Error
  • error getting organization by id: record not found

NFT API can be access via hooks

following the api are 1. getNFTFavoriteListByUser 2. addNFTToFavorite 3. removeNFTFromFavorite 4. getAllRegistryTokens 5. getNFTDetails 6. getNFTHistory 7. getNFTAttributesRarity 8. initiateBuyNFT 9. updateTransactionHash 10. generateSecondaryInvoice 11. userOrderActivity 12. transferNFT 13. getAllInvoices 14. generatePrimaryInvoice 15. getFileSignedURL

getNFTFavoriteListByUser

It can able to get favorite NFT list

import { useNFT, GetNFTFavoriteListByUserData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIdUUID1
searchKeyNumber
filterenumSavedNFTFilterInput
limitInt
offsetInt
buyerAddressString
SavedNFTFilterInput
enum
Enum Variablevalue
recently_listedrecently_listed
recently_mintedrecently_minted
initially_mintedinitially_minted
price_low_to_highprice_low_to_high
most_savedmost_saved
purchased_from_orgpurchased_from_org
Response
{
  "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"
        }
      ]
    }
  }
}
Error
  • error getting organization by id: record not found

addNFTToFavorite

It can able to add NFT to favorite

import { useNFT, AddNFTToFavoriteData } from "@mojito-inc/core-service";

  const { addNFTToFavorite } = useNFT();

  const response: Response<AddNFTToFavoriteData> = await addNFTToFavorite({
          orgID: <ORG_ID>,
          tokenId: <TOKEN_ID>,
        });
ParamtypeRequiredDescription
orgIdUUID1
tokenIdUUID1
Response
{
  "data": {
    "addNFTToFavourite": true,
  }
}
Error
  • error getting token by ID: record not found

removeNFTFromFavorite

It can able to remove NFT from favorite

import { useNFT, RemoveNFTFromFavoriteData } from "@mojito-inc/core-service";

  const { removeNFTFromFavorite } = useNFT();

  const response: Response<RemoveNFTFromFavoriteData> = await removeNFTFromFavorite({
          orgID: <ORG_ID>,
          tokenId: <TOKEN_ID>,
        });
ParamtypeRequiredDescription
orgIdUUID1
tokenIdUUID1
Response
{
  "data": {
    "removeNFTFromFavourite": true,
  }
}
Error
  • error getting token by ID: record not found

getAllRegistryTokens

It can able to get NFT list

import { useNFT, GetAllRegistryTokensData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIDUUID1
searchKeyNumber
filterenumRegistryTokenFilterInput
limitInt
offsetInt
buyerAddressString
sortRegistryTokenSortInput
artistIDUUID1
registryIDUUID1
categorySlugString
artistSlugString
RegistryTokenFilterInput
enum
Enum Variablevalue
recently_listedrecently_listed
recently_mintedrecently_minted
initially_mintedinitially_minted
price_low_to_highprice_low_to_high
price_high_to_lowprice_high_to_low
Response
{
  "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"
        }
      ]
    }
  }
}
Error
  • error getting organization by id: record not found

getNFTDetails

It can able to get NFT list

import { useNFT, GetNFTDetailsData } from "@mojito-inc/core-service";

  const { getNFTDetails } = useNFT();

  const response: Response<GetNFTDetailsData> = await getNFTDetails({
          orgId: <ORG_ID>,
          contractAddress: <CONTRACT_ADDRESS>,
          onChainTokenID: <ONCHAIN_TOKEN_ID>,
          ownerAddress: <OWNER_ADDRESS>,
        });
ParamtypeRequiredDescription
orgIdUUID1
contractAddressString
onChainTokenIDBigInt
ownerAddressString
buyerAddressString
editionNumberInt
nftTokenIdUUID1
networkIdUUID1
Response
{
  "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"
    }
  }
}
Error
  • error getting organization by id: record not found

getNFTHistory

It can able to get NFT history

import { useNFT, GetNFTHistoryData } from "@mojito-inc/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>
        });
ParamtypeRequiredDescription
orgIdUUID1
contractAddressString
networkIdUUID1
tokenIdBigInt
nftTokenIdUUID1
ownerAddressString
limitInt
offsetInt
Response
{
  "data": {
    "getNFTHistoryV2": {
      "totalCount": 30,
      "data": [
        {
          "hash":"0xd3cc350c9020a32f699bea54824b90aa5adad6fbc5e09a0dbc2b78ce1415ae03",
          "from":"0xa77915a574e1f9b88db152525ceBfEAA8c71bAa4",
          "to":"test"
          "blockTimestamp":"2023-01-27T12:41:23Z"
          "eventType":"Sale"
          "fromUserAvatar":"qvx3wQZawwkDtws2"
        }
      ]
    }
  }
}
Error
  • error getting organization by id: record not found

getNFTAttributesRarity

It can able to get NFT Traits

import { useNFT, GetNFTAttributesRarityData } from "@mojito-inc/core-service";

  const { getNFTAttributesRarity } = useNFT();

  const response: Response<GetNFTAttributesRarityData> = await getNFTAttributesRarity({
          contractAddress: <CONTRACT_ADDRESS>,
          tokenID: <TOKEN_ID>,
          networkID: <NETWORK_ID>,
          refreshCatch: <REFRESH_CACHE>,
        });
ParamtypeRequiredDescription
contractAddressString
networkIDUUID1
tokenIDBigInt
refreshCatchBoolean
Response
{
  "data": {
    "getNFTAttributesRarity": [
      {
        "traitType":"Brand",
        "displayType":"",
        "maxValue":0,
        "prevalance":0,
        "value": {
          "__typename":"AttributeValueString",
          "stringValue":"DGAF"
        }
      }
    ]
  }
}
Error
  • error getting organization by id: record not found

initiateBuyNFT

It can able to get order details

import { useNFT, InitiateBuyNFTData } from "@mojito-inc/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>
        });
ParamtypeRequiredDescription
nftTokenIdUUID1
buyerAddressString
orgIdUUID1
countryString
postalCodeString
currencyIdUUID1
cryptoTaxCryptoTax
taxAddressTaxAddressInput
Response
{
  "data": {
    "initiateBuyNFT": {
      "proofOfApproval":"0x28a9e439e3c091e737ff6209a1aa6f6022d8e7d16d738b2cbbc2fe8fad86630c341602d2653fcda2d02034278aee2a4fce9d6a48b7662ab67c5893c0fd857cf01c"
    }
  }
}
Error
  • error getting organization by id: record not found

updateTransactionHash

It can able to update the transaction hash

import { useNFT, UpdateTransactionHashData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
nftTokenIdUUID1
orgIdUUID1
buyerAddressString
transactionHashString
orderIdUUID1
Response
{
  "data": {
    "updateTransactionHash": {
      "success":false,
      "newNFTID":"2bb1fec0-94be-499c-989c-1a2a75ceb478"
    }
  }
}
Error
  • error getting organization by id: record not found

generateSecondaryInvoice

It will give a url to download invoice as a PDF format

import { useNFT, GenerateSecondaryInvoiceData } from "@mojito-inc/core-service";

  const { generateSecondaryInvoice } = useNFT();

  const response: Response<GenerateSecondaryInvoiceData> = 
  await generateSecondaryInvoice({
          invoiceID: <INVOICE_ID>,
          orderID: <ORDER_ID>,
          activityName: <ACTIVITY_NAME>,
          invoiceResType: <INVOICE_RES_TYPE>,
        });
ParamtypeRequiredDescription
invoiceIDUUID1
orderIDUUID1
activityNameenumActivityName
invoiceResTypeenumInvoiceResType
ActivityName
enum
Enum Variablevalue
Listed_ItemListed_Item
Listed_Item_RemovedListed_Item_Removed
Sold_ItemSold_Item
OfferedOffered
Offer_CancelledOffer_Cancelled
Offer_RejectedOffer_Rejected
Offer_ExpiredOffer_Expired
Bought_ItemBought_Item
InvoiceResType
enum
Enum Variablevalue
pdfpdf
base64base64
Response
 {
    "data: {
      "generateSecondaryInvoice": "https://storage.googleapis.com/mojito-dev-public/organizations/8fb128bd-f55d-4bcc-8b6c-0beb684e4d4e/invoices/208af15b-ae03-47c7-aa79-27ce453bcb2d_buyer.pdf"
    }
 }
Error
  • error getting invoice with id: record not found

generatePrimaryInvoice

It will give a url to download invoice as a PDF format

import { useNFT, GeneratePrimaryInvoiceData } from "@mojito-inc/core-service";

  const { generatePrimaryInvoice } = useNFT();

  const response: Response<GeneratePrimaryInvoiceData> = 
  await generatePrimaryInvoice({
          invoiceID: <INVOICE_ID>,
          invoiceResType: <INVOICE_RES_TYPE>,
        });
ParamtypeRequiredDescription
invoiceIDUUID1
invoiceResTypeenumInvoiceResType
InvoiceResType
enum
Enum Variablevalue
pdfpdf
base64base64
Response
 {
    "data: {
      "generatePrimaryInvoice": "https://storage.googleapis.com/mojito-dev-public/organizations/8fb128bd-f55d-4bcc-8b6c-0beb684e4d4e/invoices/208af15b-ae03-47c7-aa79-27ce453bcb2d_buyer.pdf"
    }
 }
Error
  • error getting invoice with id: record not found

getUserOrderActivity

It will provide a user order activity data

import { useUser, UserOrderActivityData } from "@mojito-inc/core-service";
  const { userOrderActivity } = useUser();
  const response: Response<UserOrderActivityData> = await userOrderActivity({
          orgId: <ORG_ID>,
          filter: <FILTER>,
          limit: <LIMIT>,
          offset: <OFFSET> 
        });
ParamtypeRequiredDescription
orgIdUUID1
filterenumOrderActivityFilters
limitInt
offsetInt
OrderActivityFilters
enum
Enum Variablevalue
LATEST_TO_OLDESTLATEST_TO_OLDEST
LATEST_TO_OLDESTLATEST_TO_OLDEST
Response
 {
    "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
            }
          }
        ]
      }
    }
 }
Error
  • error getting organization by id: record not found

transferNFT

It can be able to transfer NFT

import { useNFT, TransferNFTData } from "@mojito-inc/core-service";
  const { transferNFT } = useNFT();
  const response: Response<TransferNFTData> = await transferNFT({
          walletId: <WALLET_ID>,
          orgId: <ORG_ID>,
          contractAddress: <CONTRACT_ADDRESS>,
          tokenType: <TOKEN_TYPE>,
          tokenOnChainId: <TOKEN_ONCHAIN_ID>,
          amount: <AMOUNT>,
          transferTo: <TRANSFER_TO>,
          isClaimedToken: <IS_CLAIMEDTOKEN>,
        });
ParamtypeRequiredDescription
walletIdUUID1
orgIdUUID1
contractAddressstring
tokenTypeTokenType
tokenOnChainIdInt
amountInt
transferTostring
isClaimedTokenboolean
Response
{
  "data": {
    "transferToken": "transfered",
  }
}
Error
  • error getting organization by id: record not found

getAllInvoices

It will provide all the invoices data

import { useNFT, getAllInvoices } from "@mojito-inc/core-service";
  const { getAllInvoices } = useNFT();
  const response: Response<GetAllInvoicesData> = await getAllInvoices({
          orgID: <ORG_ID>,
          filter: <FILTER>,
          limit: <LIMIT>,
          offset: <OFFSET> 
        });
ParamtypeRequiredDescription
orgIDUUID1
filterenumOrderActivityFilters
limitInt
offsetInt
OrderActivityFilters
enum
Enum Variablevalue
LATEST_TO_OLDESTLATEST_TO_OLDEST
LATEST_TO_OLDESTLATEST_TO_OLDEST
Response
 {
    "data: {
      "getAllInvoices": {
        "count": 633,
        "data": [
          {
          "id": "bec11a55-e92e-4491-b215-fa466717537c",
          "createdAt": "2023-08-28T11:06:40Z",
          "isSecondary": true,
          "userID": "aae0fe77-1c48-45cd-a10c-55115713e4d7",
          "status": "COMPLETED",
          "totalPrice": 0.04,
          "PriceCrypto": 0.04,
          "usdItemPrice": 65.44640000000001,
          "quantity": 1,
          "transactionHash": "0x15ebacc1025202c0a9c3bf2200ec38ab4a55b0f446376ebab1acebef5ca7b422",
          "invoiceID": "1cf8d0ab-3b1a-4f9a-bcd8-8e6d9d6d37aa",
          "invoiceNumber": 27388,
          "itemID": "890ee587-50ec-471d-9283-88b61655f5d0",
          "tokenID": "3f24646a-7abe-414b-b510-e51a5e58e9fe",
          "contractAddress": "0xe016a4a7ffa5b3305d1c2e1cdda13d92e11bb2da",
          "onChainTokenID": "2",
          "networkID": null,
          "eventType": "List",
          "fromWalletAddress": "0xa77915a574e1f9b88db152525ceBfEAA8c71bAa4",
          "toWalletAddress": null,
          "image": "https://storage.googleapis.com/mojito-dev-public/organizations/960ce62a-412d-43ee-b60d-da21ee1ea217/nft/assets/3f24646a-7abe-414b-b510-e51a5e58e9fe_2023-08-28T11:24:51.276062873Z.gif",
          "itemName": "The Plague #2",
          "tokenName": "The Plague #2",
          }
        ]
      }
    }
 }
Error
  • error getting organization by id: record not found

getFileSignedURL

It can be able to get the FileSignedURL

import { useNFT, FileSignedUrlData } from "@mojito-inc/core-service";
  const { getFileSignedUrl } = useNFT();
  const response: Response<FileSignedUrlData> = await getFileSignedUrl({
          urlInput: <FileSignedWithURL>,
          input: <FileSignedWithGatingInput>,
        });
ParamtypeRequiredDescription
urlInputFileSignedWithURL
inputFileSignedWithGatingInput
Response
{
  "data": {
    "getFileSignedURL": {
      mediaURL: "https://storage.cloud.google.com/mojito-dev-private/nft/0x0b1ee1de78a9d2db7b647834423a86e6c5bf1bdb/videos/1.mp4",
      type: 'mp4'
    },
  }
}
Error
  • The gated NFT not belongs to the walletAddress

Offer API can be access via hooks

following the api are 1. acceptOffer 2. cancelOffer 3. createOffer 4. getOffers 5. getSignatureForOfferApproval 6. rejectOffer 7. submitProofOfOffer

acceptOffer

It can able to accept offer for an NFT

import { useOffer, AcceptOfferData } from "@mojito-inc/core-service";

  const { acceptOffer } = useOffer();

  const response: Response<AcceptOfferData> = await acceptOffer({
          orgId: <ORG_ID>,
          orderId: <ORDER_ID>,
          transactionHash: <TRANSACTION_HASH>,
        });
ParamtypeRequiredDescription
orgIdUUID1
orderIdUUID1
transactionHashString
Response
{
  "data": {
    "acceptOffer": {
      "success":false
      "newNFTID":"5bc739a6-f5d3-4417-b4af-91687e0af525"
    }
  }
}
Error
  • error getting organization by id: record not found

cancelOffer

It can able to cancel offer for an NFT

import { useOffer, CancelOfferData } from "@mojito-inc/core-service";

  const { cancelOffer } = useOffer();

  const response: Response<CancelOfferData> = await cancelOffer({
          orgId: <ORG_ID>,
          orderId: <ORDER_ID>,
        });
ParamtypeRequiredDescription
orgIdUUID1
orderIdUUID1
Response
{
  "data": {
    "cancelOffer": "Offer cancelled."
  }
}
Error
  • error getting organization by id: record not found

createOffer

It can able to create offer for an NFT

import { useOffer, CreateOfferData } from "@mojito-inc/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>,
        });
ParamtypeRequiredDescription
orgIdUUID1
nftTokenIdUUID1
buyerAddressString
offerPriceNumber
expiryDateString
paymentTokenString
currencyIdString
cryptoTaxCryptoTax
taxAddressTaxAddressInput
Response
{
  "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
      }
    }
  }
}
Error
  • error getting organization by id: record not found

getOffers

It can able to get offers list for an NFT

import { useOffer, GetOffersData } from "@mojito-inc/core-service";

  const { getOffers } = useOffer();

  const response: Response<GetOffersData> = await getOffers({
          orgId: <ORG_ID>,
          nftTokenId: <NFT_TOKEN_ID>,
        });
ParamtypeRequiredDescription
orgIdUUID1
nftTokenIdUUID1
Response
{
  "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"
      }
    ]
  }
}
Error
  • error getting organization by id: record not found

getSignatureForOfferApproval

It can able to get signature approval data for an NFT

import { useOffer, GetSignatureForOfferApprovalData } from "@mojito-inc/core-service";

  const { getSignatureForOfferApproval } = useOffer();

  const response: Response<GetSignatureForOfferApprovalData> = await getSignatureForOfferApproval({
          orgId: <ORG_ID>,
          orderId: <ORDER_ID>,
          creatorFee: <CREATOR_FEE>,
        });
ParamtypeRequiredDescription
orgIdUUID1
orderIdUUID1
creatorFeeInt
Response
{
  "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
      }
    }
  }
}
Error
  • error getting organization by id: record not found

rejectOffer

It can able to reject offer for an NFT

import { useOffer, RejectOfferData } from "@mojito-inc/core-service";

  const { rejectOffer } = useOffer();

  const response: Response<RejectOfferData> = await rejectOffer({
          orgId: <ORG_ID>,
          orderId: <ORDER_ID>,
        });
ParamtypeRequiredDescription
orgIdUUID1
orderIdUUID1
Response
{
  "data": {
    "rejectOffer": "Offer rejected."
  }
}
Error
  • error getting organization by id: record not found

submitProofOfOffer

It can able to submit proof of offer for an NFT

import { useOffer, SubmitProofOfOfferData } from "@mojito-inc/core-service";

  const { submitProofOfOffer } = useOffer();

  const response: Response<SubmitProofOfOfferData> = await submitProofOfOffer({
          orgId: <ORG_ID>,
          orderId: <ORDER_ID>,
          signature: <SIGNATURE>,
        });
ParamtypeRequiredDescription
orgIdUUID1
orderIdUUID1
signatureString
Response
{
  "data": {
    "submitProofOfOffer":"Signature updated."
  }
}
Error
  • error getting organization by id: record not found

Token Gating API can be access via hooks

following the api are 1. createTokenGating 2. checkTokenGating 3. checkTokenGatingV2

createTokenGating

This API is used to create a Token Gating for an NFT.

import { useTokenGating, CreateTokenGatingData } from "@mojito-inc/core-service";

const { createTokenGating } = useTokenGating();

const response: Response<CreateTokenGatingData> = await createTokenGating({
          input: {
            orgID: <ORG_ID>,
            networkId: <NETWORK_ID>,
            rule: <GatingRule>,
            groupName: <GROUP_NAME>,
            groupId: <GROUP_ID>,
          }
        });
ParamtypeRequiredDescription
orgIDUUID1
networkIdUUID1
groupIdUUID1
groupNameString
ruleGatingRuleGatingRule

GatingRule

ParamtypeRequiredDescription
ruleTypeenumRuleType
contractAddressString
contractAddressWithTokenIdcontractAddressWithTokenIdContractAddressWithTokenIDGating
metaDataMetaDataGatingMetaDataGating
onchainenumOnchainGating
ContractAddressWithTokenIDGating
ParamtypeRequiredDescription
contractAddressString
tokenIDInt
MetaDataGating
ParamtypeRequiredDescription
keyString
valueString
enum
RuleType
Enum Variablevalue
ContractAddressContractAddress
ContractAddressWithTokenIDContractAddressWithTokenID
MetaDataMetaData
OnchainOnchain
OnchainGating
Enum Variablevalue
ONCHAINONCHAIN
Response
{
  "data": {
    "createTokenGatingRule": {
      "id": "8bb24c9a-6b46-44d0-a2f7-3439c4bdd4ef",
      "groupName": "TEST GATING SEPOLIA",
      "networkID": "b260424b-bb37-4a3e-86d0-0866175e5e68",
      "organizationID": "f2f5c627-5421-4c40-9913-edfd09dd98b3",
      "rules": [
        {
          "id": "85d9b667-44c2-4bec-9e8a-ddf0e04cc107",
          "gatingGroupId": "8bb24c9a-6b46-44d0-a2f7-3439c4bdd4ef",
          "ruleType": "MetaData",
          "rules": {
            "metaData": [
              {
                "key": "name",
                "value": "Milady 1"
              },
              {
                "key": "description",
                "value": "Milady Maker is a collection of 10,000 generative pfpNFT's in a aesthetic inspired by street style tribes."
              }
            ]
          }
        }
      ]
    }
  }
}
Error
  • error getting organization by id: orgID record not found

checkTokenGating

This API is used to check whether the nft is Gated or not.

import { useTokenGating, CheckTokenGatingData } from "@mojito-inc/core-service";

const { checkTokenGating } = useTokenGating();

const response: Response<CheckTokenGatingData> = await checkTokenGating({
         groupID: <GROUP_ID>,
         ruleID: <RULE_ID>,
         buyerAddress: <BUYER_ADDRESS>,
         contractAddress: <CONTRACT_ADDRESS>,
         tokenId: <TOKEN_ID>,
       });
ParamtypeRequiredDescription
groupIDUUID1
ruleIDUUID1
buyerAddressString
contractAddressString
tokenIdString
Response
{
  "data": {
    "checkTokenGating": {
      "isGated": true,
      "gatedTokens": [
        {
          "id": "1",
          "title": "Milady 1",
          "description": "Milady Maker is a collection of 10,000 generative pfpNFT's in a aesthetic inspired by street style tribes.",
          "tokenURI": "https://www.miladymaker.net/milady/json/1",
          "tokenType": "ERC721",
          "contractName": "Milady",
          "contractAddress": "0x3e9d45ad0da57683b5375d0f3d5bc606429128f9",
          "metadata": {
            "name": "Milady 1",
            "description": "Milady Maker is a collection of 10,000 generative pfpNFT's in a aesthetic inspired by street style tribes.",
            "image": "https://www.miladymaker.net/milady/1.png",
            "attributes": [
              {
                "traitType": "Background",
                "value": {
             
1.0.8-beta.22

24 days ago

1.0.8-beta.21

3 months ago

1.0.8-beta.20

3 months ago

1.0.8-beta.19

3 months ago

1.0.8-beta.16

4 months ago

1.0.8-beta.15

4 months ago

1.0.8-beta.18

4 months ago

1.0.8-beta.17

4 months ago

1.0.8-beta.14

5 months ago

1.0.8-beta.13

5 months ago

1.0.8-beta.12

5 months ago

1.0.8-beta.11

5 months ago

1.0.8-beta.10

6 months ago

1.0.8-beta.9

6 months ago

1.0.8-beta.8

6 months ago

1.0.8-beta.7

6 months ago

1.0.8-beta.6

7 months ago

1.0.8-beta.5

7 months ago

1.0.8-beta.4

7 months ago

1.0.8-beta.3

7 months ago

1.0.9

7 months ago

1.0.8-beta.2

8 months ago

1.0.8-beta.1

9 months ago

1.0.8-beta.0

9 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.0

11 months ago