@alephium/web3 0.1.0-rc.3 → 0.2.0-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/contracts/{add.ral → add/add.ral} +1 -1
  2. package/contracts/{greeter.ral → greeter/greeter.ral} +0 -0
  3. package/contracts/{greeter_interface.ral → greeter/greeter_interface.ral} +0 -0
  4. package/contracts/greeter_main.ral +1 -1
  5. package/contracts/main.ral +1 -1
  6. package/contracts/{sub.ral → sub/sub.ral} +0 -0
  7. package/dev/user.conf +1 -0
  8. package/dist/alephium-web3.min.js +1 -1
  9. package/dist/alephium-web3.min.js.map +1 -1
  10. package/dist/src/api/api-alephium.d.ts +75 -4
  11. package/dist/src/api/api-alephium.js +1 -1
  12. package/dist/src/api/api-explorer.d.ts +33 -6
  13. package/dist/src/contract/contract.d.ts +18 -10
  14. package/dist/src/contract/contract.js +95 -56
  15. package/dist/src/contract/events.d.ts +7 -25
  16. package/dist/src/contract/events.js +18 -31
  17. package/dist/src/index.d.ts +1 -0
  18. package/dist/src/index.js +1 -0
  19. package/dist/src/transaction/index.d.ts +2 -0
  20. package/dist/src/transaction/index.js +31 -0
  21. package/dist/src/{utils/transaction.d.ts → transaction/sign-verify.d.ts} +0 -0
  22. package/dist/src/{utils/transaction.js → transaction/sign-verify.js} +1 -1
  23. package/dist/src/transaction/status.d.ts +10 -0
  24. package/dist/src/transaction/status.js +48 -0
  25. package/dist/src/utils/index.d.ts +1 -1
  26. package/dist/src/utils/index.js +1 -1
  27. package/dist/src/utils/subscription.d.ts +24 -0
  28. package/dist/src/utils/subscription.js +52 -0
  29. package/dist/src/utils/utils.d.ts +2 -0
  30. package/dist/src/utils/utils.js +9 -1
  31. package/package.json +3 -3
  32. package/src/api/api-alephium.ts +111 -4
  33. package/src/api/api-explorer.ts +50 -6
  34. package/src/contract/contract.ts +112 -66
  35. package/src/contract/events.ts +21 -48
  36. package/src/index.ts +1 -0
  37. package/src/transaction/index.ts +20 -0
  38. package/src/{utils/transaction.test.ts → transaction/sign-verify.test.ts} +1 -1
  39. package/src/{utils/transaction.ts → transaction/sign-verify.ts} +1 -1
  40. package/src/transaction/status.ts +58 -0
  41. package/src/utils/index.ts +1 -1
  42. package/src/utils/subscription.ts +72 -0
  43. package/src/utils/utils.test.ts +2 -1
  44. package/src/utils/utils.ts +8 -0
  45. package/templates/base/package.json +1 -1
  46. package/templates/react/package.json +1 -1
  47. package/test/contract.test.ts +24 -7
  48. package/test/events.test.ts +18 -19
  49. package/test/transaction.test.ts +72 -0
@@ -31,6 +31,7 @@ export interface AssetInput {
31
31
  unlockScript: string;
32
32
  }
