Methods
connect
Connect the wallet and retrieve the current account's address and public key.
Request
{
silent?: boolean;
}
Response
{
accounts: [
{
address: string;
publicKey: Uint8Array;
chains: string[];
features: string[];
}
]
}
Example
const { accounts } = await wallet.features['standard:connect'].connect();
console.log(accounts[0].address);
signPersonalMessage
Sign a personal message with the connected account.
Request
{
message: Uint8Array;
account: WalletAccount;
}
Response
{
bytes: string;
signature: string;
}
Example
const { bytes, signature } = await wallet.features['sui:signPersonalMessage'].signPersonalMessage({
message: new TextEncoder().encode("Hello SUI"),
account: currentAccount
});
console.log(signature);
signTransaction
Sign a transaction without submitting it to the network.
Request
{
transaction: Transaction;
account: WalletAccount;
chain: string;
}
Response
{
bytes: string;
signature: string;
}
Example
const { bytes, signature } = await wallet.features['sui:signTransaction'].signTransaction({
transaction: txBlock,
account: currentAccount,
chain: "sui:mainnet"
});
signAndExecuteTransaction
Sign a transaction and submit it to the Sui network.
Request
{
transaction: Transaction;
account: WalletAccount;
chain: string;
requestType?: string;
options?: {
showEffects?: boolean;
showEvents?: boolean;
}
}
Response
{
bytes: string;
signature: string;
digest: string;
effects?: TransactionEffects;
}
Example
const result = await wallet.features['sui:signAndExecuteTransaction'].signAndExecuteTransaction({
transaction: txBlock,
account: currentAccount,
chain: "sui:mainnet"
});
console.log(result.digest);
reportTransactionEffects
Report the effects of a transaction back to the wallet (used when the dApp submits the transaction independently after signing).
Request
{
effects: string;
account: WalletAccount;
chain: string;
}
Response
None
Example
await wallet.features['sui:reportTransactionEffects'].reportTransactionEffects({
effects: txEffectsBcs,
account: currentAccount,
chain: "sui:mainnet"
});
getPublicKey
Get the public key associated with the connected account.
Request
{
account: WalletAccount;
}
Response
{
publicKey: Uint8Array;
}
Example
const { publicKey } = await wallet.features['sui:getPublicKey'].getPublicKey({
account: currentAccount
});