📓
Mitum JS SDK
CtrlK
  • Introduction
    • Installation
    • Import Mitum
    • Get data from Mitum network
      • SucessResponse
      • ErrorResponse
      • List of functions
    • Post data to Mitum network
      • Response: the return value of sending transaction
      • Receipt: the return value of wait
      • List of functions
    • Single-sig, multi-sig account
    • Error handling
    • Functions
  • Class Reference
    • Basic Functions
      • getAPI()
      • setAPI(api)
      • getNetworkID()
      • setNetworkID(networkID)
      • getDelegate()
      • setDelegate(delegateIP)
    • Node Functions
      • getNodeInfo()
    • Account Functions
      • key(seed?)
      • keys(n)
      • fromPrivateKey(key)
      • address(key)
      • addressForMultiSig(keys, threshold)
      • checksummedAddress(address)
      • hdKey()
      • fromPhrase(phrase, path?)
      • createWallet(sender, currency, amount, ?:seed, ?:weight)
      • createBatchWallet(sender, n, currency, amount)
      • touch(privatekey, wallet)
      • createAccount(sender, key, currency, amount)
      • createMultiSig(sender, keys, currency, amount, threshold)
      • updateKey(sender, newKeys, currency, threshold)
      • getAccountInfo(address)
      • getOperations(address, limit?, offset?, reverse?)
      • getByPublickey(publickey)
      • balance(address)
    • Block Functions
      • getAllBlocks(limit?, offset?, reverse?)
      • getBlockByHeight(height)
      • getBlockByHash(hash)
      • getOperationsByHeight(height)
    • Currency Functions
      • getAllCurrencies()
      • getCurrency(currencyID)
      • registerCurrency(genesisAddress, initialSupply, currency, decimal, data)
      • updateCurrency(currency, data)
      • transfer(sender, receiver, currency, amount)
      • batchTransfer(sender, receivers, currency, amounts)
      • withdraw(sender, target, currency, amount)
      • ⚠️ multiWithdraw(sender, target, currency, amount)
      • mint(receiver, currency, amount)
    • Utils Functions
      • setDecimal(decimal)
      • formatUnits(value)
      • parseUnits(value)
    • Operation Functions
      • getAllOperations(limit?, offset?, reverse?)
      • getOperation(factHash)
      • sign(privatekey, operation, ?:option)
      • send(operation, ?: headers)
      • .wait(timeout?, interval?)
    • Signer Function
      • sign(privatekey, operation, ?:option)
    • Contract Interaction
      • Contract Functions
        • createWallet(sender, currencyID, amount, ?:seed)
        • ⚠️ createBatchWallet(sender, n, currencyID, amount)
        • touch(privatekey, operation)
        • createAccount(sender, key, currency, amount)
        • createMultiSig(sender, keys, currency, amount, threshold)
        • getContractInfo(address)
        • updateHandler(sender, contract, currency, handlers)
      • Contract Model
        • NFT Functions
          • registerModel(contract, sender, data, currency)
          • updateModelConfig(contract, sender, data, currency)
          • getModeInfo(contract)
          • mint(contract, sender, receiver, uri, hash, currency, creator)
          • ⚠️ multiMint(contract, sender, receivers, uri, hash, currency, creator)
          • mintForMultiCreators(contract, sender, receiver, uri, hash, currency, creators)
          • getNFT(contract, nftIdx)
          • getOwner(contract, nftIdx)
          • getURI(contract, nftIdx)
          • getTotalSupply(contract)
          • addSignature(contract, sender, nftIdx, currency)
          • approve(contract, sender, approved, nftIdx, currency)
          • ⚠️ multiApprove(contract, sender, approved, nft
          • getApproved(contract, nftIdx)
          • approveAll(contract, sender, approved, mode, currency)
          • ⚠️ multiApproveAll(contract, sender, approved, mode, currency)
          • getApprovedAll(contract, owner)
          • transfer(contract, sender, receiver, nftIdx, currencyId)
          • ⚠️ multiTransfer(contract, sender, receiver, nftIdx, currencyId)
          • getNFTs(contract, factHash?, limit?, offset?, reverse?)
        • Timestamp Functions
          • registerModel(contract, sender, currency)
          • getModelInfo(contract)
          • issue(contract, sender, projectID, requestTimeStamp, data, currency)
          • getTimestamp(contract, projectID, timestampIdx)
        • Credential Functions
          • registerModel(contract, sender, currency)
          • getModelInfo(contract)
          • addTemplate(contract, sender, data, currency)
          • getTemplate(contract, templateID)
          • issue(contract, sender, data, currency)
          • revoke(contract, sender, holder, templateID, credentialID, currency)
          • getCredential(contract, templateID, credentialID)
          • getAllCredentials(contract, templateID)
          • getByHolder(contract, holder)
        • Token Functions
          • registerModel(contract, sender, currency, name, symbol, decimal?, initialSupply?)
          • getModelInfo(contract)
          • mint(contract, sender, currency, receiver, amount)
          • burn(contract, sender, currency, amount)
          • getBalance(contract, owner)
          • approve(contract, sender, currency, approved, amount)
          • getAllowance(contract, owner, approved)
          • transfer(contract, sender, currency, receiver, amount)
          • transferFrom(contract, sender, currency, receiver, target, amount)
        • Point Functions
          • registerModel(contract, sender, currency, name, symbol, decimal?, initialSupply?)
          • getModelInfo(contract)
          • mint(contract, sender, currency, receiver, amount)
          • burn(contract, sender, currency, amount)
          • getBalance(contract, account)
          • approve(contract, sender, currency, approved, amount)
          • getAllowance(contract, owner, approved)
          • transfer(contract, sender, currency, receiver, amount)
          • transferFrom(contract, sender, currency, receiver, target, amount)
        • ST (Security Token) Functions
          • createService(contract, sender, data, currency)
          • setDocument(contract, sender, title, uri, documentHash, currency)
          • getServiceInfo(contract)
          • issue(contract, sender, receiver, partition, amount, currency)
          • getPartitionsInfo(contract, holder)
          • getPartitionBalanceInfo(contract, partition)
          • getBalanceByHolder(contract, holder, partition)
          • authorizeOperator(contract, sender, operator, partition, currency)
          • getOperatorsByHolder(contract, holder, partition)
          • getAuthorizedInfo(contract, operator)
          • revokeOperator(contract, sender, operator, partition, currency)
          • transferByPartition(contract, sender, holder, receiver, partition, amount, currency)
          • redeem(contract, sender, tokenHolder, partition, amount, currency)
        • DAO Functions
          • reigsterModel(contract, sender, data, currency)
          • updateModelConfig(contract, sender, data, currency)
          • getModelInfo(contract)
          • writeBizProposal(proposer, startTime, url, hash, options)
          • writeCryptoProposal(proposer, startTime, calldata)
          • formTransferCalldata(sender, receiver, currency, amount)
          • formSetPolicyCalldata(data, currency)
          • propose(contract, sender, proposalId, data, currency)
          • getProposal(contract, proposalID)
          • cancelProposal(contract, sender, proposalID, currency)
          • register(contract, sender, proposalID, currency, approved?)
          • getApproved(contract, proposalId, account)
          • getVoters(contract, proposalID, voter)
          • preSnap(contract, sender, proposalID, currency)
          • getVotingStatus(contract, proposalID)
          • vote(contract, sender, proposalID, voteOption, currency)
          • postSnap(contract, sender, proposalID, currency)
          • execute(contract, sender, proposalID, currency)
        • Storage Functions
          • registerModel(contract, sender, currency, name, symbol, decimal?, initialSupply?)
          • getModelInfo(contract)
          • createData(contract, sender, dataKey, dataValue, currency)
          • createMultiData(contracts, sender, dataKeys, dataValues, currency)
          • getData(contract, dataKey)
          • updateData(contract, sender, dataKey, dataValue, currency)
          • updateMultiData(contracts, sender, dataKeys, dataValues, currency)
          • deleteData(contract, sender, dataKey, currency)
          • getDataHistory(contract, dataKey, limit?, offset?, reverse?)
          • getDataCount(contract, deleted?)
        • Payment Functions
          • registerModel(contract, sender, currency)
          • deposit(contract, sender, amount, transfer_limit, start_time, end_time, duration, currency)
          • updateSetting(contract, sender, transfer_limit, start_time, end_time, duration, currency)
          • transfer(contract, sender, receiver, amount, currency)
          • withdraw(contract, sender, currency)
          • getModelInfo(contract)
          • getPaymentInfo(contracts, address)
  • Using mitumJS with Delegate Server
    • Delegate server setting
    • GET request through delegate server
    • Post request through delegate server
  • Account Abstraction
    • User Operation
    • Usage
    • Functions
      • DID Registry Functions (Authdid)
        • registerModel(contract, sender, didMethod, currency)
        • getModelInfo(contract)
        • create(contract, sender, authType, publicKey, serviceType, serviceEndPoints, currency)
        • getDID(contract, account)
        • getDocument(contract, did)
        • updateDocument(contract, sender, document, currency)
        • writeAsymkeyAuth(id, authType, controller, publicKey)
        • writeSocialLoginAuth(id, controller, serviceEndpoint, verificationMethod)
        • writeDocument(didContext, didID, authentications, serviceID, serviceType, serviceEndpoint)
      • 0. Update recipient to proxy payer contract
        • contract.updateRecipient(sender, contract, currencyID, recipients)
      • 1. Create UserOperation
        • aa.createUserOperation(fact, contract, authentication_id)
      • 2. Complete UserOperation
        • aa.addAlterSign(privateKey, userOperation)
        • <UserOperation>.addAlterSign(privateKey)
        • aa.setSettlement(userOperation, opSender)
        • <UserOperation>.setSettlement(opSender)
        • aa.setProxyPayer(userOperation, proxyPayer)
        • <UserOperation>.setProxyPayer(proxyPayer)
      • 3. Sign to UserOperation
        • signer.sign(privateKey)
        • operation.sign(privateKey, userOpeation)
        • <UserOpseration>.sign(privateKey)
    • QnA
Powered by GitBook
On this page
  1. Class Reference
  2. Contract Interaction

Contract Model

NFT FunctionsTimestamp FunctionsCredential FunctionsToken FunctionsPoint FunctionsST (Security Token) FunctionsDAO FunctionsStorage FunctionsPayment Functions
PreviousupdateHandler(sender, contract, currency, handlers)NextNFT Functions