@dfns/sdk 0.4.3 → 0.5.0
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.
- package/dfnsApiClient.d.ts +0 -6
- package/dfnsApiClient.js +0 -12
- package/dfnsDelegatedApiClient.d.ts +0 -6
- package/dfnsDelegatedApiClient.js +0 -12
- package/generated/auth/client.d.ts +2 -0
- package/generated/auth/client.js +24 -0
- package/generated/auth/delegatedClient.d.ts +2 -0
- package/generated/auth/delegatedClient.js +24 -0
- package/generated/auth/types.d.ts +66 -12
- package/generated/permissions/types.d.ts +2 -2
- package/generated/policies/types.d.ts +15 -0
- package/generated/wallets/types.d.ts +105 -18
- package/package.json +1 -1
- package/store.d.ts +3 -32
- package/codegen/Assets/AssetsClient.d.ts +0 -13
- package/codegen/Assets/AssetsClient.js +0 -93
- package/codegen/Assets/DelegatedAssetsClient.d.ts +0 -16
- package/codegen/Assets/DelegatedAssetsClient.js +0 -124
- package/codegen/Assets/index.d.ts +0 -3
- package/codegen/Assets/index.js +0 -19
- package/codegen/Assets/types.d.ts +0 -37
- package/codegen/Assets/types.js +0 -2
- package/codegen/Auth/AuthClient.d.ts +0 -50
- package/codegen/Auth/AuthClient.js +0 -518
- package/codegen/Auth/DelegatedAuthClient.d.ts +0 -78
- package/codegen/Auth/DelegatedAuthClient.js +0 -936
- package/codegen/Auth/index.d.ts +0 -3
- package/codegen/Auth/index.js +0 -19
- package/codegen/Auth/types.d.ts +0 -177
- package/codegen/Auth/types.js +0 -2
- package/codegen/Callbacks/CallbacksClient.d.ts +0 -12
- package/codegen/Callbacks/CallbacksClient.js +0 -78
- package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +0 -15
- package/codegen/Callbacks/DelegatedCallbacksClient.js +0 -110
- package/codegen/Callbacks/index.d.ts +0 -3
- package/codegen/Callbacks/index.js +0 -19
- package/codegen/Callbacks/types.d.ts +0 -23
- package/codegen/Callbacks/types.js +0 -2
- package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +0 -21
- package/codegen/PublicKeys/DelegatedPublicKeysClient.js +0 -189
- package/codegen/PublicKeys/PublicKeysClient.d.ts +0 -16
- package/codegen/PublicKeys/PublicKeysClient.js +0 -128
- package/codegen/PublicKeys/index.d.ts +0 -3
- package/codegen/PublicKeys/index.js +0 -19
- package/codegen/PublicKeys/types.d.ts +0 -51
- package/codegen/PublicKeys/types.js +0 -2
- package/codegen/Wallets/DelegatedWalletsClient.d.ts +0 -32
- package/codegen/Wallets/DelegatedWalletsClient.js +0 -325
- package/codegen/Wallets/WalletsClient.d.ts +0 -24
- package/codegen/Wallets/WalletsClient.js +0 -219
- package/codegen/Wallets/index.d.ts +0 -3
- package/codegen/Wallets/index.js +0 -19
- package/codegen/Wallets/types.d.ts +0 -101
- package/codegen/Wallets/types.js +0 -2
- package/codegen/datamodel/Assets/errors.d.ts +0 -11
- package/codegen/datamodel/Assets/errors.js +0 -17
- package/codegen/datamodel/Assets/index.d.ts +0 -3
- package/codegen/datamodel/Assets/index.js +0 -19
- package/codegen/datamodel/Assets/responses.d.ts +0 -47
- package/codegen/datamodel/Assets/responses.js +0 -2
- package/codegen/datamodel/Assets/types.d.ts +0 -219
- package/codegen/datamodel/Assets/types.js +0 -75
- package/codegen/datamodel/Auth/errors.d.ts +0 -0
- package/codegen/datamodel/Auth/errors.js +0 -1
- package/codegen/datamodel/Auth/index.d.ts +0 -2
- package/codegen/datamodel/Auth/index.js +0 -18
- package/codegen/datamodel/Auth/responses.d.ts +0 -358
- package/codegen/datamodel/Auth/responses.js +0 -2
- package/codegen/datamodel/Auth/types.d.ts +0 -933
- package/codegen/datamodel/Auth/types.js +0 -149
- package/codegen/datamodel/Callbacks/errors.d.ts +0 -0
- package/codegen/datamodel/Callbacks/errors.js +0 -1
- package/codegen/datamodel/Callbacks/index.d.ts +0 -2
- package/codegen/datamodel/Callbacks/index.js +0 -18
- package/codegen/datamodel/Callbacks/responses.d.ts +0 -36
- package/codegen/datamodel/Callbacks/responses.js +0 -2
- package/codegen/datamodel/Callbacks/types.d.ts +0 -43
- package/codegen/datamodel/Callbacks/types.js +0 -39
- package/codegen/datamodel/Foundations/errors.d.ts +0 -131
- package/codegen/datamodel/Foundations/errors.js +0 -182
- package/codegen/datamodel/Foundations/index.d.ts +0 -2
- package/codegen/datamodel/Foundations/index.js +0 -18
- package/codegen/datamodel/Foundations/responses.d.ts +0 -0
- package/codegen/datamodel/Foundations/responses.js +0 -1
- package/codegen/datamodel/Foundations/types.d.ts +0 -9795
- package/codegen/datamodel/Foundations/types.js +0 -57763
- package/codegen/datamodel/PublicKeys/errors.d.ts +0 -0
- package/codegen/datamodel/PublicKeys/errors.js +0 -1
- package/codegen/datamodel/PublicKeys/index.d.ts +0 -2
- package/codegen/datamodel/PublicKeys/index.js +0 -18
- package/codegen/datamodel/PublicKeys/responses.d.ts +0 -56
- package/codegen/datamodel/PublicKeys/responses.js +0 -2
- package/codegen/datamodel/PublicKeys/types.d.ts +0 -223
- package/codegen/datamodel/PublicKeys/types.js +0 -59
- package/codegen/datamodel/Wallets/errors.d.ts +0 -0
- package/codegen/datamodel/Wallets/errors.js +0 -1
- package/codegen/datamodel/Wallets/index.d.ts +0 -2
- package/codegen/datamodel/Wallets/index.js +0 -18
- package/codegen/datamodel/Wallets/responses.d.ts +0 -92
- package/codegen/datamodel/Wallets/responses.js +0 -2
- package/codegen/datamodel/Wallets/types.d.ts +0 -790
- package/codegen/datamodel/Wallets/types.js +0 -293
|
@@ -1,325 +0,0 @@
|
|
|
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
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets', {
|
|
73
|
-
path: {},
|
|
74
|
-
query: request.query ?? {},
|
|
75
|
-
});
|
|
76
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
77
|
-
method: 'GET',
|
|
78
|
-
apiOptions: this.apiOptions,
|
|
79
|
-
});
|
|
80
|
-
return response.json();
|
|
81
|
-
}
|
|
82
|
-
async getWalletHistory(request) {
|
|
83
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/history', {
|
|
84
|
-
path: { walletId: request.walletId },
|
|
85
|
-
query: request.query ?? {},
|
|
86
|
-
});
|
|
87
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
88
|
-
method: 'GET',
|
|
89
|
-
apiOptions: this.apiOptions,
|
|
90
|
-
});
|
|
91
|
-
return response.json();
|
|
92
|
-
}
|
|
93
|
-
async transferAssetInit(request) {
|
|
94
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
95
|
-
path: { walletId: request.walletId },
|
|
96
|
-
query: {},
|
|
97
|
-
});
|
|
98
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
99
|
-
userActionHttpMethod: 'POST',
|
|
100
|
-
userActionHttpPath: path,
|
|
101
|
-
userActionPayload: JSON.stringify(request.body),
|
|
102
|
-
userActionServerKind: 'Api',
|
|
103
|
-
}, this.apiOptions);
|
|
104
|
-
return challenge;
|
|
105
|
-
}
|
|
106
|
-
async transferAssetComplete(request, signedChallenge) {
|
|
107
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
108
|
-
path: { walletId: request.walletId },
|
|
109
|
-
query: {},
|
|
110
|
-
});
|
|
111
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
112
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
113
|
-
method: 'POST',
|
|
114
|
-
body: request.body,
|
|
115
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
116
|
-
apiOptions: this.apiOptions,
|
|
117
|
-
});
|
|
118
|
-
return response.json();
|
|
119
|
-
}
|
|
120
|
-
async getTransfer(request) {
|
|
121
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId', {
|
|
122
|
-
path: { walletId: request.walletId, transferId: request.transferId },
|
|
123
|
-
query: {},
|
|
124
|
-
});
|
|
125
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
126
|
-
method: 'GET',
|
|
127
|
-
apiOptions: this.apiOptions,
|
|
128
|
-
});
|
|
129
|
-
return response.json();
|
|
130
|
-
}
|
|
131
|
-
async listTransfers(request) {
|
|
132
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
133
|
-
path: { walletId: request.walletId },
|
|
134
|
-
query: request.query ?? {},
|
|
135
|
-
});
|
|
136
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
137
|
-
method: 'GET',
|
|
138
|
-
apiOptions: this.apiOptions,
|
|
139
|
-
});
|
|
140
|
-
return response.json();
|
|
141
|
-
}
|
|
142
|
-
async broadcastTransactionInit(request) {
|
|
143
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
144
|
-
path: { walletId: request.walletId },
|
|
145
|
-
query: {},
|
|
146
|
-
});
|
|
147
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
148
|
-
userActionHttpMethod: 'POST',
|
|
149
|
-
userActionHttpPath: path,
|
|
150
|
-
userActionPayload: JSON.stringify(request.body),
|
|
151
|
-
userActionServerKind: 'Api',
|
|
152
|
-
}, this.apiOptions);
|
|
153
|
-
return challenge;
|
|
154
|
-
}
|
|
155
|
-
async broadcastTransactionComplete(request, signedChallenge) {
|
|
156
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
157
|
-
path: { walletId: request.walletId },
|
|
158
|
-
query: {},
|
|
159
|
-
});
|
|
160
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
161
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
162
|
-
method: 'POST',
|
|
163
|
-
body: request.body,
|
|
164
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
165
|
-
apiOptions: this.apiOptions,
|
|
166
|
-
});
|
|
167
|
-
return response.json();
|
|
168
|
-
}
|
|
169
|
-
async getTransaction(request) {
|
|
170
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId', {
|
|
171
|
-
path: {
|
|
172
|
-
walletId: request.walletId,
|
|
173
|
-
transactionId: request.transactionId,
|
|
174
|
-
},
|
|
175
|
-
query: {},
|
|
176
|
-
});
|
|
177
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
178
|
-
method: 'GET',
|
|
179
|
-
apiOptions: this.apiOptions,
|
|
180
|
-
});
|
|
181
|
-
return response.json();
|
|
182
|
-
}
|
|
183
|
-
async listTransactions(request) {
|
|
184
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
185
|
-
path: { walletId: request.walletId },
|
|
186
|
-
query: request.query ?? {},
|
|
187
|
-
});
|
|
188
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
189
|
-
method: 'GET',
|
|
190
|
-
apiOptions: this.apiOptions,
|
|
191
|
-
});
|
|
192
|
-
return response.json();
|
|
193
|
-
}
|
|
194
|
-
async generateSignatureInit(request) {
|
|
195
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
196
|
-
path: { walletId: request.walletId },
|
|
197
|
-
query: {},
|
|
198
|
-
});
|
|
199
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
200
|
-
userActionHttpMethod: 'POST',
|
|
201
|
-
userActionHttpPath: path,
|
|
202
|
-
userActionPayload: JSON.stringify(request.body),
|
|
203
|
-
userActionServerKind: 'Api',
|
|
204
|
-
}, this.apiOptions);
|
|
205
|
-
return challenge;
|
|
206
|
-
}
|
|
207
|
-
async generateSignatureComplete(request, signedChallenge) {
|
|
208
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
209
|
-
path: { walletId: request.walletId },
|
|
210
|
-
query: {},
|
|
211
|
-
});
|
|
212
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
213
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
214
|
-
method: 'POST',
|
|
215
|
-
body: request.body,
|
|
216
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
217
|
-
apiOptions: this.apiOptions,
|
|
218
|
-
});
|
|
219
|
-
return response.json();
|
|
220
|
-
}
|
|
221
|
-
async getSignature(request) {
|
|
222
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
|
|
223
|
-
path: { walletId: request.walletId, signatureId: request.signatureId },
|
|
224
|
-
query: {},
|
|
225
|
-
});
|
|
226
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
227
|
-
method: 'GET',
|
|
228
|
-
apiOptions: this.apiOptions,
|
|
229
|
-
});
|
|
230
|
-
return response.json();
|
|
231
|
-
}
|
|
232
|
-
async listSignatures(request) {
|
|
233
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
234
|
-
path: { walletId: request.walletId },
|
|
235
|
-
query: request.query ?? {},
|
|
236
|
-
});
|
|
237
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
238
|
-
method: 'GET',
|
|
239
|
-
apiOptions: this.apiOptions,
|
|
240
|
-
});
|
|
241
|
-
return response.json();
|
|
242
|
-
}
|
|
243
|
-
async importWalletInit(request) {
|
|
244
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
245
|
-
path: {},
|
|
246
|
-
query: {},
|
|
247
|
-
});
|
|
248
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
249
|
-
userActionHttpMethod: 'POST',
|
|
250
|
-
userActionHttpPath: path,
|
|
251
|
-
userActionPayload: JSON.stringify(request.body),
|
|
252
|
-
userActionServerKind: 'Api',
|
|
253
|
-
}, this.apiOptions);
|
|
254
|
-
return challenge;
|
|
255
|
-
}
|
|
256
|
-
async importWalletComplete(request, signedChallenge) {
|
|
257
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
258
|
-
path: {},
|
|
259
|
-
query: {},
|
|
260
|
-
});
|
|
261
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
262
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
263
|
-
method: 'POST',
|
|
264
|
-
body: request.body,
|
|
265
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
266
|
-
apiOptions: this.apiOptions,
|
|
267
|
-
});
|
|
268
|
-
return response.json();
|
|
269
|
-
}
|
|
270
|
-
async exportWalletInit(request) {
|
|
271
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/export', {
|
|
272
|
-
path: { walletId: request.walletId },
|
|
273
|
-
query: {},
|
|
274
|
-
});
|
|
275
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
276
|
-
userActionHttpMethod: 'POST',
|
|
277
|
-
userActionHttpPath: path,
|
|
278
|
-
userActionPayload: JSON.stringify(request.body),
|
|
279
|
-
userActionServerKind: 'Api',
|
|
280
|
-
}, this.apiOptions);
|
|
281
|
-
return challenge;
|
|
282
|
-
}
|
|
283
|
-
async exportWalletComplete(request, signedChallenge) {
|
|
284
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/export', {
|
|
285
|
-
path: { walletId: request.walletId },
|
|
286
|
-
query: {},
|
|
287
|
-
});
|
|
288
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
289
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
290
|
-
method: 'POST',
|
|
291
|
-
body: request.body,
|
|
292
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
293
|
-
apiOptions: this.apiOptions,
|
|
294
|
-
});
|
|
295
|
-
return response.json();
|
|
296
|
-
}
|
|
297
|
-
async delegateWalletInit(request) {
|
|
298
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/delegate', {
|
|
299
|
-
path: { walletId: request.walletId },
|
|
300
|
-
query: {},
|
|
301
|
-
});
|
|
302
|
-
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
303
|
-
userActionHttpMethod: 'POST',
|
|
304
|
-
userActionHttpPath: path,
|
|
305
|
-
userActionPayload: JSON.stringify(request.body),
|
|
306
|
-
userActionServerKind: 'Api',
|
|
307
|
-
}, this.apiOptions);
|
|
308
|
-
return challenge;
|
|
309
|
-
}
|
|
310
|
-
async delegateWalletComplete(request, signedChallenge) {
|
|
311
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/delegate', {
|
|
312
|
-
path: { walletId: request.walletId },
|
|
313
|
-
query: {},
|
|
314
|
-
});
|
|
315
|
-
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
316
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
317
|
-
method: 'POST',
|
|
318
|
-
body: request.body,
|
|
319
|
-
headers: { 'x-dfns-useraction': userAction },
|
|
320
|
-
apiOptions: this.apiOptions,
|
|
321
|
-
});
|
|
322
|
-
return response.json();
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
exports.DelegatedWalletsClient = DelegatedWalletsClient;
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
importWallet(request: T.ImportWalletRequest): Promise<T.ImportWalletResponse>;
|
|
22
|
-
exportWallet(request: T.ExportWalletRequest): Promise<T.ExportWalletResponse>;
|
|
23
|
-
delegateWallet(request: T.DelegateWalletRequest): Promise<T.DelegateWalletResponse>;
|
|
24
|
-
}
|
|
@@ -1,219 +0,0 @@
|
|
|
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
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets', {
|
|
57
|
-
path: {},
|
|
58
|
-
query: request.query ?? {},
|
|
59
|
-
});
|
|
60
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
61
|
-
method: 'GET',
|
|
62
|
-
apiOptions: this.apiOptions,
|
|
63
|
-
});
|
|
64
|
-
return response.json();
|
|
65
|
-
}
|
|
66
|
-
async getWalletHistory(request) {
|
|
67
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/history', {
|
|
68
|
-
path: { walletId: request.walletId },
|
|
69
|
-
query: request.query ?? {},
|
|
70
|
-
});
|
|
71
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
72
|
-
method: 'GET',
|
|
73
|
-
apiOptions: this.apiOptions,
|
|
74
|
-
});
|
|
75
|
-
return response.json();
|
|
76
|
-
}
|
|
77
|
-
async transferAsset(request) {
|
|
78
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
79
|
-
path: { walletId: request.walletId },
|
|
80
|
-
query: {},
|
|
81
|
-
});
|
|
82
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
83
|
-
method: 'POST',
|
|
84
|
-
body: request.body,
|
|
85
|
-
apiOptions: this.apiOptions,
|
|
86
|
-
});
|
|
87
|
-
return response.json();
|
|
88
|
-
}
|
|
89
|
-
async getTransfer(request) {
|
|
90
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId', {
|
|
91
|
-
path: { walletId: request.walletId, transferId: request.transferId },
|
|
92
|
-
query: {},
|
|
93
|
-
});
|
|
94
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
95
|
-
method: 'GET',
|
|
96
|
-
apiOptions: this.apiOptions,
|
|
97
|
-
});
|
|
98
|
-
return response.json();
|
|
99
|
-
}
|
|
100
|
-
async listTransfers(request) {
|
|
101
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
102
|
-
path: { walletId: request.walletId },
|
|
103
|
-
query: request.query ?? {},
|
|
104
|
-
});
|
|
105
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
106
|
-
method: 'GET',
|
|
107
|
-
apiOptions: this.apiOptions,
|
|
108
|
-
});
|
|
109
|
-
return response.json();
|
|
110
|
-
}
|
|
111
|
-
async broadcastTransaction(request) {
|
|
112
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
113
|
-
path: { walletId: request.walletId },
|
|
114
|
-
query: {},
|
|
115
|
-
});
|
|
116
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
117
|
-
method: 'POST',
|
|
118
|
-
body: request.body,
|
|
119
|
-
apiOptions: this.apiOptions,
|
|
120
|
-
});
|
|
121
|
-
return response.json();
|
|
122
|
-
}
|
|
123
|
-
async getTransaction(request) {
|
|
124
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId', {
|
|
125
|
-
path: {
|
|
126
|
-
walletId: request.walletId,
|
|
127
|
-
transactionId: request.transactionId,
|
|
128
|
-
},
|
|
129
|
-
query: {},
|
|
130
|
-
});
|
|
131
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
132
|
-
method: 'GET',
|
|
133
|
-
apiOptions: this.apiOptions,
|
|
134
|
-
});
|
|
135
|
-
return response.json();
|
|
136
|
-
}
|
|
137
|
-
async listTransactions(request) {
|
|
138
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
139
|
-
path: { walletId: request.walletId },
|
|
140
|
-
query: request.query ?? {},
|
|
141
|
-
});
|
|
142
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
143
|
-
method: 'GET',
|
|
144
|
-
apiOptions: this.apiOptions,
|
|
145
|
-
});
|
|
146
|
-
return response.json();
|
|
147
|
-
}
|
|
148
|
-
async generateSignature(request) {
|
|
149
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
150
|
-
path: { walletId: request.walletId },
|
|
151
|
-
query: {},
|
|
152
|
-
});
|
|
153
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
154
|
-
method: 'POST',
|
|
155
|
-
body: request.body,
|
|
156
|
-
apiOptions: this.apiOptions,
|
|
157
|
-
});
|
|
158
|
-
return response.json();
|
|
159
|
-
}
|
|
160
|
-
async getSignature(request) {
|
|
161
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
|
|
162
|
-
path: { walletId: request.walletId, signatureId: request.signatureId },
|
|
163
|
-
query: {},
|
|
164
|
-
});
|
|
165
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
166
|
-
method: 'GET',
|
|
167
|
-
apiOptions: this.apiOptions,
|
|
168
|
-
});
|
|
169
|
-
return response.json();
|
|
170
|
-
}
|
|
171
|
-
async listSignatures(request) {
|
|
172
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
173
|
-
path: { walletId: request.walletId },
|
|
174
|
-
query: request.query ?? {},
|
|
175
|
-
});
|
|
176
|
-
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
177
|
-
method: 'GET',
|
|
178
|
-
apiOptions: this.apiOptions,
|
|
179
|
-
});
|
|
180
|
-
return response.json();
|
|
181
|
-
}
|
|
182
|
-
async importWallet(request) {
|
|
183
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
184
|
-
path: {},
|
|
185
|
-
query: {},
|
|
186
|
-
});
|
|
187
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
188
|
-
method: 'POST',
|
|
189
|
-
body: request.body,
|
|
190
|
-
apiOptions: this.apiOptions,
|
|
191
|
-
});
|
|
192
|
-
return response.json();
|
|
193
|
-
}
|
|
194
|
-
async exportWallet(request) {
|
|
195
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/export', {
|
|
196
|
-
path: { walletId: request.walletId },
|
|
197
|
-
query: {},
|
|
198
|
-
});
|
|
199
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
200
|
-
method: 'POST',
|
|
201
|
-
body: request.body,
|
|
202
|
-
apiOptions: this.apiOptions,
|
|
203
|
-
});
|
|
204
|
-
return response.json();
|
|
205
|
-
}
|
|
206
|
-
async delegateWallet(request) {
|
|
207
|
-
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/delegate', {
|
|
208
|
-
path: { walletId: request.walletId },
|
|
209
|
-
query: {},
|
|
210
|
-
});
|
|
211
|
-
const response = await (0, fetch_1.userActionFetch)(path, {
|
|
212
|
-
method: 'POST',
|
|
213
|
-
body: request.body,
|
|
214
|
-
apiOptions: this.apiOptions,
|
|
215
|
-
});
|
|
216
|
-
return response.json();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
exports.WalletsClient = WalletsClient;
|
package/codegen/Wallets/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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);
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import * as Foundations from '../datamodel/Foundations';
|
|
2
|
-
import * as Wallets from '../datamodel/Wallets';
|
|
3
|
-
export type CreateWalletRequest = {
|
|
4
|
-
body: Wallets.CreateWalletBody;
|
|
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.TransferAssetBody;
|
|
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.BroadcastTransactionBody;
|
|
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.GenerateSignatureBody;
|
|
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;
|
|
88
|
-
export type ImportWalletRequest = {
|
|
89
|
-
body: Wallets.ImportWalletBody;
|
|
90
|
-
};
|
|
91
|
-
export type ImportWalletResponse = Wallets.Wallet;
|
|
92
|
-
export type ExportWalletRequest = {
|
|
93
|
-
walletId: Foundations.EntityId;
|
|
94
|
-
body: Wallets.ExportWalletBody;
|
|
95
|
-
};
|
|
96
|
-
export type ExportWalletResponse = Wallets.ExportedSigningKey;
|
|
97
|
-
export type DelegateWalletRequest = {
|
|
98
|
-
walletId: Foundations.EntityId;
|
|
99
|
-
body: Wallets.DelegateWalletBody;
|
|
100
|
-
};
|
|
101
|
-
export type DelegateWalletResponse = Wallets.DelegateWalletResult;
|