@dfns/sdk 0.1.2 → 0.1.3-rc.2

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 (46) hide show
  1. package/codegen/datamodel/ApiKeys/types.js +1 -1
  2. package/codegen/datamodel/Assets/types.js +7 -7
  3. package/codegen/datamodel/Auth/types.js +11 -11
  4. package/codegen/datamodel/Blockchains/types.js +6 -6
  5. package/codegen/datamodel/Callbacks/types.js +3 -3
  6. package/codegen/datamodel/Foundations/types.d.ts +3 -0
  7. package/codegen/datamodel/Foundations/types.js +8 -6
  8. package/codegen/datamodel/Orgs/types.js +3 -3
  9. package/codegen/datamodel/Permissions/types.js +4 -4
  10. package/codegen/datamodel/PolicyExecution/types.js +1 -1
  11. package/codegen/datamodel/PolicyManagement/types.d.ts +3 -23
  12. package/codegen/datamodel/PolicyManagement/types.js +8 -24
  13. package/codegen/datamodel/PublicKeys/types.js +4 -4
  14. package/codegen/datamodel/Signers/types.d.ts +9 -0
  15. package/codegen/datamodel/Wallets/types.d.ts +235 -9
  16. package/codegen/datamodel/Wallets/types.js +81 -33
  17. package/dfnsApiClient.d.ts +2 -2
  18. package/dfnsApiClient.js +4 -4
  19. package/dfnsDelegatedApiClient.d.ts +2 -2
  20. package/dfnsDelegatedApiClient.js +4 -4
  21. package/generated/signers/client.d.ts +7 -0
  22. package/generated/signers/client.js +22 -0
  23. package/generated/signers/delegatedClient.d.ts +7 -0
  24. package/generated/signers/delegatedClient.js +22 -0
  25. package/generated/signers/index.d.ts +3 -0
  26. package/generated/signers/index.js +19 -0
  27. package/generated/signers/types.d.ts +9 -0
  28. package/generated/signers/types.js +2 -0
  29. package/generated/wallets/client.d.ts +25 -0
  30. package/generated/wallets/client.js +228 -0
  31. package/generated/wallets/delegatedClient.d.ts +34 -0
  32. package/generated/wallets/delegatedClient.js +349 -0
  33. package/generated/wallets/index.d.ts +3 -0
  34. package/generated/wallets/index.js +19 -0
  35. package/generated/wallets/types.d.ts +1011 -0
  36. package/generated/wallets/types.js +2 -0
  37. package/package.json +1 -1
  38. package/types/signers.d.ts +1 -0
  39. package/types/signers.js +17 -0
  40. package/types/wallets.d.ts +1 -0
  41. package/types/wallets.js +17 -0
  42. package/types/webhooks.d.ts +1 -0
  43. package/types/webhooks.js +17 -0
  44. package/utils/fetch.js +2 -2
  45. package/utils/index.d.ts +4 -0
  46. package/utils/index.js +20 -0
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlockchainNetwork = exports.SignatureStatus = exports.TransactionStatus = exports.TransferStatus = exports.TransferDirection = exports.EventKind = exports.KeyProtocol = exports.KeyCurve = exports.KeyScheme = exports.WalletStatus = exports.SignatureKind = exports.TransactionKind = exports.TransferKind = void 0;
4
- // FIXME: Missing documentation for TransferKind
3
+ exports.BlockchainNetwork = exports.SignatureStatus = exports.TransactionStatus = exports.TransferStatus = exports.TransferDirection = exports.EventKind = exports.BalanceKind = exports.KeyProtocol = exports.KeyCurve = exports.KeyScheme = exports.WalletStatus = exports.SignatureKind = exports.TransactionKind = exports.TransferKind = void 0;
4
+ /**
5
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
6
+ */
5
7
  var TransferKind;
6
8
  (function (TransferKind) {
7
9
  // FIXME: Missing documentation for Native
@@ -10,8 +12,16 @@ var TransferKind;
10
12
  TransferKind["Erc20"] = "Erc20";
11
13
  // FIXME: Missing documentation for Erc721
12
14
  TransferKind["Erc721"] = "Erc721";
13
- })(TransferKind = exports.TransferKind || (exports.TransferKind = {}));
14
- // FIXME: Missing documentation for TransactionKind
15
+ // FIXME: Missing documentation for Trc10
16
+ TransferKind["Trc10"] = "Trc10";
17
+ // FIXME: Missing documentation for Trc20
18
+ TransferKind["Trc20"] = "Trc20";
19
+ // FIXME: Missing documentation for Trc721
20
+ TransferKind["Trc721"] = "Trc721";
21
+ })(TransferKind || (exports.TransferKind = TransferKind = {}));
22
+ /**
23
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
24
+ */
15
25
  var TransactionKind;
16
26
  (function (TransactionKind) {
17
27
  // FIXME: Missing documentation for Transaction
@@ -24,8 +34,10 @@ var TransactionKind;
24
34
  TransactionKind["EvmLegacy"] = "EvmLegacy";
25
35
  // FIXME: Missing documentation for Psbt
26
36
  TransactionKind["Psbt"] = "Psbt";
27
- })(TransactionKind = exports.TransactionKind || (exports.TransactionKind = {}));
28
- // FIXME: Missing documentation for SignatureKind
37
+ })(TransactionKind || (exports.TransactionKind = TransactionKind = {}));
38
+ /**
39
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
40
+ */
29
41
  var SignatureKind;
30
42
  (function (SignatureKind) {
31
43
  // FIXME: Missing documentation for Hash
@@ -38,44 +50,64 @@ var SignatureKind;
38
50
  SignatureKind["Eip712"] = "Eip712";
39
51
  // FIXME: Missing documentation for Psbt
40
52
  SignatureKind["Psbt"] = "Psbt";
41
- })(SignatureKind = exports.SignatureKind || (exports.SignatureKind = {}));
42
- // FIXME: Missing documentation for WalletStatus
53
+ })(SignatureKind || (exports.SignatureKind = SignatureKind = {}));
54
+ /**
55
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
56
+ */
43
57
  var WalletStatus;
44
58
  (function (WalletStatus) {
45
59
  // FIXME: Missing documentation for Active
46
60
  WalletStatus["Active"] = "Active";
47
- //Initial state of `AssetAccount` entity, indicating that it’s being created at the moment.
48
- WalletStatus["Creating"] = "Creating";
49
- // FIXME: Missing documentation for Failed
50
- WalletStatus["Failed"] = "Failed";
51
61
  // FIXME: Missing documentation for Archived
52
62
  WalletStatus["Archived"] = "Archived";
53
- })(WalletStatus = exports.WalletStatus || (exports.WalletStatus = {}));
54
- // FIXME: Missing documentation for KeyScheme
63
+ })(WalletStatus || (exports.WalletStatus = WalletStatus = {}));
64
+ /**
65
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
66
+ */
55
67
  var KeyScheme;
56
68
  (function (KeyScheme) {
57
69
  // FIXME: Missing documentation for ECDSA
58
70
  KeyScheme["ECDSA"] = "ECDSA";
59
71
  // FIXME: Missing documentation for EdDSA
60
72
  KeyScheme["EdDSA"] = "EdDSA";
61
- })(KeyScheme = exports.KeyScheme || (exports.KeyScheme = {}));
62
- // FIXME: Missing documentation for KeyCurve
73
+ })(KeyScheme || (exports.KeyScheme = KeyScheme = {}));
74
+ /**
75
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
76
+ */
63
77
  var KeyCurve;
64
78
  (function (KeyCurve) {
65
79
  // FIXME: Missing documentation for ed25519
66
80
  KeyCurve["ed25519"] = "ed25519";
67
81
  // FIXME: Missing documentation for secp256k1
68
82
  KeyCurve["secp256k1"] = "secp256k1";
69
- })(KeyCurve = exports.KeyCurve || (exports.KeyCurve = {}));
70
- // FIXME: Missing documentation for KeyProtocol
83
+ // FIXME: Missing documentation for stark
84
+ KeyCurve["stark"] = "stark";
85
+ })(KeyCurve || (exports.KeyCurve = KeyCurve = {}));
86
+ /**
87
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
88
+ */
71
89
  var KeyProtocol;
72
90
  (function (KeyProtocol) {
73
91
  // FIXME: Missing documentation for CGGMP21
74
92
  KeyProtocol["CGGMP21"] = "CGGMP21";
75
93
  // FIXME: Missing documentation for BINANCE_EDDSA
76
94
  KeyProtocol["BINANCE_EDDSA"] = "BINANCE_EDDSA";
77
- })(KeyProtocol = exports.KeyProtocol || (exports.KeyProtocol = {}));
78
- // FIXME: Missing documentation for EventKind
95
+ })(KeyProtocol || (exports.KeyProtocol = KeyProtocol = {}));
96
+ /**
97
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
98
+ */
99
+ var BalanceKind;
100
+ (function (BalanceKind) {
101
+ // FIXME: Missing documentation for Native
102
+ BalanceKind["Native"] = "Native";
103
+ // FIXME: Missing documentation for Erc20
104
+ BalanceKind["Erc20"] = "Erc20";
105
+ // FIXME: Missing documentation for Erc721
106
+ BalanceKind["Erc721"] = "Erc721";
107
+ })(BalanceKind || (exports.BalanceKind = BalanceKind = {}));
108
+ /**
109
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
110
+ */
79
111
  var EventKind;
80
112
  (function (EventKind) {
81
113
  // FIXME: Missing documentation for NativeTransfer
@@ -84,16 +116,20 @@ var EventKind;
84
116
  EventKind["Erc20Transfer"] = "Erc20Transfer";
85
117
  // FIXME: Missing documentation for Erc721Transfer
86
118
  EventKind["Erc721Transfer"] = "Erc721Transfer";
87
- })(EventKind = exports.EventKind || (exports.EventKind = {}));
88
- // FIXME: Missing documentation for TransferDirection
119
+ })(EventKind || (exports.EventKind = EventKind = {}));
120
+ /**
121
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
122
+ */
89
123
  var TransferDirection;
90
124
  (function (TransferDirection) {
91
125
  // FIXME: Missing documentation for In
92
126
  TransferDirection["In"] = "In";
93
127
  // FIXME: Missing documentation for Out
94
128
  TransferDirection["Out"] = "Out";
95
- })(TransferDirection = exports.TransferDirection || (exports.TransferDirection = {}));
96
- // FIXME: Missing documentation for TransferStatus
129
+ })(TransferDirection || (exports.TransferDirection = TransferDirection = {}));
130
+ /**
131
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
132
+ */
97
133
  var TransferStatus;
98
134
  (function (TransferStatus) {
99
135
  // FIXME: Missing documentation for Pending
@@ -108,8 +144,10 @@ var TransferStatus;
108
144
  TransferStatus["Failed"] = "Failed";
109
145
  // FIXME: Missing documentation for Rejected
110
146
  TransferStatus["Rejected"] = "Rejected";
111
- })(TransferStatus = exports.TransferStatus || (exports.TransferStatus = {}));
112
- // FIXME: Missing documentation for TransactionStatus
147
+ })(TransferStatus || (exports.TransferStatus = TransferStatus = {}));
148
+ /**
149
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
150
+ */
113
151
  var TransactionStatus;
114
152
  (function (TransactionStatus) {
115
153
  // FIXME: Missing documentation for Pending
@@ -124,8 +162,10 @@ var TransactionStatus;
124
162
  TransactionStatus["Failed"] = "Failed";
125
163
  // FIXME: Missing documentation for Rejected
126
164
  TransactionStatus["Rejected"] = "Rejected";
127
- })(TransactionStatus = exports.TransactionStatus || (exports.TransactionStatus = {}));
128
- // FIXME: Missing documentation for SignatureStatus
165
+ })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
166
+ /**
167
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
168
+ */
129
169
  var SignatureStatus;
130
170
  (function (SignatureStatus) {
131
171
  // FIXME: Missing documentation for Pending
@@ -140,8 +180,10 @@ var SignatureStatus;
140
180
  SignatureStatus["Failed"] = "Failed";
141
181
  // FIXME: Missing documentation for Rejected
142
182
  SignatureStatus["Rejected"] = "Rejected";
143
- })(SignatureStatus = exports.SignatureStatus || (exports.SignatureStatus = {}));
144
- // FIXME: Missing documentation for BlockchainNetwork
183
+ })(SignatureStatus || (exports.SignatureStatus = SignatureStatus = {}));
184
+ /**
185
+ * @deprecated import equivalent type from '@dfns/sdk/types/wallets' instead
186
+ */
145
187
  var BlockchainNetwork;
146
188
  (function (BlockchainNetwork) {
147
189
  // FIXME: Missing documentation for ArbitrumOne
@@ -192,12 +234,18 @@ var BlockchainNetwork;
192
234
  BlockchainNetwork["Solana"] = "Solana";
193
235
  // FIXME: Missing documentation for SolanaDevnet
194
236
  BlockchainNetwork["SolanaDevnet"] = "SolanaDevnet";
237
+ // FIXME: Missing documentation for Tezos
238
+ BlockchainNetwork["Tezos"] = "Tezos";
239
+ // FIXME: Missing documentation for TezosGhostnet
240
+ BlockchainNetwork["TezosGhostnet"] = "TezosGhostnet";
195
241
  // FIXME: Missing documentation for Tron
196
242
  BlockchainNetwork["Tron"] = "Tron";
197
- // FIXME: Missing documentation for TronShasta
198
- BlockchainNetwork["TronShasta"] = "TronShasta";
243
+ // FIXME: Missing documentation for TronNile
244
+ BlockchainNetwork["TronNile"] = "TronNile";
199
245
  // FIXME: Missing documentation for KeyECDSA
200
246
  BlockchainNetwork["KeyECDSA"] = "KeyECDSA";
201
247
  // FIXME: Missing documentation for KeyEdDSA
202
248
  BlockchainNetwork["KeyEdDSA"] = "KeyEdDSA";
203
- })(BlockchainNetwork = exports.BlockchainNetwork || (exports.BlockchainNetwork = {}));
249
+ // FIXME: Missing documentation for KeyECDSAStark
250
+ BlockchainNetwork["KeyECDSAStark"] = "KeyECDSAStark";
251
+ })(BlockchainNetwork || (exports.BlockchainNetwork = BlockchainNetwork = {}));
@@ -7,8 +7,8 @@ import { PermissionsClient } from './codegen/Permissions';
7
7
  import { PolicyExecutionClient } from './codegen/PolicyExecution';
8
8
  import { PolicyManagementClient } from './codegen/PolicyManagement';
9
9
  import { PublicKeysClient } from './codegen/PublicKeys';
10
- import { WalletsClient } from './codegen/Wallets';
11
- import { SignersClient } from './codegen/Signers';
10
+ import { SignersClient } from './generated/signers';
11
+ import { WalletsClient } from './generated/wallets';
12
12
  import { WebhooksClient } from './generated/webhooks';
13
13
  import { CredentialSigner } from './signer';
