KrypCore Web3
PlatformSupportSDK
  • 👋Welcome to Krypcore Web3
  • Introduction
    • Overview
    • Product Architecture
    • Supported Networks
  • Product Overview
    • Key Concepts
    • Unified SDK / APIs
      • Benefits of a Unified Model
      • KrypCore Web3 SDK
      • KrypCore Web3 APIs
    • Infrastructure
      • Blockchain Endpoints
        • Adding network to Metamask
      • Storage Endpoints
      • DID Service Endpoints
    • Core Services
      • Wallets
        • Choosing the right wallet for your Dapp
        • Custodial Wallet
        • Self Managed Wallet
        • MPC Wallet
        • Developer Wallet
        • Smart Contract Wallet
      • Smart Contracts
        • Deploy from Templates
          • Templates Explained
            • ERC 20
            • ERC 721
            • ERC 1155
            • ERC20DAO Token
            • TokenERC20
        • Deploy your own contract
        • Deploy Contract
        • Load Contract
      • NFT
        • Creating a collection
        • Minting NFTs
      • FT
        • Creating an ERC-20 token
      • DIDs
      • Storage
    • Add on Services
      • Datalake
      • Gasless
        • Integration Steps
        • Considerations and Best Practices
  • API Reference
    • KCW3 APIs Explained
    • Infrastructure APIs
      • Ethereum JSON RPC APIs
        • eth_accounts
        • eth_blockNumber
        • eth_call
        • eth_chainId
        • eth_estimateGas
        • eth_feeHistory
        • eth_gasPrice
        • eth_getBalance
        • eth_getBlockByHash
        • eth_getBlockByNumber
        • eth_getBlockReceipts
        • eth_getBlockTransactionCountByHash
        • eth_getBlockTransactionCountByNumber
        • eth_getCode
        • eth_getFilterChanges
        • eth_getFilterLogs
        • eth_getLogs
        • eth_getProof
        • eth_getStorageAt
        • eth_getTransactionByBlockHashAndIndex
        • eth_getTransactionByBlockNumberAndIndex
        • eth_getTransactionByHash
        • eth_getTransactionCount
        • eth_getTransactionReceipt
        • eth_getUncleCountByBlockHash
        • eth_getUncleCountByBlockNumber
        • eth_hashrate
        • eth_maxPriorityFeePerGas
        • eth_mining
        • eth_newBlockFilter
        • eth_newFilter
        • eth_newPendingTransactionFilter
        • eth_signTransaction
        • eth_syncing
        • eth_uninstallFilter
        • eth_unsubscribe
        • eth_sendRawTransaction
        • net_listening
        • net_peerCount
        • net_version
        • txpool_content
        • txpool_inspect
        • txpool_status
        • web3_clientVersion
        • web3_sha3
      • IPFS HTTP Client APIs
        • How to
        • HTTP API methods
          • add
          • block_get
          • block_stat
          • cat
          • dag_get
          • dag_import
          • dag_put
          • dag_resolve
          • get
          • pin_add
          • pin_ls
          • pin_rm
          • pin_update
          • version
          • block_put
    • Core Service APIs
      • Wallet Manager APIs
        • Self Managed Wallet
          • Setup SM Wallet
          • Create Wallet
          • Get Wallet balance
          • Sign Message
          • Verifies Signature off chain
          • Deploy Contract
          • Submit Transaction
          • Estimating Gas Price
          • Call Contract Method
          • Sign and Submit Gasless Transaction
        • Developer Wallet
          • Generate Keys
          • Deploy Contract
          • Call Contract
          • Get Balance
          • Sign And Submit Gasless Txn
          • Create And Execute Txn
          • Sign EIP712 Txn
          • Verify Signature OffChain
          • Sign Message
          • Sign TxHash
          • Estimate Gas
        • Smart Contract Wallet APIs
          • Create Wallet
          • Get All SC Wallet Details
          • GenerateUserOp
          • SubmitUserOp
      • DID Manager APIs
        • Create issuer Profile
        • Create Subject Profile
        • Create Verifiable Credentials
        • Create Verifiable Presentation
        • List Issuer Profile
        • List Subject Profile
        • List Verifiable Credential
        • List Verifiable Credential Templates
        • Verify Verifiable Credential
        • Revoke Verifiable Credential
        • Delete Issuer Profile
        • Resolve DID
      • NFT Studio APIs
        • Create NFT Collection
        • Get all NFT Collections details created by a user
        • Get a NFT collection details created by a user
        • Mint NFT
        • Get all Minted NFT details in a smart contract
      • FT Manager APIs
        • Create ERC20Token
        • Get all Fungible Token details created by user
        • Get a Fungible Token details created by user
        • Mint ERC20 Token
        • Approve ERC20Token
        • Transfer ERC20 Token
        • Burn ERC20Token
        • Get Total Supply
        • Get Balance of an user address
      • Storage Manager APIs
        • Upload file to IPFS Storage
        • Get File Details
        • Download Files from IPFS
        • Update Pin status
      • Gasless API
        • Get Transaction Payload
        • Send Transaction
        • Create Gas Request
        • Add Whitelisted Contract Linked to DApp
        • List All Whitelisted Contracts
        • List All Protocol Configs
        • List All Funded Transactions
        • Update Configured Gas Limit
        • Deactivate Whitelisted Contract
        • Get Protocol Config using userId and ChainId
        • Sign And Submit Gasless Txn Using (Dev wallet)
        • Sign And Submit Gasless Txn Using (kms wallet)
    • Add On APIs
      • Gasless Transactions APIs
      • Datalake APIs
  • SDK Reference
    • Getting Started
    • SDK Architecture
    • Wrapper Packages
    • Power Methods
      • Wallet Suite
      • Utils Suite
    • Core Service Methods
      • Custodial Wallet Kit
      • DID Kit
      • NFT Kit
      • FT Kit
      • Storage Kit
  • faq
    • Platform FAQs
    • API FAQs
    • SDK FAQs
  • Releases
    • Latest Updates
    • Release Notes v1.0.0 Beta
    • Release Notes v1.0.0
Powered by GitBook
On this page
  • Wallet Manager
  • Table of Contents
  • Bootstrapping the SDK for custodial wallet kit
  • SDK Methods
  • createWallet(walletName, curveType)
  • createAndExecuteTx(chainId, contractAddress, abi, isContractTx, method, accessToken, value, args)
  • getAllWallets()
  • getWallet(walletName)
  • getBalance(walletName)
  • callContract(chainId, contractAddress, abi, method, args, accessToken)
  • getTxHistory(chainId, accessToken)
  • signMessage(message, accessToken)
  • signTxHash(txHash, accessToken)
  • verifySignatureOffChain(message, signature, accessToken)
  • signEip712TypedData(typedData, accessToken)
  • deployContract(chainId, abi, bytecode, accessToken, constructorParams)

Was this helpful?

  1. SDK Reference
  2. Core Service Methods

Custodial Wallet Kit

Wallet Manager

Wallet Manager Service is a component of the KrypCore Web3 SDK that provides a set of methods and functionalities for managing wallets and interacting with blockchain networks. It allows developers to perform various wallet-related operations such as creating wallets, retrieving wallet details, signing transactions, getting wallet balances, and more.

With the Wallet Manager Service, developers can easily integrate wallet management capabilities into their decentralized applications (DApps) and streamline the interaction between users and the blockchain network.

Now, let's dive into the documentation for each method provided by the Wallet Manager Service in the KrypCore Web3 SDK:

Table of Contents

  • Create Wallet

  • Create and Execute Transaction

  • Get All Wallets

  • Get Wallet Details

  • Get Wallet Balance

  • Call Contract

  • Get Transaction History

  • Sign Message

  • Sign Transaction Hash

  • Verify Signature

  • Sign Typed Data

  • Deploy Contract

Bootstrapping the SDK for custodial wallet kit

const krypcore_web3_sdk = require("@krypc/krypcore-web3-sdk");
const configFilePath = '../../config.json';
const Web3Engine = new krypcore_web3_sdk.Web3Engine(configFilePath);
const WalletMgrService = new Web3Engine.Services.WalletManager(configFilePath);

SDK Methods

createWallet(walletName, curveType)

Creates a new wallet with the specified name and curve type.

Parameters:

  • walletName (string): The name of the wallet.

  • curveType (string): The type of elliptic curve to use for key generation.

Usage:

const walletName = "sample-test-123456789012";
const curveType = "secp256k1";
const creationStatus = await WalletMgrService.createWallet(walletName, curveType);
console.log(creationStatus);

createAndExecuteTx(chainId, contractAddress, abi, isContractTx, method, accessToken, value, args)

Creates and executes a transaction on the specified chain with the given parameters.

Parameters:

  • chainId (number): The ID of the chain on which to execute the transaction.

  • contractAddress (string): The address of the contract.

  • abi (string): The ABI of the contract in JSON string format.

  • isContractTx (boolean): Indicates whether the transaction is for a contract method.

  • method (string): The name of the contract method to invoke.

  • accessToken (string): The access token for authentication.

  • value (number): The value to send with the transaction.

  • args (array): An array of arguments for the contract method.

Usage:

const chainId = 80001;
const contractAddress = "0xE396a584D29036c44c138E98072341C4174778BD";
const abi = JSON.stringify(sampleAbi);
const isContractTx = true;
const method = "mintNFT";
const accessToken = process.env.WALLET_ACCESS_TOKEN;
const value = 0;
const args = [];

const txStatus = await WalletMgrService.createAndExecuteTx(chainId, contractAddress, abi, isContractTx, method, accessToken, value, args);
console.log(txStatus);

getAllWallets()

Retrieves the details of all wallets associated with the current user.

Usage:

const allWallets = await WalletMgrService.getAllWallets();
console.log(allWallets);

getWallet(walletName)

Retrieves the details of a specific wallet based on its name.

Parameters:

  • walletName (string): The name of the wallet to retrieve.

Usage:

const walletName = process.env.WALLET_NAME;
const walletDetails = await WalletMgrService.getWallet(walletName);
console.log(walletDetails);

getBalance(walletName)

Retrieves the balance of a wallet.

Parameters:

  • walletName (string): The name of the wallet.

Usage:

const walletName = process.env.WALLET_NAME;
const balanceDetails = await WalletMgrService.getBalance(walletName);
console.log(balanceDetails);

callContract(chainId, contractAddress, abi, method, args, accessToken)

Invokes a view or pure method of a contract.

Parameters:

  • chainId (number): The ID of the chain on which the contract is deployed.

  • contractAddress (string): The address of the contract.

  • abi (string): The ABI of the contract in JSON string format.

  • method (string): The name of the contract method to invoke.

  • args (array): An array of arguments for the contract method.

  • accessToken (string): The access token for authentication.

Usage:

const chainId = 80001;
const contractAddress = "0xE396a584D29036c44c138E98072341C4174778BD";
const abi = JSON.stringify(sampleAbi);
const method = "owner";
const args = [];
const accessToken = process.env.WALLET_ACCESS_TOKEN;

const callStatus = await WalletMgrService.callContract(chainId, contractAddress, abi, method, args, accessToken);
console.log(callStatus);

getTxHistory(chainId, accessToken)

Retrieves the transaction history of the specified chain for the current user.

Parameters:

  • chainId (number): The ID of the chain.

  • accessToken (string): The access token for authentication.

Usage:

const chainId = 80001;
const accessToken = process.env.WALLET_ACCESS_TOKEN;

const txHistory = await WalletMgrService.getTxHistory(chainId, accessToken);
console.log(txHistory);

signMessage(message, accessToken)

Signs a message using the wallet.

Parameters:

  • message (string): The message to sign.

  • accessToken (string): The access token for authentication.

Usage:

const message = "Hello there";
const accessToken = process.env.WALLET_ACCESS_TOKEN;

const signMessage = await WalletMgrService.signMessage(message, accessToken);
console.log(signMessage);

signTxHash(txHash, accessToken)

Signs a transaction hash using the wallet.

Parameters:

  • txHash (string): The transaction hash to sign.

  • accessToken (string): The access token for authentication.

Usage:

const txHash = "0x157755d6d077c508b02526308399d14b8c4e731849bcf81c51936405139d701f";
const accessToken = process.env.WALLET_ACCESS_TOKEN;

const signTxHash = await WalletMgrService.signTxHash(txHash, accessToken);
console.log(signTxHash);

verifySignatureOffChain(message, signature, accessToken)

Verifies the off-chain signature.

Parameters:

  • message (string): The message that was signed.

  • signature (string): The signature to verify.

  • accessToken (string): The access token for authentication.

Usage:

const message = "Hello there";
const signature = "0x00e6ec512a9496c9ecb63cb0875f2357e5e0e4e7f3b5741bac9ac0f8e17a17df538b66bde141e083bf6ef0bc74129b6295e72bce792755a9a5937bd7ef35053701";
const accessToken = process.env.WALLET_ACCESS_TOKEN;

const verifySignature = await WalletMgrService.verifySignatureOffChain(message, signature, accessToken);
console.log(verifySignature);

signEip712TypedData(typedData, accessToken)

Signs the EIP-712 typed data using the wallet.

Parameters:

  • typedData (string): The EIP-712 typed data as a JSON string.

  • accessToken (string): The access token for authentication.

Usage:

const typedData = JSON.stringify(typedData);
const accessToken = process.env.WALLET_ACCESS_TOKEN;

const signTyped

Data = await WalletMgrService.signEip712TypedData(typedData, accessToken);
console.log(signTypedData);

deployContract(chainId, abi, bytecode, accessToken, constructorParams)

Deploys a contract on the specified chain.

Parameters:

  • chainId (number): The ID of the chain on which to deploy the contract.

  • abi (string): The ABI of the contract in JSON string format.

  • bytecode (string): The bytecode of the contract.

  • accessToken (string): The access token for authentication.

  • constructorParams (array): An array of constructor parameters for the contract.

Usage:

const chainId = 80001;
const abi = sampleAbiBase64;
const bytecode = sampleBytecode;
const accessToken = process.env.WALLET_ACCESS_TOKEN;
const constructorParams = ["Test Collection", "TEST"];

const deployStatus = await WalletMgrService.deployContract(chainId, abi, bytecode, accessToken, constructorParams);
console.log(deployStatus);
PreviousCore Service MethodsNextDID Kit

Last updated 1 year ago

Was this helpful?