@dfns/sdk 0.1.0-alpha.1

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 (161) hide show
  1. package/baseAuthApi.d.ts +53 -0
  2. package/baseAuthApi.js +39 -0
  3. package/codegen/ApiKeys/ApiKeysClient.d.ts +10 -0
  4. package/codegen/ApiKeys/ApiKeysClient.js +56 -0
  5. package/codegen/ApiKeys/DelegatedApiKeysClient.d.ts +13 -0
  6. package/codegen/ApiKeys/DelegatedApiKeysClient.js +88 -0
  7. package/codegen/ApiKeys/index.d.ts +3 -0
  8. package/codegen/ApiKeys/index.js +19 -0
  9. package/codegen/ApiKeys/types.d.ts +16 -0
  10. package/codegen/ApiKeys/types.js +2 -0
  11. package/codegen/Assets/AssetsClient.d.ts +14 -0
  12. package/codegen/Assets/AssetsClient.js +105 -0
  13. package/codegen/Assets/DelegatedAssetsClient.d.ts +18 -0
  14. package/codegen/Assets/DelegatedAssetsClient.js +152 -0
  15. package/codegen/Assets/index.d.ts +3 -0
  16. package/codegen/Assets/index.js +19 -0
  17. package/codegen/Assets/types.d.ts +39 -0
  18. package/codegen/Assets/types.js +2 -0
  19. package/codegen/Auth/AuthClient.d.ts +62 -0
  20. package/codegen/Auth/AuthClient.js +667 -0
  21. package/codegen/Auth/DelegatedAuthClient.d.ts +98 -0
  22. package/codegen/Auth/DelegatedAuthClient.js +1223 -0
  23. package/codegen/Auth/index.d.ts +3 -0
  24. package/codegen/Auth/index.js +19 -0
  25. package/codegen/Auth/types.d.ts +243 -0
  26. package/codegen/Auth/types.js +2 -0
  27. package/codegen/Callbacks/CallbacksClient.d.ts +12 -0
  28. package/codegen/Callbacks/CallbacksClient.js +78 -0
  29. package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +15 -0
  30. package/codegen/Callbacks/DelegatedCallbacksClient.js +110 -0
  31. package/codegen/Callbacks/index.d.ts +3 -0
  32. package/codegen/Callbacks/index.js +19 -0
  33. package/codegen/Callbacks/types.d.ts +23 -0
  34. package/codegen/Callbacks/types.js +2 -0
  35. package/codegen/Permissions/DelegatedPermissionsClient.d.ts +28 -0
  36. package/codegen/Permissions/DelegatedPermissionsClient.js +297 -0
  37. package/codegen/Permissions/PermissionsClient.d.ts +19 -0
  38. package/codegen/Permissions/PermissionsClient.js +169 -0
  39. package/codegen/Permissions/index.d.ts +3 -0
  40. package/codegen/Permissions/index.js +19 -0
  41. package/codegen/Permissions/types.d.ts +71 -0
  42. package/codegen/Permissions/types.js +2 -0
  43. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.d.ts +11 -0
  44. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.js +62 -0
  45. package/codegen/PolicyExecution/PolicyExecutionClient.d.ts +9 -0
  46. package/codegen/PolicyExecution/PolicyExecutionClient.js +46 -0
  47. package/codegen/PolicyExecution/index.d.ts +3 -0
  48. package/codegen/PolicyExecution/index.js +19 -0
  49. package/codegen/PolicyExecution/types.d.ts +16 -0
  50. package/codegen/PolicyExecution/types.js +2 -0
  51. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +31 -0
  52. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +324 -0
  53. package/codegen/PolicyManagement/PolicyManagementClient.d.ts +21 -0
  54. package/codegen/PolicyManagement/PolicyManagementClient.js +185 -0
  55. package/codegen/PolicyManagement/index.d.ts +3 -0
  56. package/codegen/PolicyManagement/index.js +19 -0
  57. package/codegen/PolicyManagement/types.d.ts +91 -0
  58. package/codegen/PolicyManagement/types.js +2 -0
  59. package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +21 -0
  60. package/codegen/PublicKeys/DelegatedPublicKeysClient.js +191 -0
  61. package/codegen/PublicKeys/PublicKeysClient.d.ts +16 -0
  62. package/codegen/PublicKeys/PublicKeysClient.js +130 -0
  63. package/codegen/PublicKeys/index.d.ts +3 -0
  64. package/codegen/PublicKeys/index.js +19 -0
  65. package/codegen/PublicKeys/types.d.ts +51 -0
  66. package/codegen/PublicKeys/types.js +2 -0
  67. package/codegen/Wallets/DelegatedWalletsClient.d.ts +26 -0
  68. package/codegen/Wallets/DelegatedWalletsClient.js +249 -0
  69. package/codegen/Wallets/WalletsClient.d.ts +21 -0
  70. package/codegen/Wallets/WalletsClient.js +188 -0
  71. package/codegen/Wallets/index.d.ts +3 -0
  72. package/codegen/Wallets/index.js +19 -0
  73. package/codegen/Wallets/types.d.ts +87 -0
  74. package/codegen/Wallets/types.js +2 -0
  75. package/codegen/datamodel/ApiKeys/errors.d.ts +6 -0
  76. package/codegen/datamodel/ApiKeys/errors.js +15 -0
  77. package/codegen/datamodel/ApiKeys/index.d.ts +3 -0
  78. package/codegen/datamodel/ApiKeys/index.js +19 -0
  79. package/codegen/datamodel/ApiKeys/responses.d.ts +25 -0
  80. package/codegen/datamodel/ApiKeys/responses.js +2 -0
  81. package/codegen/datamodel/ApiKeys/types.d.ts +32 -0
  82. package/codegen/datamodel/ApiKeys/types.js +11 -0
  83. package/codegen/datamodel/Assets/errors.d.ts +11 -0
  84. package/codegen/datamodel/Assets/errors.js +17 -0
  85. package/codegen/datamodel/Assets/index.d.ts +3 -0
  86. package/codegen/datamodel/Assets/index.js +19 -0
  87. package/codegen/datamodel/Assets/responses.d.ts +45 -0
  88. package/codegen/datamodel/Assets/responses.js +2 -0
  89. package/codegen/datamodel/Assets/types.d.ts +225 -0
  90. package/codegen/datamodel/Assets/types.js +75 -0
  91. package/codegen/datamodel/Auth/index.d.ts +2 -0
  92. package/codegen/datamodel/Auth/index.js +18 -0
  93. package/codegen/datamodel/Auth/responses.d.ts +348 -0
  94. package/codegen/datamodel/Auth/responses.js +2 -0
  95. package/codegen/datamodel/Auth/types.d.ts +610 -0
  96. package/codegen/datamodel/Auth/types.js +127 -0
  97. package/codegen/datamodel/Callbacks/index.d.ts +2 -0
  98. package/codegen/datamodel/Callbacks/index.js +18 -0
  99. package/codegen/datamodel/Callbacks/responses.d.ts +36 -0
  100. package/codegen/datamodel/Callbacks/responses.js +2 -0
  101. package/codegen/datamodel/Callbacks/types.d.ts +43 -0
  102. package/codegen/datamodel/Callbacks/types.js +39 -0
  103. package/codegen/datamodel/Foundations/errors.d.ts +121 -0
  104. package/codegen/datamodel/Foundations/errors.js +169 -0
  105. package/codegen/datamodel/Foundations/index.d.ts +2 -0
  106. package/codegen/datamodel/Foundations/index.js +18 -0
  107. package/codegen/datamodel/Foundations/types.d.ts +9754 -0
  108. package/codegen/datamodel/Foundations/types.js +57741 -0
  109. package/codegen/datamodel/Permissions/index.d.ts +2 -0
  110. package/codegen/datamodel/Permissions/index.js +18 -0
  111. package/codegen/datamodel/Permissions/responses.d.ts +75 -0
  112. package/codegen/datamodel/Permissions/responses.js +2 -0
  113. package/codegen/datamodel/Permissions/types.d.ts +106 -0
  114. package/codegen/datamodel/Permissions/types.js +65 -0
  115. package/codegen/datamodel/PolicyExecution/errors.d.ts +11 -0
  116. package/codegen/datamodel/PolicyExecution/errors.js +17 -0
  117. package/codegen/datamodel/PolicyExecution/index.d.ts +3 -0
  118. package/codegen/datamodel/PolicyExecution/index.js +19 -0
  119. package/codegen/datamodel/PolicyExecution/responses.d.ts +17 -0
  120. package/codegen/datamodel/PolicyExecution/responses.js +2 -0
  121. package/codegen/datamodel/PolicyExecution/types.d.ts +45 -0
  122. package/codegen/datamodel/PolicyExecution/types.js +15 -0
  123. package/codegen/datamodel/PolicyManagement/index.d.ts +2 -0
  124. package/codegen/datamodel/PolicyManagement/index.js +18 -0
  125. package/codegen/datamodel/PolicyManagement/responses.d.ts +83 -0
  126. package/codegen/datamodel/PolicyManagement/responses.js +2 -0
  127. package/codegen/datamodel/PolicyManagement/types.d.ts +252 -0
  128. package/codegen/datamodel/PolicyManagement/types.js +81 -0
  129. package/codegen/datamodel/PublicKeys/index.d.ts +2 -0
  130. package/codegen/datamodel/PublicKeys/index.js +18 -0
  131. package/codegen/datamodel/PublicKeys/responses.d.ts +56 -0
  132. package/codegen/datamodel/PublicKeys/responses.js +2 -0
  133. package/codegen/datamodel/PublicKeys/types.d.ts +222 -0
  134. package/codegen/datamodel/PublicKeys/types.js +59 -0
  135. package/codegen/datamodel/Wallets/index.d.ts +2 -0
  136. package/codegen/datamodel/Wallets/index.js +18 -0
  137. package/codegen/datamodel/Wallets/responses.d.ts +77 -0
  138. package/codegen/datamodel/Wallets/responses.js +2 -0
  139. package/codegen/datamodel/Wallets/types.d.ts +261 -0
  140. package/codegen/datamodel/Wallets/types.js +89 -0
  141. package/dfnsApiClient.d.ts +27 -0
  142. package/dfnsApiClient.js +45 -0
  143. package/dfnsAuthenticator.d.ts +11 -0
  144. package/dfnsAuthenticator.js +18 -0
  145. package/dfnsDelegatedApiClient.d.ts +24 -0
  146. package/dfnsDelegatedApiClient.js +41 -0
  147. package/dfnsError.d.ts +5 -0
  148. package/dfnsError.js +11 -0
  149. package/index.d.ts +3 -0
  150. package/index.js +19 -0
  151. package/package.json +11 -0
  152. package/signer.d.ts +47 -0
  153. package/signer.js +2 -0
  154. package/utils/base64.d.ts +3 -0
  155. package/utils/base64.js +20 -0
  156. package/utils/fetch.d.ts +12 -0
  157. package/utils/fetch.js +89 -0
  158. package/utils/nonce.d.ts +1 -0
  159. package/utils/nonce.js +12 -0
  160. package/utils/url.d.ts +4 -0
  161. package/utils/url.js +15 -0
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DelegatedWalletsClient = void 0;
4
+ const baseAuthApi_1 = require("../../baseAuthApi");
5
+ const fetch_1 = require("../../utils/fetch");
6
+ const url_1 = require("../../utils/url");
7
+ class DelegatedWalletsClient {
8
+ constructor(apiOptions) {
9
+ this.apiOptions = apiOptions;
10
+ }
11
+ async createWalletInit(request) {
12
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
13
+ path: {},
14
+ query: {},
15
+ });
16
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
17
+ userActionHttpMethod: 'POST',
18
+ userActionHttpPath: path,
19
+ userActionPayload: JSON.stringify(request.body),
20
+ userActionServerKind: 'Api',
21
+ }, this.apiOptions);
22
+ return challenge;
23
+ }
24
+ async createWalletComplete(request, signedChallenge) {
25
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
26
+ path: {},
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: 'POST',
32
+ body: request.body,
33
+ headers: { 'x-dfns-useraction': userAction },
34
+ apiOptions: this.apiOptions,
35
+ });
36
+ return response.json();
37
+ }
38
+ async getWallet(request) {
39
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
40
+ path: { walletId: request.walletId },
41
+ query: {},
42
+ });
43
+ const response = await (0, fetch_1.simpleFetch)(path, {
44
+ method: 'GET',
45
+ apiOptions: this.apiOptions,
46
+ });
47
+ return response.json();
48
+ }
49
+ async getWalletAssets(request) {
50
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/assets', {
51
+ path: { walletId: request.walletId },
52
+ query: {},
53
+ });
54
+ const response = await (0, fetch_1.simpleFetch)(path, {
55
+ method: 'GET',
56
+ apiOptions: this.apiOptions,
57
+ });
58
+ return response.json();
59
+ }
60
+ async getWalletNfts(request) {
61
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/nfts', {
62
+ path: { walletId: request.walletId },
63
+ query: {},
64
+ });
65
+ const response = await (0, fetch_1.simpleFetch)(path, {
66
+ method: 'GET',
67
+ apiOptions: this.apiOptions,
68
+ });
69
+ return response.json();
70
+ }
71
+ async listWallets(request) {
72
+ var _a;
73
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
74
+ path: {},
75
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
76
+ });
77
+ const response = await (0, fetch_1.simpleFetch)(path, {
78
+ method: 'GET',
79
+ apiOptions: this.apiOptions,
80
+ });
81
+ return response.json();
82
+ }
83
+ async getWalletHistory(request) {
84
+ var _a;
85
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/history', {
86
+ path: { walletId: request.walletId },
87
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
88
+ });
89
+ const response = await (0, fetch_1.simpleFetch)(path, {
90
+ method: 'GET',
91
+ apiOptions: this.apiOptions,
92
+ });
93
+ return response.json();
94
+ }
95
+ async transferAssetInit(request) {
96
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
97
+ path: { walletId: request.walletId },
98
+ query: {},
99
+ });
100
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
101
+ userActionHttpMethod: 'POST',
102
+ userActionHttpPath: path,
103
+ userActionPayload: JSON.stringify(request.body),
104
+ userActionServerKind: 'Api',
105
+ }, this.apiOptions);
106
+ return challenge;
107
+ }
108
+ async transferAssetComplete(request, signedChallenge) {
109
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
110
+ path: { walletId: request.walletId },
111
+ query: {},
112
+ });
113
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
114
+ const response = await (0, fetch_1.simpleFetch)(path, {
115
+ method: 'POST',
116
+ body: request.body,
117
+ headers: { 'x-dfns-useraction': userAction },
118
+ apiOptions: this.apiOptions,
119
+ });
120
+ return response.json();
121
+ }
122
+ async getTransfer(request) {
123
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId', {
124
+ path: { walletId: request.walletId, transferId: request.transferId },
125
+ query: {},
126
+ });
127
+ const response = await (0, fetch_1.simpleFetch)(path, {
128
+ method: 'GET',
129
+ apiOptions: this.apiOptions,
130
+ });
131
+ return response.json();
132
+ }
133
+ async listTransfers(request) {
134
+ var _a;
135
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
136
+ path: { walletId: request.walletId },
137
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
138
+ });
139
+ const response = await (0, fetch_1.simpleFetch)(path, {
140
+ method: 'GET',
141
+ apiOptions: this.apiOptions,
142
+ });
143
+ return response.json();
144
+ }
145
+ async broadcastTransactionInit(request) {
146
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
147
+ path: { walletId: request.walletId },
148
+ query: {},
149
+ });
150
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
151
+ userActionHttpMethod: 'POST',
152
+ userActionHttpPath: path,
153
+ userActionPayload: JSON.stringify(request.body),
154
+ userActionServerKind: 'Api',
155
+ }, this.apiOptions);
156
+ return challenge;
157
+ }
158
+ async broadcastTransactionComplete(request, signedChallenge) {
159
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
160
+ path: { walletId: request.walletId },
161
+ query: {},
162
+ });
163
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
164
+ const response = await (0, fetch_1.simpleFetch)(path, {
165
+ method: 'POST',
166
+ body: request.body,
167
+ headers: { 'x-dfns-useraction': userAction },
168
+ apiOptions: this.apiOptions,
169
+ });
170
+ return response.json();
171
+ }
172
+ async getTransaction(request) {
173
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId', {
174
+ path: {
175
+ walletId: request.walletId,
176
+ transactionId: request.transactionId,
177
+ },
178
+ query: {},
179
+ });
180
+ const response = await (0, fetch_1.simpleFetch)(path, {
181
+ method: 'GET',
182
+ apiOptions: this.apiOptions,
183
+ });
184
+ return response.json();
185
+ }
186
+ async listTransactions(request) {
187
+ var _a;
188
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
189
+ path: { walletId: request.walletId },
190
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
191
+ });
192
+ const response = await (0, fetch_1.simpleFetch)(path, {
193
+ method: 'GET',
194
+ apiOptions: this.apiOptions,
195
+ });
196
+ return response.json();
197
+ }
198
+ async generateSignatureInit(request) {
199
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
200
+ path: { walletId: request.walletId },
201
+ query: {},
202
+ });
203
+ const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
204
+ userActionHttpMethod: 'POST',
205
+ userActionHttpPath: path,
206
+ userActionPayload: JSON.stringify(request.body),
207
+ userActionServerKind: 'Api',
208
+ }, this.apiOptions);
209
+ return challenge;
210
+ }
211
+ async generateSignatureComplete(request, signedChallenge) {
212
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
213
+ path: { walletId: request.walletId },
214
+ query: {},
215
+ });
216
+ const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
217
+ const response = await (0, fetch_1.simpleFetch)(path, {
218
+ method: 'POST',
219
+ body: request.body,
220
+ headers: { 'x-dfns-useraction': userAction },
221
+ apiOptions: this.apiOptions,
222
+ });
223
+ return response.json();
224
+ }
225
+ async getSignature(request) {
226
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
227
+ path: { walletId: request.walletId, signatureId: request.signatureId },
228
+ query: {},
229
+ });
230
+ const response = await (0, fetch_1.simpleFetch)(path, {
231
+ method: 'GET',
232
+ apiOptions: this.apiOptions,
233
+ });
234
+ return response.json();
235
+ }
236
+ async listSignatures(request) {
237
+ var _a;
238
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
239
+ path: { walletId: request.walletId },
240
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
241
+ });
242
+ const response = await (0, fetch_1.simpleFetch)(path, {
243
+ method: 'GET',
244
+ apiOptions: this.apiOptions,
245
+ });
246
+ return response.json();
247
+ }
248
+ }
249
+ exports.DelegatedWalletsClient = DelegatedWalletsClient;
@@ -0,0 +1,21 @@
1
+ import { DfnsApiClientOptions } from '../../dfnsApiClient';
2
+ import * as T from './types';
3
+ export declare class WalletsClient {
4
+ private apiOptions;
5
+ constructor(apiOptions: DfnsApiClientOptions);
6
+ createWallet(request: T.CreateWalletRequest): Promise<T.CreateWalletResponse>;
7
+ getWallet(request: T.GetWalletRequest): Promise<T.GetWalletResponse>;
8
+ getWalletAssets(request: T.GetWalletAssetsRequest): Promise<T.GetWalletAssetsResponse>;
9
+ getWalletNfts(request: T.GetWalletNftsRequest): Promise<T.GetWalletNftsResponse>;
10
+ listWallets(request: T.ListWalletsRequest): Promise<T.ListWalletsResponse>;
11
+ getWalletHistory(request: T.GetWalletHistoryRequest): Promise<T.GetWalletHistoryResponse>;
12
+ transferAsset(request: T.TransferAssetRequest): Promise<T.TransferAssetResponse>;
13
+ getTransfer(request: T.GetTransferRequest): Promise<T.GetTransferResponse>;
14
+ listTransfers(request: T.ListTransfersRequest): Promise<T.ListTransfersResponse>;
15
+ broadcastTransaction(request: T.BroadcastTransactionRequest): Promise<T.BroadcastTransactionResponse>;
16
+ getTransaction(request: T.GetTransactionRequest): Promise<T.GetTransactionResponse>;
17
+ listTransactions(request: T.ListTransactionsRequest): Promise<T.ListTransactionsResponse>;
18
+ generateSignature(request: T.GenerateSignatureRequest): Promise<T.GenerateSignatureResponse>;
19
+ getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
20
+ listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
21
+ }
@@ -0,0 +1,188 @@
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 createWallet(request) {
11
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
12
+ path: {},
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 getWallet(request) {
23
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
24
+ path: { walletId: request.walletId },
25
+ query: {},
26
+ });
27
+ const response = await (0, fetch_1.simpleFetch)(path, {
28
+ method: 'GET',
29
+ apiOptions: this.apiOptions,
30
+ });
31
+ return response.json();
32
+ }
33
+ async getWalletAssets(request) {
34
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/assets', {
35
+ path: { walletId: request.walletId },
36
+ query: {},
37
+ });
38
+ const response = await (0, fetch_1.simpleFetch)(path, {
39
+ method: 'GET',
40
+ apiOptions: this.apiOptions,
41
+ });
42
+ return response.json();
43
+ }
44
+ async getWalletNfts(request) {
45
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/nfts', {
46
+ path: { walletId: request.walletId },
47
+ query: {},
48
+ });
49
+ const response = await (0, fetch_1.simpleFetch)(path, {
50
+ method: 'GET',
51
+ apiOptions: this.apiOptions,
52
+ });
53
+ return response.json();
54
+ }
55
+ async listWallets(request) {
56
+ var _a;
57
+ const path = (0, url_1.buildPathAndQuery)('/wallets', {
58
+ path: {},
59
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
60
+ });
61
+ const response = await (0, fetch_1.simpleFetch)(path, {
62
+ method: 'GET',
63
+ apiOptions: this.apiOptions,
64
+ });
65
+ return response.json();
66
+ }
67
+ async getWalletHistory(request) {
68
+ var _a;
69
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/history', {
70
+ path: { walletId: request.walletId },
71
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
72
+ });
73
+ const response = await (0, fetch_1.simpleFetch)(path, {
74
+ method: 'GET',
75
+ apiOptions: this.apiOptions,
76
+ });
77
+ return response.json();
78
+ }
79
+ async transferAsset(request) {
80
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
81
+ path: { walletId: request.walletId },
82
+ query: {},
83
+ });
84
+ const response = await (0, fetch_1.userActionFetch)(path, {
85
+ method: 'POST',
86
+ body: request.body,
87
+ apiOptions: this.apiOptions,
88
+ });
89
+ return response.json();
90
+ }
91
+ async getTransfer(request) {
92
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId', {
93
+ path: { walletId: request.walletId, transferId: request.transferId },
94
+ query: {},
95
+ });
96
+ const response = await (0, fetch_1.simpleFetch)(path, {
97
+ method: 'GET',
98
+ apiOptions: this.apiOptions,
99
+ });
100
+ return response.json();
101
+ }
102
+ async listTransfers(request) {
103
+ var _a;
104
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
105
+ path: { walletId: request.walletId },
106
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
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 broadcastTransaction(request) {
115
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
116
+ path: { walletId: request.walletId },
117
+ query: {},
118
+ });
119
+ const response = await (0, fetch_1.userActionFetch)(path, {
120
+ method: 'POST',
121
+ body: request.body,
122
+ apiOptions: this.apiOptions,
123
+ });
124
+ return response.json();
125
+ }
126
+ async getTransaction(request) {
127
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId', {
128
+ path: {
129
+ walletId: request.walletId,
130
+ transactionId: request.transactionId,
131
+ },
132
+ query: {},
133
+ });
134
+ const response = await (0, fetch_1.simpleFetch)(path, {
135
+ method: 'GET',
136
+ apiOptions: this.apiOptions,
137
+ });
138
+ return response.json();
139
+ }
140
+ async listTransactions(request) {
141
+ var _a;
142
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
143
+ path: { walletId: request.walletId },
144
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
145
+ });
146
+ const response = await (0, fetch_1.simpleFetch)(path, {
147
+ method: 'GET',
148
+ apiOptions: this.apiOptions,
149
+ });
150
+ return response.json();
151
+ }
152
+ async generateSignature(request) {
153
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
154
+ path: { walletId: request.walletId },
155
+ query: {},
156
+ });
157
+ const response = await (0, fetch_1.userActionFetch)(path, {
158
+ method: 'POST',
159
+ body: request.body,
160
+ apiOptions: this.apiOptions,
161
+ });
162
+ return response.json();
163
+ }
164
+ async getSignature(request) {
165
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
166
+ path: { walletId: request.walletId, signatureId: request.signatureId },
167
+ query: {},
168
+ });
169
+ const response = await (0, fetch_1.simpleFetch)(path, {
170
+ method: 'GET',
171
+ apiOptions: this.apiOptions,
172
+ });
173
+ return response.json();
174
+ }
175
+ async listSignatures(request) {
176
+ var _a;
177
+ const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
178
+ path: { walletId: request.walletId },
179
+ query: (_a = request.query) !== null && _a !== void 0 ? _a : {},
180
+ });
181
+ const response = await (0, fetch_1.simpleFetch)(path, {
182
+ method: 'GET',
183
+ apiOptions: this.apiOptions,
184
+ });
185
+ return response.json();
186
+ }
187
+ }
188
+ exports.WalletsClient = WalletsClient;
@@ -0,0 +1,3 @@
1
+ export * from './DelegatedWalletsClient';
2
+ export * from './types';
3
+ export * from './WalletsClient';
@@ -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("./DelegatedWalletsClient"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ __exportStar(require("./WalletsClient"), exports);
@@ -0,0 +1,87 @@
1
+ import * as Foundations from '../datamodel/Foundations';
2
+ import * as Wallets from '../datamodel/Wallets';
3
+ export type CreateWalletRequest = {
4
+ body: Wallets.CreateWalletRequest;
5
+ };
6
+ export type CreateWalletResponse = Wallets.Wallet;
7
+ export type GetWalletRequest = {
8
+ walletId: Foundations.EntityId;
9
+ };
10
+ export type GetWalletResponse = Wallets.Wallet;
11
+ export type GetWalletAssetsRequest = {
12
+ walletId: Foundations.EntityId;
13
+ };
14
+ export type GetWalletAssetsResponse = Wallets.WalletAssets;
15
+ export type GetWalletNftsRequest = {
16
+ walletId: Foundations.EntityId;
17
+ };
18
+ export type GetWalletNftsResponse = Wallets.WalletNfts;
19
+ export type ListWalletsRequest = {
20
+ query?: {
21
+ limit?: Foundations.IntegerPositiveStrict;
22
+ paginationToken?: string;
23
+ };
24
+ };
25
+ export type ListWalletsResponse = Wallets.PaginatedWalletList;
26
+ export type GetWalletHistoryRequest = {
27
+ walletId: Foundations.EntityId;
28
+ query?: {
29
+ limit?: Foundations.IntegerPositiveStrict;
30
+ paginationToken?: Foundations.IsoDatetime;
31
+ };
32
+ };
33
+ export type GetWalletHistoryResponse = Wallets.PaginatedEventHistory;
34
+ export type TransferAssetRequest = {
35
+ walletId: Foundations.EntityId;
36
+ body: Wallets.TransferAssetRequest;
37
+ };
38
+ export type TransferAssetResponse = Wallets.TransferRequest;
39
+ export type GetTransferRequest = {
40
+ walletId: Foundations.EntityId;
41
+ transferId: Foundations.EntityId;
42
+ };
43
+ export type GetTransferResponse = Wallets.TransferRequest;
44
+ export type ListTransfersRequest = {
45
+ walletId: Foundations.EntityId;
46
+ query?: {
47
+ limit?: Foundations.IntegerPositiveStrict;
48
+ paginationToken?: string;
49
+ };
50
+ };
51
+ export type ListTransfersResponse = Wallets.PaginatedTransferList;
52
+ export type BroadcastTransactionRequest = {
53
+ walletId: Foundations.EntityId;
54
+ body: Wallets.BroadcastTransactionRequest;
55
+ };
56
+ export type BroadcastTransactionResponse = Wallets.TransactionRequest;
57
+ export type GetTransactionRequest = {
58
+ walletId: Foundations.EntityId;
59
+ transactionId: Foundations.EntityId;
60
+ };
61
+ export type GetTransactionResponse = Wallets.TransactionRequest;
62
+ export type ListTransactionsRequest = {
63
+ walletId: Foundations.EntityId;
64
+ query?: {
65
+ limit?: Foundations.IntegerPositiveStrict;
66
+ paginationToken?: string;
67
+ };
68
+ };
69
+ export type ListTransactionsResponse = Wallets.PaginatedTransactionList;
70
+ export type GenerateSignatureRequest = {
71
+ walletId: Foundations.EntityId;
72
+ body: Wallets.GenerateSignatureRequest;
73
+ };
74
+ export type GenerateSignatureResponse = Wallets.SignatureRequest;
75
+ export type GetSignatureRequest = {
76
+ walletId: Foundations.EntityId;
77
+ signatureId: Foundations.EntityId;
78
+ };
79
+ export type GetSignatureResponse = Wallets.SignatureRequest;
80
+ export type ListSignaturesRequest = {
81
+ walletId: Foundations.EntityId;
82
+ query?: {
83
+ limit?: Foundations.IntegerPositiveStrict;
84
+ paginationToken?: string;
85
+ };
86
+ };
87
+ export type ListSignaturesResponse = Wallets.PaginatedSignatureList;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { DfnsError } from '../Foundations';
2
+ export declare class ApiKeyActionNotAllowed extends DfnsError {
3
+ name: string;
4
+ httpStatus: number;
5
+ errorName: string;
6
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiKeyActionNotAllowed = void 0;
4
+ const Foundations_1 = require("../Foundations");
5
+ class ApiKeyActionNotAllowed extends Foundations_1.DfnsError {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.name = 'ApiKeyActionNotAllowed';
9
+ // FIXME: Missing documentation for httpStatus
10
+ this.httpStatus = 403;
11
+ // FIXME: Missing documentation for errorName
12
+ this.errorName = 'Forbidden';
13
+ }
14
+ }
15
+ exports.ApiKeyActionNotAllowed = ApiKeyActionNotAllowed;
@@ -0,0 +1,3 @@
1
+ export * from './errors';
2
+ export * from './responses';
3
+ export * from './types';
@@ -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("./errors"), exports);
18
+ __exportStar(require("./responses"), exports);
19
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,25 @@
1
+ import { BadRequestError, EntityNotFoundError, ForbiddenError, UnauthorizedError } from '../Foundations';
2
+ import { ApiKeyActionNotAllowed } from './errors';
3
+ import { ApiKeyRecord, ApiKeyRecordWithToken } from './types';
4
+ export type CreateApiKeySuccess = ApiKeyRecordWithToken;
5
+ export type CreateApiKeyError = {
6
+ error: ApiKeyActionNotAllowed | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
7
+ };
8
+ export type CreateApiKeyResponse = CreateApiKeySuccess | CreateApiKeyError;
9
+ export type ListApiKeysSuccess = {
10
+ items: ApiKeyRecord[];
11
+ };
12
+ export type ListApiKeysError = {
13
+ error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
14
+ };
15
+ export type ListApiKeysResponse = ListApiKeysSuccess | ListApiKeysError;
16
+ export type RevokeApiKeySuccess = ApiKeyRecord;
17
+ export type RevokeApiKeyError = {
18
+ error: ApiKeyActionNotAllowed | UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
19
+ };
20
+ export type RevokeApiKeyResponse = RevokeApiKeySuccess | RevokeApiKeyError;
21
+ export type GetApiKeyByIdSuccess = ApiKeyRecord;
22
+ export type GetApiKeyByIdError = {
23
+ error: UnauthorizedError | ForbiddenError | BadRequestError | EntityNotFoundError;
24
+ };
25
+ export type GetApiKeyByIdResponse = GetApiKeyByIdSuccess | GetApiKeyByIdError;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });