@fuzzwallet/core
v1.0.9
Published
## Installation
Downloads
19
Maintainers
Readme
@fuzzwallet/core
Installation
$ pnpm add graphql-request buffer @aptos-labs/ts-sdk @fuzzwallet/core
Usage
Initialized by APP_ID
import { Fuzz } from '@fuzzwallet/core';
const FUZZ_WALLET_APP_ID = 'xxxxx';
// Initialization
const FuzzClient = new Fuzz({
appId: FUZZ_WALLET_APP_ID,
// 'mainnet' | 'testnet'
network: 'mainnet',
});
Login In Telegram [Docs of Telegram Mini App]
await FuzzClient.loginInTG(window.Telegram.WebApp.initData);
Fetch User's Address
const address: string = await FuzzClient.getUserWalletAddress();
Functions
- Create Order
The very first step is Order Creation, when your user try to interactive with the chain.
const orderId: any = await FuzzClient.createOrder({
payload: {
function: '0x1::aptos_account::transfer_coins',
typeArguments: ['0x1::aptos_coin::AptosCoin'],
functionArguments: ['0x12345abcde', 10000000],
},
});
// orderId: 1234-abcd-12312412
- Confirm Order
Let the order confirmed by user, and the payload will be submitted to the chain.
await FuzzClient.confirmOrder({
orderId: '1234-abcd-12312412',
});