@dfns/sdk 0.6.6 → 0.6.8

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.
@@ -103,7 +103,7 @@ class KeysClient {
103
103
  return response.json();
104
104
  }
105
105
  async listSignatures(request) {
106
- const path = (0, url_1.buildPathAndQuery)('/wallets/:keyId/signatures', {
106
+ const path = (0, url_1.buildPathAndQuery)('/keys/:keyId/signatures', {
107
107
  path: request ?? {},
108
108
  query: request.query ?? {},
109
109
  });
@@ -177,7 +177,7 @@ class DelegatedKeysClient {
177
177
  return response.json();
178
178
  }
179
179
  async listSignatures(request) {
180
- const path = (0, url_1.buildPathAndQuery)('/wallets/:keyId/signatures', {
180
+ const path = (0, url_1.buildPathAndQuery)('/keys/:keyId/signatures', {
181
181
  path: request ?? {},
182
182
  query: request.query ?? {},
183
183
  });
@@ -40,6 +40,7 @@ export type ExportKeyBody = {
40
40
  protocol: "CGGMP21" | "FROST" | "FROST_BITCOIN" | "KU23";
41
41
  curve: "ed25519" | "secp256k1" | "stark";
42
42
  }[];
43
+ delete?: boolean | undefined;
43
44
  };
44
45
  export type ExportKeyParams = {
45
46
  keyId: string;
@@ -247,6 +248,10 @@ export type GetKeyResponse = {
247
248
  imported?: boolean | undefined;
248
249
  exported?: boolean | undefined;
249
250
  dateExported?: string | undefined;
251
+ wallets: {
252
+ id: string;
253
+ network: ("Algorand" | "AlgorandTestnet" | "Aptos" | "AptosTestnet" | "ArbitrumOne" | "ArbitrumGoerli" | "ArbitrumSepolia" | "AvalancheC" | "AvalancheCFuji" | "Base" | "BaseGoerli" | "BaseSepolia" | "Berachain" | "BerachainBArtio" | "BerachainBepolia" | "Bitcoin" | "BitcoinSignet" | "BitcoinTestnet3" | "Bsc" | "BscTestnet" | "Canton" | "CantonDevnet" | "CantonTestnet" | "Cardano" | "CardanoPreprod" | "Celo" | "CeloAlfajores" | "Dogecoin" | "DogecoinTestnet" | "Ethereum" | "EthereumGoerli" | "EthereumSepolia" | "EthereumHolesky" | "FantomOpera" | "FantomTestnet" | "InternetComputer" | "Ion" | "IonTestnet" | "Iota" | "IotaTestnet" | "IotaZodianet" | "Kaspa" | "KaspaTestnet11" | "Kusama" | "Litecoin" | "LitecoinTestnet" | "Optimism" | "OptimismGoerli" | "OptimismSepolia" | "Origyn" | "Polkadot" | "Polygon" | "PolygonAmoy" | "PolygonMumbai" | "Polymesh" | "PolymeshTestnet" | "Race" | "RaceSepolia" | "SeiAtlantic2" | "SeiPacific1" | "Solana" | "SolanaDevnet" | "Stellar" | "StellarTestnet" | "Sui" | "SuiTestnet" | "Tezos" | "TezosGhostnet" | "Ton" | "TonTestnet" | "Tron" | "TronNile" | "Westend" | "XrpLedger" | "XrpLedgerTestnet") | ("KeyECDSA" | "KeyEdDSA" | "KeyECDSAStark");
254
+ }[];
250
255
  };
251
256
  export type GetKeyRequest = GetKeyParams;
252
257
  export type GetSignatureParams = {
@@ -16,43 +16,122 @@ export type CreateStakeBody = {
16
16
  amount?: string | undefined;
17
17
  lockedIotas?: string[] | undefined;
18
18
  };
19
- export type CreateStakeResponse = {
20
- stake: {
21
- id: string;
22
- provider?: (("Figment") | undefined) | null;
23
- providerStakeId?: (string | undefined) | null;
19
+ export type CreateStakeResponse = ({
20
+ id: string;
21
+ provider?: ("Figment") | undefined;
22
+ walletId: string;
23
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
24
+ requester: {
25
+ userId: string;
26
+ tokenId?: string | undefined;
27
+ appId?: string | undefined;
28
+ };
29
+ requestBody: {
30
+ protocol: "Babylon";
24
31
  walletId: string;
25
- protocol: "Babylon" | "Ethereum" | "Iota";
26
- status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
27
- requester: {
28
- userId: string;
29
- tokenId?: string | undefined;
30
- appId?: string | undefined;
31
- };
32
- requestBody: {
33
- protocol: "Babylon";
34
- walletId: string;
35
- provider: "Figment";
36
- amount: string;
37
- duration: number;
38
- } | {
39
- protocol: "Ethereum";
40
- walletId: string;
41
- provider: "Figment";
42
- amount: string;
43
- } | {
44
- protocol: "Iota";
45
- walletId: string;
46
- validator: string;
47
- amount?: string | undefined;
48
- lockedIotas?: string[] | undefined;
49
- };
50
- dateCreated: string;
32
+ provider: "Figment";
33
+ amount: string;
34
+ duration: number;
35
+ } | {
36
+ protocol: "Ethereum";
37
+ walletId: string;
38
+ provider: "Figment";
39
+ amount: string;
40
+ } | {
41
+ protocol: "Iota";
42
+ walletId: string;
43
+ validator: string;
44
+ amount?: string | undefined;
45
+ lockedIotas?: string[] | undefined;
51
46
  };
52
- stakeAction: {
47
+ dateCreated: string;
48
+ protocol: "Babylon";
49
+ data: {
50
+ finalityProviders: string[];
51
+ covenantPubkeys: string[];
52
+ magicBytes: string;
53
+ covenantThreshold: number;
54
+ minUnbondingTime: number;
55
+ lockHeight: number;
56
+ };
57
+ } | {
58
+ id: string;
59
+ provider?: ("Figment") | undefined;
60
+ walletId: string;
61
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
62
+ requester: {
63
+ userId: string;
64
+ tokenId?: string | undefined;
65
+ appId?: string | undefined;
66
+ };
67
+ requestBody: {
68
+ protocol: "Babylon";
69
+ walletId: string;
70
+ provider: "Figment";
71
+ amount: string;
72
+ duration: number;
73
+ } | {
74
+ protocol: "Ethereum";
75
+ walletId: string;
76
+ provider: "Figment";
77
+ amount: string;
78
+ } | {
79
+ protocol: "Iota";
80
+ walletId: string;
81
+ validator: string;
82
+ amount?: string | undefined;
83
+ lockedIotas?: string[] | undefined;
84
+ };
85
+ dateCreated: string;
86
+ protocol: "Iota";
87
+ data: {
88
+ stakedObjectId?: string | undefined;
89
+ expirationDate?: string | undefined;
90
+ amount: string;
91
+ validator: string;
92
+ };
93
+ } | {
94
+ id: string;
95
+ provider?: ("Figment") | undefined;
96
+ walletId: string;
97
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
98
+ requester: {
99
+ userId: string;
100
+ tokenId?: string | undefined;
101
+ appId?: string | undefined;
102
+ };
103
+ requestBody: {
104
+ protocol: "Babylon";
105
+ walletId: string;
106
+ provider: "Figment";
107
+ amount: string;
108
+ duration: number;
109
+ } | {
110
+ protocol: "Ethereum";
111
+ walletId: string;
112
+ provider: "Figment";
113
+ amount: string;
114
+ } | {
115
+ protocol: "Iota";
116
+ walletId: string;
117
+ validator: string;
118
+ amount?: string | undefined;
119
+ lockedIotas?: string[] | undefined;
120
+ };
121
+ dateCreated: string;
122
+ protocol: "Ethereum";
123
+ data: {
124
+ validators: {
125
+ pubkey: string;
126
+ withdrawalAddress: string;
127
+ }[];
128
+ };
129
+ }) & {
130
+ actions: {
53
131
  id: string;
54
132
  stakeId: string;
55
133
  transactionId?: string | undefined;
134
+ signatureId?: string | undefined;
56
135
  transactionHash?: string | undefined;
57
136
  kind: "Stake" | "Unbond" | "Withdraw";
58
137
  requester: {
@@ -88,8 +167,7 @@ export type CreateStakeResponse = {
88
167
  kind: "Withdraw";
89
168
  });
90
169
  dateCreated: string;
91
- data?: any;
92
- };
170
+ }[];
93
171
  };
94
172
  export type CreateStakeRequest = {
95
173
  body: CreateStakeBody;
@@ -110,10 +188,82 @@ export type CreateStakeActionParams = {
110
188
  export type CreateStakeActionResponse = {
111
189
  stake: {
112
190
  id: string;
113
- provider?: (("Figment") | undefined) | null;
114
- providerStakeId?: (string | undefined) | null;
191
+ provider?: ("Figment") | undefined;
192
+ walletId: string;
193
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
194
+ requester: {
195
+ userId: string;
196
+ tokenId?: string | undefined;
197
+ appId?: string | undefined;
198
+ };
199
+ requestBody: {
200
+ protocol: "Babylon";
201
+ walletId: string;
202
+ provider: "Figment";
203
+ amount: string;
204
+ duration: number;
205
+ } | {
206
+ protocol: "Ethereum";
207
+ walletId: string;
208
+ provider: "Figment";
209
+ amount: string;
210
+ } | {
211
+ protocol: "Iota";
212
+ walletId: string;
213
+ validator: string;
214
+ amount?: string | undefined;
215
+ lockedIotas?: string[] | undefined;
216
+ };
217
+ dateCreated: string;
218
+ protocol: "Babylon";
219
+ data: {
220
+ finalityProviders: string[];
221
+ covenantPubkeys: string[];
222
+ magicBytes: string;
223
+ covenantThreshold: number;
224
+ minUnbondingTime: number;
225
+ lockHeight: number;
226
+ };
227
+ } | {
228
+ id: string;
229
+ provider?: ("Figment") | undefined;
230
+ walletId: string;
231
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
232
+ requester: {
233
+ userId: string;
234
+ tokenId?: string | undefined;
235
+ appId?: string | undefined;
236
+ };
237
+ requestBody: {
238
+ protocol: "Babylon";
239
+ walletId: string;
240
+ provider: "Figment";
241
+ amount: string;
242
+ duration: number;
243
+ } | {
244
+ protocol: "Ethereum";
245
+ walletId: string;
246
+ provider: "Figment";
247
+ amount: string;
248
+ } | {
249
+ protocol: "Iota";
250
+ walletId: string;
251
+ validator: string;
252
+ amount?: string | undefined;
253
+ lockedIotas?: string[] | undefined;
254
+ };
255
+ dateCreated: string;
256
+ protocol: "Iota";
257
+ data: {
258
+ stakedObjectId?: string | undefined;
259
+ expirationDate?: string | undefined;
260
+ amount: string;
261
+ validator: string;
262
+ };
263
+ } | {
264
+ id: string;
265
+ provider?: ("Figment") | undefined;
115
266
  walletId: string;
116
- protocol: "Babylon" | "Ethereum" | "Iota";
117
267
  status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
118
268
  requester: {
119
269
  userId: string;
@@ -139,11 +289,19 @@ export type CreateStakeActionResponse = {
139
289
  lockedIotas?: string[] | undefined;
140
290
  };
141
291
  dateCreated: string;
292
+ protocol: "Ethereum";
293
+ data: {
294
+ validators: {
295
+ pubkey: string;
296
+ withdrawalAddress: string;
297
+ }[];
298
+ };
142
299
  };
143
300
  stakeAction: {
144
301
  id: string;
145
302
  stakeId: string;
146
303
  transactionId?: string | undefined;
304
+ signatureId?: string | undefined;
147
305
  transactionHash?: string | undefined;
148
306
  kind: "Stake" | "Unbond" | "Withdraw";
149
307
  requester: {
@@ -179,7 +337,6 @@ export type CreateStakeActionResponse = {
179
337
  kind: "Withdraw";
180
338
  });
181
339
  dateCreated: string;
182
- data?: any;
183
340
  };
184
341
  };
185
342
  export type CreateStakeActionRequest = CreateStakeActionParams & {
@@ -202,6 +359,7 @@ export type ListStakeActionsResponse = {
202
359
  id: string;
203
360
  stakeId: string;
204
361
  transactionId?: string | undefined;
362
+ signatureId?: string | undefined;
205
363
  transactionHash?: string | undefined;
206
364
  kind: "Stake" | "Unbond" | "Withdraw";
207
365
  requester: {
@@ -237,7 +395,6 @@ export type ListStakeActionsResponse = {
237
395
  kind: "Withdraw";
238
396
  });
239
397
  dateCreated: string;
240
- data?: any;
241
398
  }[];
242
399
  nextPageToken?: string | undefined;
243
400
  };
@@ -249,12 +406,10 @@ export type ListStakesQuery = {
249
406
  paginationToken?: string | undefined;
250
407
  };
251
408
  export type ListStakesResponse = {
252
- items: {
409
+ items: ({
253
410
  id: string;
254
- provider?: (("Figment") | undefined) | null;
255
- providerStakeId?: (string | undefined) | null;
411
+ provider?: ("Figment") | undefined;
256
412
  walletId: string;
257
- protocol: "Babylon" | "Ethereum" | "Iota";
258
413
  status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
259
414
  requester: {
260
415
  userId: string;
@@ -280,7 +435,88 @@ export type ListStakesResponse = {
280
435
  lockedIotas?: string[] | undefined;
281
436
  };
282
437
  dateCreated: string;
283
- }[];
438
+ protocol: "Babylon";
439
+ data: {
440
+ finalityProviders: string[];
441
+ covenantPubkeys: string[];
442
+ magicBytes: string;
443
+ covenantThreshold: number;
444
+ minUnbondingTime: number;
445
+ lockHeight: number;
446
+ };
447
+ } | {
448
+ id: string;
449
+ provider?: ("Figment") | undefined;
450
+ walletId: string;
451
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
452
+ requester: {
453
+ userId: string;
454
+ tokenId?: string | undefined;
455
+ appId?: string | undefined;
456
+ };
457
+ requestBody: {
458
+ protocol: "Babylon";
459
+ walletId: string;
460
+ provider: "Figment";
461
+ amount: string;
462
+ duration: number;
463
+ } | {
464
+ protocol: "Ethereum";
465
+ walletId: string;
466
+ provider: "Figment";
467
+ amount: string;
468
+ } | {
469
+ protocol: "Iota";
470
+ walletId: string;
471
+ validator: string;
472
+ amount?: string | undefined;
473
+ lockedIotas?: string[] | undefined;
474
+ };
475
+ dateCreated: string;
476
+ protocol: "Iota";
477
+ data: {
478
+ stakedObjectId?: string | undefined;
479
+ expirationDate?: string | undefined;
480
+ amount: string;
481
+ validator: string;
482
+ };
483
+ } | {
484
+ id: string;
485
+ provider?: ("Figment") | undefined;
486
+ walletId: string;
487
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
488
+ requester: {
489
+ userId: string;
490
+ tokenId?: string | undefined;
491
+ appId?: string | undefined;
492
+ };
493
+ requestBody: {
494
+ protocol: "Babylon";
495
+ walletId: string;
496
+ provider: "Figment";
497
+ amount: string;
498
+ duration: number;
499
+ } | {
500
+ protocol: "Ethereum";
501
+ walletId: string;
502
+ provider: "Figment";
503
+ amount: string;
504
+ } | {
505
+ protocol: "Iota";
506
+ walletId: string;
507
+ validator: string;
508
+ amount?: string | undefined;
509
+ lockedIotas?: string[] | undefined;
510
+ };
511
+ dateCreated: string;
512
+ protocol: "Ethereum";
513
+ data: {
514
+ validators: {
515
+ pubkey: string;
516
+ withdrawalAddress: string;
517
+ }[];
518
+ };
519
+ })[];
284
520
  nextPageToken?: string | undefined;
285
521
  };
286
522
  export type ListStakesRequest = {
@@ -149,6 +149,7 @@ export type ExportWalletBody = {
149
149
  protocol: "CGGMP21" | "FROST" | "FROST_BITCOIN" | "KU23";
150
150
  curve: "ed25519" | "secp256k1" | "stark";
151
151
  }[];
152
+ delete?: boolean | undefined;
152
153
  };
153
154
  export type ExportWalletParams = {
154
155
  walletId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfns/sdk",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "dependencies": {
5
5
  "buffer": "6.0.3",
6
6
  "cross-fetch": "3.1.6",