@xelis/sdk 0.11.11 → 0.11.13

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.
@@ -33,7 +33,7 @@ export interface Block {
33
33
  tips: string[];
34
34
  timestamp: number;
35
35
  height: number;
36
- nonce: string;
36
+ nonce: number;
37
37
  extra_nonce: string;
38
38
  miner: string;
39
39
  txs_hashes: string[];
@@ -183,18 +183,28 @@ export interface ContractDeposit {
183
183
  export interface InvokeContractPayload {
184
184
  contract: string;
185
185
  deposits: {
186
- [key: string]: ContractDeposit;
186
+ [hash: string]: ContractDeposit;
187
187
  };
188
188
  chunk_id: number;
189
189
  max_gas: number;
190
190
  parameters: number[][];
191
191
  }
192
+ export interface InvokeConstructorPayload {
193
+ max_gas: number;
194
+ deposits: {
195
+ [hash: string]: ContractDeposit;
196
+ };
197
+ }
198
+ export interface DeployContractPayload {
199
+ module: Module;
200
+ invoke: InvokeConstructorPayload | null;
201
+ }
192
202
  export interface TransactionData {
193
203
  transfers: Transfer[] | null;
194
204
  burn: Burn | null;
195
205
  multi_sig: MultiSigPayload | null;
196
206
  invoke_contract: InvokeContractPayload | null;
197
- deploy_contract: Module | null;
207
+ deploy_contract: DeployContractPayload | null;
198
208
  }
199
209
  export interface SourceCommitment {
200
210
  commitment: number[];
@@ -472,12 +482,15 @@ export interface GetContractBalanceAtTopoheightParams {
472
482
  export interface Chunk {
473
483
  instructions: number[];
474
484
  }
485
+ export type Access = "all" | "internal" | {
486
+ "hook": {
487
+ id: number;
488
+ };
489
+ } | "entry";
475
490
  export interface Module {
476
- constants: any;
477
- chunks: Chunk[];
491
+ chunks: (Chunk | Access)[];
492
+ constants: any[];
478
493
  entry_chunk_ids: number[];
479
- structs: any[];
480
- enums: any[];
481
494
  }
482
495
  export interface GetContractModuleResult {
483
496
  previous_topoheight: number | null;
@@ -14,6 +14,16 @@ export interface ContractDepositBuilder {
14
14
  amount: number;
15
15
  private: boolean;
16
16
  }
17
+ export interface DeployContractInvokeBuilder {
18
+ max_gas: number;
19
+ deposits: {
20
+ [key: string]: ContractDepositBuilder;
21
+ };
22
+ }
23
+ export interface DeployContractBuilder {
24
+ module: string;
25
+ invoke?: DeployContractInvokeBuilder;
26
+ }
17
27
  export interface InvokeContractBuilder {
18
28
  contract: string;
19
29
  max_gas: number;
@@ -38,7 +48,7 @@ export interface BuildTransactionParams {
38
48
  burn?: daemonTypes.Burn;
39
49
  multi_sig?: MultiSigBuilder;
40
50
  invoke_contract?: InvokeContractBuilder;
41
- deploy_contract?: string;
51
+ deploy_contract?: DeployContractBuilder;
42
52
  fee?: FeeBuilder;
43
53
  nonce?: number;
44
54
  tx_version?: number;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.11.11",
2
+ "version": "0.11.13",
3
3
  "name": "@xelis/sdk",
4
4
  "description": "Xelis software development kit for JS",
5
5
  "exports": {