0.3.3 • Published 4 months ago

radix-web3.js v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Radix Web3.js

A collection of JavaScript/TypeScript packages for interacting with the Radix Network.

šŸ‘‰ See docs

Getting Started

npm install radix-web3.js

Quick Example

import { createEd25519KeyPair, createRadixWeb3Client } from 'radix-web3.js'
import { sendResourceManifest } from 'radix-web3.js/manifests'
import { fromPublicKey } from 'radix-web3.js/account'

// Create a new keypair
const keyPair = createEd25519KeyPair()

// Initialize the client
const web3Client = createRadixWeb3Client({
  networkId: 'Stokenet',
  notaryPublicKey: keyPair.publicKey(),
  notarizer: (hash) => keyPair.signToSignature(hash),
})

// Get your account address
const accountAddress = await fromPublicKey(keyPair.publicKey(), 2) // 2 = Stokenet

// Send 1 XRD to another address
const { transactionId } = await web3Client.submitTransaction(
  sendResourceManifest({
    resourceAddress:
      'resource_tdx_2_1tknxxxxxxxxxradxrdxxxxxxxxx009923554798xxxxxxxxxtfd2jc',
    amount: '1',
    fromAddress: accountAddress,
    toAddress: 'account_tdx_2_12yf3qp4feqnw...',
  }),
)

// Check your balances
const { fungibleTokens } = await web3Client.getBalances(accountAddress)
console.log('Balances:', fungibleTokens)
0.3.3

4 months ago

0.3.2

4 months ago

0.3.1

5 months ago

0.3.0

5 months ago

0.2.0

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago