-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functions to fund smart wallet or P2P address with either the native …
…token or a specific ERC20 (#106) * BAC-1191 topup methods sdk * BAC-1191 topup methods sdk * BAC-1191 topup methods sdk * BAC-1191 topup methods sdk * BAC-1191 topup methods sdk * BAC-1191 topup methods sdk * BAC-1191 topup methods sdk * BAC-1191 fix * BAC-1191 add exception, decimal * BAC-1191 decimal fix * BAC-1191 parameter update * BAC-1191 transferToken update * BAC-1191 fix typo * BAC-1191 if not computeContractAccount on topup * BAC-1191 if not computeContractAccount on topup * BAC-1191 rename method isContractAccount * BAC-1191 update conditions is contract account * BAC-1191 update contract ERC20Token abi * BAC-1191 format * BAC-1191 remove default value for token contract decimals * BAC-1191 wallet provider update * BAC-1191 test update * BAC-1191 udpate test and contract top up * BAC-1191 update version * BAC-1191 update version Co-authored-by: riccardo <[email protected]>
- Loading branch information
1 parent
30feaf5
commit dbd3a2c
Showing
14 changed files
with
8,587 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Wallet, getDefaultProvider, providers } from 'ethers'; | ||
import { EnvNames, NetworkNames, Sdk } from '../../src'; | ||
import { logger, deployToken, getPrivateKeyWallet, balanceOf } from './common'; | ||
|
||
async function main(): Promise<void> { | ||
|
||
// default hardhat local network signer privatekey | ||
let privateKey = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; | ||
const wallet = getPrivateKeyWallet(privateKey,NetworkNames.LocalA); | ||
|
||
const sdk = new Sdk(wallet); | ||
await sdk.computeContractAccount({sync: false}); | ||
const tokenAddress = await deployToken(wallet); | ||
|
||
await balanceOf(wallet, tokenAddress); | ||
|
||
await sdk.topUp("10"); | ||
|
||
await sdk.topUpP2P("10"); | ||
|
||
await sdk.topUpToken("1",tokenAddress); | ||
await balanceOf(wallet, tokenAddress); | ||
|
||
await sdk.topUpTokenP2P("1",tokenAddress); | ||
await balanceOf(wallet, tokenAddress); | ||
} | ||
|
||
main() | ||
.catch(logger.error) | ||
.finally(() => process.exit()); |
Oops, something went wrong.