1.1.25 • Published 2 years ago

svelte-contracts v1.1.25

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

Svelte-Contracts

About

svelte-contracts is a library to easily create and manage web3 contracts as svelte readable stores.

Installation

npm install svelte-contracts

Usage

Create your own contracts

import { createContract } from 'svelte-contracts';
const ERC20Token = createContract('0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce');
const symbol = await ERC20Token.methods.symbol().call();
console.log(symbol);

Output: 'SHIB'

Use prebuilt contracts

Note: you must be connected to the blockchain to use any prebuild contracts. Try svelte-web3.

import { supported } from 'svelte-contracts';
console.log(supported);

Output: ['USDT', 'USDC', 'BUSD', 'UNI', 'UST', 'DAI']
import { USDC, USDT } from 'svelte-contracts';
await USDC.methods.transfer('0x7b76229515d374a537360BDFE1504aF5EE04c415').call();
await USDC.methods.approve('0x7b76229515d374a537360BDFE1504aF5EE04c415').call();
1.1.25

2 years ago

1.1.24

2 years ago

1.1.23

2 years ago

1.1.22

2 years ago

1.1.21

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago