@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.
- package/codegen/datamodel/ApiKeys/types.js +1 -1
- package/codegen/datamodel/Assets/types.js +7 -7
- package/codegen/datamodel/Auth/types.js +11 -11
- package/codegen/datamodel/Blockchains/types.js +6 -6
- package/codegen/datamodel/Callbacks/types.js +3 -3
- package/codegen/datamodel/Foundations/types.d.ts +3 -0
- package/codegen/datamodel/Foundations/types.js +8 -6
- package/codegen/datamodel/Orgs/types.js +3 -3
- package/codegen/datamodel/Permissions/types.js +4 -4
- package/codegen/datamodel/PolicyExecution/types.js +1 -1
- package/codegen/datamodel/PolicyManagement/types.d.ts +3 -23
- package/codegen/datamodel/PolicyManagement/types.js +8 -24
- package/codegen/datamodel/PublicKeys/types.js +4 -4
- package/codegen/datamodel/Signers/types.d.ts +9 -0
- package/codegen/datamodel/Wallets/types.d.ts +235 -9
- package/codegen/datamodel/Wallets/types.js +81 -33
- package/dfnsApiClient.d.ts +2 -2
- package/dfnsApiClient.js +4 -4
- package/dfnsDelegatedApiClient.d.ts +2 -2
- package/dfnsDelegatedApiClient.js +4 -4
- package/generated/signers/client.d.ts +7 -0
- package/generated/signers/client.js +22 -0
- package/generated/signers/delegatedClient.d.ts +7 -0
- package/generated/signers/delegatedClient.js +22 -0
- package/generated/signers/index.d.ts +3 -0
- package/generated/signers/index.js +19 -0
- package/generated/signers/types.d.ts +9 -0
- package/generated/signers/types.js +2 -0
- package/generated/wallets/client.d.ts +25 -0
- package/generated/wallets/client.js +228 -0
- package/generated/wallets/delegatedClient.d.ts +34 -0
- package/generated/wallets/delegatedClient.js +349 -0
- package/generated/wallets/index.d.ts +3 -0
- package/generated/wallets/index.js +19 -0
- package/generated/wallets/types.d.ts +1011 -0
- package/generated/wallets/types.js +2 -0
- package/package.json +1 -1
- package/types/signers.d.ts +1 -0
- package/types/signers.js +17 -0
- package/types/wallets.d.ts +1 -0
- package/types/wallets.js +17 -0
- package/types/webhooks.d.ts +1 -0
- package/types/webhooks.js +17 -0
- package/utils/fetch.js +2 -2
- package/utils/index.d.ts +4 -0
- package/utils/index.js +20 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SignUserActionChallengeRequest, UserActionChallengeResponse } from '../../baseAuthApi';
|
|
2
|
+
import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient';
|
|
3
|
+
import * as T from './types';
|
|
4
|
+
export declare class DelegatedWalletsClient {
|
|
5
|
+
private apiOptions;
|
|
6
|
+
constructor(apiOptions: DfnsDelegatedApiClientOptions);
|
|
7
|
+
broadcastTransactionInit(request: T.BroadcastTransactionRequest): Promise<UserActionChallengeResponse>;
|
|
8
|
+
broadcastTransactionComplete(request: T.BroadcastTransactionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.BroadcastTransactionResponse>;
|
|
9
|
+
createWalletInit(request: T.CreateWalletRequest): Promise<UserActionChallengeResponse>;
|
|
10
|
+
createWalletComplete(request: T.CreateWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateWalletResponse>;
|
|
11
|
+
delegateWalletInit(request: T.DelegateWalletRequest): Promise<UserActionChallengeResponse>;
|
|
12
|
+
delegateWalletComplete(request: T.DelegateWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.DelegateWalletResponse>;
|
|
13
|
+
exportWalletInit(request: T.ExportWalletRequest): Promise<UserActionChallengeResponse>;
|
|
14
|
+
exportWalletComplete(request: T.ExportWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ExportWalletResponse>;
|
|
15
|
+
generateSignatureInit(request: T.GenerateSignatureRequest): Promise<UserActionChallengeResponse>;
|
|
16
|
+
generateSignatureComplete(request: T.GenerateSignatureRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.GenerateSignatureResponse>;
|
|
17
|
+
getSignature(request: T.GetSignatureRequest): Promise<T.GetSignatureResponse>;
|
|
18
|
+
getTransaction(request: T.GetTransactionRequest): Promise<T.GetTransactionResponse>;
|
|
19
|
+
getTransfer(request: T.GetTransferRequest): Promise<T.GetTransferResponse>;
|
|
20
|
+
getWallet(request: T.GetWalletRequest): Promise<T.GetWalletResponse>;
|
|
21
|
+
getWalletAssets(request: T.GetWalletAssetsRequest): Promise<T.GetWalletAssetsResponse>;
|
|
22
|
+
getWalletHistory(request: T.GetWalletHistoryRequest): Promise<T.GetWalletHistoryResponse>;
|
|
23
|
+
getWalletNfts(request: T.GetWalletNftsRequest): Promise<T.GetWalletNftsResponse>;
|
|
24
|
+
importWalletInit(request: T.ImportWalletRequest): Promise<UserActionChallengeResponse>;
|
|
25
|
+
importWalletComplete(request: T.ImportWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.ImportWalletResponse>;
|
|
26
|
+
listSignatures(request: T.ListSignaturesRequest): Promise<T.ListSignaturesResponse>;
|
|
27
|
+
listTransactions(request: T.ListTransactionsRequest): Promise<T.ListTransactionsResponse>;
|
|
28
|
+
listTransfers(request: T.ListTransfersRequest): Promise<T.ListTransfersResponse>;
|
|
29
|
+
listWallets(request?: T.ListWalletsRequest): Promise<T.ListWalletsResponse>;
|
|
30
|
+
transferAssetInit(request: T.TransferAssetRequest): Promise<UserActionChallengeResponse>;
|
|
31
|
+
transferAssetComplete(request: T.TransferAssetRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.TransferAssetResponse>;
|
|
32
|
+
updateWalletInit(request: T.UpdateWalletRequest): Promise<UserActionChallengeResponse>;
|
|
33
|
+
updateWalletComplete(request: T.UpdateWalletRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.UpdateWalletResponse>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
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 broadcastTransactionInit(request) {
|
|
12
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
13
|
+
path: request ?? {},
|
|
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 broadcastTransactionComplete(request, signedChallenge) {
|
|
25
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
26
|
+
path: request ?? {},
|
|
27
|
+
query: {},
|
|
28
|
+
});
|
|
29
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
30
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
body: request.body,
|
|
33
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
34
|
+
apiOptions: this.apiOptions,
|
|
35
|
+
});
|
|
36
|
+
return response.json();
|
|
37
|
+
}
|
|
38
|
+
async createWalletInit(request) {
|
|
39
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets', {
|
|
40
|
+
path: request ?? {},
|
|
41
|
+
query: {},
|
|
42
|
+
});
|
|
43
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
44
|
+
userActionHttpMethod: 'POST',
|
|
45
|
+
userActionHttpPath: path,
|
|
46
|
+
userActionPayload: JSON.stringify(request.body),
|
|
47
|
+
userActionServerKind: 'Api',
|
|
48
|
+
}, this.apiOptions);
|
|
49
|
+
return challenge;
|
|
50
|
+
}
|
|
51
|
+
async createWalletComplete(request, signedChallenge) {
|
|
52
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets', {
|
|
53
|
+
path: request ?? {},
|
|
54
|
+
query: {},
|
|
55
|
+
});
|
|
56
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
57
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
58
|
+
method: 'POST',
|
|
59
|
+
body: request.body,
|
|
60
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
61
|
+
apiOptions: this.apiOptions,
|
|
62
|
+
});
|
|
63
|
+
return response.json();
|
|
64
|
+
}
|
|
65
|
+
async delegateWalletInit(request) {
|
|
66
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/delegate', {
|
|
67
|
+
path: request ?? {},
|
|
68
|
+
query: {},
|
|
69
|
+
});
|
|
70
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
71
|
+
userActionHttpMethod: 'POST',
|
|
72
|
+
userActionHttpPath: path,
|
|
73
|
+
userActionPayload: JSON.stringify(request.body),
|
|
74
|
+
userActionServerKind: 'Api',
|
|
75
|
+
}, this.apiOptions);
|
|
76
|
+
return challenge;
|
|
77
|
+
}
|
|
78
|
+
async delegateWalletComplete(request, signedChallenge) {
|
|
79
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/delegate', {
|
|
80
|
+
path: request ?? {},
|
|
81
|
+
query: {},
|
|
82
|
+
});
|
|
83
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
84
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
85
|
+
method: 'POST',
|
|
86
|
+
body: request.body,
|
|
87
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
88
|
+
apiOptions: this.apiOptions,
|
|
89
|
+
});
|
|
90
|
+
return response.json();
|
|
91
|
+
}
|
|
92
|
+
async exportWalletInit(request) {
|
|
93
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/export', {
|
|
94
|
+
path: request ?? {},
|
|
95
|
+
query: {},
|
|
96
|
+
});
|
|
97
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
98
|
+
userActionHttpMethod: 'POST',
|
|
99
|
+
userActionHttpPath: path,
|
|
100
|
+
userActionPayload: JSON.stringify(request.body),
|
|
101
|
+
userActionServerKind: 'Api',
|
|
102
|
+
}, this.apiOptions);
|
|
103
|
+
return challenge;
|
|
104
|
+
}
|
|
105
|
+
async exportWalletComplete(request, signedChallenge) {
|
|
106
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/export', {
|
|
107
|
+
path: request ?? {},
|
|
108
|
+
query: {},
|
|
109
|
+
});
|
|
110
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
111
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
112
|
+
method: 'POST',
|
|
113
|
+
body: request.body,
|
|
114
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
115
|
+
apiOptions: this.apiOptions,
|
|
116
|
+
});
|
|
117
|
+
return response.json();
|
|
118
|
+
}
|
|
119
|
+
async generateSignatureInit(request) {
|
|
120
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
121
|
+
path: request ?? {},
|
|
122
|
+
query: {},
|
|
123
|
+
});
|
|
124
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
125
|
+
userActionHttpMethod: 'POST',
|
|
126
|
+
userActionHttpPath: path,
|
|
127
|
+
userActionPayload: JSON.stringify(request.body),
|
|
128
|
+
userActionServerKind: 'Api',
|
|
129
|
+
}, this.apiOptions);
|
|
130
|
+
return challenge;
|
|
131
|
+
}
|
|
132
|
+
async generateSignatureComplete(request, signedChallenge) {
|
|
133
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
134
|
+
path: request ?? {},
|
|
135
|
+
query: {},
|
|
136
|
+
});
|
|
137
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
138
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
139
|
+
method: 'POST',
|
|
140
|
+
body: request.body,
|
|
141
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
142
|
+
apiOptions: this.apiOptions,
|
|
143
|
+
});
|
|
144
|
+
return response.json();
|
|
145
|
+
}
|
|
146
|
+
async getSignature(request) {
|
|
147
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures/:signatureId', {
|
|
148
|
+
path: request ?? {},
|
|
149
|
+
query: {},
|
|
150
|
+
});
|
|
151
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
152
|
+
method: 'GET',
|
|
153
|
+
apiOptions: this.apiOptions,
|
|
154
|
+
});
|
|
155
|
+
return response.json();
|
|
156
|
+
}
|
|
157
|
+
async getTransaction(request) {
|
|
158
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions/:transactionId', {
|
|
159
|
+
path: request ?? {},
|
|
160
|
+
query: {},
|
|
161
|
+
});
|
|
162
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
163
|
+
method: 'GET',
|
|
164
|
+
apiOptions: this.apiOptions,
|
|
165
|
+
});
|
|
166
|
+
return response.json();
|
|
167
|
+
}
|
|
168
|
+
async getTransfer(request) {
|
|
169
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers/:transferId', {
|
|
170
|
+
path: request ?? {},
|
|
171
|
+
query: {},
|
|
172
|
+
});
|
|
173
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
174
|
+
method: 'GET',
|
|
175
|
+
apiOptions: this.apiOptions,
|
|
176
|
+
});
|
|
177
|
+
return response.json();
|
|
178
|
+
}
|
|
179
|
+
async getWallet(request) {
|
|
180
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
|
|
181
|
+
path: request ?? {},
|
|
182
|
+
query: {},
|
|
183
|
+
});
|
|
184
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
185
|
+
method: 'GET',
|
|
186
|
+
apiOptions: this.apiOptions,
|
|
187
|
+
});
|
|
188
|
+
return response.json();
|
|
189
|
+
}
|
|
190
|
+
async getWalletAssets(request) {
|
|
191
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/assets', {
|
|
192
|
+
path: request ?? {},
|
|
193
|
+
query: {},
|
|
194
|
+
});
|
|
195
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
196
|
+
method: 'GET',
|
|
197
|
+
apiOptions: this.apiOptions,
|
|
198
|
+
});
|
|
199
|
+
return response.json();
|
|
200
|
+
}
|
|
201
|
+
async getWalletHistory(request) {
|
|
202
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/history', {
|
|
203
|
+
path: request ?? {},
|
|
204
|
+
query: request.query ?? {},
|
|
205
|
+
});
|
|
206
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
207
|
+
method: 'GET',
|
|
208
|
+
apiOptions: this.apiOptions,
|
|
209
|
+
});
|
|
210
|
+
return response.json();
|
|
211
|
+
}
|
|
212
|
+
async getWalletNfts(request) {
|
|
213
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/nfts', {
|
|
214
|
+
path: request ?? {},
|
|
215
|
+
query: {},
|
|
216
|
+
});
|
|
217
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
218
|
+
method: 'GET',
|
|
219
|
+
apiOptions: this.apiOptions,
|
|
220
|
+
});
|
|
221
|
+
return response.json();
|
|
222
|
+
}
|
|
223
|
+
async importWalletInit(request) {
|
|
224
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
225
|
+
path: request ?? {},
|
|
226
|
+
query: {},
|
|
227
|
+
});
|
|
228
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
229
|
+
userActionHttpMethod: 'POST',
|
|
230
|
+
userActionHttpPath: path,
|
|
231
|
+
userActionPayload: JSON.stringify(request.body),
|
|
232
|
+
userActionServerKind: 'Api',
|
|
233
|
+
}, this.apiOptions);
|
|
234
|
+
return challenge;
|
|
235
|
+
}
|
|
236
|
+
async importWalletComplete(request, signedChallenge) {
|
|
237
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/import', {
|
|
238
|
+
path: request ?? {},
|
|
239
|
+
query: {},
|
|
240
|
+
});
|
|
241
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
242
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
243
|
+
method: 'POST',
|
|
244
|
+
body: request.body,
|
|
245
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
246
|
+
apiOptions: this.apiOptions,
|
|
247
|
+
});
|
|
248
|
+
return response.json();
|
|
249
|
+
}
|
|
250
|
+
async listSignatures(request) {
|
|
251
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/signatures', {
|
|
252
|
+
path: request ?? {},
|
|
253
|
+
query: request.query ?? {},
|
|
254
|
+
});
|
|
255
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
256
|
+
method: 'GET',
|
|
257
|
+
apiOptions: this.apiOptions,
|
|
258
|
+
});
|
|
259
|
+
return response.json();
|
|
260
|
+
}
|
|
261
|
+
async listTransactions(request) {
|
|
262
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transactions', {
|
|
263
|
+
path: request ?? {},
|
|
264
|
+
query: request.query ?? {},
|
|
265
|
+
});
|
|
266
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
267
|
+
method: 'GET',
|
|
268
|
+
apiOptions: this.apiOptions,
|
|
269
|
+
});
|
|
270
|
+
return response.json();
|
|
271
|
+
}
|
|
272
|
+
async listTransfers(request) {
|
|
273
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
274
|
+
path: request ?? {},
|
|
275
|
+
query: request.query ?? {},
|
|
276
|
+
});
|
|
277
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
278
|
+
method: 'GET',
|
|
279
|
+
apiOptions: this.apiOptions,
|
|
280
|
+
});
|
|
281
|
+
return response.json();
|
|
282
|
+
}
|
|
283
|
+
async listWallets(request) {
|
|
284
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets', {
|
|
285
|
+
path: request ?? {},
|
|
286
|
+
query: request?.query ?? {},
|
|
287
|
+
});
|
|
288
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
289
|
+
method: 'GET',
|
|
290
|
+
apiOptions: this.apiOptions,
|
|
291
|
+
});
|
|
292
|
+
return response.json();
|
|
293
|
+
}
|
|
294
|
+
async transferAssetInit(request) {
|
|
295
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
296
|
+
path: request ?? {},
|
|
297
|
+
query: {},
|
|
298
|
+
});
|
|
299
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
300
|
+
userActionHttpMethod: 'POST',
|
|
301
|
+
userActionHttpPath: path,
|
|
302
|
+
userActionPayload: JSON.stringify(request.body),
|
|
303
|
+
userActionServerKind: 'Api',
|
|
304
|
+
}, this.apiOptions);
|
|
305
|
+
return challenge;
|
|
306
|
+
}
|
|
307
|
+
async transferAssetComplete(request, signedChallenge) {
|
|
308
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId/transfers', {
|
|
309
|
+
path: request ?? {},
|
|
310
|
+
query: {},
|
|
311
|
+
});
|
|
312
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
313
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
314
|
+
method: 'POST',
|
|
315
|
+
body: request.body,
|
|
316
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
317
|
+
apiOptions: this.apiOptions,
|
|
318
|
+
});
|
|
319
|
+
return response.json();
|
|
320
|
+
}
|
|
321
|
+
async updateWalletInit(request) {
|
|
322
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
|
|
323
|
+
path: request ?? {},
|
|
324
|
+
query: {},
|
|
325
|
+
});
|
|
326
|
+
const challenge = await baseAuthApi_1.BaseAuthApi.createUserActionChallenge({
|
|
327
|
+
userActionHttpMethod: 'PUT',
|
|
328
|
+
userActionHttpPath: path,
|
|
329
|
+
userActionPayload: JSON.stringify(request.body),
|
|
330
|
+
userActionServerKind: 'Api',
|
|
331
|
+
}, this.apiOptions);
|
|
332
|
+
return challenge;
|
|
333
|
+
}
|
|
334
|
+
async updateWalletComplete(request, signedChallenge) {
|
|
335
|
+
const path = (0, url_1.buildPathAndQuery)('/wallets/:walletId', {
|
|
336
|
+
path: request ?? {},
|
|
337
|
+
query: {},
|
|
338
|
+
});
|
|
339
|
+
const { userAction } = await baseAuthApi_1.BaseAuthApi.signUserActionChallenge(signedChallenge, this.apiOptions);
|
|
340
|
+
const response = await (0, fetch_1.simpleFetch)(path, {
|
|
341
|
+
method: 'PUT',
|
|
342
|
+
body: request.body,
|
|
343
|
+
headers: { 'x-dfns-useraction': userAction },
|
|
344
|
+
apiOptions: this.apiOptions,
|
|
345
|
+
});
|
|
346
|
+
return response.json();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
exports.DelegatedWalletsClient = DelegatedWalletsClient;
|
|
@@ -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);
|