@alephium/web3 0.2.0-test.0 → 0.2.0-test.1
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.
- package/contracts/add/add.ral +5 -8
- package/contracts/greeter/greeter.ral +3 -3
- package/contracts/greeter/greeter_interface.ral +1 -0
- package/contracts/greeter_main.ral +3 -5
- package/contracts/main.ral +0 -2
- package/contracts/sub/sub.ral +2 -1
- package/contracts/test/metadata.ral +18 -0
- package/contracts/test/warnings.ral +8 -0
- package/dist/alephium-web3.min.js +1 -1
- package/dist/alephium-web3.min.js.map +1 -1
- package/dist/scripts/create-project.js +2 -1
- package/dist/src/api/api-alephium.d.ts +37 -7
- package/dist/src/api/api-alephium.js +19 -3
- package/dist/src/api/api-explorer.d.ts +16 -0
- package/dist/src/api/api-explorer.js +26 -0
- package/dist/src/contract/contract.d.ts +86 -52
- package/dist/src/contract/contract.js +325 -218
- package/dist/src/global.d.ts +3 -0
- package/dist/src/global.js +38 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/signer/node-wallet.d.ts +1 -3
- package/dist/src/signer/node-wallet.js +2 -5
- package/dist/src/signer/signer.d.ts +1 -1
- package/dist/src/signer/signer.js +3 -2
- package/dist/src/test/index.d.ts +1 -2
- package/dist/src/test/index.js +4 -4
- package/dist/src/test/privatekey-wallet.d.ts +2 -3
- package/dist/src/test/privatekey-wallet.js +4 -4
- package/dist/src/utils/subscription.d.ts +0 -1
- package/dist/src/utils/subscription.js +2 -1
- package/dist/src/utils/utils.d.ts +2 -2
- package/dist/src/utils/utils.js +2 -2
- package/gitignore +0 -1
- package/package.json +3 -5
- package/scripts/create-project.ts +2 -1
- package/src/api/api-alephium.ts +57 -8
- package/src/api/api-explorer.ts +30 -0
- package/src/contract/contract.ts +430 -317
- package/src/contract/events.ts +2 -2
- package/src/contract/ralph.test.ts +4 -4
- package/src/global.ts +36 -0
- package/src/index.ts +1 -0
- package/src/signer/node-wallet.ts +2 -11
- package/src/signer/signer.ts +4 -3
- package/src/test/index.ts +2 -3
- package/src/test/privatekey-wallet.ts +4 -5
- package/src/transaction/status.ts +1 -1
- package/src/utils/subscription.ts +3 -3
- package/src/utils/utils.test.ts +1 -1
- package/src/utils/utils.ts +4 -4
- package/templates/base/package.json +2 -2
- package/templates/base/src/greeter.ts +8 -7
- package/templates/react/package.json +2 -2
- package/templates/react/src/App.tsx +2 -2
- package/test/contract.test.ts +60 -25
- package/test/events.test.ts +20 -17
- package/test/transaction.test.ts +10 -9
|
@@ -86,7 +86,8 @@ function prepareShared(packageRoot, projectRoot) {
|
|
|
86
86
|
}
|
|
87
87
|
function prepareBase(packageRoot, projectRoot) {
|
|
88
88
|
prepareShared(packageRoot, projectRoot);
|
|
89
|
-
copy('contracts', ['
|
|
89
|
+
copy('contracts', ['greeter_main.ral']);
|
|
90
|
+
copy('contracts/greeter', ['greeter.ral', 'greeter_interface.ral']);
|
|
90
91
|
fs_extra_1.default.copySync(path_1.default.join(packageRoot, 'templates/base'), projectRoot);
|
|
91
92
|
}
|
|
92
93
|
function prepareReact(packageRoot, projectRoot, projectName) {
|
|
@@ -148,6 +148,8 @@ export interface BuildDeployContractTx {
|
|
|
148
148
|
gasAmount?: number;
|
|
149
149
|
/** @format uint256 */
|
|
150
150
|
gasPrice?: string;
|
|
151
|
+
/** @format block-hash */
|
|
152
|
+
targetBlockHash?: string;
|
|
151
153
|
}
|
|
152
154
|
export interface BuildDeployContractTxResult {
|
|
153
155
|
/** @format int32 */
|
|
@@ -176,6 +178,8 @@ export interface BuildExecuteScriptTx {
|
|
|
176
178
|
gasAmount?: number;
|
|
177
179
|
/** @format uint256 */
|
|
178
180
|
gasPrice?: string;
|
|
181
|
+
/** @format block-hash */
|
|
182
|
+
targetBlockHash?: string;
|
|
179
183
|
}
|
|
180
184
|
export interface BuildExecuteScriptTxResult {
|
|
181
185
|
/** @format int32 */
|
|
@@ -224,6 +228,8 @@ export interface BuildSweepAddressTransactions {
|
|
|
224
228
|
gasAmount?: number;
|
|
225
229
|
/** @format uint256 */
|
|
226
230
|
gasPrice?: string;
|
|
231
|
+
/** @format block-hash */
|
|
232
|
+
targetBlockHash?: string;
|
|
227
233
|
}
|
|
228
234
|
export interface BuildSweepAddressTransactionsResult {
|
|
229
235
|
unsignedTxs: SweepAddressTransaction[];
|
|
@@ -241,6 +247,8 @@ export interface BuildTransaction {
|
|
|
241
247
|
gasAmount?: number;
|
|
242
248
|
/** @format uint256 */
|
|
243
249
|
gasPrice?: string;
|
|
250
|
+
/** @format block-hash */
|
|
251
|
+
targetBlockHash?: string;
|
|
244
252
|
}
|
|
245
253
|
export interface BuildTransactionResult {
|
|
246
254
|
unsignedTx: string;
|
|
@@ -303,11 +311,17 @@ export interface CompileContractResult {
|
|
|
303
311
|
fields: FieldsSig;
|
|
304
312
|
functions: FunctionSig[];
|
|
305
313
|
events: EventSig[];
|
|
314
|
+
warnings: string[];
|
|
315
|
+
}
|
|
316
|
+
export interface CompileProjectResult {
|
|
317
|
+
contracts: CompileContractResult[];
|
|
318
|
+
scripts: CompileScriptResult[];
|
|
306
319
|
}
|
|
307
320
|
export interface CompileScriptResult {
|
|
308
321
|
bytecodeTemplate: string;
|
|
309
322
|
fields: FieldsSig;
|
|
310
323
|
functions: FunctionSig[];
|
|
324
|
+
warnings: string[];
|
|
311
325
|
}
|
|
312
326
|
export interface Confirmed {
|
|
313
327
|
/** @format block-hash */
|
|
@@ -401,7 +415,6 @@ export interface Destination {
|
|
|
401
415
|
export declare type DiscoveryAction = Reachable | Unreachable;
|
|
402
416
|
export interface EventSig {
|
|
403
417
|
name: string;
|
|
404
|
-
signature: string;
|
|
405
418
|
fieldNames: string[];
|
|
406
419
|
fieldTypes: string[];
|
|
407
420
|
}
|
|
@@ -409,9 +422,9 @@ export interface FetchResponse {
|
|
|
409
422
|
blocks: BlockEntry[][];
|
|
410
423
|
}
|
|
411
424
|
export interface FieldsSig {
|
|
412
|
-
signature: string;
|
|
413
425
|
names: string[];
|
|
414
426
|
types: string[];
|
|
427
|
+
isMutable: boolean[];
|
|
415
428
|
}
|
|
416
429
|
export interface FixedAssetOutput {
|
|
417
430
|
/** @format int32 */
|
|
@@ -430,9 +443,12 @@ export interface FixedAssetOutput {
|
|
|
430
443
|
}
|
|
431
444
|
export interface FunctionSig {
|
|
432
445
|
name: string;
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
446
|
+
usePreapprovedAssets: boolean;
|
|
447
|
+
useAssetsInContract: boolean;
|
|
448
|
+
isPublic: boolean;
|
|
449
|
+
paramNames: string[];
|
|
450
|
+
paramTypes: string[];
|
|
451
|
+
paramIsMutable: boolean[];
|
|
436
452
|
returnTypes: string[];
|
|
437
453
|
}
|
|
438
454
|
export interface Group {
|
|
@@ -514,6 +530,9 @@ export interface Penalty {
|
|
|
514
530
|
value: number;
|
|
515
531
|
type: string;
|
|
516
532
|
}
|
|
533
|
+
export interface Project {
|
|
534
|
+
code: string;
|
|
535
|
+
}
|
|
517
536
|
export interface Reachable {
|
|
518
537
|
peers: string[];
|
|
519
538
|
type: string;
|
|
@@ -580,6 +599,8 @@ export interface Sweep {
|
|
|
580
599
|
gasPrice?: string;
|
|
581
600
|
/** @format int32 */
|
|
582
601
|
utxosLimit?: number;
|
|
602
|
+
/** @format block-hash */
|
|
603
|
+
targetBlockHash?: string;
|
|
583
604
|
}
|
|
584
605
|
export interface SweepAddressTransaction {
|
|
585
606
|
/** @format 32-byte-hash */
|
|
@@ -845,8 +866,8 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
845
866
|
}
|
|
846
867
|
/**
|
|
847
868
|
* @title Alephium API
|
|
848
|
-
* @version 1.
|
|
849
|
-
* @baseUrl
|
|
869
|
+
* @version 1.5.0
|
|
870
|
+
* @baseUrl ../
|
|
850
871
|
*/
|
|
851
872
|
export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
|
|
852
873
|
wallets: {
|
|
@@ -1324,6 +1345,15 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1324
1345
|
* @request POST:/contracts/compile-contract
|
|
1325
1346
|
*/
|
|
1326
1347
|
postContractsCompileContract: (data: Contract, params?: RequestParams) => Promise<CompileContractResult>;
|
|
1348
|
+
/**
|
|
1349
|
+
* No description
|
|
1350
|
+
*
|
|
1351
|
+
* @tags Contracts
|
|
1352
|
+
* @name PostContractsCompileProject
|
|
1353
|
+
* @summary Compile a project
|
|
1354
|
+
* @request POST:/contracts/compile-project
|
|
1355
|
+
*/
|
|
1356
|
+
postContractsCompileProject: (data: Project, params?: RequestParams) => Promise<CompileProjectResult>;
|
|
1327
1357
|
/**
|
|
1328
1358
|
* No description
|
|
1329
1359
|
*
|
|
@@ -28,7 +28,7 @@ var ContentType;
|
|
|
28
28
|
})(ContentType = exports.ContentType || (exports.ContentType = {}));
|
|
29
29
|
class HttpClient {
|
|
30
30
|
constructor(apiConfig = {}) {
|
|
31
|
-
this.baseUrl = '
|
|
31
|
+
this.baseUrl = '../';
|
|
32
32
|
this.securityData = null;
|
|
33
33
|
this.abortControllers = new Map();
|
|
34
34
|
this.customFetch = (...fetchParams) => fetch(...fetchParams);
|
|
@@ -158,8 +158,8 @@ class HttpClient {
|
|
|
158
158
|
exports.HttpClient = HttpClient;
|
|
159
159
|
/**
|
|
160
160
|
* @title Alephium API
|
|
161
|
-
* @version 1.
|
|
162
|
-
* @baseUrl
|
|
161
|
+
* @version 1.5.0
|
|
162
|
+
* @baseUrl ../
|
|
163
163
|
*/
|
|
164
164
|
class Api extends HttpClient {
|
|
165
165
|
constructor() {
|
|
@@ -901,6 +901,22 @@ class Api extends HttpClient {
|
|
|
901
901
|
format: 'json',
|
|
902
902
|
...params
|
|
903
903
|
}).then(convertHttpResponse),
|
|
904
|
+
/**
|
|
905
|
+
* No description
|
|
906
|
+
*
|
|
907
|
+
* @tags Contracts
|
|
908
|
+
* @name PostContractsCompileProject
|
|
909
|
+
* @summary Compile a project
|
|
910
|
+
* @request POST:/contracts/compile-project
|
|
911
|
+
*/
|
|
912
|
+
postContractsCompileProject: (data, params = {}) => this.request({
|
|
913
|
+
path: `/contracts/compile-project`,
|
|
914
|
+
method: 'POST',
|
|
915
|
+
body: data,
|
|
916
|
+
type: ContentType.Json,
|
|
917
|
+
format: 'json',
|
|
918
|
+
...params
|
|
919
|
+
}).then(convertHttpResponse),
|
|
904
920
|
/**
|
|
905
921
|
* No description
|
|
906
922
|
*
|
|
@@ -470,6 +470,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
470
470
|
* @request PUT:/utils/sanity-check
|
|
471
471
|
*/
|
|
472
472
|
putUtilsSanityCheck: (params?: RequestParams) => Promise<void>;
|
|
473
|
+
/**
|
|
474
|
+
* @description Update global log level, accepted: TRACE, DEBUG, INFO, WARN, ERROR
|
|
475
|
+
*
|
|
476
|
+
* @tags Utils
|
|
477
|
+
* @name PutUtilsUpdateGlobalLoglevel
|
|
478
|
+
* @request PUT:/utils/update-global-loglevel
|
|
479
|
+
*/
|
|
480
|
+
putUtilsUpdateGlobalLoglevel: (data: 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR', params?: RequestParams) => Promise<void>;
|
|
481
|
+
/**
|
|
482
|
+
* @description Update logging file, only logback.xml is accepted
|
|
483
|
+
*
|
|
484
|
+
* @tags Utils
|
|
485
|
+
* @name PutUtilsUpdateLogConfig
|
|
486
|
+
* @request PUT:/utils/update-log-config
|
|
487
|
+
*/
|
|
488
|
+
putUtilsUpdateLogConfig: (data: string, params?: RequestParams) => Promise<void>;
|
|
473
489
|
};
|
|
474
490
|
}
|
|
475
491
|
export {};
|
|
@@ -450,6 +450,32 @@ class Api extends HttpClient {
|
|
|
450
450
|
path: `/utils/sanity-check`,
|
|
451
451
|
method: 'PUT',
|
|
452
452
|
...params
|
|
453
|
+
}).then(convertHttpResponse),
|
|
454
|
+
/**
|
|
455
|
+
* @description Update global log level, accepted: TRACE, DEBUG, INFO, WARN, ERROR
|
|
456
|
+
*
|
|
457
|
+
* @tags Utils
|
|
458
|
+
* @name PutUtilsUpdateGlobalLoglevel
|
|
459
|
+
* @request PUT:/utils/update-global-loglevel
|
|
460
|
+
*/
|
|
461
|
+
putUtilsUpdateGlobalLoglevel: (data, params = {}) => this.request({
|
|
462
|
+
path: `/utils/update-global-loglevel`,
|
|
463
|
+
method: 'PUT',
|
|
464
|
+
body: data,
|
|
465
|
+
...params
|
|
466
|
+
}).then(convertHttpResponse),
|
|
467
|
+
/**
|
|
468
|
+
* @description Update logging file, only logback.xml is accepted
|
|
469
|
+
*
|
|
470
|
+
* @tags Utils
|
|
471
|
+
* @name PutUtilsUpdateLogConfig
|
|
472
|
+
* @request PUT:/utils/update-log-config
|
|
473
|
+
*/
|
|
474
|
+
putUtilsUpdateLogConfig: (data, params = {}) => this.request({
|
|
475
|
+
path: `/utils/update-log-config`,
|
|
476
|
+
method: 'PUT',
|
|
477
|
+
body: data,
|
|
478
|
+
...params
|
|
453
479
|
}).then(convertHttpResponse)
|
|
454
480
|
};
|
|
455
481
|
}
|
|
@@ -1,79 +1,113 @@
|
|
|
1
|
-
import { NodeProvider } from '../api';
|
|
2
|
-
import { node } from '../api';
|
|
1
|
+
import { node, NodeProvider } from '../api';
|
|
3
2
|
import { SignDeployContractTxParams, SignExecuteScriptTxParams, SignerWithNodeProvider } from '../signer';
|
|
3
|
+
import { CompileContractResult, CompileScriptResult } from '../api/api-alephium';
|
|
4
|
+
declare type FieldsSig = node.FieldsSig;
|
|
5
|
+
declare type EventSig = node.EventSig;
|
|
6
|
+
declare type FunctionSig = node.FunctionSig;
|
|
7
|
+
declare enum SourceType {
|
|
8
|
+
Contract = 0,
|
|
9
|
+
Script = 1,
|
|
10
|
+
AbstractContract = 2,
|
|
11
|
+
Interface = 3
|
|
12
|
+
}
|
|
13
|
+
export declare type CompilerOptions = {
|
|
14
|
+
errorOnWarnings: boolean;
|
|
15
|
+
ignoreUnusedConstantsWarnings: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const DEFAULT_COMPILER_OPTIONS: CompilerOptions;
|
|
18
|
+
declare class TypedMatcher<T extends SourceType> {
|
|
19
|
+
matcher: RegExp;
|
|
20
|
+
type: T;
|
|
21
|
+
name: string | undefined;
|
|
22
|
+
constructor(pattern: string, type: T);
|
|
23
|
+
match(str: string): number;
|
|
24
|
+
}
|
|
4
25
|
declare class SourceFile {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
static
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
type: SourceType;
|
|
27
|
+
typeId: string;
|
|
28
|
+
contractPath: string;
|
|
29
|
+
sourceCode: string;
|
|
30
|
+
sourceCodeHash: string;
|
|
31
|
+
getArtifactPath(artifactsRootPath: string): string;
|
|
32
|
+
constructor(type: SourceType, typeId: string, sourceCode: string, contractPath: string);
|
|
33
|
+
}
|
|
34
|
+
declare class Compiled<T extends Artifact> {
|
|
35
|
+
sourceFile: SourceFile;
|
|
36
|
+
artifact: T;
|
|
37
|
+
warnings: string[];
|
|
38
|
+
constructor(sourceFile: SourceFile, artifact: T, warnings: string[]);
|
|
39
|
+
}
|
|
40
|
+
export declare class Project {
|
|
41
|
+
sourceFiles: SourceFile[];
|
|
42
|
+
contracts: Compiled<Contract>[];
|
|
43
|
+
scripts: Compiled<Script>[];
|
|
44
|
+
readonly contractsRootPath: string;
|
|
45
|
+
readonly artifactsRootPath: string;
|
|
46
|
+
readonly nodeProvider: NodeProvider;
|
|
47
|
+
static currentProject: Project;
|
|
48
|
+
static readonly abstractContractMatcher: TypedMatcher<SourceType>;
|
|
49
|
+
static readonly contractMatcher: TypedMatcher<SourceType.Contract>;
|
|
50
|
+
static readonly interfaceMatcher: TypedMatcher<SourceType.Interface>;
|
|
51
|
+
static readonly scriptMatcher: TypedMatcher<SourceType.Script>;
|
|
52
|
+
static readonly matchers: TypedMatcher<SourceType>[];
|
|
53
|
+
private constructor();
|
|
54
|
+
private getContractPath;
|
|
55
|
+
private static checkCompilerWarnings;
|
|
56
|
+
static contract(path: string, compilerOptions?: Partial<CompilerOptions>): Contract;
|
|
57
|
+
static script(path: string, compilerOptions?: Partial<CompilerOptions>): Script;
|
|
58
|
+
private saveArtifactsToFile;
|
|
59
|
+
contractByCodeHash(codeHash: string): Contract;
|
|
60
|
+
private saveProjectArtifactToFile;
|
|
61
|
+
private static compile;
|
|
62
|
+
private static loadArtifacts;
|
|
63
|
+
private static loadSourceFile;
|
|
64
|
+
private static loadSourceFiles;
|
|
65
|
+
static build(contractsRootPath?: string, artifactsRootPath?: string): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
export declare abstract class Artifact {
|
|
68
|
+
readonly typeId: string;
|
|
69
|
+
readonly functions: FunctionSig[];
|
|
70
|
+
constructor(typeId: string, functions: FunctionSig[]);
|
|
32
71
|
abstract buildByteCodeToDeploy(initialFields?: Fields): string;
|
|
72
|
+
publicFunctions(): string[];
|
|
73
|
+
usingPreapprovedAssetsFunctions(): string[];
|
|
74
|
+
usingAssetsInContractFunctions(): string[];
|
|
33
75
|
}
|
|
34
|
-
export declare class Contract extends
|
|
76
|
+
export declare class Contract extends Artifact {
|
|
35
77
|
readonly bytecode: string;
|
|
36
78
|
readonly codeHash: string;
|
|
37
|
-
readonly fieldsSig:
|
|
38
|
-
readonly eventsSig:
|
|
39
|
-
constructor(
|
|
40
|
-
static checkCodeType(fileName: string, contractStr: string): void;
|
|
41
|
-
private static loadContractStr;
|
|
42
|
-
static fromSource(provider: NodeProvider, path: string): Promise<Contract>;
|
|
43
|
-
private static compile;
|
|
79
|
+
readonly fieldsSig: FieldsSig;
|
|
80
|
+
readonly eventsSig: EventSig[];
|
|
81
|
+
constructor(typeId: string, bytecode: string, codeHash: string, fieldsSig: FieldsSig, eventsSig: EventSig[], functions: FunctionSig[]);
|
|
44
82
|
static fromJson(artifact: any): Contract;
|
|
83
|
+
static fromCompileResult(typeId: string, result: CompileContractResult): Contract;
|
|
45
84
|
static fromArtifactFile(path: string): Promise<Contract>;
|
|
46
|
-
fetchState(
|
|
85
|
+
fetchState(address: string, group: number): Promise<ContractState>;
|
|
47
86
|
toString(): string;
|
|
48
87
|
toState(fields: Fields, asset: Asset, address?: string): ContractState;
|
|
49
88
|
static randomAddress(): string;
|
|
50
89
|
private _test;
|
|
51
|
-
testPublicMethod(
|
|
52
|
-
testPrivateMethod(
|
|
90
|
+
testPublicMethod(funcName: string, params: TestContractParams): Promise<TestContractResult>;
|
|
91
|
+
testPrivateMethod(funcName: string, params: TestContractParams): Promise<TestContractResult>;
|
|
53
92
|
toApiFields(fields?: Fields): node.Val[];
|
|
54
93
|
toApiArgs(funcName: string, args?: Arguments): node.Val[];
|
|
55
94
|
getMethodIndex(funcName: string): number;
|
|
56
95
|
toApiContractStates(states?: ContractState[]): node.ContractState[] | undefined;
|
|
57
96
|
toTestContract(funcName: string, params: TestContractParams): node.TestContract;
|
|
58
|
-
static fromCodeHash(codeHash: string): Promise<Contract>;
|
|
59
|
-
static getFieldsSig(state: node.ContractState): Promise<node.FieldsSig>;
|
|
60
97
|
fromApiContractState(state: node.ContractState): Promise<ContractState>;
|
|
61
|
-
static ContractCreatedEvent:
|
|
62
|
-
static ContractDestroyedEvent:
|
|
98
|
+
static ContractCreatedEvent: EventSig;
|
|
99
|
+
static ContractDestroyedEvent: EventSig;
|
|
63
100
|
static fromApiEvent(event: node.ContractEventByTxId, codeHash: string | undefined): Promise<ContractEventByTxId>;
|
|
64
101
|
fromTestContractResult(methodIndex: number, result: node.TestContractResult): Promise<TestContractResult>;
|
|
65
102
|
paramsForDeployment(params: BuildDeployContractTx): Promise<SignDeployContractTxParams>;
|
|
66
103
|
transactionForDeployment(signer: SignerWithNodeProvider, params: Omit<BuildDeployContractTx, 'signerAddress'>): Promise<DeployContractTransaction>;
|
|
67
104
|
buildByteCodeToDeploy(initialFields: Fields): string;
|
|
68
105
|
}
|
|
69
|
-
export declare class Script extends
|
|
106
|
+
export declare class Script extends Artifact {
|
|
70
107
|
readonly bytecodeTemplate: string;
|
|
71
|
-
readonly fieldsSig:
|
|
72
|
-
constructor(
|
|
73
|
-
static
|
|
74
|
-
private static loadContractStr;
|
|
75
|
-
static fromSource(provider: NodeProvider, path: string): Promise<Script>;
|
|
76
|
-
private static compile;
|
|
108
|
+
readonly fieldsSig: FieldsSig;
|
|
109
|
+
constructor(typeId: string, bytecodeTemplate: string, fieldsSig: FieldsSig, functions: FunctionSig[]);
|
|
110
|
+
static fromCompileResult(typeId: string, result: CompileScriptResult): Script;
|
|
77
111
|
static fromJson(artifact: any): Script;
|
|
78
112
|
static fromArtifactFile(path: string): Promise<Script>;
|
|
79
113
|
toString(): string;
|
|
@@ -107,7 +141,7 @@ export interface ContractState {
|
|
|
107
141
|
initialStateHash?: string;
|
|
108
142
|
codeHash: string;
|
|
109
143
|
fields: Fields;
|
|
110
|
-
fieldsSig:
|
|
144
|
+
fieldsSig: FieldsSig;
|
|
111
145
|
asset: Asset;
|
|
112
146
|
}
|
|
113
147
|
export interface TestContractParams {
|