@dfns/sdk 0.7.9-rc.2 → 0.7.10

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 (36) hide show
  1. package/dfnsApiClient.d.ts +4 -1
  2. package/dfnsApiClient.js +8 -3
  3. package/generated/agreements/client.d.ts +8 -0
  4. package/generated/agreements/client.js +36 -0
  5. package/generated/agreements/delegatedClient.d.ts +10 -0
  6. package/generated/agreements/delegatedClient.js +50 -0
  7. package/generated/agreements/index.d.ts +3 -0
  8. package/generated/agreements/index.js +19 -0
  9. package/generated/agreements/types.d.ts +23 -0
  10. package/generated/agreements/types.js +2 -0
  11. package/generated/auth/client.d.ts +2 -0
  12. package/generated/auth/client.js +22 -0
  13. package/generated/auth/delegatedClient.d.ts +2 -0
  14. package/generated/auth/delegatedClient.js +22 -0
  15. package/generated/auth/types.d.ts +33 -2
  16. package/generated/exchanges/types.d.ts +21 -1
  17. package/generated/feeSponsors/types.d.ts +6 -6
  18. package/generated/keys/types.d.ts +108 -84
  19. package/generated/networks/types.d.ts +3 -3
  20. package/generated/permissions/types.d.ts +2 -2
  21. package/generated/policies/types.d.ts +285 -135
  22. package/generated/swaps/client.d.ts +11 -0
  23. package/generated/swaps/client.js +70 -0
  24. package/generated/swaps/delegatedClient.d.ts +14 -0
  25. package/generated/swaps/delegatedClient.js +99 -0
  26. package/generated/swaps/index.d.ts +3 -0
  27. package/generated/swaps/index.js +19 -0
  28. package/generated/swaps/types.d.ts +333 -0
  29. package/generated/swaps/types.js +2 -0
  30. package/generated/wallets/client.d.ts +4 -0
  31. package/generated/wallets/client.js +46 -0
  32. package/generated/wallets/delegatedClient.d.ts +6 -0
  33. package/generated/wallets/delegatedClient.js +76 -0
  34. package/generated/wallets/types.d.ts +339 -122
  35. package/generated/webhooks/types.d.ts +9 -9
  36. package/package.json +1 -1
@@ -9,6 +9,18 @@ class WalletsClient {
9
9
  constructor(apiOptions) {
10
10
  this.apiOptions = apiOptions;
11
11
  }
12
+ async acceptOffer(request) {
13
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/accept', {
14
+ path: request ?? {},
15
+ query: {},
16
+ });
17
+ const response = await (0, userActionFetch_1.userActionFetch)(path, {
18
+ method: 'PUT',
19
+ body: {},
20
+ apiOptions: this.apiOptions,
21
+ });
22
+ return response.json();
23
+ }
12
24
  async broadcastTransaction(request) {
13
25
  const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
14
26
  path: request ?? {},
@@ -69,6 +81,17 @@ class WalletsClient {
69
81
  });
70
82
  return response.json();
71
83
  }
84
+ async getOffer(request) {
85
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId', {
86
+ path: request ?? {},
87
+ query: {},
88
+ });
89
+ const response = await (0, fetch_1.simpleFetch)(path, {
90
+ method: 'GET',
91
+ apiOptions: this.apiOptions,
92
+ });
93
+ return response.json();
94
+ }
72
95
  async getSignature(request) {
73
96
  const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
74
97
  path: request ?? {},
@@ -158,6 +181,17 @@ class WalletsClient {
158
181
  });
159
182
  return response.json();
160
183
  }
