@fuzzwallet/core
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

@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

  1. 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
  1. Confirm Order

Let the order confirmed by user, and the payload will be submitted to the chain.

await FuzzClient.confirmOrder({
  orderId: '1234-abcd-12312412',
});

Package Sidebar

Install

npm i @fuzzwallet/core

Weekly Downloads

17

Version

1.0.9

License

Apache-2.0

Unpacked Size

28.3 kB

Total Files

12

Last publish

Collaborators

  • alcove-npm