Fewcha Wallet Dev Docs
  • Introduction
  • Get Started
    • Connect
    • Get data
    • Sign and Submit Transaction
  • Response Format and Types
  • Serializer/Deserializer
  • Status codes
  • TypeScript Wrapper
  • React Connect Button
  • Reference
    • Wallet Methods
      • Connection
      • Account Data
      • Transactions
        • Aptos transaction
        • SUI transaction
    • Token (NFT) Methods (Aptos)
    • SDK Get Data Methods
      • Account
      • Transaction
      • Miscellaneous
  • Github
  • Chrome Extension
Powered by GitBook
On this page
  • account
  • getNetwork
  • getBalance
  • getNetworkType

Was this helpful?

  1. Reference
  2. Wallet Methods

Account Data

account

async window.fewcha.account(): Promise<Response<PublicAccount>>

Response

{
    "method": "getCurrentAccount",
    "status": 200,
    "data": {
        "address": "0x20364f4121f608f2a09830bc0ab6980fdccff45c2f5df6c41c17f40e511fe80e",
        "publicKey": "0x89a10bded6d812d21299ee129410d53a74f12f91183989c19282fa24ce629b49"
    }
}

TypeScript Wrapper

async web3.action.account(): Promise<Response<PublicAccount>>

Response

{
    "method": "getCurrentAccount",
    "status": 200,
    "data": {
        "address": "0x20364f4121f608f2a09830bc0ab6980fdccff45c2f5df6c41c17f40e511fe80e",
        "publicKey": "0x89a10bded6d812d21299ee129410d53a74f12f91183989c19282fa24ce629b49"
    }
}

getNetwork

async window.fewcha.getNetwork(): Promise<Response<string>>;

Response

{
    "method": "getNetwork",
    "status": 200,
    "data": "https://fullnode.devnet.aptoslabs.com"
}

TypeScript Wrapper

async web3.action.getNetwork(): Promise<Response<string>>;

Response

{
    "method": "getNetwork",
    "status": 200,
    "data": "https://fullnode.devnet.aptoslabs.com"
}

getBalance

async window.fewcha.getBalance(): Promise<Response<string>>;

Response

{
    "method": "getBalance",
    "status": 200,
    "data": "4000"
}

TypeScript Wrapper

async web3.action.getBalance(): Promise<Response<string>>;

Response

{
    "method": "getBalance",
    "status": 200,
    "data": {
        "0x1::aptos_coin::AptosCoin": "4000",
        "0x8::staked_coin::StakedCoin": "9000"
    }
}

getNetworkType

async window.fewcha.getNetworkType(): Promise<Response<"Aptos"|"SUI">>;

Response

{
    "method": "getNetworkType",
    "status": 200,
    "data": "SUI"
}
PreviousConnectionNextTransactions

Last updated 2 years ago

Was this helpful?