Skip to content

Commit

Permalink
[Fix] Enable support for transferring decimals amount (#4)
Browse files Browse the repository at this point in the history
* [Fix] Enable support for transferring decimals amount

* update avail-js-sdk to v0.1.7

---------

Co-authored-by: [email protected] <tq-tuan15>
  • Loading branch information
HadesGuard authored Dec 25, 2023
1 parent 5857ae8 commit e6d1e62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ const transfer = async (to: string, value: number, options: {
}

const tempConsoleWarn = console.warn
console.warn = () => {}
console.warn = () => { }
const api = await initialize(rpcUrl, { noInitWarn: true })
console.warn = tempConsoleWarn
const keyring = getKeyringFromSeed(seed)
const amount = new BN(value * 1e18);
const amount = formatNumberToBalance(value);
const opt: Partial<any> = { nonce: -1 }
if (options.wait !== Wait.No) {
await sendTransferTx(api, to, amount, keyring, opt, options.network, options.wait)
Expand Down Expand Up @@ -116,7 +116,7 @@ const sendBlobTx = async (api: any, blob: string, keyring: KeyringPair, opt: Par
})
}

async function data (blob: string, options: {
async function data(blob: string, options: {
seed: string
network: NetworkNames
rpc: string
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"author": "QEDK",
"license": "Apache-2.0",
"dependencies": {
"avail-js-sdk": "^0.1.2",
"avail-js-sdk": "^0.1.7",
"commander": "^11.1.0"
},
"devDependencies": {
Expand Down

0 comments on commit e6d1e62

Please sign in to comment.