@@ -50,7 +50,7 @@ If you want to use custom ICON node url, change the value of `NODE_URL` variable
50
50
* For more information on the testnet, see [ the documentation] ( https://github.com/icon-project/icon-project.github.io/blob/master/docs/icon_network.md ) for the ICON network.*
51
51
52
52
``` javascript
53
- const NODE_URL = ' https://bicon.net.solidwallet.io/api/v3' ;
53
+ const NODE_URL = ' https://bicon.net.solidwallet.io/api/v3' ;
54
54
```
55
55
56
56
@@ -122,7 +122,7 @@ After calling `store`, Keystore json object can be looked up with the returned v
122
122
const privateKey = ' 38f792b95a5202ab431bfc799f7e1e5c74ec0b9ede5c6142ee7364f2c84d72f6'
123
123
const wallet = IconWallet .loadPrivateKey (privateKey);
124
124
console .log (wallet .store (' qwer1234!' ));
125
- // Output:
125
+ // Output:
126
126
// {
127
127
// "version": 3,
128
128
// "id": "e00e113c-1e45-47e4-b732-10f3d1903d75",
@@ -225,7 +225,7 @@ Generate SignedTransaction to add signature of the transaction.
225
225
const signedTransaction = new SignedTransaction (transaction, wallet);
226
226
// Read params to transfer to nodes
227
227
console .log (signedTransaction .getProperties ());
228
- // Output:
228
+ // Output:
229
229
// {
230
230
// from: "hx902ecb51c109183ace539f247b4ea1347fbf23b5",
231
231
// nid: "0x3",
@@ -294,7 +294,7 @@ const wallet = IconWallet.loadPrivateKey(MockData.PRIVATE_KEY_2);
294
294
const balance = await iconService .getBalance (wallet .getAddress ()).execute ();
295
295
console .log (balance);
296
296
297
- // Output:
297
+ // Output:
298
298
// 100432143214321432143
299
299
```
300
300
@@ -308,18 +308,18 @@ This example shows how to deploy IRC token and transfer deployed token.
308
308
309
309
You need the SCORE Project to deploy token.
310
310
311
- In this example, you will use ‘test.zi ’ from the ‘resources’ folder.
311
+ In this example, you will use ‘irc2-token.jar ’ from the ‘resources’ folder.
312
312
313
- * test.zi : SampleToken SCORE Project Zip file .
313
+ * irc2-token.jar : SampleToken SCORE contract .
314
314
315
- Generate wallet using ` MockData.PRIVATE_KEY_1 ` , then read the binary data from ‘test.zi ’
315
+ Generate wallet using ` MockData.PRIVATE_KEY_1 ` , then read the binary data from ‘irc2-token.jar ’
316
316
317
317
``` javascript
318
318
const { Wallet } = this .iconService ;
319
319
this .wallet = IconWallet .loadPrivateKey (MockData .PRIVATE_KEY_1 );
320
320
321
321
this .content = ' ' ;
322
- // Read test.zi from ‘resources’ folder.
322
+ // Read irc2-token.jar from ‘resources’ folder.
323
323
```
324
324
325
325
Enter the basic information of the token you want to deploy.
@@ -338,7 +338,7 @@ You can get the maximum step limit value as follows.
338
338
// GOVERNANCE_ADDRESS : cx0000000000000000000000000000000000000001
339
339
async getMaxStepLimit () {
340
340
const { CallBuilder } = IconBuilder;
341
-
341
+
342
342
const governanceApi = await this .iconService .getScoreApi (MockData .GOVERNANCE_ADDRESS ).execute ();
343
343
// "getMaxStepLimit" : the maximum step limit value that any SCORE execution should be bounded by.
344
344
const methodName = ' getMaxStepLimit' ;
@@ -370,15 +370,15 @@ async buildDeployTransaction() {
370
370
const decimals = IconConverter .toBigNumber (" 18" );
371
371
const tokenName = " StandardToken" ;
372
372
const tokenSymbol = " ST" ;
373
- const contentType = " application/zip " ;
373
+ const contentType = " application/java " ;
374
374
// Enter token information
375
- // key name ("initialSupply ", "decimals ", "name ", "symbol ")
375
+ // key name ("_initialSupply ", "_decimals ", "_name ", "_symbol ")
376
376
// You must enter the given values. Otherwise, your transaction will be rejected.
377
377
const params = {
378
- initialSupply : IconConverter .toHex (initialSupply),
379
- decimals : IconConverter .toHex (decimals),
380
- name : tokenName,
381
- symbol : tokenSymbol
378
+ _initialSupply : IconConverter .toHex (initialSupply),
379
+ _decimals : IconConverter .toHex (decimals),
380
+ _name : tokenName,
381
+ _symbol : tokenSymbol
382
382
}
383
383
const installScore = MockData .SCORE_INSTALL_ADDRESS ;
384
384
const stepLimit = await this .getMaxStepLimit ();
@@ -402,8 +402,8 @@ async buildDeployTransaction() {
402
402
.content (` 0x${ this .content } ` )
403
403
.params (params)
404
404
.version (version)
405
- .build ();
406
- return transaction;
405
+ .build ();
406
+ return transaction;
407
407
}
408
408
```
409
409
@@ -463,7 +463,7 @@ You can get a step cost to send token as follows.
463
463
``` javascript
464
464
async getDefaultStepCost () {
465
465
const { CallBuilder } = IconBuilder;
466
-
466
+
467
467
// Get apis that provides Governance SCORE
468
468
// GOVERNANCE_ADDRESS : cx0000000000000000000000000000000000000001
469
469
const governanceApi = await this .iconService .getScoreApi (MockData .GOVERNANCE_ADDRESS ).execute ();
@@ -506,7 +506,7 @@ async buildTokenTransaction() {
506
506
_to: MockData .WALLET_ADDRESS_2 ,
507
507
_value: IconConverter .toHex (value)
508
508
}
509
-
509
+
510
510
// Enter transaction information
511
511
const tokenTransactionBuilder = new CallTransactionBuilder ();
512
512
const transaction = tokenTransactionBuilder
@@ -518,7 +518,7 @@ async buildTokenTransaction() {
518
518
.method (methodName)
519
519
.params (params)
520
520
.version (version)
521
- .build ();
521
+ .build ();
522
522
return transaction;
523
523
}
524
524
```
@@ -652,13 +652,13 @@ async syncBlock(block) {
652
652
653
653
const tokenName = await this .getTokenName (transaction .to );
654
654
const symbol = await this .getTokenSymbol (transaction .to );
655
-
655
+
656
656
document .getElementById (" S03-2" ).innerHTML += ` <li >${ block .height } - [${ tokenName} - ${ symbol} ] status: ${ txResult .status === 1 ? ' success' : ' failure' } | amount: ${ value} </li >` ;
657
657
}
658
658
}
659
659
})
660
660
)
661
-
661
+
662
662
this .prevHeight = block .height ;
663
663
}
664
664
@@ -697,5 +697,5 @@ async getTokenSymbol(to) {
697
697
698
698
## References
699
699
700
- - [ ICON JSON-RPC API v3] ( https://icondev.readme.io/docs/json-rpc-specification )
700
+ - [ ICON JSON-RPC API v3] ( https://icondev.readme.io/docs/json-rpc-specification )
701
701
- [ IRC2 Specification] ( https://github.com/icon-project/IIPs/blob/master/IIPS/iip-2.md )
0 commit comments