Skip to main content

Create Deposit Address

EIP-712

const domain: TypedDataDomain = {
name: 'MiraiLabs|Bank',
version: '1.0',
};

Deposit Address

  • Endpoint: /deposit/address
  • Description: Used to get deposit address for ERC20/ERC721
  • Method: POST
  • Params:
NameTypeRequire?Description
txobject[x]Raw transaction
tx.chainTypeEIP155,SOLANA[x]Type of address
tx.assetaddress[x]Adddress of asset
signaturestring[x]Signature of transaction
const types: Record<string, TypedDataField[]> = {
DepositAddress: [
{ name: 'chainType', type: 'string' },
{ name: 'asset', type: 'address' },
],
};

const value = {
chainType: 'EIP155',
asset: '0x....',
};

const signature = await userWallet._signTypedData(domain, types, value);
  • Return Values: JSON object
NameTypeDescription
statusboolStatus of request
addressaddressDeposit Address
assetobjectAsset
asset.namestringName of asset
asset.symbolstringSymbol of asset
asset.identitystringUnique ID of asset on MiraiBank
asset.decimalsnumberDecimal of asset
chainobjectChain of asset
chain.namestringName of chain
chain.chainIdstringChainId of chain
chain.isMainnetbooleanMainnet or testnet
chain.chainTypeEIP155,SOLANAType of chain

Deposit App

  • Endpoint: /deposit/app
  • Description: Used to get deposit address for ERC20/ERC721
  • Method: POST
  • Params:
NameTypeRequire?Description
txobject[x]Raw transaction
tx.userIdstring[x]UserId of user in app
tx.chainTypeEIP155,SOLANA[x]Type of address
tx.assetaddress[x]Adddress of asset
signaturestring[x]Signature of asset=&chainType=&userId=
  • Return Values: JSON object
NameTypeDescription
statusboolStatus of request
addressaddressDeposit Address
appobjectAsset
app.namestringName of app
app.addressaddressAddress of app
app.userIdstringUserID of user in app
assetobjectAsset
asset.namestringName of asset
asset.symbolstringSymbol of asset
asset.identitystringUnique ID of asset on MiraiBank
asset.decimalsnumberDecimal of asset
chainobjectChain of asset
chain.namestringName of chain
chain.chainIdstringChainId of chain
chain.isMainnetbooleanMainnet or testnet
chain.chainTypeEIP155,SOLANAType of chain