@xelis/sdk 0.11.33 → 0.11.34

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.
@@ -300,16 +300,27 @@ export interface Reference {
300
300
  hash: string;
301
301
  topoheight: number;
302
302
  }
303
+ export interface SignatureId {
304
+ id: number;
305
+ signature: string;
306
+ }
307
+ export interface MultiSig {
308
+ signatures: {
309
+ [id: number]: SignatureId;
310
+ };
311
+ }
303
312
  export interface Transaction {
304
313
  hash: string;
305
314
  version: number;
306
315
  source: string;
307
316
  data: TransactionData;
308
317
  fee: number;
318
+ fee_limit: number;
309
319
  nonce: number;
310
320
  source_commitments: SourceCommitment[];
311
321
  range_proof: number[];
312
322
  reference: Reference;
323
+ multisig?: MultiSig;
313
324
  signature: string;
314
325
  size: number;
315
326
  }
@@ -418,25 +429,23 @@ export interface MaxSupplyFixed {
418
429
  export interface MaxSupplyMintable {
419
430
  mintable: number;
420
431
  }
421
- export interface AssetCreator {
432
+ export type MaxSupplyMode = "none" | MaxSupplyFixed | MaxSupplyMintable;
433
+ export interface AssetOwnerCreator {
422
434
  contract: string;
423
435
  id: number;
424
436
  }
425
- export interface AssetOwner {
437
+ export interface AssetOwnerOwner {
426
438
  origin: string;
427
439
  origin_id: number;
428
440
  owner: string;
429
441
  }
442
+ export type AssetOwner = "none" | AssetOwnerCreator | AssetOwnerOwner;
430
443
  export interface AssetData {
431
444
  decimals: number;
432
445
  name: string;
433
446
  ticker: string;
434
- max_supply: "none" | MaxSupplyFixed | MaxSupplyMintable;
435
- owner: "none" | {
436
- creator: AssetCreator;
437
- } | {
438
- owner: AssetOwner;
439
- };
447
+ max_supply: MaxSupplyMode;
448
+ owner: AssetOwner;
440
449
  topoheight: number;
441
450
  }
442
451
  export interface AssetWithData extends AssetData {
@@ -25,7 +25,7 @@ export declare class RPC extends HttpRPC {
25
25
  buildTransaction(params: types.BuildTransactionParams): Promise<types.TransactionResponse>;
26
26
  buildTransactionOffline(params: types.BuildTransactionOfflineParams): Promise<types.TransactionResponse>;
27
27
  buildUnsignedTransaction(params: types.BuildTransactionParams): Promise<types.UnsignedTransactionResponse>;
28
- signUnsignedTransaction(params: types.SignUnsignedTransactionParams): Promise<types.SignatureId>;
28
+ signUnsignedTransaction(params: types.SignUnsignedTransactionParams): Promise<daemonTypes.SignatureId>;
29
29
  finalizeUnsignedTransaction(params: types.FinalizeUnsignedTransactionParams): Promise<types.TransactionResponse>;
30
30
  clearTxCache(): Promise<boolean>;
31
31
  listTransactions(params?: types.ListTransactionParams): Promise<types.TransactionEntry[]>;
@@ -2,10 +2,20 @@ import * as daemonTypes from '../daemon/types';
2
2
  export interface GetAddressParams {
3
3
  integrated_data?: string;
4
4
  }
5
- export interface FeeBuilder {
6
- multiplier?: number;
7
- value?: number;
5
+ export interface ExtraFeeModeTip {
6
+ tip: number;
8
7
  }
8
+ export interface ExtraFeeModeMultiplier {
9
+ multiplier: number;
10
+ }
11
+ export type ExtraFeeMode = "none" | ExtraFeeModeTip | ExtraFeeModeMultiplier;
12
+ export interface FeeBuilderFixed {
13
+ fixed: number;
14
+ }
15
+ export interface FeeBuilderExtra {
16
+ extra: ExtraFeeMode;
17
+ }
18
+ export type FeeBuilder = FeeBuilderFixed | FeeBuilderExtra;
9
19
  export interface MultiSigBuilder {
10
20
  participants: string[];
11
21
  threshold: number;
@@ -44,45 +54,51 @@ export interface SignerId {
44
54
  id: number;
45
55
  private_key: number[];
46
56
  }
47
- export interface BuildTransactionParams {
57
+ export interface BaseFeeModeFixed {
58
+ fixed: number;
59
+ }
60
+ export interface BaseFeeModeCap {
61
+ cap: number;
62
+ }
63
+ type BaseFeeMode = "none" | BaseFeeModeFixed | BaseFeeModeCap;
64
+ export interface BuildUnsignedTransaction {
48
65
  transfers?: TransferBuilder[];
49
66
  burn?: daemonTypes.Burn;
50
67
  multi_sig?: MultiSigBuilder;
51
68
  invoke_contract?: InvokeContractBuilder;
52
69
  deploy_contract?: DeployContractBuilder;
53
70
  fee?: FeeBuilder;
71
+ base_fee?: BaseFeeMode;
72
+ fee_limit?: number;
54
73
  nonce?: number;
55
74
  tx_version?: number;
56
- broadcast: boolean;
57
75
  tx_as_hex: boolean;
76
+ }
77
+ export interface BuildTransactionParams extends BuildUnsignedTransaction {
78
+ broadcast: boolean;
58
79
  signers?: SignerId[];
59
80
  }
60
81
  export interface BuildTransactionOfflineParams extends BuildTransactionParams {
61
- nonce: number;
82
+ balances: {
83
+ [hash: string]: any;
84
+ };
62
85
  reference: daemonTypes.Reference;
86
+ nonce: number;
63
87
  }
64
88
  export interface TransactionResponse extends daemonTypes.Transaction {
65
89
  txt_as_hex?: string;
66
90
  }
67
- export interface SignatureId {
68
- id: number;
69
- signature: string;
70
- }
71
- export interface MultiSig {
72
- signatures: {
73
- [id: number]: SignatureId;
74
- };
75
- }
76
91
  export interface UnsignedTransaction {
77
92
  version: number;
78
93
  source: string;
79
94
  data: daemonTypes.TransactionData;
80
95
  fee: number;
96
+ fee_limit: number;
81
97
  nonce: number;
82
98
  source_commitments: daemonTypes.SourceCommitment[];
83
99
  reference: daemonTypes.Reference;
84
100
  range_proof: number[];
85
- multisig?: MultiSig;
101
+ multisig?: daemonTypes.MultiSig;
86
102
  }
87
103
  export interface UnsignedTransactionResponse extends UnsignedTransaction {
88
104
  hash: string;
@@ -201,7 +217,7 @@ export interface SignUnsignedTransactionParams {
201
217
  }
202
218
  export interface FinalizeUnsignedTransactionParams {
203
219
  unsigned: string;
204
- signatures: SignatureId[];
220
+ signatures: daemonTypes.SignatureId[];
205
221
  broadcast: boolean;
206
222
  tx_as_hex: boolean;
207
223
  }
@@ -366,3 +382,4 @@ export declare enum RPCEvent {
366
382
  TrackAsset = "track_asset",
367
383
  UntrackAsset = "untrack_asset"
368
384
  }
385
+ export {};
@@ -77,7 +77,7 @@ export declare class WalletMethods {
77
77
  buildTransaction(params: types.BuildTransactionParams): Promise<types.TransactionResponse>;
78
78
  buildTransactionOffline(params: types.BuildTransactionOfflineParams): Promise<types.TransactionResponse>;
79
79
  buildUnsignedTransaction(params: types.BuildTransactionParams): Promise<types.UnsignedTransactionResponse>;
80
- signUnsignedTransaction(params: types.SignUnsignedTransactionParams): Promise<types.SignatureId>;
80
+ signUnsignedTransaction(params: types.SignUnsignedTransactionParams): Promise<daemonTypes.SignatureId>;
81
81
  finalizeUnsignedTransaction(params: types.FinalizeUnsignedTransactionParams): Promise<types.TransactionResponse>;
82
82
  clearTxCache(): Promise<boolean>;
83
83
  listTransactions(params?: types.ListTransactionParams): Promise<types.TransactionEntry[]>;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.11.33",
2
+ "version": "0.11.34",
3
3
  "name": "@xelis/sdk",
4
4
  "description": "Xelis software development kit for JS",
5
5
  "exports": {