33
33
  export interface AssetOutput {
34
+ /** @format int32 */
34
35
  hint: number;
35
36
  /** @format 32-byte-hash */
36
37
  key: string;
@@ -62,6 +63,9 @@ export interface Balance {
62
63
  lockedBalance: string;
63
64
  /** @format x.x ALPH */
64
65
  lockedBalanceHint: string;
66
+ tokenBalances?: Token[];
67
+ lockedTokenBalances?: Token[];
68
+ /** @format int32 */
65
69
  utxoNum: number;
66
70
  warning?: string;
67
71
  }
@@ -86,8 +90,11 @@ export interface BlockEntry {
86
90
  hash: string;
87
91
  /** @format int64 */
88
92
  timestamp: number;
93
+ /** @format int32 */
89
94
  chainFrom: number;
95
+ /** @format int32 */
90
96
  chainTo: number;
97
+ /** @format int32 */
91
98
  height: number;
92
99
  deps: string[];
93
100
  transactions: Transaction[];
@@ -106,18 +113,26 @@ export interface BlockHeaderEntry {
106
113
  hash: string;
107
114
  /** @format int64 */
108
115
  timestamp: number;
116
+ /** @format int32 */
109
117
  chainFrom: number;
118
+ /** @format int32 */
110
119
  chainTo: number;
120
+ /** @format int32 */
111
121
  height: number;
112
122
  deps: string[];
113
123
  }
114
124
  export interface BrokerInfo {
115
125
  /** @format clique-id */
116
126
  cliqueId: string;
127
+ /** @format int32 */
117
128
  brokerId: number;
129
+ /** @format int32 */
118
130
  brokerNum: number;
119
131
  /** @format inet-socket-address */
120
- address: string;
132
+ address: {
133
+ addr: string;
134
+ port: number;
135
+ };
121
136
  }
122
137
  export interface BuildDeployContractTx {
123
138
  /** @format public-key */
@@ -135,7 +150,9 @@ export interface BuildDeployContractTx {
135
150
  gasPrice?: string;
136
151
  }
137
152
  export interface BuildDeployContractTxResult {
153
+ /** @format int32 */
138
154
  fromGroup: number;
155
+ /** @format int32 */
139
156
  toGroup: number;
140
157
  unsignedTx: string;
141
158
  /** @format gas */
@@ -161,7 +178,9 @@ export interface BuildExecuteScriptTx {
161
178
  gasPrice?: string;
162
179
  }
163
180
  export interface BuildExecuteScriptTxResult {
181
+ /** @format int32 */
164
182
  fromGroup: number;
183
+ /** @format int32 */
165
184
  toGroup: number;
166
185
  unsignedTx: string;
167
186
  /** @format gas */
@@ -187,6 +206,7 @@ export interface BuildMultisig {
187
206
  }
188
207
  export interface BuildMultisigAddress {
189
208
  keys: string[];
209
+ /** @format int32 */
190
210
  mrequired: number;
191
211
  }
192
212
  export interface BuildMultisigAddressResult {
@@ -207,7 +227,9 @@ export interface BuildSweepAddressTransactions {
207
227
  }
208
228
  export interface BuildSweepAddressTransactionsResult {
209
229
  unsignedTxs: SweepAddressTransaction[];
230
+ /** @format int32 */
210
231
  fromGroup: number;
232
+ /** @format int32 */
211
233
  toGroup: number;
212
234
  }
213
235
  export interface BuildTransaction {
@@ -228,10 +250,13 @@ export interface BuildTransactionResult {
228
250
  gasPrice: string;
229
251
  /** @format 32-byte-hash */
230
252
  txId: string;
253
+ /** @format int32 */
231
254
  fromGroup: number;
255
+ /** @format int32 */
232
256
  toGroup: number;
233
257
  }
234
258
  export interface CallContract {
259
+ /** @format int32 */
235
260
  group: number;
236
261
  /** @format block-hash */
237
262
  worldStateBlockHash?: string;
@@ -239,6 +264,7 @@ export interface CallContract {
239
264
  txId?: string;
240
265
  /** @format address */
241
266
  address: string;
267
+ /** @format int32 */
242
268
  methodIndex: number;
243
269
  args?: Val[];
244
270
  existingContracts?: string[];
@@ -246,6 +272,7 @@ export interface CallContract {
246
272
  }
247
273
  export interface CallContractResult {
248
274
  returns: Val[];
275
+ /** @format int32 */
249
276
  gasUsed: number;
250
277
  contracts: ContractState[];
251
278
  txInputs: string[];
@@ -253,12 +280,16 @@ export interface CallContractResult {
253
280
  events: ContractEventByTxId[];
254
281
  }
255
282
  export interface ChainInfo {
283
+ /** @format int32 */
256
284
  currentHeight: number;
257
285
  }
258
286
  export interface ChainParams {
259
287
  networkId: number;
288
+ /** @format int32 */
260
289
  numZerosAtLeastInHash: number;
290
+ /** @format int32 */
261
291
  groupNumPerBroker: number;
292
+ /** @format int32 */
262
293
  groups: number;
263
294
  }
264
295
  export interface ChangeActiveAddress {
@@ -281,9 +312,13 @@ export interface CompileScriptResult {
281
312
  export interface Confirmed {
282
313
  /** @format block-hash */
283
314
  blockHash: string;
315
+ /** @format int32 */
284
316
  txIndex: number;
317
+ /** @format int32 */
285
318
  chainConfirmations: number;
319
+ /** @format int32 */
286
320
  fromGroupConfirmations: number;
321
+ /** @format int32 */
287
322
  toGroupConfirmations: number;
288
323
  type: string;
289
324
  }
@@ -295,6 +330,7 @@ export interface ContractEvent {
295
330
  blockHash: string;
296
331
  /** @format 32-byte-hash */
297
332
  txId: string;
333
+ /** @format int32 */
298
334
  eventIndex: number;
299
335
  fields: Val[];
300
336
  }
@@ -303,18 +339,22 @@ export interface ContractEventByTxId {
303
339
  blockHash: string;
304
340
  /** @format address */
305
341
  contractAddress: string;
342
+ /** @format int32 */
306
343
  eventIndex: number;
307
344
  fields: Val[];
308
345
  }
309
346
  export interface ContractEvents {
310
347
  events: ContractEvent[];
348
+ /** @format int32 */
311
349
  nextStart: number;
312
350
  }
313
351
  export interface ContractEventsByTxId {
314
352
  events: ContractEventByTxId[];
353
+ /** @format int32 */
315
354
  nextStart: number;
316
355
  }
317
356
  export interface ContractOutput {
357
+ /** @format int32 */
318
358
  hint: number;
319
359
  /** @format 32-byte-hash */
320
360
  key: string;
@@ -341,7 +381,9 @@ export interface DecodeUnsignedTx {
341
381
  unsignedTx: string;
342
382
  }
343
383
  export interface DecodeUnsignedTxResult {
384
+ /** @format int32 */
344
385
  fromGroup: number;
386
+ /** @format int32 */
345
387
  toGroup: number;
346
388
  unsignedTx: UnsignedTx;
347
389
  }
@@ -372,6 +414,7 @@ export interface FieldsSig {
372
414
  types: string[];
373
415
  }
374
416
  export interface FixedAssetOutput {
417
+ /** @format int32 */
375
418
  hint: number;
376
419
  /** @format 32-byte-hash */
377
420
  key: string;
@@ -393,6 +436,7 @@ export interface FunctionSig {
393
436
  returnTypes: string[];
394
437
  }
395
438
  export interface Group {
439
+ /** @format int32 */
396
440
  group: number;
397
441
  }
398
442
  export interface HashesAtHeight {
@@ -401,10 +445,15 @@ export interface HashesAtHeight {
401
445
  export interface InterCliquePeerInfo {
402
446
  /** @format clique-id */
403
447
  cliqueId: string;
448
+ /** @format int32 */
404
449
  brokerId: number;
450
+ /** @format int32 */
405
451
  groupNumPerBroker: number;
406
452
  /** @format inet-socket-address */
407
- address: string;
453
+ address: {
454
+ addr: string;
455
+ port: number;
456
+ };
408
457
  isSynced: boolean;
409
458
  clientVersion: string;
410
459
  }
@@ -425,7 +474,10 @@ export interface NodeInfo {
425
474
  buildInfo: BuildInfo;
426
475
  upnp: boolean;
427
476
  /** @format inet-socket-address */
428
- externalAddress?: string;
477
+ externalAddress?: {
478
+ addr: string;
479
+ port: number;
480
+ };
429
481
  }
430
482
  export interface NodeVersion {
431
483
  version: ReleaseVersion;
@@ -436,6 +488,7 @@ export interface NotFound {
436
488
  }
437
489
  export declare type Output = AssetOutput | ContractOutput;
438
490
  export interface OutputRef {
491
+ /** @format int32 */
439
492
  hint: number;
440
493
  /** @format 32-byte-hash */
441
494
  key: string;
@@ -443,8 +496,11 @@ export interface OutputRef {
443
496
  export interface PeerAddress {
444
497
  /** @format inet-address */
445
498
  address: string;
499
+ /** @format int32 */
446
500
  restPort: number;
501
+ /** @format int32 */
447
502
  wsPort: number;
503
+ /** @format int32 */
448
504
  minerApiPort: number;
449
505
  }
450
506
  export interface PeerMisbehavior {
@@ -454,6 +510,7 @@ export interface PeerMisbehavior {
454
510
  }
455
511
  export declare type PeerStatus = Banned | Penalty;
456
512
  export interface Penalty {
513
+ /** @format int32 */
457
514
  value: number;
458
515
  type: string;
459
516
  }
@@ -462,8 +519,11 @@ export interface Reachable {
462
519
  type: string;
463
520
  }
464
521
  export interface ReleaseVersion {
522
+ /** @format int32 */
465
523
  major: number;
524
+ /** @format int32 */
466
525
  minor: number;
526
+ /** @format int32 */
467
527
  patch: number;
468
528
  }
469
529
  export interface RevealMnemonic {
@@ -504,7 +564,9 @@ export interface SubmitTransaction {
504
564
  export interface SubmitTxResult {
505
565
  /** @format 32-byte-hash */
506
566
  txId: string;
567
+ /** @format int32 */
507
568
  fromGroup: number;
569
+ /** @format int32 */
508
570
  toGroup: number;
509
571
  }
510
572
  export interface Sweep {
@@ -516,6 +578,7 @@ export interface Sweep {
516
578
  gasAmount?: number;
517
579
  /** @format uint256 */
518
580
  gasPrice?: string;
581
+ /** @format int32 */
519
582
  utxosLimit?: number;
520
583
  }
521
584
  export interface SweepAddressTransaction {
@@ -528,6 +591,7 @@ export interface SweepAddressTransaction {
528
591
  gasPrice: string;
529
592
  }
530
593
  export interface TestContract {
594
+ /** @format int32 */
531
595
  group?: number;
532
596
  /** @format block-hash */
533
597
  blockHash?: string;
@@ -539,6 +603,7 @@ export interface TestContract {
539
603
  bytecode: string;
540
604
  initialFields?: Val[];
541
605
  initialAsset?: AssetState;
606
+ /** @format int32 */
542
607
  methodIndex?: number;
543
608
  args?: Val[];
544
609
  existingContracts?: ContractState[];
@@ -550,6 +615,7 @@ export interface TestContractResult {
550
615
  /** @format 32-byte-hash */
551
616
  codeHash: string;
552
617
  returns: Val[];
618
+ /** @format int32 */
553
619
  gasUsed: number;
554
620
  contracts: ContractState[];
555
621
  txInputs: string[];
@@ -586,6 +652,7 @@ export interface Transfer {
586
652
  gas?: number;
587
653
  /** @format uint256 */
588
654
  gasPrice?: string;
655
+ /** @format int32 */
589
656
  utxosLimit?: number;
590
657
  }
591
658
  export interface TransferResult {
@@ -625,7 +692,9 @@ export interface Unban {
625
692
  type: string;
626
693
  }
627
694
  export interface UnconfirmedTransactions {
695
+ /** @format int32 */
628
696
  fromGroup: number;
697
+ /** @format int32 */
629
698
  toGroup: number;
630
699
  unconfirmedTransactions: TransactionTemplate[];
631
700
  }
@@ -640,6 +709,7 @@ export interface UnsignedTx {
640
709
  networkId: number;
641
710
  /** @format script */
642
711
  scriptOpt?: string;
712
+ /** @format int32 */
643
713
  gasAmount: number;
644
714
  /** @format uint256 */
645
715
  gasPrice: string;
@@ -666,6 +736,7 @@ export interface ValByteVec {
666
736
  type: string;
667
737
  }
668
738
  export interface ValI256 {
739
+ /** @format bigint */
669
740
  value: string;
670
741
  type: string;
671
742
  }
@@ -774,7 +845,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
774
845
  }
775
846
  /**
776
847
  * @title Alephium API
777
- * @version 1.4.0
848
+ * @version 1.4.2
778
849
  * @baseUrl {protocol}://{host}:{port}
779
850
  */
780
851
  export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
@@ -158,7 +158,7 @@ class HttpClient {
158
158
  exports.HttpClient = HttpClient;
159
159
  /**
160
160
  * @title Alephium API
161
- * @version 1.4.0
161
+ * @version 1.4.2
162
162
  * @baseUrl {protocol}://{host}:{port}
163
163
  */
164
164
  class Api extends HttpClient {
@@ -9,30 +9,39 @@ export interface AddressInfo {
9
9
  balance: string;
10
10
  /** @format uint256 */
11
11
  lockedBalance: string;
12
+ /** @format int32 */
12
13
  txNumber: number;
13
14
  }
14
15
  export interface BadRequest {
15
16
  detail: string;
16
17
  }
17
18
  export interface BlockEntryLite {
19
+ /** @format block-hash */
18
20
  hash: string;
19
21
  /** @format int64 */
20
22
  timestamp: number;
23
+ /** @format int32 */
21
24
  chainFrom: number;
25
+ /** @format int32 */
22
26
  chainTo: number;
27
+ /** @format int32 */
23
28
  height: number;
29
+ /** @format int32 */
24
30
  txNumber: number;
25
31
  mainChain: boolean;
26
32
  /** @format bigint */
27
33
  hashRate: string;
28
34
  }
29
35
  export interface ConfirmedTransaction {
36
+ /** @format 32-byte-hash */
30
37
  hash: string;
38
+ /** @format block-hash */
31
39
  blockHash: string;
32
40
  /** @format int64 */
33
41
  timestamp: number;
34
42
  inputs?: Input[];
35
43
  outputs?: Output[];
44
+ /** @format int32 */
36
45
  gasAmount: number;
37
46
  /** @format uint256 */
38
47
  gasPrice: string;
@@ -45,12 +54,13 @@ export interface ExplorerInfo {
45
54
  export interface Hashrate {
46
55
  /** @format int64 */
47
56
  timestamp: number;
48
- hashrate: string;
49
- value: string;
57
+ hashrate: number;
58
+ value: number;
50
59
  }
51
60
  export interface Input {
52
61
  outputRef: OutputRef;
53
62
  unlockScript?: string;
63
+ /** @format 32-byte-hash */
54
64
  txHashRef: string;
55
65
  address: string;
56
66
  /** @format uint256 */
@@ -60,6 +70,7 @@ export interface InternalServerError {
60
70
  detail: string;
61
71
  }
62
72
  export interface ListBlocks {
73
+ /** @format int32 */
63
74
  total: number;
64
75
  blocks?: BlockEntryLite[];
65
76
  }
@@ -68,6 +79,7 @@ export interface NotFound {
68
79
  resource: string;
69
80
  }
70
81
  export interface Output {
82
+ /** @format int32 */
71
83
  hint: number;
72
84
  /** @format 32-byte-hash */
73
85
  key: string;
@@ -76,21 +88,27 @@ export interface Output {
76
88
  address: string;
77
89
  /** @format int64 */
78
90
  lockTime?: number;
91
+ /** @format 32-byte-hash */
79
92
  spent?: string;
80
93
  }
81
94
  export interface OutputRef {
95
+ /** @format int32 */
82
96
  hint: number;
83
97
  /** @format 32-byte-hash */
84
98
  key: string;
85
99
  }
86
100
  export interface PerChainCount {
101
+ /** @format int32 */
87
102
  chainFrom: number;
103
+ /** @format int32 */
88
104
  chainTo: number;
89
105
  /** @format int64 */
90
106
  count: number;
91
107
  }
92
108
  export interface PerChainDuration {
109
+ /** @format int32 */
93
110
  chainFrom: number;
111
+ /** @format int32 */
94
112
  chainTo: number;
95
113
  /** @format int64 */
96
114
  duration: number;
@@ -98,7 +116,9 @@ export interface PerChainDuration {
98
116
  value: number;
99
117
  }
100
118
  export interface PerChainHeight {
119
+ /** @format int32 */
101
120
  chainFrom: number;
121
+ /** @format int32 */
102
122
  chainTo: number;
103
123
  /** @format int64 */
104
124
  height: number;
@@ -134,12 +154,15 @@ export interface TokenSupply {
134
154
  maximum: string;
135
155
  }
136
156
  export interface Transaction {
157
+ /** @format 32-byte-hash */
137
158
  hash: string;
159
+ /** @format block-hash */
138
160
  blockHash: string;
139
161
  /** @format int64 */
140
162
  timestamp: number;
141
163
  inputs?: Input[];
142
164
  outputs?: Output[];
165
+ /** @format int32 */
143
166
  gasAmount: number;
144
167
  /** @format uint256 */
145
168
  gasPrice: string;
@@ -160,11 +183,15 @@ export interface Unauthorized {
160
183
  detail: string;
161
184
  }
162
185
  export interface UnconfirmedTransaction {
186
+ /** @format 32-byte-hash */
163
187
  hash: string;
188
+ /** @format int32 */
164
189
  chainFrom: number;
190
+ /** @format int32 */
165
191
  chainTo: number;
166
192
  inputs?: UInput[];
167
193
  outputs?: UOutput[];
194
+ /** @format int32 */
168
195
  gasAmount: number;
169
196
  /** @format uint256 */
170
197
  gasPrice: string;
@@ -351,7 +378,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
351
378
  * @name GetInfosSupplyTotalAlph
352
379
  * @request GET:/infos/supply/total-alph
353
380
  */
354
- getInfosSupplyTotalAlph: (params?: RequestParams) => Promise<string>;
381
+ getInfosSupplyTotalAlph: (params?: RequestParams) => Promise<number>;
355
382
  /**
356
383
  * @description Get the ALPH circulating supply
357
384
  *
@@ -359,7 +386,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
359
386
  * @name GetInfosSupplyCirculatingAlph
360
387
  * @request GET:/infos/supply/circulating-alph
361
388
  */
362
- getInfosSupplyCirculatingAlph: (params?: RequestParams) => Promise<string>;
389
+ getInfosSupplyCirculatingAlph: (params?: RequestParams) => Promise<number>;
363
390
  /**
364
391
  * @description Get the ALPH reserved supply
365
392
  *
@@ -367,7 +394,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
367
394
  * @name GetInfosSupplyReservedAlph
368
395
  * @request GET:/infos/supply/reserved-alph
369
396
  */
370
- getInfosSupplyReservedAlph: (params?: RequestParams) => Promise<string>;
397
+ getInfosSupplyReservedAlph: (params?: RequestParams) => Promise<number>;
371
398
  /**
372
399
  * @description Get the ALPH locked supply
373
400
  *
@@ -375,7 +402,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
375
402
  * @name GetInfosSupplyLockedAlph
376
403
  * @request GET:/infos/supply/locked-alph
377
404
  */
378
- getInfosSupplyLockedAlph: (params?: RequestParams) => Promise<string>;
405
+ getInfosSupplyLockedAlph: (params?: RequestParams) => Promise<number>;
379
406
  /**
380
407
  * @description Get the total number of transactions
381
408
  *
@@ -1,6 +1,13 @@
1
1
  import { NodeProvider } from '../api';
2
2
  import { node } from '../api';
3
3
  import { SignDeployContractTxParams, SignExecuteScriptTxParams, SignerWithNodeProvider } from '../signer';
4
+ declare class SourceFile {
5
+ readonly dirs: string[];
6
+ readonly dirPath: string;
7
+ readonly contractPath: string;
8
+ readonly artifactPath: string;
9
+ constructor(dirs: string[], fileName: string);
10
+ }
4
11
  export declare abstract class Common {
5
12
  readonly sourceCodeSha256: string;
6
13
  readonly functions: node.FunctionSig[];
@@ -13,16 +20,15 @@ export declare abstract class Common {
13
20
  protected static _getArtifactFromCache(codeHash: string): Contract | Script | undefined;
14
21
  protected static _putArtifactToCache(contract: Contract): void;
15
22
  constructor(sourceCodeSha256: string, functions: node.FunctionSig[]);
16
- protected static _contractPath(fileName: string): string;
17
- protected static _artifactPath(fileName: string): string;
18
23
  protected static _artifactsFolder(): string;
19
- protected static _handleImports(contractStr: string, importsCache: string[]): Promise<string>;
20
- protected static _loadContractStr(fileName: string, importsCache: string[], validate: (fileName: string) => void): Promise<string>;
24
+ static getSourceFile(path: string, _dirs: string[]): SourceFile;
25
+ protected static _handleImports(pathes: string[], contractStr: string, importsCache: string[]): Promise<string>;
26
+ protected static _loadContractStr(sourceFile: SourceFile, importsCache: string[], validate: (code: string) => void): Promise<string>;
21
27
  static checkFileNameExtension(fileName: string): void;
22
28
  protected static _from<T extends {
23
29
  sourceCodeSha256: string;
24
- }>(provider: NodeProvider, fileName: string, loadContractStr: (fileName: string, importsCache: string[]) => Promise<string>, compile: (provider: NodeProvider, fileName: string, contractStr: string, contractHash: string) => Promise<T>): Promise<T>;
25
- protected _saveToFile(fileName: string): Promise<void>;
30
+ }>(provider: NodeProvider, sourceFile: SourceFile, loadContractStr: (sourceFile: SourceFile, importsCache: string[]) => Promise<string>, compile: (provider: NodeProvider, sourceFile: SourceFile, contractStr: string, contractHash: string) => Promise<T>): Promise<T>;
31
+ protected _saveToFile(sourceFile: SourceFile): Promise<void>;
26
32
  abstract buildByteCodeToDeploy(initialFields?: Fields): string;
27
33
  }
28
34
  export declare class Contract extends Common {
@@ -33,10 +39,11 @@ export declare class Contract extends Common {
33
39
  constructor(sourceCodeSha256: string, bytecode: string, codeHash: string, fieldsSig: node.FieldsSig, eventsSig: node.EventSig[], functions: node.FunctionSig[]);
34
40
  static checkCodeType(fileName: string, contractStr: string): void;
35
41
  private static loadContractStr;
36
- static fromSource(provider: NodeProvider, fileName: string): Promise<Contract>;
42
+ static fromSource(provider: NodeProvider, path: string): Promise<Contract>;
37
43
  private static compile;
38
44
  static fromJson(artifact: any): Contract;
39
- static fromArtifactFile(fileName: string): Promise<Contract>;
45
+ static fromArtifactFile(path: string): Promise<Contract>;
46
+ fetchState(provider: NodeProvider, address: string, group: number): Promise<ContractState>;
40
47
  toString(): string;
41
48
  toState(fields: Fields, asset: Asset, address?: string): ContractState;
42
49
  static randomAddress(): string;
@@ -65,10 +72,10 @@ export declare class Script extends Common {
65
72
  constructor(sourceCodeSha256: string, bytecodeTemplate: string, fieldsSig: node.FieldsSig, functions: node.FunctionSig[]);
66
73
  static checkCodeType(fileName: string, contractStr: string): void;
67
74
  private static loadContractStr;
68
- static fromSource(provider: NodeProvider, fileName: string): Promise<Script>;
75
+ static fromSource(provider: NodeProvider, path: string): Promise<Script>;
69
76
  private static compile;
70
77
  static fromJson(artifact: any): Script;
71
- static fromArtifactFile(fileName: string): Promise<Script>;
78
+ static fromArtifactFile(path: string): Promise<Script>;
72
79
  toString(): string;
73
80
  paramsForDeployment(params: BuildExecuteScriptTx): Promise<SignExecuteScriptTxParams>;
74
81
  transactionForDeployment(signer: SignerWithNodeProvider, params: Omit<BuildExecuteScriptTx, 'signerAddress'>): Promise<BuildScriptTxResult>;
@@ -180,3 +187,4 @@ export interface BuildScriptTxResult {
180
187
  unsignedTx: string;
181
188
  txId: string;
182
189
  }
190
+ export {};