14
14
  export type DfnsApiClientOptions = DfnsBaseApiOptions & {
package/dfnsApiClient.js CHANGED
@@ -9,8 +9,8 @@ const Permissions_1 = require("./codegen/Permissions");
9
9
  const PolicyExecution_1 = require("./codegen/PolicyExecution");
10
10
  const PolicyManagement_1 = require("./codegen/PolicyManagement");
11
11
  const PublicKeys_1 = require("./codegen/PublicKeys");
12
- const Wallets_1 = require("./codegen/Wallets");
13
- const Signers_1 = require("./codegen/Signers");
12
+ const signers_1 = require("./generated/signers");
13
+ const wallets_1 = require("./generated/wallets");
14
14
  const webhooks_1 = require("./generated/webhooks");
15
15
  class DfnsApiClient {
16
16
  constructor(apiOptions) {
@@ -41,13 +41,13 @@ class DfnsApiClient {
41
41
  return new PublicKeys_1.PublicKeysClient(this.apiOptions);
42
42
  }
43
43
  get wallets() {
44
- return new Wallets_1.WalletsClient(this.apiOptions);
44
+ return new wallets_1.WalletsClient(this.apiOptions);
45
45
  }
46
46
  get webhooks() {
47
47
  return new webhooks_1.WebhooksClient(this.apiOptions);
48
48
  }
49
49
  get signers() {
50
- return new Signers_1.SignersClient(this.apiOptions);
50
+ return new signers_1.SignersClient(this.apiOptions);
51
51
  }
52
52
  }
53
53
  exports.DfnsApiClient = DfnsApiClient;
@@ -7,9 +7,9 @@ import { DelegatedPermissionsClient } from './codegen/Permissions';
7
7
  import { DelegatedPolicyExecutionClient } from './codegen/PolicyExecution';
8
8
  import { DelegatedPolicyManagementClient } from './codegen/PolicyManagement';
9
9
  import { DelegatedPublicKeysClient } from './codegen/PublicKeys';
10
- import { DelegatedSignersClient } from './codegen/Signers';
10
+ import { DelegatedSignersClient } from './generated/signers';
11
+ import { DelegatedWalletsClient } from './generated/wallets';
11
12
  import { DelegatedWebhooksClient } from './generated/webhooks';
12
- import { DelegatedWalletsClient } from './codegen/Wallets';
13
13
  export type DfnsDelegatedApiClientOptions = DfnsBaseApiOptions & {
14
14
  authToken: string;
15
15
  };
@@ -9,9 +9,9 @@ const Permissions_1 = require("./codegen/Permissions");
9
9
  const PolicyExecution_1 = require("./codegen/PolicyExecution");
10
10
  const PolicyManagement_1 = require("./codegen/PolicyManagement");
11
11
  const PublicKeys_1 = require("./codegen/PublicKeys");
12
- const Signers_1 = require("./codegen/Signers");
12
+ const signers_1 = require("./generated/signers");
13
+ const wallets_1 = require("./generated/wallets");
13
14
  const webhooks_1 = require("./generated/webhooks");
14
- const Wallets_1 = require("./codegen/Wallets");
15
15
  class DfnsDelegatedApiClient {
16
16
  constructor(apiOptions) {
17
17
  this.apiOptions = apiOptions;
@@ -41,13 +41,13 @@ class DfnsDelegatedApiClient {
41
41
  return new PublicKeys_1.DelegatedPublicKeysClient(this.apiOptions);
42
42
  }
43
43
  get wallets() {
44
- return new Wallets_1.DelegatedWalletsClient(this.apiOptions);
44
+ return new wallets_1.DelegatedWalletsClient(this.apiOptions);
45
45
  }
46
46
  get webhooks() {
47
47
  return new webhooks_1.DelegatedWebhooksClient(this.apiOptions);
48
48
  }
49
49
  get signers() {
50
- return new Signers_1.DelegatedSignersClient(this.apiOptions);
50
+ return new signers_1.DelegatedSignersClient(this.apiOptions);
51
51
  }
52
52
  }
53
53
  exports.DfnsDelegatedApiClient = DfnsDelegatedApiClient;
@@ -0,0 +1,7 @@
1
+ import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
+ import * as T from './types';
3
+ export declare class SignersClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsApiClientOptions);
6
+ listSigners(): Promise<T.ListSignersResponse>;
7
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignersClient = void 0;
4
+ const fetch_1 = require("../../utils/fetch");
5
+ const url_1 = require("../../utils/url");
6
+ class SignersClient {
7
+ constructor(apiOptions) {
8
+ this.apiOptions = apiOptions;
9
+ }
10
+ async listSigners() {
11
+ const path = (0, url_1.buildPathAndQuery)('/signers', {
12
+ path: {},
13
+ query: {},
14
+ });
15
+ const response = await (0, fetch_1.simpleFetch)(path, {
16
+ method: 'GET',
17
+ apiOptions: this.apiOptions,
18
+ });
19
+ return response.json();
20
+ }
21
+ }
22
+ exports.SignersClient = SignersClient;
@@ -0,0 +1,7 @@
1
+ import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
2
+ import * as T from './types';
3
+ export declare class DelegatedSignersClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsDelegatedApiClientOptions);
6
+ listSigners(): Promise<T.ListSignersResponse>;
7
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelegatedSignersClient = void 0;
4
+ const fetch_1 = require("../../utils/fetch");
5
+ const url_1 = require("../../utils/url");
6
+ class DelegatedSignersClient {
7
+ constructor(apiOptions) {
8
+ this.apiOptions = apiOptions;
9
+ }
10
+ async listSigners() {
11
+ const path = (0, url_1.buildPathAndQuery)('/signers', {
12
+ path: {},
13
+ query: {},
14
+ });
15
+ const response = await (0, fetch_1.simpleFetch)(path, {
16
+ method: 'GET',
17
+ apiOptions: this.apiOptions,
18
+ });
19
+ return response.json();
20
+ }
21
+ }
22
+ exports.DelegatedSignersClient = DelegatedSignersClient;
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './client';
3
+ export * from './delegatedClient';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./client"), exports);
19
+ __exportStar(require("./delegatedClient"), exports);
@@ -0,0 +1,9 @@
1
+ export type ListSignersResponse = {
2
+ clusters: {
3
+ clusterId: string;
4
+ signers: {
5
+ signerId: string;
6
+ encryptionKey: string;
7
+ }[];
8
+ }[];
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
+ import * as T from './types';
3
+ export declare class WalletsClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsApiClientOptions);
6
+ broadcastTransaction(request: T.BroadcastTransactionRequest): Promise<T.BroadcastTransactionResponse>;
7
+ createWallet(request: T.CreateWalletRequest): Promise<T.CreateWalletResponse>;
8
+ delegateWallet(request: T.DelegateWalletRequest): Promise<T.DelegateWalletResponse>;
9
+ exportWallet(request: T.ExportWalletRequest): Promise<T.ExportWalletResponse>;
10
+ generateSignature(request: T.GenerateSignatureRequest): Promise<T.GenerateSignatureResponse>;
11
+ getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
12
+ getTransaction(request: T.GetTransactionRequest): Promise<T.GetTransactionResponse>;
13
+ getTransfer(request: T.GetTransferRequest): Promise<T.GetTransferResponse>;
14
+ getWallet(request: T.GetWalletRequest): Promise<T.GetWalletResponse>;
15
+ getWalletAssets(request: T.GetWalletAssetsRequest): Promise<T.GetWalletAssetsResponse>;
16
+ getWalletHistory(request: T.GetWalletHistoryRequest): Promise<T.GetWalletHistoryResponse>;
17
+ getWalletNfts(request: T.GetWalletNftsRequest): Promise<T.GetWalletNftsResponse>;
18
+ importWallet(request: T.ImportWalletRequest): Promise<T.ImportWalletResponse>;
19
+ listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
20
+ listTransactions(request: T.ListTransactionsRequest): Promise<T.ListTransactionsResponse>;
21
+ listTransfers(request: T.ListTransfersRequest): Promise<T.ListTransfersResponse>;
22
+ listWallets(request?: T.ListWalletsRequest): Promise<T.ListWalletsResponse>;
23
+ transferAsset(request: T.TransferAssetRequest): Promise<T.TransferAssetResponse>;
24
+ updateWallet(request: T.UpdateWalletRequest): Promise<T.UpdateWalletResponse>;
25
+ }
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletsClient = void 0;
4
+ const fetch_1 = require("../../utils/fetch");
5
+ const url_1 = require("../../utils/url");
6
+ class WalletsClient {
7
+ constructor(apiOptions) {
8
+ this.apiOptions = apiOptions;
9
+ }
10
+ async broadcastTransaction(request) {
11
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
12
+ path: request ?? {},
13
+ query: {},
14
+ });
15
+ const response = await (0, fetch_1.userActionFetch)(path, {
16
+ method: 'POST',
17
+ body: request.body,
18
+ apiOptions: this.apiOptions,
19
+ });
20
+ return response.json();
21
+ }
22
+ async createWallet(request) {
23
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
24
+ path: request ?? {},
25
+ query: {},
26
+ });
27
+ const response = await (0, fetch_1.userActionFetch)(path, {
28
+ method: 'POST',
29
+ body: request.body,
30
+ apiOptions: this.apiOptions,
31
+ });
32
+ return response.json();
33
+ }
34
+ async delegateWallet(request) {
35
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/delegate', {
36
+ path: request ?? {},
37
+ query: {},
38
+ });
39
+ const response = await (0, fetch_1.userActionFetch)(path, {
40
+ method: 'POST',
41
+ body: request.body,
42
+ apiOptions: this.apiOptions,
43
+ });
44
+ return response.json();
45
+ }
46
+ async exportWallet(request) {
47
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/export', {
48
+ path: request ?? {},
49
+ query: {},
50
+ });
51
+ const response = await (0, fetch_1.userActionFetch)(path, {
52
+ method: 'POST',
53
+ body: request.body,
54
+ apiOptions: this.apiOptions,
55
+ });
56
+ return response.json();
57
+ }
58
+ async generateSignature(request) {
59
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
60
+ path: request ?? {},
61
+ query: {},
62
+ });
63
+ const response = await (0, fetch_1.userActionFetch)(path, {
64
+ method: 'POST',
65
+ body: request.body,
66
+ apiOptions: this.apiOptions,
67
+ });
68
+ return response.json();
69
+ }
70
+ async getSignature(request) {
71
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
72
+ path: request ?? {},
73
+ query: {},
74
+ });
75
+ const response = await (0, fetch_1.simpleFetch)(path, {
76
+ method: 'GET',
77
+ apiOptions: this.apiOptions,
78
+ });
79
+ return response.json();
80
+ }
81
+ async getTransaction(request) {
82
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId', {
83
+ path: request ?? {},
84
+ query: {},
85
+ });
86
+ const response = await (0, fetch_1.simpleFetch)(path, {
87
+ method: 'GET',
88
+ apiOptions: this.apiOptions,
89
+ });
90
+ return response.json();
91
+ }
92
+ async getTransfer(request) {
93
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId', {
94
+ path: request ?? {},
95
+ query: {},
96
+ });
97
+ const response = await (0, fetch_1.simpleFetch)(path, {
98
+ method: 'GET',
99
+ apiOptions: this.apiOptions,
100
+ });
101
+ return response.json();
102
+ }
103
+ async getWallet(request) {
104
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
105
+ path: request ?? {},
106
+ query: {},
107
+ });
108
+ const response = await (0, fetch_1.simpleFetch)(path, {
109
+ method: 'GET',
110
+ apiOptions: this.apiOptions,
111
+ });
112
+ return response.json();
113
+ }
114
+ async getWalletAssets(request) {
115
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/assets', {
116
+ path: request ?? {},
117
+ query: {},
118
+ });
119
+ const response = await (0, fetch_1.simpleFetch)(path, {
120
+ method: 'GET',
121
+ apiOptions: this.apiOptions,
122
+ });
123
+ return response.json();
124
+ }
125
+ async getWalletHistory(request) {
126
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/history', {
127
+ path: request ?? {},
128
+ query: request.query ?? {},
129
+ });
130
+ const response = await (0, fetch_1.simpleFetch)(path, {
131
+ method: 'GET',
132
+ apiOptions: this.apiOptions,
133
+ });
134
+ return response.json();
135
+ }
136
+ async getWalletNfts(request) {
137
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/nfts', {
138
+ path: request ?? {},
139
+ query: {},
140
+ });
141
+ const response = await (0, fetch_1.simpleFetch)(path, {
142
+ method: 'GET',
143
+ apiOptions: this.apiOptions,
144
+ });
145
+ return response.json();
146
+ }
147
+ async importWallet(request) {
148
+ const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
149
+ path: request ?? {},
150
+ query: {},
151
+ });
152
+ const response = await (0, fetch_1.userActionFetch)(path, {
153
+ method: 'POST',
154
+ body: request.body,
155
+ apiOptions: this.apiOptions,
156
+ });
157
+ return response.json();
158
+ }
159
+ async listSignatures(request) {
160
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
161
+ path: request ?? {},
162
+ query: request.query ?? {},
163
+ });
164
+ const response = await (0, fetch_1.simpleFetch)(path, {
165
+ method: 'GET',
166
+ apiOptions: this.apiOptions,
167
+ });
168
+ return response.json();
169
+ }
170
+ async listTransactions(request) {
171
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
172
+ path: request ?? {},
173
+ query: request.query ?? {},
174
+ });
175
+ const response = await (0, fetch_1.simpleFetch)(path, {
176
+ method: 'GET',
177
+ apiOptions: this.apiOptions,
178
+ });
179
+ return response.json();
180
+ }
181
+ async listTransfers(request) {
182
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
183
+ path: request ?? {},
184
+ query: request.query ?? {},
185
+ });
186
+ const response = await (0, fetch_1.simpleFetch)(path, {
187
+ method: 'GET',
188
+ apiOptions: this.apiOptions,
189
+ });
190
+ return response.json();
191
+ }
192
+ async listWallets(request) {
193
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
194
+ path: request ?? {},
195
+ query: request?.query ?? {},
196
+ });
197
+ const response = await (0, fetch_1.simpleFetch)(path, {
198
+ method: 'GET',
199
+ apiOptions: this.apiOptions,
200
+ });
201
+ return response.json();
202
+ }
203
+ async transferAsset(request) {
204
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
205
+ path: request ?? {},
206
+ query: {},
207
+ });
208
+ const response = await (0, fetch_1.userActionFetch)(path, {
209
+ method: 'POST',
210
+ body: request.body,
211
+ apiOptions: this.apiOptions,
212
+ });
213
+ return response.json();
214
+ }
215
+ async updateWallet(request) {
216
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
217
+ path: request ?? {},
218
+ query: {},
219
+ });
220
+ const response = await (0, fetch_1.userActionFetch)(path, {
221
+ method: 'PUT',
222
+ body: request.body,
223
+ apiOptions: this.apiOptions,
224
+ });
225
+ return response.json();
226
+ }
227
+ }
228
+ exports.WalletsClient = WalletsClient;