🌉
Celer cBridge
  • 👋Welcome to cBridge
  • Introduction
    • Architectural Benefits
    • State Guardian Network
    • SGN and cBridge
      • The SGN as a cBridge node gateway and Service Level Agreement (SLA) arbitrator
      • The SGN as a Shared Liquidity Pool Manager
    • Fungible Token Bridging Models
    • cBridge Security
  • Tutorial
    • Cross-chain Transfer
    • LP Guide
    • SGN V2 Staking Guide
    • SGN V1 Unbonding Guide
    • Smart Contract as LP
    • Aptos Bridging Guide
    • Ape Chain Bridging Guide
    • Flow Cadence Bridging Guide
    • Flow EVM Bridging Guide
  • Developer
    • Circle Cross-chain USDC Transfer Protocol(CCTP)
    • cBridge SDK
    • cBridge Pool-Based Transfer (xLiquidity)
      • Transfer
      • Transfer Refund
    • cBridge Canonical Mapping Transfer (xAsset)
      • Mint
      • Mint Refund
      • Burn
      • Burn Refund
    • cBridge Transfer Web Widget
    • cBridge Aptos Transfer (xAsset Only)
    • Custom Transfer URL Schemes
    • cBridge APIs for Sui
    • Referral Specific Transfer
    • cBridge Limit Parameters
    • API Reference
      • Gateway: GetTransferConfigsForAll
      • Gateway: EstimateAmt
      • Contract: Pool-Based Transfer
      • Gateway: GetTransferStatus
      • Contract: Pool-Based Transfer Refund
      • Gateway: TransferHistory
      • Contract: Mint Canonical Token(OriginalTokenVault)
      • Contract: Mint Canonical Token(OriginalTokenVaultV2)
      • Contract: Mint Canonical Token Transfer Refund
      • Contract: Burn Canonical Token(PeggedTokenBridge)
      • Contract: Burn Canonical Token (PeggedTokenBridgeV2)
      • Contract: Burn Canonical Token Transfer Refund
      • Gateway: MarkRefRelation
      • Contract: TransferAgent Mint Token Submission
      • Contract: TransferAgent Burn Token Submission
      • Contract: Aptos Vault Mint Token Submission
      • Contract: Aptos PegBridge Burn Token Submission
  • NFT Bridge
    • Introduction
    • NFT Bridge Fee
  • List Your Tokens
    • Simple Listing Process
  • Reference
    • FAQ
    • Audit Reports
    • Contract Addresses
Powered by GitBook
On this page
  • Implementation
  • Request Parameters
  • TransferId Generation
  • Response
  1. Developer
  2. API Reference

Contract: Aptos Vault Mint Token Submission

Submit deposit transaction from Aptos chain

Implementation

You will generate Aptos transaction payload and submit it on-chain

const mintTransactionPayload = {
    arguments: [
      amount, /// Mint token amount with decimal
      destinationChainId.toString(), /// Destination chain id
      Array.from(ethers.utils.arrayify(RECEIVER_ADDRESS)), /// Destination receiver address bytes
      nonce /// timestamp
    ],
    function: `0x${VAULT_CONTRACT_ADDRESS}::vault::deposit`,
    type: 'entry_function_payload',
    type_arguments: [MINT_TOKEN_ADDRESS], /// Mint token address
  };

Request Parameters

Name
Type
Description

amount

u64

Mint token amount

mint_chain_id

u64

Destination chain id

mint_addr

vector<U8>

Destination receiver address bytes

nonce

u64

Timestamp

TransferId Generation

import { ethers } from "ethers";

const receiverAddressWithout0x = "..." /// Receiver address on destination chain
const transferId = ethers.utils.solidityKeccak256(
    [
      "bytes32", 
      "string", 
      "uint64", 
      "uint64", 
      `bytes${Math.floor(receiverAddressWithout0x.length / 2)}`, 
      "uint64", 
      "uint64", 
      "bytes32", 
      "string"
    ],
    [
      "...", /// Aptos wallet address as sender, 32-byte hexString
      "..." /// Aptos token address
      "...", /// Transfer amount
      "...", /// Destination chain id
      `0x${receiverAddressWithout0x}`, /// Receiver address which length may vary based on different chains
      "...", /// Nonce
      "12360001", /// Source chain id
      `0x${this.contractAddress}`, /// Aptos contract address, 32-byte hexString
      "vault", /// hardcoded message 
    ],
);

Response

Since this function is an on-chain transaction, the response is the corresponding transaction response

PreviousContract: TransferAgent Burn Token SubmissionNextContract: Aptos PegBridge Burn Token Submission

Last updated 2 years ago