Client side JS libraries for AssetMantle SDK transaction generation, signing and broadcasting.
If you want to contribute to MantleJS, please read the instructions in CODING_GUIDELINES.md.
npm install @assetmantle/mantlejs
OR
npm install "https://github.com/AssetMantle/mantlejs.git"
yarn add @assetmantle/mantlejs
OR
yarn add "https://github.com/AssetMantle/mantlejs.git"
import {queryIdentities} from "mantlejs/build/transaction/identity/query";
// get the queryIdentities controller object to perform the query
const queryIdentitiesControllerObj = new queryIdentities(process.env.REACT_APP_ASSET_MANTLE_API);
const handleSubmit = async event => {
event.preventDefault();
const IdentityName = event.target.identityname.value;
// create double hash
const hashGenerate = GetMetaHelper.Hash(GetMetaHelper.Hash(IdentityName));
// build identityID using nub classificationID and the generated hash
const identityID = config.nubClassificationID+'|'+hashGenerate;
// query identities in the chain associated with the particular identityID
const identitiesPromise = queryIdentitiesControllerObj.queryIdentityWithID(identityID);
}
The list of critical JS API endpoints which acts as the interface to the AssetMantle SDK, used for rapid Javascript based DApp prototyping
APIs pertaining to manipulating the 'identity', a DID based entity used to represent identity of user.
used to define an identity entity. Defines a message and initiates the transaction.
Function Signature
define: (address: string, chain_id: string, mnemonic: string, fromID: string, mutableTraits: string, immutableTraits: any, mutableMetaTraits: any, immutableMetaTraits: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string) => Promise<any>;
---------------
used to define an identity entity. Only defines and outputs a message object.
Function Signature
createIdentityDefineMsg: (address: string, chain_id: string, fromID: string, mutableTraits: string, immutableTraits: any, mutableMetaTraits: any, immutableMetaTraits: any, feesAmount: any, feesToken: any, gas: any, memo: string) => Promise<any>;
---------------
used to issue an identity entity. Defines a message and initiates the transaction.
Function Signature
issue: (address: string, chain_id: string, mnemonic: any, to: any, fromID: string, classificationID: any, mutableProperties: string, immutableProperties: any, mutableMetaProperties: any, immutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string) => Promise<any>;
---------------
used to issue an identity entity. Only defines and outputs a message object.
Function Signature
createIdentityIssueMsg: (address: string, chain_id: string, to: any, fromID: string, classificationID: any, mutableProperties: string, immutableProperties: any, mutableMetaProperties: any, immutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, memo: string) => Promise<any>;
---------------
used to create a nub ID, which is the simplest but complete and valid unit of identification. Defines a message and initiates the transaction.
Function Signature
nub: (address: string, chain_id: string, mnemonic: any, nubID: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string) => Promise<any>;
---------------
used to create a nub ID, which is the simplest but complete and valid unit of identification. Only defines and outputs a message object.
Function Signature
createIdentityNubMsg: (address: string, chain_id: string, nubID: any, feesAmount: any, feesToken: any, gas: any, memo: string) => Promise<any>;
---------------
used to create a provision address which is used to control / operate an identity. a nub ID, which is the simplest but complete and valid unit of identification. Defines a message and initiates the transaction.
Function Signature
provision: (address: string, chain_id: string, mnemonic: any, identityID: any, to: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string) => Promise<any>;
---------------
used to create a provision address which is used to control / operate an identity. Only defines and outputs a message object
Function Signature
createIdentityProvisionMsg: (address: string, chain_id: string, identityID: any, to: any, feesAmount: any, feesToken: any, gas: any, memo: string) => Promise<any>;
---------------
used to query the list of all identities. Defines a message and initiates the transaction.
Function Signature
queryIdentity: () => Promise<any>;
---------------
used to query the list of all identities pertaining to a certain ID argument passed. Defines a message and initiates the transaction.
Function Signature
queryIdentityWithID: (id: any) => Promise<any>;
APIs pertaining to manipulating the 'assets', a DID based entity used to represent NFTs.
used to burn an Asset. Defines a message and initiates the transaction.
Function Signature
burn: (address: string, chain_id: string, mnemonic: string, fromID: string, assetID: string, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to burn an Asset. Only defines and outputs a message object
Function Signature
createAssetBurnMsg: ( address: string, chain_id: string, fromID: string, assetID: string, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to define the schema of an Asset. Defines a message and initiates the transaction.
Function Signature
define: ( address: string, chain_id: string, mnemonic: string, fromID: string, mutableTraits: string, immutableTraits: any, mutableMetaTraits: any, immutableMetaTraits: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to define the schema of an Asset. Only defines and outputs a message object
Function Signature
createAssetDefineMsg: ( address: string, chain_id: string, fromID: string, mutableTraits: string, immutableTraits: any, mutableMetaTraits: any, immutableMetaTraits: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to mint an asset using the defined schema. Defines a message and initiates the transaction.
Function Signature
mint: ( address: string, chain_id: string, mnemonic: any, toID: any, fromID: string, classificationID: any, mutableProperties: string, immutableProperties: any, mutableMetaProperties: any, immutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to mint an asset using the defined schema. Only defines and outputs a message object.
Function Signature
createAssetMintMsg: ( address: string, chain_id: string, toID: any, fromID: string, classificationID: any, mutableProperties: string, immutableProperties: any, mutableMetaProperties: any, immutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to change the mutable properties of an Asset. These specific properties must be already defined as mutable in the schema of asset. Defines a message and initiates the transaction.
Function Signature
mutate: ( address: string, chain_id: string, mnemonic: any, fromID: string, assetID: any, mutableProperties: string, mutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to change the mutable properties of an Asset. These specific properties must be already defined as mutable in the schema of asset. Only defines and outputs a message object.
Function Signature
createAssetMutateMsg: ( address: string, chain_id: string, fromID: string, assetID: any, mutableProperties: string, mutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to change the mutable properties of an Asset. These specific properties must be already defined as mutable in the schema of asset. Defines a message and initiates the transaction.
Function Signature
queryAsset: () => Promise<any>;
---------------
used to change the mutable properties of an Asset. These specific properties must be already defined as mutable in the schema of asset. Only defines and outputs a message object.
Function Signature
queryAssetWithID: (id: any) => Promise<any>;
APIs pertaining to manipulating the Classifications or schemas of entities created
used to query the details of all Classifications IDs.
Function Signature
queryClassification: () => Promise<any>;
---------------
used to query the details of Classification IDs pertaining to the ID argument provided in the function
Function Signature
queryClassificationWithID: (id: any) => Promise<any>;
---------------
APIs pertaining to managing the maintainers and access control lists of various entities
used to provide or revoke access controls to new maintainer roles. Defines a message and initiates the transaction.
Function Signature
deputize: ( address: string, chain_id: string, mnemonic: string, identityID: string, clsID: string, toID: string, maintainedTraits: string, addMaintainer: any, removeMaintainer: any, mutateMaintainer: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to provide or revoke access controls to new maintainer roles. Only defines and outputs a message object.
Function Signature
createDeputizeMsg: ( address: string, chain_id: string, identityID: string, clsID: string, toID: string, maintainedTraits: string, addMaintainer: any, removeMaintainer: any, mutateMaintainer: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to query the details of Classification IDs pertaining to the ID argument provided in the function
Function Signature
queryMaintainerWithID: (id: any) => Promise<any>;
APIs pertaining to manipulating the 'order', a DID based entity used to represent orders created to perform a transfer of value between 'identities' and 'assets'.
used to define a schema for an order type. Defines a message and initiates the transaction.
Function Signature
define: ( address: string, chain_id: string, mnemonic: string, fromID: string, mutableTraits: string, immutableTraits: any, mutableMetaTraits: any, immutableMetaTraits: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to define a schema for an order type. Only defines and outputs a message object.
Function Signature
createOrderDefineMsg: ( address: string, chain_id: string, fromID: string, mutableTraits: string, immutableTraits: any, mutableMetaTraits: any, immutableMetaTraits: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to issue an order pertaining to a specific classification. Defines a message and initiates the transaction.
Function Signature
make: ( address: string, chain_id: string, mnemonic: any, fromID: string, classificationID: any, makerOwnableID: string, takerOwnableID: string, expiresIn: any, makerOwnableSplit: any, mutableProperties: string, immutableProperties: any, mutableMetaProperties: any, immutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to issue an order pertaining to a specific classification. Only defines and outputs a message object.
Function Signature
createOrderMakeMsg: ( address: string, chain_id: string, fromID: string, classificationID: any, makerOwnableID: string, takerOwnableID: string, expiresIn: any, makerOwnableSplit: any, mutableProperties: string, immutableProperties: any, mutableMetaProperties: any, immutableMetaProperties: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to accept an issued order pertaining to a specific order ID. Defines a message and initiates the transaction.
Function Signature
take: ( address: string, chain_id: string, mnemonic: any, fromID: string, takerOwnableSplit: any, orderID: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to accept an issued order pertaining to a specific order ID. Only defines and outputs a message object.
Function Signature
createOrderTakeMsg: ( address: string, chain_id: string, fromID: string, takerOwnableSplit: any, orderID: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to cancel an issued order pertaining to a specific order ID. Defines a message and initiates the transaction.
Function Signature
cancel: ( address: string, chain_id: string, mnemonic: string, fromID: string, orderID: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to cancel an issued order pertaining to a specific order ID. Only defines and outputs a message object.
Function Signature
createOrderCancelMsg: ( address: string, chain_id: string, fromID: string, orderID: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to query for the list of all orders available
Function Signature
queryOrder: () => Promise<any>;
---------------
used to query for a specifc order pertaining to an order ID
Function Signature
queryOrderWithID: (id: any) => Promise<any>;
APIs pertaining to querying a certain meta property across the entities
used to query for a meta property of entities of a certain ID
Function Signature
queryMetaWithID: (id: any) => Promise<any>;
---------------
used to cancel an issued order pertaining to a specific order ID. Defines a message and initiates the transaction.
Function Signature
reveal: ( address: string, chain_id: string, mnemonic: any, metaFact: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to cancel an issued order pertaining to a specific order ID. Only defines and outputs a message object.
Function Signature
createMetaRevealMsg: ( address: string, chain_id: string, metaFact: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
APIs pertaining to creating and manipulating fractionalizing of NFTs and their correlation with FTs
used to query a split (fractional NFT) using a specific ID
Function Signature
querySplitsWithID: (id: any) => Promise<any>;
---------------
used to send a split from one identity to another. Defines a message and initiates the transaction.
Function Signature
send: ( address: string, chain_id: string, mnemonic: string, fromID: string, toID: string, ownableID: string, split: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to send a split from one identity to another. Only defines and outputs a message object.
Function Signature
createSplitsSendMsg: ( address: string, chain_id: string, fromID: string, toID: string, ownableID: string, split: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to wrap a coin into a split, which is then used for transacting (transfer of value) in AssetMantle's NFT Economy. Defines a message and initiates the transaction.
Function Signature
wrap: ( address: string, chain_id: string, mnemonic: string, fromID: string, coins: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to wrap a coin into a split, which is then used for transacting (transfer of value) in AssetMantle's NFT Economy. Only defines and outputs a message object.
Function Signature
createSplitsWrapMsg: ( address: string, chain_id: string, fromID: string, coins: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to unwrap a split back into a coin, which is then used for transacting (transfer of value) in Cosmos Economy and beyond. Defines a message and initiates the transaction.
Function Signature
unwrap: ( address: string, chain_id: string, mnemonic: string, fromID: string, ownableID: string, split: any, feesAmount: any, feesToken: any, gas: any, mode: any, memo: string, ) => Promise<any>;
---------------
used to unwrap a split back into a coin, which is then used for transacting (transfer of value) in Cosmos Economy and beyond. Only defines and outputs a message object.
Function Signature
createSplitsUnwrapMsg: ( address: string, chain_id: string, fromID: string, ownableID: string, split: any, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
APIs pertaining to creating an account in AssetMantle chain for storing and transacting on coins
used to create and initiate an account in the AssetMantle chain
Function Signature
create: ( address: string, chain_id: string, mnemonic: string, name: string, denom: string, amount: any, gas: any, memo: string, ) => Promise<any>;
---------------
used to recover an existing account using a mnemonic
Function Signature
recover: (mnemonic: string, name: string) => Promise<any>;
APIs pertaining to transfer of value of coins in the AssetMantle chain and beyond.
APIs pertaining to transfer of value of coins in the AssetMantle chain and beyond.
Function Signature
create: ( address: string, chain_id: string, mnemonic: string, name: string, denom: string, amount: any, gas: any, memo: string, ) => Promise<any>;
---------------
APIs pertaining to transfer of value of coins in the AssetMantle chain and beyond. Only defines and outputs a message object.
Function Signature
createSendCoinMsg: ( from_address: string, chain_id: string, to_address: string, denom: string, amount: string, feesAmount: any, feesToken: any, gas: any, memo: string, ) => Promise<any>;
---------------
APIs pertaining to creation of wallets and keystores in the AssetMantle chain.
used to create a wallet using a mnemonic and a bip39 passphrase.
Function Signature
createWallet: ( mnemonic: string, bip39Passphrase: string, ) => Promise<{ address: string; mnemonic: string; }>;
---------------
used to create a wallet using a bip39 passphrase, while the mnemonic is generated automatically.
Function Signature
createRandomWallet: (bip39Passphrase: string) => Promise<{ address: string; mnemonic: string; }>;
---------------
used to get the object pertaining to already created wallet, pertaining to a certain mnemonic and bip39 passphrase
Function Signature
getWallet: (mnemonic: string, bip39Passphrase: string) => Promise<any>;
---------------
used to create a encrypted keystore using a specified mnemonic and password
Function Signature
createStore: ( mnemonic: string, password: string, ) => { Response: any; error: any; };
---------------
used to decrypt / open and encrypted keystore file, by specifying the file path and a password to decrypt.
Function Signature
decryptStore: ( fileData: any, password: string, ) => { mnemonic: any; };
---------------