Coin98
English
English
  • Coin98
  • Products
    • Coin98 AI Wallet
    • Coin98 Telegram Wallet
      • How to create a Coin98 Telegram Wallet
      • General Settings
      • How to invite friends on Coin98 Telegram Wallet
      • How to create/import a hot wallet on Coin98 Telegram Wallet
      • How to activate a wallet on Coin98 Telegram Wallet
      • How to manage blockchains on Coin98 Telegram Wallet
      • How to use Watch-only Wallet
      • How to retrieve Seed Phrase/Private key on Coin98 Telegram Wallet
      • How to buy cryptocurrency by fiat on Coin98 Telegram Wallet
      • How to Send a Token
      • How to Receive tokens
      • How to swap natively on Coin98 Telegram Wallet
      • How to contact Live Chat on the Coin98 Telegram Wallet
    • Coin98 Super Wallet
      • Mobile
        • Coin98 Super Wallet V15 UI Overview
        • Getting Started
          • How to download and install Coin98 Super Wallet
          • General Settings
          • How to automatically update Coin98 Super Wallet
          • How to manage notifications on Coin98 Super Wallet
          • How to create or import a Multichain Wallet to Coin98 Super Wallet
          • How to buy cryptocurrency by fiat on Coin98 Super Wallet?
          • How to add a contact on Coin98 Super Wallet
          • FAQs
            • What is the difference between Private Key and Seed phrase?
            • Do I have to backup every time my Wallet updates?
            • Does Coin98 Super Wallet hold my funds?
            • I can't find an answer to my question. Where do I find an answer?
        • Wallet Management
          • How to activate a wallet on Coin98 Super Wallet
          • How to show Seed Phrase / Private key
          • How to import Multi-chain wallets to Coin98 Super Wallet
          • How to switch a single-chain wallet to another chain wallet on Coin98 Super Wallet
          • How to use Seed Phrase Recover Tool
          • How to Refresh a Multichain Wallet
          • How to connect Hardware Wallet on Coin98 Super Wallet
          • How to use Watch-only Wallet
          • How to rename/remove Wallet
          • FAQ: Why did I recover a wallet but my balance shows 0 and the addresses are changed?
        • Social Wallet
          • How to upgrade a social wallet to Ramper Core V2 on Coin98 Super Wallet
          • How to create a Social Wallet
          • How to restore a Social Wallet
          • How to manage a Social Wallet
        • Zen Card Wallet
          • How to Create a Zen Card Wallet
          • How to Restore a Zen Card Wallet
          • Migrate Hot Wallets to Zen Card
          • How to Manage Zen Card
          • How to Setup and Manage a Profile for eCard
          • How to Redeem Zen Gift
          • How to Use Zen Card
          • FAQs
        • Asset Management
          • How to connect your account from an exchange platform to Coin98 Super Wallet
          • How to manage blockchains on Coin98 Super Wallet
          • How to add Custom Network on Coin98 Super Wallet
          • How to withdraw tokens from Binance to Coin98 Super Wallet
          • How to create a send request for someone
          • How to Send a Token
          • How to send a token to multiple addresses
          • How to add a Custom Token on Coin98 Super Wallet
          • How to Receive (Deposit) a Token
          • How to hide/unhide tokens on Coin98 Super Wallet
          • How to create a token using Token Issuer
          • How to create a portfolio on Coin98 Super Wallet
          • How to track portfolio on Coin98 Super Wallet
          • FAQs
            • Balances Not Loading or Showing on my wallet
            • Why can't I send USDT to other wallets?
        • NFTs
          • How to create a NFT using NFT Issuer
          • How to Receive (Deposit) an NFT
          • How to Send NFT
          • How to send multiple NFTs to an address
          • How to list an NFT on Marketplace
          • NFTverse
          • How to buy NFT in Coin98 Super Wallet
        • SwapX
          • How to swap tokens natively on SwapX
          • How to convert tokens on SwapX?
          • FAQs
            • Why did my transaction fail?
            • What is gas setting
            • Why did I have to pay gas fees for a failed transaction?
            • What is slippage tolerance
            • What is inverse rate
            • What is Unlimited approval?
            • What is Transaction Deadline
            • FAQs
        • Futures
          • How to use Futures on Coin98 Super Wallet
        • OneID
          • OneID Profile: Log in with OneID, Manage Profile and Get OneID Referral Link
          • How to link a wallet to a OneID on Coin98 Super Wallet
          • How to use OneID on Coin98 Super Wallet
          • How to perform KYC Verification on Coin98 Super Wallet
        • Stake Master
          • How to unstake Coin98 Staking V1
          • How to use Coin98 PowerPool on Coin98 Super Wallet
          • How to use Dynamic Rate Staking on Coin98 Super Wallet
        • Coin98 Messenger
          • How to change Messenger settings
          • How to start new conversation in Coin98 Messenger
          • How to create a request for someone to send their tokens
          • Cypheus Assistant Bot
          • How to set up a Lucky Gift
          • How to receive a Lucky Gift
          • How to set up a Quiz Gift
          • How to receive a Quiz Gift
          • How to contact Coin98 Live Support via Coin98 Messenger
        • Third party platforms and dApps
          • How to use multichain dApp browser on Coin98 Super Wallet
          • How to use Faucet on Coin98 Super Wallet
          • How to manage connections of the wallet
          • How to use Super Connect
        • Coin98 Vault
          • How to use Coin98 Vault on Coin98 Super Wallet
          • How to claim NFT on NFT Privileges
        • Security & Privacy
          • What to do when your wallet has been hacked?
          • How to use Cloud Backup on the Coin98 Super Wallet
          • How to revoke token allowances using Wallet Approval
          • How to use Clear Clipboard on Coin98 Super Wallet?
      • Extension
        • Getting Started
          • How to install Coin98 Extension
          • General Settings
          • How to update Coin98 Extension
          • How to create or import a Multichain Wallet to Coin98 Extension
          • How to buy cryptocurrency by fiat on Coin98 Extension?
          • Get Started with Coin98 Extension: Set a password and Create your new wallet
          • How to change your Coin98 Extension Password
        • Wallet Management
          • How to activate a wallet on Coin98 Extension
          • How to show Seed Phrase / Private key
          • How to switch a single-chain wallet to another chain wallet on Coin98 Extension
          • How to Refresh a Multichain Wallet
          • How to connect Hardware Wallet on Coin98 Extension
          • How to use Watch-only Wallet
          • How to rename/remove Wallet
        • Social Wallet
          • How to create a Social Wallet
          • How to restore a Social Wallet
        • Asset Management
          • How to manage blockchains on Coin98 Extension
          • How to add Custom Network on Coin98 Extension
          • How to Send a Token
          • How to send a token to multiple addresses
          • How to add a Custom Token on Coin98 Extension
          • How to Receive (Deposit) a Token
        • Swap
          • How to swap natively on Coin98 Extension
        • Bridge
          • How to convert tokens on Bridge?
        • Security & Privacy
          • How to use Cloud Backup on the Coin98 Extension
    • Zen Card
      • How to use Zen Card with Coin98 Super Wallet
      • Legal
        • PRIVACY POLICY
        • TERMS OF USE
      • FAQs
    • Coin98 Vault
      • How to claim Vault on Coin98 Super Wallet
      • How to claim Vault with Coin98 Extension
      • How to create Vault to distribute tokens
    • Coin98 Staking
      • How to stake C98 on Coin98 Super Wallet
      • How to stake C98 on Coin98 Staking website
      • Fixed Rate Staking
    • Coin98 Token
      • Why is the C98 token issued on Ethereum, BNB Chain, Solana, Polygon and Viction?
      • How can I get Coin98 (C98) Token?
      • Where to trade C98
      • Where can I store my C98
      • Can I get back the money when I sent C98 to the contract address?
      • How to convert C98 token on Coin98 Super Wallet
    • Coin98 Terminals
      • Token Issuer
        • How to use Token Issuer on Coin98 Super Wallet
        • How to use Token Issuer on Coin98 Extension
      • Multisender
        • How to use Multisend
    • Coin98 Markets
      • How to use Coin98 Markets
    • Single Chain Wallet
      • Ancient8 Wallet
        • How to migrate social wallet to V2
        • Terms of Service
        • Privacy Policy
        • Developer Guide
  • Audits
    • Coin98 Token
    • Coin98 Staking
    • Coin98 Vault
    • 🐞BUG BOUNTY
  • Developer Guide
    • Coin98 Adapter
      • Setup Coin98 Adapter for Next.js
      • Setup Coin98 Adapter for React
      • Hooks
        • useWallet
        • useWalletModal
      • Example
    • Coin98 Connect Integration
    • Bitcoin Dapps Integration
    • Ethereum DApps Integration
    • EthereumPoW DApps Integration
    • BNB Chain DApps Integration
    • Kucoin Chain DApps Integration
    • Solana DApps Integration
    • Near DApps Integration
    • Cosmos DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Secret Network DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • KAVA DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Persistence DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Terra DApps Integration
      • Terra Station Override
    • Ronin DApps Integration
    • Arbitrum DApps Integration
    • Optimism DApps Integration
    • Boba Network DApps Integration
    • Harmony DApps Integration
    • Klaytn DApps Integration
    • Fantom DApps Integration
    • Celo DApps Integration
    • Gnosis Chain DApps Integration
    • GateChain DApps Integration
    • Polygon DApps Integration
    • Viction DApps Integration
    • Avalanche DApps Integration
    • OKExChain DApps Integration
    • Heco DApps Integration
    • Aurora DApps Integration
    • Cronos DApps Integration
    • Bittorrent DApps Integration
    • PlatON Network DApps Integration
    • Moonbeam DApps Integration
    • Kardia DApps Integration
    • Aptos Dapps Integration
    • Sui DApps Integration
    • Sei DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Osmosis DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Injective DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Oasis network DApps Integration
    • Evmos DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Juno network DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Agoric DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Archway (Testnet) DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Stargaze DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Umee DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Stride DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Deeplink
    • Kujira DApps Integration
      • Keplr Override
        • Basic API
        • Use with CosmJs
        • Use with SecretJS
        • Suggest Chain
    • Mantle DApps Integration
    • DApps Integration
      • EVM-compatible DApps Integration
    • Ethereum Coin98 Telegram Wallet SDK Bot Integration
      • Ethereum Coin98 Telegram Wallet SDK Bot Integration For React
      • Ethereum Coin98 Telegram Wallet SDK Bot Integration For Vanilla Javascript
  • Ton SDK Integration Guide For Partners
  • Legal
    • Coin98 Super Wallet
      • Terms of Service
      • Privacy Policy
    • Coin98 Telegram Game
      • Terms of Use
      • Privacy Policy
  • Coin98 Links and Communities
    • Official Coin98 Links
    • Official Communities
  • BRAND ASSETS & GUIDLINES
    • Brand Assets & Guidelines
Powered by GitBook
On this page
  • Aptos testnet​
  • Aptos devnet​
  • Dapp API
  • connect(), disconnect(), isConnected()​
  • account()​
  • signAndSubmitTransaction(transaction: EntryFunctionPayload)​
  • signMessage(payload: SignMessagePayload)​
  • dApp Integration
  • Verify signature:
  1. Developer Guide

Aptos Dapps Integration

(Require app ver > 12.5.0)

PreviousKardia DApps IntegrationNextSui DApps Integration

Last updated 2 years ago

Aptos testnet

  • REST API Open API spec:

  • REST service:

  • Faucet service:

  • Genesis:

  • Genesis and waypoint:

  • ChainID: .

Aptos devnet

  • REST API Open API spec:

  • REST service:

  • Faucet service:

  • Genesis:

  • Waypoint:

  • ChainID: .

Dapp API

  • connect({network: 'mainnet' | 'testnet' | 'devnet'}), disconnect(), and isConnected()

  • account()

  • signAndSubmitTransaction(transaction: EntryFunctionPayload)

  • signMessage(payload: SignMessagePayload)

  • Event listening (onAccountChanged(listener), onNetworkChanged(listener))

// Common Args and Responses

interface PublicAccount {
    string address;
    string publicKey;
}

// The important thing to return here is the transaction hash the dapp can wait for it
type [PendingTransaction](https://github.com/aptos-labs/aptos-core/blob/1bc5fd1f5eeaebd2ef291ac741c0f5d6f75ddaef/ecosystem/typescript/sdk/src/generated/models/PendingTransaction.ts)

type [EntryFunctionPayload](https://github.com/aptos-labs/aptos-core/blob/1bc5fd1f5eeaebd2ef291ac741c0f5d6f75ddaef/ecosystem/typescript/sdk/src/generated/models/EntryFunctionPayload.t

It is important that dapps, aren't allow to send requests to the wallet until the user acknowledges that they want to see these requests.

  • connect({network: 'mainnet' | 'testnet' | 'devnet'}) will prompt the user

    • return Promise<PublicAccount>

  • disconnect() allows the user to stop giving access to a dapp and also helps the dapp with state management

    • return Promise<void>

  • isConnected() able to make requests to the wallet to get current state of connection

    • return Promise<boolean>

Needs to be connected The dapp may want to query for the current connected account to get the address or public key.

  • account() no prompt to the user

    • returns Promise<PublicAccount>

  • signAndSubmitTransaction(transaction: EntryFunctionPayload) will prompt the user with the transaction they are signing

    • returns Promise<PendingTransaction>

The most common usecase for this function is to verify identity, but there are a few other possible use cases. You may notice some wallets from other chains just provide an interface to sign arbitrary strings. This can be susceptible to man-in-the-middle attacks, signing string transactions, etc.

Types:

export interface SignMessagePayload {
  address?: boolean; // Should we include the address of the account in the message
  application?: boolean; // Should we include the domain of the dapp
  chainId?: boolean; // Should we include the current chain id the wallet is connected to
  message: string; // The message to be signed and displayed to the user
  nonce: string; // A nonce the dapp should generate
}

export interface SignMessageResponse {
  address: string;
  application: string;
  chainId: number;
  fullMessage: string; // The message that was generated to sign
  message: string; // The message passed in by the user
  nonce: string,
  prefix: string, // Should always be APTOS
  signature: string; // The signed full message
}
  • signMessage(payload: SignMessagePayload) prompts the user with the payload.message to be signed

    • returns Promise<SignMessageResponse>

An example: signMessage({nonce: 1234034, message: "Welcome to dapp!", address: true, application: true, chainId: true })

This would generate the fullMessage to be signed and returned as the signature:

APTOS
address: 0x000001
chain_id: 7
application: badsite.firebase.google.com
nonce: 1234034
message: Welcome to dapp!

dApp Integration

dApps can make requests to the wallet from their website:

  • connect(): prompts the user to allow connection from the dApp (neccessary to make other requests)

  • isConnected(): returns if the dApp has established a connection with the wallet

  • account(): gets the address of the account signed into the wallet

  • signAndSubmitTransaction(transaction): signs the given transaction and submits to chain

  • signTransaction(transaction): signs the given transaction and returns it to be submitted by the dApp

  • disconnect(): Removes connection between dApp and wallet. Useful when the user wants to remove the connection.

// import transaction build from aptos sdk: https://github.com/aptos-labs/aptos-core/tree/main/ecosystem/typescript/sdk
import { BCS, TxnBuilderTypes } from 'aptos';

// Establish connection to the wallet
const result = await window.aptos.connect()
// OR
const result = await window.coin98.aptos.isConnected()

// Check connection status of wallet
const status = await window.aptos.isConnected()
// OR
const status = await window.coin98.aptos.isConnected()

// Gets the address of the account signed into the wallet
const accountAddress = await window.aptos.account()
// OR
const accountAddress = await window.coin98.aptos.account()

// Create a transaction
const transaction = {
    arguments: [address, '717'],
    function: '0x1::coin::transfer',
    type: 'entry_function_payload',
    type_arguments: ['0x1::aptos_coin::AptosCoin'],
};

// Send transaction to the extension to be signed and submitted to chain
const response = await window.aptos.signAndSubmitTransaction(transaction)
// OR
const response = await window.coin98.aptos.signAndSubmitTransaction(transaction)

// Send transaction to the extension to be signed and returns
const signedTransaction = await window.aptos.signTransaction(transaction)
// OR
const signedTransaction = await window.coin98.aptos.signTransaction(transaction)

// Disconnect dApp from the wallet
await window.aptos.disconnect(transaction)
// OR
await window.coin98.aptos.disconnect(transaction)

Verify signature:

const signMessage = async () => {
  const result = await window.aptos.signMessage({
      nonce: 3885,
      message: 'Click to sign in and accept the BlueMove Terms of Service. This request will not cost any gas fees.',
      address: true,
      application: true,
      chainId: true
    })
    setState(state => ({ ...state, message: result }))
  }

  const verifyMessage = () => {
    const { message, account } = state
    const sig = message.signature
    const pub = account.publicKey
    const fullMessage = message.fullMessage
    const signature = Buffer.from(sig.substring(2), 'hex')
    const pubKey = Buffer.from(pub.substring(2), 'hex')
    const verify = Nacl.sign.detached.verify(Buffer.from(fullMessage), signature, pubKey)

    alert(verify)
  }

There will be some apis that certain wallets may add but there should be a few apis that are standard across wallets. This will make mass adoption easier and will make dapp developers' lives easier.

connect(), disconnect(), isConnected()

account()

signAndSubmitTransaction(transaction: EntryFunctionPayload)

We will be generate a transaction from payload(simple JSON) using the and then sign and submit it to the wallet's node.

signMessage(payload: SignMessagePayload)

​
https://fullnode.testnet.aptoslabs.com/v1/spec#/
https://fullnode.testnet.aptoslabs.com/v1
https://faucet.testnet.aptoslabs.com
https://testnet.aptoslabs.com/genesis.blob
https://github.com/aptos-labs/aptos-genesis-waypoint/tree/main/testnet
Click here to see it on the Aptos Explorer
​
https://fullnode.devnet.aptoslabs.com/v1/spec#/
https://fullnode.devnet.aptoslabs.com/v1
https://faucet.devnet.aptoslabs.com
https://devnet.aptoslabs.com/genesis.blob
https://devnet.aptoslabs.com/waypoint.txt
Click here to see it on the Aptos Explorer
Forum post with discussion
​
​
​
sdk
​