184
+ async listOffers(request) {
185
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers', {
186
+ path: request ?? {},
187
+ query: request.query ?? {},
188
+ });
189
+ const response = await (0, fetch_1.simpleFetch)(path, {
190
+ method: 'GET',
191
+ apiOptions: this.apiOptions,
192
+ });
193
+ return response.json();
194
+ }
161
195
  async listOrgWalletHistory(request) {
162
196
  const path = (0, url_1.buildPathAndQuery)('/wallets/all/history', {
163
197
  path: request ?? {},
@@ -213,6 +247,18 @@ class WalletsClient {
213
247
  });
214
248
  return response.json();
215
249
  }
250
+ async rejectOffer(request) {
251
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/reject', {
252
+ path: request ?? {},
253
+ query: {},
254
+ });
255
+ const response = await (0, userActionFetch_1.userActionFetch)(path, {
256
+ method: 'PUT',
257
+ body: {},
258
+ apiOptions: this.apiOptions,
259
+ });
260
+ return response.json();
261
+ }
216
262
  async tagWallet(request) {
217
263
  const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/tags', {
218
264
  path: request ?? {},
@@ -4,6 +4,8 @@ import * as T from './types';
4
4
  export declare class DelegatedWalletsClient {
5
5
  private apiOptions;
6
6
  constructor(apiOptions: DfnsDelegatedApiClientOptions);
7
+ acceptOfferInit(request: T.AcceptOfferRequest): Promise<UserActionChallengeResponse>;
8
+ acceptOfferComplete(request: T.AcceptOfferRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.AcceptOfferResponse>;
7
9
  broadcastTransactionInit(request: T.BroadcastTransactionRequest): Promise<UserActionChallengeResponse>;
8
10
  broadcastTransactionComplete(request: T.BroadcastTransactionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.BroadcastTransactionResponse>;
9
11
  createWalletInit(request: T.CreateWalletRequest): Promise<UserActionChallengeResponse>;
@@ -14,6 +16,7 @@ export declare class DelegatedWalletsClient {
14
16
  exportWalletComplete(request: T.ExportWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ExportWalletResponse>;
15
17
  generateSignatureInit(request: T.GenerateSignatureRequest): Promise<UserActionChallengeResponse>;
16
18
  generateSignatureComplete(request: T.GenerateSignatureRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.GenerateSignatureResponse>;
19
+ getOffer(request: T.GetOfferRequest): Promise<T.GetOfferResponse>;
17
20
  getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
18
21
  getTransaction(request: T.GetTransactionRequest): Promise<T.GetTransactionResponse>;
19
22
  getTransfer(request: T.GetTransferRequest): Promise<T.GetTransferResponse>;
@@ -23,11 +26,14 @@ export declare class DelegatedWalletsClient {
23
26
  getWalletNfts(request: T.GetWalletNftsRequest): Promise<T.GetWalletNftsResponse>;
24
27
  importWalletInit(request: T.ImportWalletRequest): Promise<UserActionChallengeResponse>;
25
28
  importWalletComplete(request: T.ImportWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ImportWalletResponse>;
29
+ listOffers(request: T.ListOffersRequest): Promise<T.ListOffersResponse>;
26
30
  listOrgWalletHistory(request?: T.ListOrgWalletHistoryRequest): Promise<T.ListOrgWalletHistoryResponse>;
27
31
  listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
28
32
  listTransactions(request: T.ListTransactionsRequest): Promise<T.ListTransactionsResponse>;
29
33
  listTransfers(request: T.ListTransfersRequest): Promise<T.ListTransfersResponse>;
30
34
  listWallets(request?: T.ListWalletsRequest): Promise<T.ListWalletsResponse>;
35
+ rejectOfferInit(request: T.RejectOfferRequest): Promise<UserActionChallengeResponse>;
36
+ rejectOfferComplete(request: T.RejectOfferRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.RejectOfferResponse>;
31
37
  tagWalletInit(request: T.TagWalletRequest): Promise<UserActionChallengeResponse>;
32
38
  tagWalletComplete(request: T.TagWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.TagWalletResponse>;
33
39
  transferAssetInit(request: T.TransferAssetRequest): Promise<UserActionChallengeResponse>;
@@ -8,6 +8,33 @@ class DelegatedWalletsClient {
8
8
  constructor(apiOptions) {
9
9
  this.apiOptions = apiOptions;
10
10
  }
11
+ async acceptOfferInit(request) {
12
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/accept', {
13
+ path: request ?? {},
14
+ query: {},
15
+ });
16
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
17
+ userActionHttpMethod: 'PUT',
18
+ userActionHttpPath: path,
19
+ userActionPayload: JSON.stringify({}),
20
+ userActionServerKind: 'Api',
21
+ }, this.apiOptions);
22
+ return challenge;
23
+ }
24
+ async acceptOfferComplete(request, signedChallenge) {
25
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/accept', {
26
+ path: request ?? {},
27
+ query: {},
28
+ });
29
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
30
+ const response = await (0, fetch_1.simpleFetch)(path, {
31
+ method: 'PUT',
32
+ body: {},
33
+ headers: { 'x-dfns-useraction': userAction },
34
+ apiOptions: this.apiOptions,
35
+ });
36
+ return response.json();
37
+ }
11
38
  async broadcastTransactionInit(request) {
12
39
  const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
13
40
  path: request ?? {},
@@ -143,6 +170,17 @@ class DelegatedWalletsClient {
143
170
  });
144
171
  return response.json();
145
172
  }
173
+ async getOffer(request) {
174
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId', {
175
+ path: request ?? {},
176
+ query: {},
177
+ });
178
+ const response = await (0, fetch_1.simpleFetch)(path, {
179
+ method: 'GET',
180
+ apiOptions: this.apiOptions,
181
+ });
182
+ return response.json();
183
+ }
146
184
  async getSignature(request) {
147
185
  const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
148
186
  path: request ?? {},
@@ -247,6 +285,17 @@ class DelegatedWalletsClient {
247
285
  });
248
286
  return response.json();
249
287
  }
288
+ async listOffers(request) {
289
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers', {
290
+ path: request ?? {},
291
+ query: request.query ?? {},
292
+ });
293
+ const response = await (0, fetch_1.simpleFetch)(path, {
294
+ method: 'GET',
295
+ apiOptions: this.apiOptions,
296
+ });
297
+ return response.json();
298
+ }
250
299
  async listOrgWalletHistory(request) {
251
300
  const path = (0, url_1.buildPathAndQuery)('/wallets/all/history', {
252
301
  path: request ?? {},
@@ -302,6 +351,33 @@ class DelegatedWalletsClient {
302
351
  });
303
352
  return response.json();
304
353
  }
354
+ async rejectOfferInit(request) {
355
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/reject', {
356
+ path: request ?? {},
357
+ query: {},
358
+ });
359
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
360
+ userActionHttpMethod: 'PUT',
361
+ userActionHttpPath: path,
362
+ userActionPayload: JSON.stringify({}),
363
+ userActionServerKind: 'Api',
364
+ }, this.apiOptions);
365
+ return challenge;
366
+ }
367
+ async rejectOfferComplete(request, signedChallenge) {
368
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/offers/:offerId/reject', {
369
+ path: request ?? {},
370
+ query: {},
371
+ });
372
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
373
+ const response = await (0, fetch_1.simpleFetch)(path, {
374
+ method: 'PUT',
375
+ body: {},
376
+ headers: { 'x-dfns-useraction': userAction },
377
+ apiOptions: this.apiOptions,
378
+ });
379
+ return response.json();
380
+ }
305
381
  async tagWalletInit(request) {
306
382
  const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/tags', {
307
383
  path: request ?? {},