0.11.0 • Published 9 months ago

@kadena/client-utils v0.11.0

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
9 months ago

@kadena/client-utils

Utility functions build as a wrapper around @kadena/client

Kadena client utils

Introducing @kadena/client-utils, a library that aims to provide a higher-level API for interacting with smart contracts. The library includes helpers for the coin module, which can be imported using @kadena/client-utils/coin. The library also exports utilities under /core for smart contract developers to develop APIs, including some functions that can be used for any kind of smart contracts.

Find a minimal interactive example at CodeSandbox

  • asyncPipe
  • submitClient
  • preflightClient
  • dirtyReadClient
  • crossChainClient

examples

import { getBalance, transferCrossChain } from "@kadena/client-utils/coin"
import { signWithChainweaver } from "@kadena/client"

const balance = await getBalance(
  accountOne.account,
  'development',
  '0',
  'http://localhost:8080',
 );

 const result = await createAccount(
  {
    account: 'javad',
    keyset: {
      pred: 'keys-all',
      keys: ['key-a', 'key-b'],
    },
    gasPayer: { account: 'gasPayer', publicKeys: [''] },
    chainId: '0',
  },
  {
    host: 'https://api.testnet.chainweb.com',
    defaults: {
      networkId: 'testnet04',
    },
    sign: signWithChainweaver,
  },
)
   // signed Tx
  .on('sign', (data) => console.log(data))
  // preflight result
  .on('preflight', (data) => console.log(data))
  // submit result
  .on('submit', (data) => console.log(data))
  // listen result
  .on('listen', (data) => console.log(data))
  .execute();

Future work

  • npx create @kadena/client-utils

    • to allow community members to create their own interfaces for their smart-contracts
  • @kadena/client-utils/

    • faucet
    • marmalade
    • principles
    • namespace
0.11.0

9 months ago

0.10.0

10 months ago

0.9.1

10 months ago

0.9.0

12 months ago

0.8.1

1 year ago

0.8.0

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago