This repository was archived by the owner on Jul 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { RedundantSubprovider , RPCSubprovider , Web3ProviderEngine } from '@0x/subproviders' ;
2
- import { ApiConstructorParams , PolymathAPI } from '../src/PolymathAPI' ;
3
2
import { BigNumber } from '@polymathnetwork/abi-wrappers' ;
3
+ import { ApiConstructorParams , PolymathAPI } from '../src/PolymathAPI' ;
4
4
5
5
// This file acts as a valid sandbox.ts file in root directory for request POLY tokens on an unlocked node (like ganache)
6
6
@@ -17,12 +17,14 @@ window.addEventListener('load', async () => {
17
17
// Instantiate the API
18
18
const polymathAPI = new PolymathAPI ( params ) ;
19
19
20
+ // Get some poly tokens in your account and the security token
21
+ const myAddress = await polymathAPI . getAccount ( ) ;
22
+
20
23
let polyBalance = await polymathAPI . polyToken . balanceOf ( ) ;
21
24
console . log ( 'Poly Balance:' , polyBalance . toNumber ( ) ) ;
22
- if ( ! polyBalance . toNumber ( ) ) {
23
- // getPolyTokens only works on a testnet environment
24
- await polymathAPI . getPolyTokens ( { amount : new BigNumber ( 500000 ) } ) ;
25
- }
25
+
26
+ // getPolyTokens only works on a testnet environment
27
+ await polymathAPI . getPolyTokens ( { amount : new BigNumber ( 1000000 ) , address : myAddress } ) ;
26
28
polyBalance = await polymathAPI . polyToken . balanceOf ( ) ;
27
29
console . log ( 'Poly Balance:' , polyBalance . toNumber ( ) ) ;
28
30
} ) ;
You can’t perform that action at this time.
0 commit comments