1.2.4 • Published 2 years ago

bunzz-sdk v1.2.4

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 years ago

!!!CAUTION!!!

Bunzz SDK is deprecated and no longer maintained.

Bunzz SDK

Bunzz SDK is a client-side library to interact with smart contracts deployed by Bunzz. For more details, check out the documentation.

Installation

yarn add bunzz-sdk
npm i bunzz-sdk --save

Or

<script src="https://cdn.jsdelivr.net/npm/bunzz-sdk/lib/index.iife.js"></script>

Simple Usage

import bunzz from 'bunzz-sdk';

// Set your keys
const DAPP_ID = "Your DApp ID";
const API_KEY = "Your API Key";

// Initialize SDK
const handler = await bunzz.init({
  dappId: DAPP_ID,
  apiKey: API_KEY,
});

// Get a contract object
const MODULE_NAME = 'Token (ERC20)';
const erc20 = handler.getContract(MODULE_NAME);

// Connect to wallet
const connect = async () => {
  await handler.connectWallet();
  console.log("Connected to the wallet");
}

// Example of "Update Action"
const mint = async (to, amount) => {
  const signerAddress = await handler.getAddress();
  const tx = await erc20.mint(to, amount);
  const receipt = await tx.wait();

  console.log(receipt.events);
  console.log('Token successfully minted! Congratulation 🎉');
};

// Example of "Read Action"
const getBalance = async (address) => {
  const res = await erc20.balanceOf(address);
  console.log(`The ${address}'s balance is ${res.data}`);
};
1.2.4

2 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.2.0-test2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.0-test

4 years ago

0.1.8

4 years ago

0.1.9

4 years ago

0.1.7

4 years ago

0.1.4

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

1.1.11

4 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago