# Sui(updating..)

This doc is for Sui Devnet. BitKeep will update the doc as Sui upgrades.

This feature is supported by the following versions of BitKeep Wallet.

platform version description
chrome Extension >=v1.4.1 devnet
App(ios) >=v7.2.8 devnet
App(android) >=v7.2.8 devnet

# Quick Access(recommend)

  1. Please download BitKeep Wallet (opens new window) if you don't have it yet.

  2. For test tokens: Faucet Sui (opens new window)

  3. You can also refer to the methods on BitKeep website (for multiple wallet)

Note

Since Sui is in its Devnet phase, we provide an adapter based on Sui Wallet for now. We also provide a React Demo (opens new window) based on the wallet-standard (opens new window).

# Connect wallet by other means

Note

The following methods only support BitKeep wallet

# Detect sui wallet provider

If the BitKeep wallet is not installed, prompt the user to install BitKeep wallet first, and provide the following installation instructions. For example:

function getSuiWallet() {
  const provider = window.bitkeep && window.bitkeep.suiWallet;
  if (!provider) {
    window.open('https://bitkeep.com/en/download?type=2');
    throw 'Please go to  https://bitkeep.com/en/download?type=2  to download!!';
  }
  return provider;
}
1
2
3
4
5
6
7
8

# hasPermissions

Whether the user has authorized

const permissions = ['viewAccount', 'suggestTransactions']
bitkeep.suiWallet.hasPermissions(permissions): Promise<boolean>;;
1
2

# requestPermissions

We can authorize BitKeep wallet by calling bitkeep.suiWallet.requestPermissions

Note

The domain name of the application will be remembered for future sessions after the user authorizes.

const permissions = ['viewAccount', 'suggestTransactions']
bitkeep.suiWallet.requestPermissions(permissions): Promise<boolean>;;
1
2
const wallet = getSuiWallet();
try {
  const response = await wallet.requestPermissions();
  const account = await wallet.getAccounts();
  const [address] = account;
} catch (error) {
  // { code: 4001, message: "User rejected the request."}
}
1
2
3
4
5
6
7
8
9

# getAccounts

Get the user’s address

bitkeep.suiWallet.getAccounts(): Promise<Array>;
1

# Send transaction signature

# signAndExecuteTransaction

bitkeep.suiWallet.signAndExecuteTransaction(): Promise<txhash>;
bitkeep.suiWallet.signAndExecuteTransaction(
    {
    "type": "move-call",
    "data": {
      "packageObjectId": "0x2",
      "module": "devnet_nft",
      "function": "mint",
      "typeArguments": [],
      "arguments": [
        "Example NFT",
        "An example NFT created by demo Dapp",
        "ipfs://bafkreibngqhl3gaa7daob4i2vccziay2jjlp435cf66vhono7nrvww53ty"
      ],
      "gasBudget": 10000
    }
  };
);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20