@0xkey-io/core 0.1.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/LICENSE +201 -0
- package/README.MD +7 -0
- package/dist/0xkey-helpers.d.ts +68 -0
- package/dist/0xkey-helpers.d.ts.map +1 -0
- package/dist/0xkey-helpers.js +466 -0
- package/dist/0xkey-helpers.js.map +1 -0
- package/dist/0xkey-helpers.mjs +399 -0
- package/dist/0xkey-helpers.mjs.map +1 -0
- package/dist/__clients__/core.d.ts +1201 -0
- package/dist/__clients__/core.d.ts.map +1 -0
- package/dist/__clients__/core.js +3489 -0
- package/dist/__clients__/core.js.map +1 -0
- package/dist/__clients__/core.mjs +3487 -0
- package/dist/__clients__/core.mjs.map +1 -0
- package/dist/__generated__/sdk-client-base.d.ts +281 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -0
- package/dist/__generated__/sdk-client-base.js +3906 -0
- package/dist/__generated__/sdk-client-base.js.map +1 -0
- package/dist/__generated__/sdk-client-base.mjs +3904 -0
- package/dist/__generated__/sdk-client-base.mjs.map +1 -0
- package/dist/__generated__/version.d.ts +2 -0
- package/dist/__generated__/version.d.ts.map +1 -0
- package/dist/__generated__/version.js +6 -0
- package/dist/__generated__/version.js.map +1 -0
- package/dist/__generated__/version.mjs +4 -0
- package/dist/__generated__/version.mjs.map +1 -0
- package/dist/__inputs__/public_api.types.d.ts +6014 -0
- package/dist/__inputs__/public_api.types.d.ts.map +1 -0
- package/dist/__polyfills__/jest.setup.webcrypto.d.ts +2 -0
- package/dist/__polyfills__/jest.setup.webcrypto.d.ts.map +1 -0
- package/dist/__polyfills__/window.d.ts +15 -0
- package/dist/__polyfills__/window.d.ts.map +1 -0
- package/dist/__polyfills__/window.js +30 -0
- package/dist/__polyfills__/window.js.map +1 -0
- package/dist/__polyfills__/window.mjs +28 -0
- package/dist/__polyfills__/window.mjs.map +1 -0
- package/dist/__stampers__/api/base.d.ts +27 -0
- package/dist/__stampers__/api/base.d.ts.map +1 -0
- package/dist/__stampers__/api/base.js +102 -0
- package/dist/__stampers__/api/base.js.map +1 -0
- package/dist/__stampers__/api/base.mjs +100 -0
- package/dist/__stampers__/api/base.mjs.map +1 -0
- package/dist/__stampers__/api/mobile/stamper.d.ts +15 -0
- package/dist/__stampers__/api/mobile/stamper.d.ts.map +1 -0
- package/dist/__stampers__/api/mobile/stamper.js +119 -0
- package/dist/__stampers__/api/mobile/stamper.js.map +1 -0
- package/dist/__stampers__/api/mobile/stamper.mjs +117 -0
- package/dist/__stampers__/api/mobile/stamper.mjs.map +1 -0
- package/dist/__stampers__/api/web/stamper.d.ts +14 -0
- package/dist/__stampers__/api/web/stamper.d.ts.map +1 -0
- package/dist/__stampers__/api/web/stamper.js +201 -0
- package/dist/__stampers__/api/web/stamper.js.map +1 -0
- package/dist/__stampers__/api/web/stamper.mjs +199 -0
- package/dist/__stampers__/api/web/stamper.mjs.map +1 -0
- package/dist/__stampers__/passkey/base.d.ts +16 -0
- package/dist/__stampers__/passkey/base.d.ts.map +1 -0
- package/dist/__stampers__/passkey/base.js +138 -0
- package/dist/__stampers__/passkey/base.js.map +1 -0
- package/dist/__stampers__/passkey/base.mjs +134 -0
- package/dist/__stampers__/passkey/base.mjs.map +1 -0
- package/dist/__storage__/base.d.ts +3 -0
- package/dist/__storage__/base.d.ts.map +1 -0
- package/dist/__storage__/base.js +27 -0
- package/dist/__storage__/base.js.map +1 -0
- package/dist/__storage__/base.mjs +25 -0
- package/dist/__storage__/base.mjs.map +1 -0
- package/dist/__storage__/mobile/storage.d.ts +18 -0
- package/dist/__storage__/mobile/storage.d.ts.map +1 -0
- package/dist/__storage__/mobile/storage.js +76 -0
- package/dist/__storage__/mobile/storage.js.map +1 -0
- package/dist/__storage__/mobile/storage.mjs +74 -0
- package/dist/__storage__/mobile/storage.mjs.map +1 -0
- package/dist/__storage__/web/storage.d.ts +19 -0
- package/dist/__storage__/web/storage.d.ts.map +1 -0
- package/dist/__storage__/web/storage.js +79 -0
- package/dist/__storage__/web/storage.js.map +1 -0
- package/dist/__storage__/web/storage.mjs +77 -0
- package/dist/__storage__/web/storage.mjs.map +1 -0
- package/dist/__typedoc-entry__/index.d.ts +3 -0
- package/dist/__typedoc-entry__/index.d.ts.map +1 -0
- package/dist/__types__/auth.d.ts +120 -0
- package/dist/__types__/auth.d.ts.map +1 -0
- package/dist/__types__/auth.js +7 -0
- package/dist/__types__/auth.js.map +1 -0
- package/dist/__types__/auth.mjs +5 -0
- package/dist/__types__/auth.mjs.map +1 -0
- package/dist/__types__/config.d.ts +145 -0
- package/dist/__types__/config.d.ts.map +1 -0
- package/dist/__types__/enums.d.ts +59 -0
- package/dist/__types__/enums.d.ts.map +1 -0
- package/dist/__types__/enums.js +72 -0
- package/dist/__types__/enums.js.map +1 -0
- package/dist/__types__/enums.mjs +70 -0
- package/dist/__types__/enums.mjs.map +1 -0
- package/dist/__types__/error.d.ts +13 -0
- package/dist/__types__/error.d.ts.map +1 -0
- package/dist/__types__/error.js +18 -0
- package/dist/__types__/error.js.map +1 -0
- package/dist/__types__/error.mjs +16 -0
- package/dist/__types__/error.mjs.map +1 -0
- package/dist/__types__/export.d.ts +10 -0
- package/dist/__types__/export.d.ts.map +1 -0
- package/dist/__types__/external-wallets.d.ts +203 -0
- package/dist/__types__/external-wallets.d.ts.map +1 -0
- package/dist/__types__/http.d.ts +17 -0
- package/dist/__types__/http.d.ts.map +1 -0
- package/dist/__types__/http.js +11 -0
- package/dist/__types__/http.js.map +1 -0
- package/dist/__types__/http.mjs +9 -0
- package/dist/__types__/http.mjs.map +1 -0
- package/dist/__types__/index.d.ts +10 -0
- package/dist/__types__/index.d.ts.map +1 -0
- package/dist/__types__/method-types/import-export-params.d.ts +38 -0
- package/dist/__types__/method-types/import-export-params.d.ts.map +1 -0
- package/dist/__types__/method-types/shared.d.ts +378 -0
- package/dist/__types__/method-types/shared.d.ts.map +1 -0
- package/dist/__wallet__/base.d.ts +14 -0
- package/dist/__wallet__/base.d.ts.map +1 -0
- package/dist/__wallet__/base.js +35 -0
- package/dist/__wallet__/base.js.map +1 -0
- package/dist/__wallet__/base.mjs +33 -0
- package/dist/__wallet__/base.mjs.map +1 -0
- package/dist/__wallet__/connector.d.ts +60 -0
- package/dist/__wallet__/connector.d.ts.map +1 -0
- package/dist/__wallet__/connector.js +93 -0
- package/dist/__wallet__/connector.js.map +1 -0
- package/dist/__wallet__/connector.mjs +91 -0
- package/dist/__wallet__/connector.mjs.map +1 -0
- package/dist/__wallet__/mobile/manager.d.ts +51 -0
- package/dist/__wallet__/mobile/manager.d.ts.map +1 -0
- package/dist/__wallet__/mobile/manager.js +115 -0
- package/dist/__wallet__/mobile/manager.js.map +1 -0
- package/dist/__wallet__/mobile/manager.mjs +113 -0
- package/dist/__wallet__/mobile/manager.mjs.map +1 -0
- package/dist/__wallet__/stamper.d.ts +90 -0
- package/dist/__wallet__/stamper.d.ts.map +1 -0
- package/dist/__wallet__/stamper.js +183 -0
- package/dist/__wallet__/stamper.js.map +1 -0
- package/dist/__wallet__/stamper.mjs +180 -0
- package/dist/__wallet__/stamper.mjs.map +1 -0
- package/dist/__wallet__/wallet-connect/base.d.ts +182 -0
- package/dist/__wallet__/wallet-connect/base.d.ts.map +1 -0
- package/dist/__wallet__/wallet-connect/base.js +606 -0
- package/dist/__wallet__/wallet-connect/base.js.map +1 -0
- package/dist/__wallet__/wallet-connect/base.mjs +604 -0
- package/dist/__wallet__/wallet-connect/base.mjs.map +1 -0
- package/dist/__wallet__/wallet-connect/client.d.ts +132 -0
- package/dist/__wallet__/wallet-connect/client.d.ts.map +1 -0
- package/dist/__wallet__/wallet-connect/client.js +262 -0
- package/dist/__wallet__/wallet-connect/client.js.map +1 -0
- package/dist/__wallet__/wallet-connect/client.mjs +260 -0
- package/dist/__wallet__/wallet-connect/client.mjs.map +1 -0
- package/dist/__wallet__/web/manager.d.ts +70 -0
- package/dist/__wallet__/web/manager.d.ts.map +1 -0
- package/dist/__wallet__/web/manager.js +177 -0
- package/dist/__wallet__/web/manager.js.map +1 -0
- package/dist/__wallet__/web/manager.mjs +175 -0
- package/dist/__wallet__/web/manager.mjs.map +1 -0
- package/dist/__wallet__/web/native/ethereum.d.ts +101 -0
- package/dist/__wallet__/web/native/ethereum.d.ts.map +1 -0
- package/dist/__wallet__/web/native/ethereum.js +339 -0
- package/dist/__wallet__/web/native/ethereum.js.map +1 -0
- package/dist/__wallet__/web/native/ethereum.mjs +336 -0
- package/dist/__wallet__/web/native/ethereum.mjs.map +1 -0
- package/dist/__wallet__/web/native/solana.d.ts +72 -0
- package/dist/__wallet__/web/native/solana.d.ts.map +1 -0
- package/dist/__wallet__/web/native/solana.js +215 -0
- package/dist/__wallet__/web/native/solana.js.map +1 -0
- package/dist/__wallet__/web/native/solana.mjs +212 -0
- package/dist/__wallet__/web/native/solana.mjs.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils.d.ts +160 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +1047 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +1007 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,3906 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var enums = require('../__types__/enums.js');
|
|
4
|
+
var error = require('../__types__/error.js');
|
|
5
|
+
var http = require('../__types__/http.js');
|
|
6
|
+
var version = require('./version.js');
|
|
7
|
+
var sdkTypes = require('@0xkey-io/sdk-types');
|
|
8
|
+
|
|
9
|
+
/* @generated by codegen. DO NOT EDIT BY HAND */
|
|
10
|
+
class ZeroXKeySDKClientBase {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.getActivity = async (input, stampWith) => {
|
|
13
|
+
const session = await this.storageManager?.getActiveSession();
|
|
14
|
+
return this.request("/public/v1/query/get_activity", {
|
|
15
|
+
...input,
|
|
16
|
+
organizationId: input.organizationId ??
|
|
17
|
+
session?.organizationId ??
|
|
18
|
+
this.config.organizationId,
|
|
19
|
+
}, stampWith);
|
|
20
|
+
};
|
|
21
|
+
this.stampGetActivity = async (input, stampWith) => {
|
|
22
|
+
const activeStamper = this.getStamper(stampWith);
|
|
23
|
+
if (!activeStamper) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const session = await this.storageManager?.getActiveSession();
|
|
27
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_activity";
|
|
28
|
+
const body = {
|
|
29
|
+
...input,
|
|
30
|
+
organizationId: input.organizationId ??
|
|
31
|
+
session?.organizationId ??
|
|
32
|
+
this.config.organizationId,
|
|
33
|
+
};
|
|
34
|
+
const stringifiedBody = JSON.stringify(body);
|
|
35
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
36
|
+
return {
|
|
37
|
+
body: stringifiedBody,
|
|
38
|
+
stamp: stamp,
|
|
39
|
+
url: fullUrl,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
this.getApiKey = async (input, stampWith) => {
|
|
43
|
+
const session = await this.storageManager?.getActiveSession();
|
|
44
|
+
return this.request("/public/v1/query/get_api_key", {
|
|
45
|
+
...input,
|
|
46
|
+
organizationId: input.organizationId ??
|
|
47
|
+
session?.organizationId ??
|
|
48
|
+
this.config.organizationId,
|
|
49
|
+
}, stampWith);
|
|
50
|
+
};
|
|
51
|
+
this.stampGetApiKey = async (input, stampWith) => {
|
|
52
|
+
const activeStamper = this.getStamper(stampWith);
|
|
53
|
+
if (!activeStamper) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const session = await this.storageManager?.getActiveSession();
|
|
57
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_key";
|
|
58
|
+
const body = {
|
|
59
|
+
...input,
|
|
60
|
+
organizationId: input.organizationId ??
|
|
61
|
+
session?.organizationId ??
|
|
62
|
+
this.config.organizationId,
|
|
63
|
+
};
|
|
64
|
+
const stringifiedBody = JSON.stringify(body);
|
|
65
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
66
|
+
return {
|
|
67
|
+
body: stringifiedBody,
|
|
68
|
+
stamp: stamp,
|
|
69
|
+
url: fullUrl,
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
this.getApiKeys = async (input = {}, stampWith) => {
|
|
73
|
+
const session = await this.storageManager?.getActiveSession();
|
|
74
|
+
return this.request("/public/v1/query/get_api_keys", {
|
|
75
|
+
...input,
|
|
76
|
+
organizationId: input.organizationId ??
|
|
77
|
+
session?.organizationId ??
|
|
78
|
+
this.config.organizationId,
|
|
79
|
+
}, stampWith);
|
|
80
|
+
};
|
|
81
|
+
this.stampGetApiKeys = async (input, stampWith) => {
|
|
82
|
+
const activeStamper = this.getStamper(stampWith);
|
|
83
|
+
if (!activeStamper) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const session = await this.storageManager?.getActiveSession();
|
|
87
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_keys";
|
|
88
|
+
const body = {
|
|
89
|
+
...input,
|
|
90
|
+
organizationId: input.organizationId ??
|
|
91
|
+
session?.organizationId ??
|
|
92
|
+
this.config.organizationId,
|
|
93
|
+
};
|
|
94
|
+
const stringifiedBody = JSON.stringify(body);
|
|
95
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
96
|
+
return {
|
|
97
|
+
body: stringifiedBody,
|
|
98
|
+
stamp: stamp,
|
|
99
|
+
url: fullUrl,
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
this.getAuthenticator = async (input, stampWith) => {
|
|
103
|
+
const session = await this.storageManager?.getActiveSession();
|
|
104
|
+
return this.request("/public/v1/query/get_authenticator", {
|
|
105
|
+
...input,
|
|
106
|
+
organizationId: input.organizationId ??
|
|
107
|
+
session?.organizationId ??
|
|
108
|
+
this.config.organizationId,
|
|
109
|
+
}, stampWith);
|
|
110
|
+
};
|
|
111
|
+
this.stampGetAuthenticator = async (input, stampWith) => {
|
|
112
|
+
const activeStamper = this.getStamper(stampWith);
|
|
113
|
+
if (!activeStamper) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
const session = await this.storageManager?.getActiveSession();
|
|
117
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticator";
|
|
118
|
+
const body = {
|
|
119
|
+
...input,
|
|
120
|
+
organizationId: input.organizationId ??
|
|
121
|
+
session?.organizationId ??
|
|
122
|
+
this.config.organizationId,
|
|
123
|
+
};
|
|
124
|
+
const stringifiedBody = JSON.stringify(body);
|
|
125
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
126
|
+
return {
|
|
127
|
+
body: stringifiedBody,
|
|
128
|
+
stamp: stamp,
|
|
129
|
+
url: fullUrl,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
this.getAuthenticators = async (input, stampWith) => {
|
|
133
|
+
const session = await this.storageManager?.getActiveSession();
|
|
134
|
+
return this.request("/public/v1/query/get_authenticators", {
|
|
135
|
+
...input,
|
|
136
|
+
organizationId: input.organizationId ??
|
|
137
|
+
session?.organizationId ??
|
|
138
|
+
this.config.organizationId,
|
|
139
|
+
}, stampWith);
|
|
140
|
+
};
|
|
141
|
+
this.stampGetAuthenticators = async (input, stampWith) => {
|
|
142
|
+
const activeStamper = this.getStamper(stampWith);
|
|
143
|
+
if (!activeStamper) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
const session = await this.storageManager?.getActiveSession();
|
|
147
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticators";
|
|
148
|
+
const body = {
|
|
149
|
+
...input,
|
|
150
|
+
organizationId: input.organizationId ??
|
|
151
|
+
session?.organizationId ??
|
|
152
|
+
this.config.organizationId,
|
|
153
|
+
};
|
|
154
|
+
const stringifiedBody = JSON.stringify(body);
|
|
155
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
156
|
+
return {
|
|
157
|
+
body: stringifiedBody,
|
|
158
|
+
stamp: stamp,
|
|
159
|
+
url: fullUrl,
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
this.getBootProof = async (input, stampWith) => {
|
|
163
|
+
const session = await this.storageManager?.getActiveSession();
|
|
164
|
+
return this.request("/public/v1/query/get_boot_proof", {
|
|
165
|
+
...input,
|
|
166
|
+
organizationId: input.organizationId ??
|
|
167
|
+
session?.organizationId ??
|
|
168
|
+
this.config.organizationId,
|
|
169
|
+
}, stampWith);
|
|
170
|
+
};
|
|
171
|
+
this.stampGetBootProof = async (input, stampWith) => {
|
|
172
|
+
const activeStamper = this.getStamper(stampWith);
|
|
173
|
+
if (!activeStamper) {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
const session = await this.storageManager?.getActiveSession();
|
|
177
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_boot_proof";
|
|
178
|
+
const body = {
|
|
179
|
+
...input,
|
|
180
|
+
organizationId: input.organizationId ??
|
|
181
|
+
session?.organizationId ??
|
|
182
|
+
this.config.organizationId,
|
|
183
|
+
};
|
|
184
|
+
const stringifiedBody = JSON.stringify(body);
|
|
185
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
186
|
+
return {
|
|
187
|
+
body: stringifiedBody,
|
|
188
|
+
stamp: stamp,
|
|
189
|
+
url: fullUrl,
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
this.getGasUsage = async (input, stampWith) => {
|
|
193
|
+
const session = await this.storageManager?.getActiveSession();
|
|
194
|
+
return this.request("/public/v1/query/get_gas_usage", {
|
|
195
|
+
...input,
|
|
196
|
+
organizationId: input.organizationId ??
|
|
197
|
+
session?.organizationId ??
|
|
198
|
+
this.config.organizationId,
|
|
199
|
+
}, stampWith);
|
|
200
|
+
};
|
|
201
|
+
this.stampGetGasUsage = async (input, stampWith) => {
|
|
202
|
+
const activeStamper = this.getStamper(stampWith);
|
|
203
|
+
if (!activeStamper) {
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
const session = await this.storageManager?.getActiveSession();
|
|
207
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_gas_usage";
|
|
208
|
+
const body = {
|
|
209
|
+
...input,
|
|
210
|
+
organizationId: input.organizationId ??
|
|
211
|
+
session?.organizationId ??
|
|
212
|
+
this.config.organizationId,
|
|
213
|
+
};
|
|
214
|
+
const stringifiedBody = JSON.stringify(body);
|
|
215
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
216
|
+
return {
|
|
217
|
+
body: stringifiedBody,
|
|
218
|
+
stamp: stamp,
|
|
219
|
+
url: fullUrl,
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
this.getLatestBootProof = async (input, stampWith) => {
|
|
223
|
+
const session = await this.storageManager?.getActiveSession();
|
|
224
|
+
return this.request("/public/v1/query/get_latest_boot_proof", {
|
|
225
|
+
...input,
|
|
226
|
+
organizationId: input.organizationId ??
|
|
227
|
+
session?.organizationId ??
|
|
228
|
+
this.config.organizationId,
|
|
229
|
+
}, stampWith);
|
|
230
|
+
};
|
|
231
|
+
this.stampGetLatestBootProof = async (input, stampWith) => {
|
|
232
|
+
const activeStamper = this.getStamper(stampWith);
|
|
233
|
+
if (!activeStamper) {
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
const session = await this.storageManager?.getActiveSession();
|
|
237
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_latest_boot_proof";
|
|
238
|
+
const body = {
|
|
239
|
+
...input,
|
|
240
|
+
organizationId: input.organizationId ??
|
|
241
|
+
session?.organizationId ??
|
|
242
|
+
this.config.organizationId,
|
|
243
|
+
};
|
|
244
|
+
const stringifiedBody = JSON.stringify(body);
|
|
245
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
246
|
+
return {
|
|
247
|
+
body: stringifiedBody,
|
|
248
|
+
stamp: stamp,
|
|
249
|
+
url: fullUrl,
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
this.getNonces = async (input, stampWith) => {
|
|
253
|
+
const session = await this.storageManager?.getActiveSession();
|
|
254
|
+
return this.request("/public/v1/query/get_nonces", {
|
|
255
|
+
...input,
|
|
256
|
+
organizationId: input.organizationId ??
|
|
257
|
+
session?.organizationId ??
|
|
258
|
+
this.config.organizationId,
|
|
259
|
+
}, stampWith);
|
|
260
|
+
};
|
|
261
|
+
this.stampGetNonces = async (input, stampWith) => {
|
|
262
|
+
const activeStamper = this.getStamper(stampWith);
|
|
263
|
+
if (!activeStamper) {
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
const session = await this.storageManager?.getActiveSession();
|
|
267
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_nonces";
|
|
268
|
+
const body = {
|
|
269
|
+
...input,
|
|
270
|
+
organizationId: input.organizationId ??
|
|
271
|
+
session?.organizationId ??
|
|
272
|
+
this.config.organizationId,
|
|
273
|
+
};
|
|
274
|
+
const stringifiedBody = JSON.stringify(body);
|
|
275
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
276
|
+
return {
|
|
277
|
+
body: stringifiedBody,
|
|
278
|
+
stamp: stamp,
|
|
279
|
+
url: fullUrl,
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
this.getOauth2Credential = async (input, stampWith) => {
|
|
283
|
+
const session = await this.storageManager?.getActiveSession();
|
|
284
|
+
return this.request("/public/v1/query/get_oauth2_credential", {
|
|
285
|
+
...input,
|
|
286
|
+
organizationId: input.organizationId ??
|
|
287
|
+
session?.organizationId ??
|
|
288
|
+
this.config.organizationId,
|
|
289
|
+
}, stampWith);
|
|
290
|
+
};
|
|
291
|
+
this.stampGetOauth2Credential = async (input, stampWith) => {
|
|
292
|
+
const activeStamper = this.getStamper(stampWith);
|
|
293
|
+
if (!activeStamper) {
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
const session = await this.storageManager?.getActiveSession();
|
|
297
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth2_credential";
|
|
298
|
+
const body = {
|
|
299
|
+
...input,
|
|
300
|
+
organizationId: input.organizationId ??
|
|
301
|
+
session?.organizationId ??
|
|
302
|
+
this.config.organizationId,
|
|
303
|
+
};
|
|
304
|
+
const stringifiedBody = JSON.stringify(body);
|
|
305
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
306
|
+
return {
|
|
307
|
+
body: stringifiedBody,
|
|
308
|
+
stamp: stamp,
|
|
309
|
+
url: fullUrl,
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
this.getOauthProviders = async (input, stampWith) => {
|
|
313
|
+
const session = await this.storageManager?.getActiveSession();
|
|
314
|
+
return this.request("/public/v1/query/get_oauth_providers", {
|
|
315
|
+
...input,
|
|
316
|
+
organizationId: input.organizationId ??
|
|
317
|
+
session?.organizationId ??
|
|
318
|
+
this.config.organizationId,
|
|
319
|
+
}, stampWith);
|
|
320
|
+
};
|
|
321
|
+
this.stampGetOauthProviders = async (input, stampWith) => {
|
|
322
|
+
const activeStamper = this.getStamper(stampWith);
|
|
323
|
+
if (!activeStamper) {
|
|
324
|
+
return undefined;
|
|
325
|
+
}
|
|
326
|
+
const session = await this.storageManager?.getActiveSession();
|
|
327
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth_providers";
|
|
328
|
+
const body = {
|
|
329
|
+
...input,
|
|
330
|
+
organizationId: input.organizationId ??
|
|
331
|
+
session?.organizationId ??
|
|
332
|
+
this.config.organizationId,
|
|
333
|
+
};
|
|
334
|
+
const stringifiedBody = JSON.stringify(body);
|
|
335
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
336
|
+
return {
|
|
337
|
+
body: stringifiedBody,
|
|
338
|
+
stamp: stamp,
|
|
339
|
+
url: fullUrl,
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
this.getOnRampTransactionStatus = async (input, stampWith) => {
|
|
343
|
+
const session = await this.storageManager?.getActiveSession();
|
|
344
|
+
return this.request("/public/v1/query/get_onramp_transaction_status", {
|
|
345
|
+
...input,
|
|
346
|
+
organizationId: input.organizationId ??
|
|
347
|
+
session?.organizationId ??
|
|
348
|
+
this.config.organizationId,
|
|
349
|
+
}, stampWith);
|
|
350
|
+
};
|
|
351
|
+
this.stampGetOnRampTransactionStatus = async (input, stampWith) => {
|
|
352
|
+
const activeStamper = this.getStamper(stampWith);
|
|
353
|
+
if (!activeStamper) {
|
|
354
|
+
return undefined;
|
|
355
|
+
}
|
|
356
|
+
const session = await this.storageManager?.getActiveSession();
|
|
357
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_onramp_transaction_status";
|
|
358
|
+
const body = {
|
|
359
|
+
...input,
|
|
360
|
+
organizationId: input.organizationId ??
|
|
361
|
+
session?.organizationId ??
|
|
362
|
+
this.config.organizationId,
|
|
363
|
+
};
|
|
364
|
+
const stringifiedBody = JSON.stringify(body);
|
|
365
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
366
|
+
return {
|
|
367
|
+
body: stringifiedBody,
|
|
368
|
+
stamp: stamp,
|
|
369
|
+
url: fullUrl,
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
this.getOrganizationConfigs = async (input, stampWith) => {
|
|
373
|
+
const session = await this.storageManager?.getActiveSession();
|
|
374
|
+
return this.request("/public/v1/query/get_organization_configs", {
|
|
375
|
+
...input,
|
|
376
|
+
organizationId: input.organizationId ??
|
|
377
|
+
session?.organizationId ??
|
|
378
|
+
this.config.organizationId,
|
|
379
|
+
}, stampWith);
|
|
380
|
+
};
|
|
381
|
+
this.stampGetOrganizationConfigs = async (input, stampWith) => {
|
|
382
|
+
const activeStamper = this.getStamper(stampWith);
|
|
383
|
+
if (!activeStamper) {
|
|
384
|
+
return undefined;
|
|
385
|
+
}
|
|
386
|
+
const session = await this.storageManager?.getActiveSession();
|
|
387
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization_configs";
|
|
388
|
+
const body = {
|
|
389
|
+
...input,
|
|
390
|
+
organizationId: input.organizationId ??
|
|
391
|
+
session?.organizationId ??
|
|
392
|
+
this.config.organizationId,
|
|
393
|
+
};
|
|
394
|
+
const stringifiedBody = JSON.stringify(body);
|
|
395
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
396
|
+
return {
|
|
397
|
+
body: stringifiedBody,
|
|
398
|
+
stamp: stamp,
|
|
399
|
+
url: fullUrl,
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
this.getPolicy = async (input, stampWith) => {
|
|
403
|
+
const session = await this.storageManager?.getActiveSession();
|
|
404
|
+
return this.request("/public/v1/query/get_policy", {
|
|
405
|
+
...input,
|
|
406
|
+
organizationId: input.organizationId ??
|
|
407
|
+
session?.organizationId ??
|
|
408
|
+
this.config.organizationId,
|
|
409
|
+
}, stampWith);
|
|
410
|
+
};
|
|
411
|
+
this.stampGetPolicy = async (input, stampWith) => {
|
|
412
|
+
const activeStamper = this.getStamper(stampWith);
|
|
413
|
+
if (!activeStamper) {
|
|
414
|
+
return undefined;
|
|
415
|
+
}
|
|
416
|
+
const session = await this.storageManager?.getActiveSession();
|
|
417
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy";
|
|
418
|
+
const body = {
|
|
419
|
+
...input,
|
|
420
|
+
organizationId: input.organizationId ??
|
|
421
|
+
session?.organizationId ??
|
|
422
|
+
this.config.organizationId,
|
|
423
|
+
};
|
|
424
|
+
const stringifiedBody = JSON.stringify(body);
|
|
425
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
426
|
+
return {
|
|
427
|
+
body: stringifiedBody,
|
|
428
|
+
stamp: stamp,
|
|
429
|
+
url: fullUrl,
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
this.getPolicyEvaluations = async (input, stampWith) => {
|
|
433
|
+
const session = await this.storageManager?.getActiveSession();
|
|
434
|
+
return this.request("/public/v1/query/get_policy_evaluations", {
|
|
435
|
+
...input,
|
|
436
|
+
organizationId: input.organizationId ??
|
|
437
|
+
session?.organizationId ??
|
|
438
|
+
this.config.organizationId,
|
|
439
|
+
}, stampWith);
|
|
440
|
+
};
|
|
441
|
+
this.stampGetPolicyEvaluations = async (input, stampWith) => {
|
|
442
|
+
const activeStamper = this.getStamper(stampWith);
|
|
443
|
+
if (!activeStamper) {
|
|
444
|
+
return undefined;
|
|
445
|
+
}
|
|
446
|
+
const session = await this.storageManager?.getActiveSession();
|
|
447
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy_evaluations";
|
|
448
|
+
const body = {
|
|
449
|
+
...input,
|
|
450
|
+
organizationId: input.organizationId ??
|
|
451
|
+
session?.organizationId ??
|
|
452
|
+
this.config.organizationId,
|
|
453
|
+
};
|
|
454
|
+
const stringifiedBody = JSON.stringify(body);
|
|
455
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
456
|
+
return {
|
|
457
|
+
body: stringifiedBody,
|
|
458
|
+
stamp: stamp,
|
|
459
|
+
url: fullUrl,
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
this.getPrivateKey = async (input, stampWith) => {
|
|
463
|
+
const session = await this.storageManager?.getActiveSession();
|
|
464
|
+
return this.request("/public/v1/query/get_private_key", {
|
|
465
|
+
...input,
|
|
466
|
+
organizationId: input.organizationId ??
|
|
467
|
+
session?.organizationId ??
|
|
468
|
+
this.config.organizationId,
|
|
469
|
+
}, stampWith);
|
|
470
|
+
};
|
|
471
|
+
this.stampGetPrivateKey = async (input, stampWith) => {
|
|
472
|
+
const activeStamper = this.getStamper(stampWith);
|
|
473
|
+
if (!activeStamper) {
|
|
474
|
+
return undefined;
|
|
475
|
+
}
|
|
476
|
+
const session = await this.storageManager?.getActiveSession();
|
|
477
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_private_key";
|
|
478
|
+
const body = {
|
|
479
|
+
...input,
|
|
480
|
+
organizationId: input.organizationId ??
|
|
481
|
+
session?.organizationId ??
|
|
482
|
+
this.config.organizationId,
|
|
483
|
+
};
|
|
484
|
+
const stringifiedBody = JSON.stringify(body);
|
|
485
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
486
|
+
return {
|
|
487
|
+
body: stringifiedBody,
|
|
488
|
+
stamp: stamp,
|
|
489
|
+
url: fullUrl,
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
this.getSendTransactionStatus = async (input, stampWith) => {
|
|
493
|
+
const session = await this.storageManager?.getActiveSession();
|
|
494
|
+
return this.request("/public/v1/query/get_send_transaction_status", {
|
|
495
|
+
...input,
|
|
496
|
+
organizationId: input.organizationId ??
|
|
497
|
+
session?.organizationId ??
|
|
498
|
+
this.config.organizationId,
|
|
499
|
+
}, stampWith);
|
|
500
|
+
};
|
|
501
|
+
this.stampGetSendTransactionStatus = async (input, stampWith) => {
|
|
502
|
+
const activeStamper = this.getStamper(stampWith);
|
|
503
|
+
if (!activeStamper) {
|
|
504
|
+
return undefined;
|
|
505
|
+
}
|
|
506
|
+
const session = await this.storageManager?.getActiveSession();
|
|
507
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_send_transaction_status";
|
|
508
|
+
const body = {
|
|
509
|
+
...input,
|
|
510
|
+
organizationId: input.organizationId ??
|
|
511
|
+
session?.organizationId ??
|
|
512
|
+
this.config.organizationId,
|
|
513
|
+
};
|
|
514
|
+
const stringifiedBody = JSON.stringify(body);
|
|
515
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
516
|
+
return {
|
|
517
|
+
body: stringifiedBody,
|
|
518
|
+
stamp: stamp,
|
|
519
|
+
url: fullUrl,
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
this.getSmartContractInterface = async (input, stampWith) => {
|
|
523
|
+
const session = await this.storageManager?.getActiveSession();
|
|
524
|
+
return this.request("/public/v1/query/get_smart_contract_interface", {
|
|
525
|
+
...input,
|
|
526
|
+
organizationId: input.organizationId ??
|
|
527
|
+
session?.organizationId ??
|
|
528
|
+
this.config.organizationId,
|
|
529
|
+
}, stampWith);
|
|
530
|
+
};
|
|
531
|
+
this.stampGetSmartContractInterface = async (input, stampWith) => {
|
|
532
|
+
const activeStamper = this.getStamper(stampWith);
|
|
533
|
+
if (!activeStamper) {
|
|
534
|
+
return undefined;
|
|
535
|
+
}
|
|
536
|
+
const session = await this.storageManager?.getActiveSession();
|
|
537
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_smart_contract_interface";
|
|
538
|
+
const body = {
|
|
539
|
+
...input,
|
|
540
|
+
organizationId: input.organizationId ??
|
|
541
|
+
session?.organizationId ??
|
|
542
|
+
this.config.organizationId,
|
|
543
|
+
};
|
|
544
|
+
const stringifiedBody = JSON.stringify(body);
|
|
545
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
546
|
+
return {
|
|
547
|
+
body: stringifiedBody,
|
|
548
|
+
stamp: stamp,
|
|
549
|
+
url: fullUrl,
|
|
550
|
+
};
|
|
551
|
+
};
|
|
552
|
+
this.getUser = async (input, stampWith) => {
|
|
553
|
+
const session = await this.storageManager?.getActiveSession();
|
|
554
|
+
return this.request("/public/v1/query/get_user", {
|
|
555
|
+
...input,
|
|
556
|
+
organizationId: input.organizationId ??
|
|
557
|
+
session?.organizationId ??
|
|
558
|
+
this.config.organizationId,
|
|
559
|
+
}, stampWith);
|
|
560
|
+
};
|
|
561
|
+
this.stampGetUser = async (input, stampWith) => {
|
|
562
|
+
const activeStamper = this.getStamper(stampWith);
|
|
563
|
+
if (!activeStamper) {
|
|
564
|
+
return undefined;
|
|
565
|
+
}
|
|
566
|
+
const session = await this.storageManager?.getActiveSession();
|
|
567
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_user";
|
|
568
|
+
const body = {
|
|
569
|
+
...input,
|
|
570
|
+
organizationId: input.organizationId ??
|
|
571
|
+
session?.organizationId ??
|
|
572
|
+
this.config.organizationId,
|
|
573
|
+
};
|
|
574
|
+
const stringifiedBody = JSON.stringify(body);
|
|
575
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
576
|
+
return {
|
|
577
|
+
body: stringifiedBody,
|
|
578
|
+
stamp: stamp,
|
|
579
|
+
url: fullUrl,
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
this.getWallet = async (input, stampWith) => {
|
|
583
|
+
const session = await this.storageManager?.getActiveSession();
|
|
584
|
+
return this.request("/public/v1/query/get_wallet", {
|
|
585
|
+
...input,
|
|
586
|
+
organizationId: input.organizationId ??
|
|
587
|
+
session?.organizationId ??
|
|
588
|
+
this.config.organizationId,
|
|
589
|
+
}, stampWith);
|
|
590
|
+
};
|
|
591
|
+
this.stampGetWallet = async (input, stampWith) => {
|
|
592
|
+
const activeStamper = this.getStamper(stampWith);
|
|
593
|
+
if (!activeStamper) {
|
|
594
|
+
return undefined;
|
|
595
|
+
}
|
|
596
|
+
const session = await this.storageManager?.getActiveSession();
|
|
597
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet";
|
|
598
|
+
const body = {
|
|
599
|
+
...input,
|
|
600
|
+
organizationId: input.organizationId ??
|
|
601
|
+
session?.organizationId ??
|
|
602
|
+
this.config.organizationId,
|
|
603
|
+
};
|
|
604
|
+
const stringifiedBody = JSON.stringify(body);
|
|
605
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
606
|
+
return {
|
|
607
|
+
body: stringifiedBody,
|
|
608
|
+
stamp: stamp,
|
|
609
|
+
url: fullUrl,
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
this.getWalletAccount = async (input, stampWith) => {
|
|
613
|
+
const session = await this.storageManager?.getActiveSession();
|
|
614
|
+
return this.request("/public/v1/query/get_wallet_account", {
|
|
615
|
+
...input,
|
|
616
|
+
organizationId: input.organizationId ??
|
|
617
|
+
session?.organizationId ??
|
|
618
|
+
this.config.organizationId,
|
|
619
|
+
}, stampWith);
|
|
620
|
+
};
|
|
621
|
+
this.stampGetWalletAccount = async (input, stampWith) => {
|
|
622
|
+
const activeStamper = this.getStamper(stampWith);
|
|
623
|
+
if (!activeStamper) {
|
|
624
|
+
return undefined;
|
|
625
|
+
}
|
|
626
|
+
const session = await this.storageManager?.getActiveSession();
|
|
627
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_account";
|
|
628
|
+
const body = {
|
|
629
|
+
...input,
|
|
630
|
+
organizationId: input.organizationId ??
|
|
631
|
+
session?.organizationId ??
|
|
632
|
+
this.config.organizationId,
|
|
633
|
+
};
|
|
634
|
+
const stringifiedBody = JSON.stringify(body);
|
|
635
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
636
|
+
return {
|
|
637
|
+
body: stringifiedBody,
|
|
638
|
+
stamp: stamp,
|
|
639
|
+
url: fullUrl,
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
this.getActivities = async (input = {}, stampWith) => {
|
|
643
|
+
const session = await this.storageManager?.getActiveSession();
|
|
644
|
+
return this.request("/public/v1/query/list_activities", {
|
|
645
|
+
...input,
|
|
646
|
+
organizationId: input.organizationId ??
|
|
647
|
+
session?.organizationId ??
|
|
648
|
+
this.config.organizationId,
|
|
649
|
+
}, stampWith);
|
|
650
|
+
};
|
|
651
|
+
this.stampGetActivities = async (input, stampWith) => {
|
|
652
|
+
const activeStamper = this.getStamper(stampWith);
|
|
653
|
+
if (!activeStamper) {
|
|
654
|
+
return undefined;
|
|
655
|
+
}
|
|
656
|
+
const session = await this.storageManager?.getActiveSession();
|
|
657
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_activities";
|
|
658
|
+
const body = {
|
|
659
|
+
...input,
|
|
660
|
+
organizationId: input.organizationId ??
|
|
661
|
+
session?.organizationId ??
|
|
662
|
+
this.config.organizationId,
|
|
663
|
+
};
|
|
664
|
+
const stringifiedBody = JSON.stringify(body);
|
|
665
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
666
|
+
return {
|
|
667
|
+
body: stringifiedBody,
|
|
668
|
+
stamp: stamp,
|
|
669
|
+
url: fullUrl,
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
this.getAppProofs = async (input, stampWith) => {
|
|
673
|
+
const session = await this.storageManager?.getActiveSession();
|
|
674
|
+
return this.request("/public/v1/query/list_app_proofs", {
|
|
675
|
+
...input,
|
|
676
|
+
organizationId: input.organizationId ??
|
|
677
|
+
session?.organizationId ??
|
|
678
|
+
this.config.organizationId,
|
|
679
|
+
}, stampWith);
|
|
680
|
+
};
|
|
681
|
+
this.stampGetAppProofs = async (input, stampWith) => {
|
|
682
|
+
const activeStamper = this.getStamper(stampWith);
|
|
683
|
+
if (!activeStamper) {
|
|
684
|
+
return undefined;
|
|
685
|
+
}
|
|
686
|
+
const session = await this.storageManager?.getActiveSession();
|
|
687
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_app_proofs";
|
|
688
|
+
const body = {
|
|
689
|
+
...input,
|
|
690
|
+
organizationId: input.organizationId ??
|
|
691
|
+
session?.organizationId ??
|
|
692
|
+
this.config.organizationId,
|
|
693
|
+
};
|
|
694
|
+
const stringifiedBody = JSON.stringify(body);
|
|
695
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
696
|
+
return {
|
|
697
|
+
body: stringifiedBody,
|
|
698
|
+
stamp: stamp,
|
|
699
|
+
url: fullUrl,
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
this.listFiatOnRampCredentials = async (input, stampWith) => {
|
|
703
|
+
const session = await this.storageManager?.getActiveSession();
|
|
704
|
+
return this.request("/public/v1/query/list_fiat_on_ramp_credentials", {
|
|
705
|
+
...input,
|
|
706
|
+
organizationId: input.organizationId ??
|
|
707
|
+
session?.organizationId ??
|
|
708
|
+
this.config.organizationId,
|
|
709
|
+
}, stampWith);
|
|
710
|
+
};
|
|
711
|
+
this.stampListFiatOnRampCredentials = async (input, stampWith) => {
|
|
712
|
+
const activeStamper = this.getStamper(stampWith);
|
|
713
|
+
if (!activeStamper) {
|
|
714
|
+
return undefined;
|
|
715
|
+
}
|
|
716
|
+
const session = await this.storageManager?.getActiveSession();
|
|
717
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_fiat_on_ramp_credentials";
|
|
718
|
+
const body = {
|
|
719
|
+
...input,
|
|
720
|
+
organizationId: input.organizationId ??
|
|
721
|
+
session?.organizationId ??
|
|
722
|
+
this.config.organizationId,
|
|
723
|
+
};
|
|
724
|
+
const stringifiedBody = JSON.stringify(body);
|
|
725
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
726
|
+
return {
|
|
727
|
+
body: stringifiedBody,
|
|
728
|
+
stamp: stamp,
|
|
729
|
+
url: fullUrl,
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
this.listOauth2Credentials = async (input, stampWith) => {
|
|
733
|
+
const session = await this.storageManager?.getActiveSession();
|
|
734
|
+
return this.request("/public/v1/query/list_oauth2_credentials", {
|
|
735
|
+
...input,
|
|
736
|
+
organizationId: input.organizationId ??
|
|
737
|
+
session?.organizationId ??
|
|
738
|
+
this.config.organizationId,
|
|
739
|
+
}, stampWith);
|
|
740
|
+
};
|
|
741
|
+
this.stampListOauth2Credentials = async (input, stampWith) => {
|
|
742
|
+
const activeStamper = this.getStamper(stampWith);
|
|
743
|
+
if (!activeStamper) {
|
|
744
|
+
return undefined;
|
|
745
|
+
}
|
|
746
|
+
const session = await this.storageManager?.getActiveSession();
|
|
747
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_oauth2_credentials";
|
|
748
|
+
const body = {
|
|
749
|
+
...input,
|
|
750
|
+
organizationId: input.organizationId ??
|
|
751
|
+
session?.organizationId ??
|
|
752
|
+
this.config.organizationId,
|
|
753
|
+
};
|
|
754
|
+
const stringifiedBody = JSON.stringify(body);
|
|
755
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
756
|
+
return {
|
|
757
|
+
body: stringifiedBody,
|
|
758
|
+
stamp: stamp,
|
|
759
|
+
url: fullUrl,
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
this.getPolicies = async (input = {}, stampWith) => {
|
|
763
|
+
const session = await this.storageManager?.getActiveSession();
|
|
764
|
+
return this.request("/public/v1/query/list_policies", {
|
|
765
|
+
...input,
|
|
766
|
+
organizationId: input.organizationId ??
|
|
767
|
+
session?.organizationId ??
|
|
768
|
+
this.config.organizationId,
|
|
769
|
+
}, stampWith);
|
|
770
|
+
};
|
|
771
|
+
this.stampGetPolicies = async (input, stampWith) => {
|
|
772
|
+
const activeStamper = this.getStamper(stampWith);
|
|
773
|
+
if (!activeStamper) {
|
|
774
|
+
return undefined;
|
|
775
|
+
}
|
|
776
|
+
const session = await this.storageManager?.getActiveSession();
|
|
777
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_policies";
|
|
778
|
+
const body = {
|
|
779
|
+
...input,
|
|
780
|
+
organizationId: input.organizationId ??
|
|
781
|
+
session?.organizationId ??
|
|
782
|
+
this.config.organizationId,
|
|
783
|
+
};
|
|
784
|
+
const stringifiedBody = JSON.stringify(body);
|
|
785
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
786
|
+
return {
|
|
787
|
+
body: stringifiedBody,
|
|
788
|
+
stamp: stamp,
|
|
789
|
+
url: fullUrl,
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
this.listPrivateKeyTags = async (input, stampWith) => {
|
|
793
|
+
const session = await this.storageManager?.getActiveSession();
|
|
794
|
+
return this.request("/public/v1/query/list_private_key_tags", {
|
|
795
|
+
...input,
|
|
796
|
+
organizationId: input.organizationId ??
|
|
797
|
+
session?.organizationId ??
|
|
798
|
+
this.config.organizationId,
|
|
799
|
+
}, stampWith);
|
|
800
|
+
};
|
|
801
|
+
this.stampListPrivateKeyTags = async (input, stampWith) => {
|
|
802
|
+
const activeStamper = this.getStamper(stampWith);
|
|
803
|
+
if (!activeStamper) {
|
|
804
|
+
return undefined;
|
|
805
|
+
}
|
|
806
|
+
const session = await this.storageManager?.getActiveSession();
|
|
807
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_key_tags";
|
|
808
|
+
const body = {
|
|
809
|
+
...input,
|
|
810
|
+
organizationId: input.organizationId ??
|
|
811
|
+
session?.organizationId ??
|
|
812
|
+
this.config.organizationId,
|
|
813
|
+
};
|
|
814
|
+
const stringifiedBody = JSON.stringify(body);
|
|
815
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
816
|
+
return {
|
|
817
|
+
body: stringifiedBody,
|
|
818
|
+
stamp: stamp,
|
|
819
|
+
url: fullUrl,
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
this.getPrivateKeys = async (input = {}, stampWith) => {
|
|
823
|
+
const session = await this.storageManager?.getActiveSession();
|
|
824
|
+
return this.request("/public/v1/query/list_private_keys", {
|
|
825
|
+
...input,
|
|
826
|
+
organizationId: input.organizationId ??
|
|
827
|
+
session?.organizationId ??
|
|
828
|
+
this.config.organizationId,
|
|
829
|
+
}, stampWith);
|
|
830
|
+
};
|
|
831
|
+
this.stampGetPrivateKeys = async (input, stampWith) => {
|
|
832
|
+
const activeStamper = this.getStamper(stampWith);
|
|
833
|
+
if (!activeStamper) {
|
|
834
|
+
return undefined;
|
|
835
|
+
}
|
|
836
|
+
const session = await this.storageManager?.getActiveSession();
|
|
837
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_keys";
|
|
838
|
+
const body = {
|
|
839
|
+
...input,
|
|
840
|
+
organizationId: input.organizationId ??
|
|
841
|
+
session?.organizationId ??
|
|
842
|
+
this.config.organizationId,
|
|
843
|
+
};
|
|
844
|
+
const stringifiedBody = JSON.stringify(body);
|
|
845
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
846
|
+
return {
|
|
847
|
+
body: stringifiedBody,
|
|
848
|
+
stamp: stamp,
|
|
849
|
+
url: fullUrl,
|
|
850
|
+
};
|
|
851
|
+
};
|
|
852
|
+
this.getSmartContractInterfaces = async (input, stampWith) => {
|
|
853
|
+
const session = await this.storageManager?.getActiveSession();
|
|
854
|
+
return this.request("/public/v1/query/list_smart_contract_interfaces", {
|
|
855
|
+
...input,
|
|
856
|
+
organizationId: input.organizationId ??
|
|
857
|
+
session?.organizationId ??
|
|
858
|
+
this.config.organizationId,
|
|
859
|
+
}, stampWith);
|
|
860
|
+
};
|
|
861
|
+
this.stampGetSmartContractInterfaces = async (input, stampWith) => {
|
|
862
|
+
const activeStamper = this.getStamper(stampWith);
|
|
863
|
+
if (!activeStamper) {
|
|
864
|
+
return undefined;
|
|
865
|
+
}
|
|
866
|
+
const session = await this.storageManager?.getActiveSession();
|
|
867
|
+
const fullUrl = this.config.apiBaseUrl +
|
|
868
|
+
"/public/v1/query/list_smart_contract_interfaces";
|
|
869
|
+
const body = {
|
|
870
|
+
...input,
|
|
871
|
+
organizationId: input.organizationId ??
|
|
872
|
+
session?.organizationId ??
|
|
873
|
+
this.config.organizationId,
|
|
874
|
+
};
|
|
875
|
+
const stringifiedBody = JSON.stringify(body);
|
|
876
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
877
|
+
return {
|
|
878
|
+
body: stringifiedBody,
|
|
879
|
+
stamp: stamp,
|
|
880
|
+
url: fullUrl,
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
this.getSubOrgIds = async (input = {}, stampWith) => {
|
|
884
|
+
const session = await this.storageManager?.getActiveSession();
|
|
885
|
+
return this.request("/public/v1/query/list_suborgs", {
|
|
886
|
+
...input,
|
|
887
|
+
organizationId: input.organizationId ??
|
|
888
|
+
session?.organizationId ??
|
|
889
|
+
this.config.organizationId,
|
|
890
|
+
}, stampWith);
|
|
891
|
+
};
|
|
892
|
+
this.stampGetSubOrgIds = async (input, stampWith) => {
|
|
893
|
+
const activeStamper = this.getStamper(stampWith);
|
|
894
|
+
if (!activeStamper) {
|
|
895
|
+
return undefined;
|
|
896
|
+
}
|
|
897
|
+
const session = await this.storageManager?.getActiveSession();
|
|
898
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_suborgs";
|
|
899
|
+
const body = {
|
|
900
|
+
...input,
|
|
901
|
+
organizationId: input.organizationId ??
|
|
902
|
+
session?.organizationId ??
|
|
903
|
+
this.config.organizationId,
|
|
904
|
+
};
|
|
905
|
+
const stringifiedBody = JSON.stringify(body);
|
|
906
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
907
|
+
return {
|
|
908
|
+
body: stringifiedBody,
|
|
909
|
+
stamp: stamp,
|
|
910
|
+
url: fullUrl,
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
this.listUserTags = async (input = {}, stampWith) => {
|
|
914
|
+
const session = await this.storageManager?.getActiveSession();
|
|
915
|
+
return this.request("/public/v1/query/list_user_tags", {
|
|
916
|
+
...input,
|
|
917
|
+
organizationId: input.organizationId ??
|
|
918
|
+
session?.organizationId ??
|
|
919
|
+
this.config.organizationId,
|
|
920
|
+
}, stampWith);
|
|
921
|
+
};
|
|
922
|
+
this.stampListUserTags = async (input, stampWith) => {
|
|
923
|
+
const activeStamper = this.getStamper(stampWith);
|
|
924
|
+
if (!activeStamper) {
|
|
925
|
+
return undefined;
|
|
926
|
+
}
|
|
927
|
+
const session = await this.storageManager?.getActiveSession();
|
|
928
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_user_tags";
|
|
929
|
+
const body = {
|
|
930
|
+
...input,
|
|
931
|
+
organizationId: input.organizationId ??
|
|
932
|
+
session?.organizationId ??
|
|
933
|
+
this.config.organizationId,
|
|
934
|
+
};
|
|
935
|
+
const stringifiedBody = JSON.stringify(body);
|
|
936
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
937
|
+
return {
|
|
938
|
+
body: stringifiedBody,
|
|
939
|
+
stamp: stamp,
|
|
940
|
+
url: fullUrl,
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
this.getUsers = async (input = {}, stampWith) => {
|
|
944
|
+
const session = await this.storageManager?.getActiveSession();
|
|
945
|
+
return this.request("/public/v1/query/list_users", {
|
|
946
|
+
...input,
|
|
947
|
+
organizationId: input.organizationId ??
|
|
948
|
+
session?.organizationId ??
|
|
949
|
+
this.config.organizationId,
|
|
950
|
+
}, stampWith);
|
|
951
|
+
};
|
|
952
|
+
this.stampGetUsers = async (input, stampWith) => {
|
|
953
|
+
const activeStamper = this.getStamper(stampWith);
|
|
954
|
+
if (!activeStamper) {
|
|
955
|
+
return undefined;
|
|
956
|
+
}
|
|
957
|
+
const session = await this.storageManager?.getActiveSession();
|
|
958
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_users";
|
|
959
|
+
const body = {
|
|
960
|
+
...input,
|
|
961
|
+
organizationId: input.organizationId ??
|
|
962
|
+
session?.organizationId ??
|
|
963
|
+
this.config.organizationId,
|
|
964
|
+
};
|
|
965
|
+
const stringifiedBody = JSON.stringify(body);
|
|
966
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
967
|
+
return {
|
|
968
|
+
body: stringifiedBody,
|
|
969
|
+
stamp: stamp,
|
|
970
|
+
url: fullUrl,
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
this.getVerifiedSubOrgIds = async (input, stampWith) => {
|
|
974
|
+
const session = await this.storageManager?.getActiveSession();
|
|
975
|
+
return this.request("/public/v1/query/list_verified_suborgs", {
|
|
976
|
+
...input,
|
|
977
|
+
organizationId: input.organizationId ??
|
|
978
|
+
session?.organizationId ??
|
|
979
|
+
this.config.organizationId,
|
|
980
|
+
}, stampWith);
|
|
981
|
+
};
|
|
982
|
+
this.stampGetVerifiedSubOrgIds = async (input, stampWith) => {
|
|
983
|
+
const activeStamper = this.getStamper(stampWith);
|
|
984
|
+
if (!activeStamper) {
|
|
985
|
+
return undefined;
|
|
986
|
+
}
|
|
987
|
+
const session = await this.storageManager?.getActiveSession();
|
|
988
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs";
|
|
989
|
+
const body = {
|
|
990
|
+
...input,
|
|
991
|
+
organizationId: input.organizationId ??
|
|
992
|
+
session?.organizationId ??
|
|
993
|
+
this.config.organizationId,
|
|
994
|
+
};
|
|
995
|
+
const stringifiedBody = JSON.stringify(body);
|
|
996
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
997
|
+
return {
|
|
998
|
+
body: stringifiedBody,
|
|
999
|
+
stamp: stamp,
|
|
1000
|
+
url: fullUrl,
|
|
1001
|
+
};
|
|
1002
|
+
};
|
|
1003
|
+
this.getWalletAccounts = async (input, stampWith) => {
|
|
1004
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1005
|
+
return this.request("/public/v1/query/list_wallet_accounts", {
|
|
1006
|
+
...input,
|
|
1007
|
+
organizationId: input.organizationId ??
|
|
1008
|
+
session?.organizationId ??
|
|
1009
|
+
this.config.organizationId,
|
|
1010
|
+
}, stampWith);
|
|
1011
|
+
};
|
|
1012
|
+
this.stampGetWalletAccounts = async (input, stampWith) => {
|
|
1013
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1014
|
+
if (!activeStamper) {
|
|
1015
|
+
return undefined;
|
|
1016
|
+
}
|
|
1017
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1018
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallet_accounts";
|
|
1019
|
+
const body = {
|
|
1020
|
+
...input,
|
|
1021
|
+
organizationId: input.organizationId ??
|
|
1022
|
+
session?.organizationId ??
|
|
1023
|
+
this.config.organizationId,
|
|
1024
|
+
};
|
|
1025
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1026
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1027
|
+
return {
|
|
1028
|
+
body: stringifiedBody,
|
|
1029
|
+
stamp: stamp,
|
|
1030
|
+
url: fullUrl,
|
|
1031
|
+
};
|
|
1032
|
+
};
|
|
1033
|
+
this.getWallets = async (input = {}, stampWith) => {
|
|
1034
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1035
|
+
return this.request("/public/v1/query/list_wallets", {
|
|
1036
|
+
...input,
|
|
1037
|
+
organizationId: input.organizationId ??
|
|
1038
|
+
session?.organizationId ??
|
|
1039
|
+
this.config.organizationId,
|
|
1040
|
+
}, stampWith);
|
|
1041
|
+
};
|
|
1042
|
+
this.stampGetWallets = async (input, stampWith) => {
|
|
1043
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1044
|
+
if (!activeStamper) {
|
|
1045
|
+
return undefined;
|
|
1046
|
+
}
|
|
1047
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1048
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallets";
|
|
1049
|
+
const body = {
|
|
1050
|
+
...input,
|
|
1051
|
+
organizationId: input.organizationId ??
|
|
1052
|
+
session?.organizationId ??
|
|
1053
|
+
this.config.organizationId,
|
|
1054
|
+
};
|
|
1055
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1056
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1057
|
+
return {
|
|
1058
|
+
body: stringifiedBody,
|
|
1059
|
+
stamp: stamp,
|
|
1060
|
+
url: fullUrl,
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
this.getWhoami = async (input = {}, stampWith) => {
|
|
1064
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1065
|
+
return this.request("/public/v1/query/whoami", {
|
|
1066
|
+
...input,
|
|
1067
|
+
organizationId: input.organizationId ??
|
|
1068
|
+
session?.organizationId ??
|
|
1069
|
+
this.config.organizationId,
|
|
1070
|
+
}, stampWith);
|
|
1071
|
+
};
|
|
1072
|
+
this.stampGetWhoami = async (input, stampWith) => {
|
|
1073
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1074
|
+
if (!activeStamper) {
|
|
1075
|
+
return undefined;
|
|
1076
|
+
}
|
|
1077
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1078
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/whoami";
|
|
1079
|
+
const body = {
|
|
1080
|
+
...input,
|
|
1081
|
+
organizationId: input.organizationId ??
|
|
1082
|
+
session?.organizationId ??
|
|
1083
|
+
this.config.organizationId,
|
|
1084
|
+
};
|
|
1085
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1086
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1087
|
+
return {
|
|
1088
|
+
body: stringifiedBody,
|
|
1089
|
+
stamp: stamp,
|
|
1090
|
+
url: fullUrl,
|
|
1091
|
+
};
|
|
1092
|
+
};
|
|
1093
|
+
this.approveActivity = async (input, stampWith) => {
|
|
1094
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1095
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1096
|
+
return this.activityDecision("/public/v1/submit/approve_activity", {
|
|
1097
|
+
parameters: rest,
|
|
1098
|
+
organizationId: organizationId ??
|
|
1099
|
+
session?.organizationId ??
|
|
1100
|
+
this.config.organizationId,
|
|
1101
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1102
|
+
type: "ACTIVITY_TYPE_APPROVE_ACTIVITY",
|
|
1103
|
+
}, stampWith);
|
|
1104
|
+
};
|
|
1105
|
+
this.stampApproveActivity = async (input, stampWith) => {
|
|
1106
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1107
|
+
if (!activeStamper) {
|
|
1108
|
+
return undefined;
|
|
1109
|
+
}
|
|
1110
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1111
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1112
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/approve_activity";
|
|
1113
|
+
const bodyWithType = {
|
|
1114
|
+
parameters,
|
|
1115
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1116
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1117
|
+
type: "ACTIVITY_TYPE_APPROVE_ACTIVITY",
|
|
1118
|
+
};
|
|
1119
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1120
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1121
|
+
return {
|
|
1122
|
+
body: stringifiedBody,
|
|
1123
|
+
stamp: stamp,
|
|
1124
|
+
url: fullUrl,
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
this.createApiKeys = async (input, stampWith) => {
|
|
1128
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1129
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1130
|
+
return this.activity("/public/v1/submit/create_api_keys", {
|
|
1131
|
+
parameters: rest,
|
|
1132
|
+
organizationId: organizationId ??
|
|
1133
|
+
session?.organizationId ??
|
|
1134
|
+
this.config.organizationId,
|
|
1135
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1136
|
+
type: "ACTIVITY_TYPE_CREATE_API_KEYS_V2",
|
|
1137
|
+
}, "createApiKeysResult", stampWith);
|
|
1138
|
+
};
|
|
1139
|
+
this.stampCreateApiKeys = async (input, stampWith) => {
|
|
1140
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1141
|
+
if (!activeStamper) {
|
|
1142
|
+
return undefined;
|
|
1143
|
+
}
|
|
1144
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1145
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1146
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_keys";
|
|
1147
|
+
const bodyWithType = {
|
|
1148
|
+
parameters,
|
|
1149
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1150
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1151
|
+
type: "ACTIVITY_TYPE_CREATE_API_KEYS_V2",
|
|
1152
|
+
};
|
|
1153
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1154
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1155
|
+
return {
|
|
1156
|
+
body: stringifiedBody,
|
|
1157
|
+
stamp: stamp,
|
|
1158
|
+
url: fullUrl,
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
this.createAuthenticators = async (input, stampWith) => {
|
|
1162
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1163
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1164
|
+
return this.activity("/public/v1/submit/create_authenticators", {
|
|
1165
|
+
parameters: rest,
|
|
1166
|
+
organizationId: organizationId ??
|
|
1167
|
+
session?.organizationId ??
|
|
1168
|
+
this.config.organizationId,
|
|
1169
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1170
|
+
type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2",
|
|
1171
|
+
}, "createAuthenticatorsResult", stampWith);
|
|
1172
|
+
};
|
|
1173
|
+
this.stampCreateAuthenticators = async (input, stampWith) => {
|
|
1174
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1175
|
+
if (!activeStamper) {
|
|
1176
|
+
return undefined;
|
|
1177
|
+
}
|
|
1178
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1179
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1180
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_authenticators";
|
|
1181
|
+
const bodyWithType = {
|
|
1182
|
+
parameters,
|
|
1183
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1184
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1185
|
+
type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2",
|
|
1186
|
+
};
|
|
1187
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1188
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1189
|
+
return {
|
|
1190
|
+
body: stringifiedBody,
|
|
1191
|
+
stamp: stamp,
|
|
1192
|
+
url: fullUrl,
|
|
1193
|
+
};
|
|
1194
|
+
};
|
|
1195
|
+
this.createFiatOnRampCredential = async (input, stampWith) => {
|
|
1196
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1197
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1198
|
+
return this.activity("/public/v1/submit/create_fiat_on_ramp_credential", {
|
|
1199
|
+
parameters: rest,
|
|
1200
|
+
organizationId: organizationId ??
|
|
1201
|
+
session?.organizationId ??
|
|
1202
|
+
this.config.organizationId,
|
|
1203
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1204
|
+
type: "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL",
|
|
1205
|
+
}, "createFiatOnRampCredentialResult", stampWith);
|
|
1206
|
+
};
|
|
1207
|
+
this.stampCreateFiatOnRampCredential = async (input, stampWith) => {
|
|
1208
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1209
|
+
if (!activeStamper) {
|
|
1210
|
+
return undefined;
|
|
1211
|
+
}
|
|
1212
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1213
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1214
|
+
const fullUrl = this.config.apiBaseUrl +
|
|
1215
|
+
"/public/v1/submit/create_fiat_on_ramp_credential";
|
|
1216
|
+
const bodyWithType = {
|
|
1217
|
+
parameters,
|
|
1218
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1219
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1220
|
+
type: "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL",
|
|
1221
|
+
};
|
|
1222
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1223
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1224
|
+
return {
|
|
1225
|
+
body: stringifiedBody,
|
|
1226
|
+
stamp: stamp,
|
|
1227
|
+
url: fullUrl,
|
|
1228
|
+
};
|
|
1229
|
+
};
|
|
1230
|
+
this.createInvitations = async (input, stampWith) => {
|
|
1231
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1232
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1233
|
+
return this.activity("/public/v1/submit/create_invitations", {
|
|
1234
|
+
parameters: rest,
|
|
1235
|
+
organizationId: organizationId ??
|
|
1236
|
+
session?.organizationId ??
|
|
1237
|
+
this.config.organizationId,
|
|
1238
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1239
|
+
type: "ACTIVITY_TYPE_CREATE_INVITATIONS",
|
|
1240
|
+
}, "createInvitationsResult", stampWith);
|
|
1241
|
+
};
|
|
1242
|
+
this.stampCreateInvitations = async (input, stampWith) => {
|
|
1243
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1244
|
+
if (!activeStamper) {
|
|
1245
|
+
return undefined;
|
|
1246
|
+
}
|
|
1247
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1248
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1249
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_invitations";
|
|
1250
|
+
const bodyWithType = {
|
|
1251
|
+
parameters,
|
|
1252
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1253
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1254
|
+
type: "ACTIVITY_TYPE_CREATE_INVITATIONS",
|
|
1255
|
+
};
|
|
1256
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1257
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1258
|
+
return {
|
|
1259
|
+
body: stringifiedBody,
|
|
1260
|
+
stamp: stamp,
|
|
1261
|
+
url: fullUrl,
|
|
1262
|
+
};
|
|
1263
|
+
};
|
|
1264
|
+
this.createOauth2Credential = async (input, stampWith) => {
|
|
1265
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1266
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1267
|
+
return this.activity("/public/v1/submit/create_oauth2_credential", {
|
|
1268
|
+
parameters: rest,
|
|
1269
|
+
organizationId: organizationId ??
|
|
1270
|
+
session?.organizationId ??
|
|
1271
|
+
this.config.organizationId,
|
|
1272
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1273
|
+
type: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL",
|
|
1274
|
+
}, "createOauth2CredentialResult", stampWith);
|
|
1275
|
+
};
|
|
1276
|
+
this.stampCreateOauth2Credential = async (input, stampWith) => {
|
|
1277
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1278
|
+
if (!activeStamper) {
|
|
1279
|
+
return undefined;
|
|
1280
|
+
}
|
|
1281
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1282
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1283
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth2_credential";
|
|
1284
|
+
const bodyWithType = {
|
|
1285
|
+
parameters,
|
|
1286
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1287
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1288
|
+
type: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL",
|
|
1289
|
+
};
|
|
1290
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1291
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1292
|
+
return {
|
|
1293
|
+
body: stringifiedBody,
|
|
1294
|
+
stamp: stamp,
|
|
1295
|
+
url: fullUrl,
|
|
1296
|
+
};
|
|
1297
|
+
};
|
|
1298
|
+
this.createOauthProviders = async (input, stampWith) => {
|
|
1299
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1300
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1301
|
+
return this.activity("/public/v1/submit/create_oauth_providers", {
|
|
1302
|
+
parameters: rest,
|
|
1303
|
+
organizationId: organizationId ??
|
|
1304
|
+
session?.organizationId ??
|
|
1305
|
+
this.config.organizationId,
|
|
1306
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1307
|
+
type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
|
|
1308
|
+
}, "createOauthProvidersResult", stampWith);
|
|
1309
|
+
};
|
|
1310
|
+
this.stampCreateOauthProviders = async (input, stampWith) => {
|
|
1311
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1312
|
+
if (!activeStamper) {
|
|
1313
|
+
return undefined;
|
|
1314
|
+
}
|
|
1315
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1316
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1317
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth_providers";
|
|
1318
|
+
const bodyWithType = {
|
|
1319
|
+
parameters,
|
|
1320
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1321
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1322
|
+
type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
|
|
1323
|
+
};
|
|
1324
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1325
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1326
|
+
return {
|
|
1327
|
+
body: stringifiedBody,
|
|
1328
|
+
stamp: stamp,
|
|
1329
|
+
url: fullUrl,
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
this.createPolicies = async (input, stampWith) => {
|
|
1333
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1334
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1335
|
+
return this.activity("/public/v1/submit/create_policies", {
|
|
1336
|
+
parameters: rest,
|
|
1337
|
+
organizationId: organizationId ??
|
|
1338
|
+
session?.organizationId ??
|
|
1339
|
+
this.config.organizationId,
|
|
1340
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1341
|
+
type: "ACTIVITY_TYPE_CREATE_POLICIES",
|
|
1342
|
+
}, "createPoliciesResult", stampWith);
|
|
1343
|
+
};
|
|
1344
|
+
this.stampCreatePolicies = async (input, stampWith) => {
|
|
1345
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1346
|
+
if (!activeStamper) {
|
|
1347
|
+
return undefined;
|
|
1348
|
+
}
|
|
1349
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1350
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1351
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_policies";
|
|
1352
|
+
const bodyWithType = {
|
|
1353
|
+
parameters,
|
|
1354
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1355
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1356
|
+
type: "ACTIVITY_TYPE_CREATE_POLICIES",
|
|
1357
|
+
};
|
|
1358
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1359
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1360
|
+
return {
|
|
1361
|
+
body: stringifiedBody,
|
|
1362
|
+
stamp: stamp,
|
|
1363
|
+
url: fullUrl,
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
this.createPolicy = async (input, stampWith) => {
|
|
1367
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1368
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1369
|
+
return this.activity("/public/v1/submit/create_policy", {
|
|
1370
|
+
parameters: rest,
|
|
1371
|
+
organizationId: organizationId ??
|
|
1372
|
+
session?.organizationId ??
|
|
1373
|
+
this.config.organizationId,
|
|
1374
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1375
|
+
type: "ACTIVITY_TYPE_CREATE_POLICY_V3",
|
|
1376
|
+
}, "createPolicyResult", stampWith);
|
|
1377
|
+
};
|
|
1378
|
+
this.stampCreatePolicy = async (input, stampWith) => {
|
|
1379
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1380
|
+
if (!activeStamper) {
|
|
1381
|
+
return undefined;
|
|
1382
|
+
}
|
|
1383
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1384
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1385
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_policy";
|
|
1386
|
+
const bodyWithType = {
|
|
1387
|
+
parameters,
|
|
1388
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1389
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1390
|
+
type: "ACTIVITY_TYPE_CREATE_POLICY_V3",
|
|
1391
|
+
};
|
|
1392
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1393
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1394
|
+
return {
|
|
1395
|
+
body: stringifiedBody,
|
|
1396
|
+
stamp: stamp,
|
|
1397
|
+
url: fullUrl,
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
this.createPrivateKeyTag = async (input, stampWith) => {
|
|
1401
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1402
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1403
|
+
return this.activity("/public/v1/submit/create_private_key_tag", {
|
|
1404
|
+
parameters: rest,
|
|
1405
|
+
organizationId: organizationId ??
|
|
1406
|
+
session?.organizationId ??
|
|
1407
|
+
this.config.organizationId,
|
|
1408
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1409
|
+
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG",
|
|
1410
|
+
}, "createPrivateKeyTagResult", stampWith);
|
|
1411
|
+
};
|
|
1412
|
+
this.stampCreatePrivateKeyTag = async (input, stampWith) => {
|
|
1413
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1414
|
+
if (!activeStamper) {
|
|
1415
|
+
return undefined;
|
|
1416
|
+
}
|
|
1417
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1418
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1419
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_private_key_tag";
|
|
1420
|
+
const bodyWithType = {
|
|
1421
|
+
parameters,
|
|
1422
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1423
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1424
|
+
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG",
|
|
1425
|
+
};
|
|
1426
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1427
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1428
|
+
return {
|
|
1429
|
+
body: stringifiedBody,
|
|
1430
|
+
stamp: stamp,
|
|
1431
|
+
url: fullUrl,
|
|
1432
|
+
};
|
|
1433
|
+
};
|
|
1434
|
+
this.createPrivateKeys = async (input, stampWith) => {
|
|
1435
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1436
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1437
|
+
return this.activity("/public/v1/submit/create_private_keys", {
|
|
1438
|
+
parameters: rest,
|
|
1439
|
+
organizationId: organizationId ??
|
|
1440
|
+
session?.organizationId ??
|
|
1441
|
+
this.config.organizationId,
|
|
1442
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1443
|
+
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2",
|
|
1444
|
+
}, "createPrivateKeysResultV2", stampWith);
|
|
1445
|
+
};
|
|
1446
|
+
this.stampCreatePrivateKeys = async (input, stampWith) => {
|
|
1447
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1448
|
+
if (!activeStamper) {
|
|
1449
|
+
return undefined;
|
|
1450
|
+
}
|
|
1451
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1452
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1453
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_private_keys";
|
|
1454
|
+
const bodyWithType = {
|
|
1455
|
+
parameters,
|
|
1456
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1457
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1458
|
+
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2",
|
|
1459
|
+
};
|
|
1460
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1461
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1462
|
+
return {
|
|
1463
|
+
body: stringifiedBody,
|
|
1464
|
+
stamp: stamp,
|
|
1465
|
+
url: fullUrl,
|
|
1466
|
+
};
|
|
1467
|
+
};
|
|
1468
|
+
this.createReadOnlySession = async (input, stampWith) => {
|
|
1469
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1470
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1471
|
+
return this.activity("/public/v1/submit/create_read_only_session", {
|
|
1472
|
+
parameters: rest,
|
|
1473
|
+
organizationId: organizationId ??
|
|
1474
|
+
session?.organizationId ??
|
|
1475
|
+
this.config.organizationId,
|
|
1476
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1477
|
+
type: "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION",
|
|
1478
|
+
}, "createReadOnlySessionResult", stampWith);
|
|
1479
|
+
};
|
|
1480
|
+
this.stampCreateReadOnlySession = async (input, stampWith) => {
|
|
1481
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1482
|
+
if (!activeStamper) {
|
|
1483
|
+
return undefined;
|
|
1484
|
+
}
|
|
1485
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1486
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1487
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_read_only_session";
|
|
1488
|
+
const bodyWithType = {
|
|
1489
|
+
parameters,
|
|
1490
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1491
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1492
|
+
type: "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION",
|
|
1493
|
+
};
|
|
1494
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1495
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1496
|
+
return {
|
|
1497
|
+
body: stringifiedBody,
|
|
1498
|
+
stamp: stamp,
|
|
1499
|
+
url: fullUrl,
|
|
1500
|
+
};
|
|
1501
|
+
};
|
|
1502
|
+
this.createReadWriteSession = async (input, stampWith) => {
|
|
1503
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1504
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1505
|
+
return this.activity("/public/v1/submit/create_read_write_session", {
|
|
1506
|
+
parameters: rest,
|
|
1507
|
+
organizationId: organizationId ??
|
|
1508
|
+
session?.organizationId ??
|
|
1509
|
+
this.config.organizationId,
|
|
1510
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1511
|
+
type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
|
|
1512
|
+
}, "createReadWriteSessionResult", stampWith);
|
|
1513
|
+
};
|
|
1514
|
+
this.stampCreateReadWriteSession = async (input, stampWith) => {
|
|
1515
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1516
|
+
if (!activeStamper) {
|
|
1517
|
+
return undefined;
|
|
1518
|
+
}
|
|
1519
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1520
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1521
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_read_write_session";
|
|
1522
|
+
const bodyWithType = {
|
|
1523
|
+
parameters,
|
|
1524
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1525
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1526
|
+
type: "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2",
|
|
1527
|
+
};
|
|
1528
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1529
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1530
|
+
return {
|
|
1531
|
+
body: stringifiedBody,
|
|
1532
|
+
stamp: stamp,
|
|
1533
|
+
url: fullUrl,
|
|
1534
|
+
};
|
|
1535
|
+
};
|
|
1536
|
+
this.createSmartContractInterface = async (input, stampWith) => {
|
|
1537
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1538
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1539
|
+
return this.activity("/public/v1/submit/create_smart_contract_interface", {
|
|
1540
|
+
parameters: rest,
|
|
1541
|
+
organizationId: organizationId ??
|
|
1542
|
+
session?.organizationId ??
|
|
1543
|
+
this.config.organizationId,
|
|
1544
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1545
|
+
type: "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE",
|
|
1546
|
+
}, "createSmartContractInterfaceResult", stampWith);
|
|
1547
|
+
};
|
|
1548
|
+
this.stampCreateSmartContractInterface = async (input, stampWith) => {
|
|
1549
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1550
|
+
if (!activeStamper) {
|
|
1551
|
+
return undefined;
|
|
1552
|
+
}
|
|
1553
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1554
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1555
|
+
const fullUrl = this.config.apiBaseUrl +
|
|
1556
|
+
"/public/v1/submit/create_smart_contract_interface";
|
|
1557
|
+
const bodyWithType = {
|
|
1558
|
+
parameters,
|
|
1559
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1560
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1561
|
+
type: "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE",
|
|
1562
|
+
};
|
|
1563
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1564
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1565
|
+
return {
|
|
1566
|
+
body: stringifiedBody,
|
|
1567
|
+
stamp: stamp,
|
|
1568
|
+
url: fullUrl,
|
|
1569
|
+
};
|
|
1570
|
+
};
|
|
1571
|
+
this.createSubOrganization = async (input, stampWith) => {
|
|
1572
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1573
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1574
|
+
return this.activity("/public/v1/submit/create_sub_organization", {
|
|
1575
|
+
parameters: rest,
|
|
1576
|
+
organizationId: organizationId ??
|
|
1577
|
+
session?.organizationId ??
|
|
1578
|
+
this.config.organizationId,
|
|
1579
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1580
|
+
type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
|
|
1581
|
+
}, "createSubOrganizationResultV7", stampWith);
|
|
1582
|
+
};
|
|
1583
|
+
this.stampCreateSubOrganization = async (input, stampWith) => {
|
|
1584
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1585
|
+
if (!activeStamper) {
|
|
1586
|
+
return undefined;
|
|
1587
|
+
}
|
|
1588
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1589
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1590
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_sub_organization";
|
|
1591
|
+
const bodyWithType = {
|
|
1592
|
+
parameters,
|
|
1593
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1594
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1595
|
+
type: "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7",
|
|
1596
|
+
};
|
|
1597
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1598
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1599
|
+
return {
|
|
1600
|
+
body: stringifiedBody,
|
|
1601
|
+
stamp: stamp,
|
|
1602
|
+
url: fullUrl,
|
|
1603
|
+
};
|
|
1604
|
+
};
|
|
1605
|
+
this.createUserTag = async (input, stampWith) => {
|
|
1606
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1607
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1608
|
+
return this.activity("/public/v1/submit/create_user_tag", {
|
|
1609
|
+
parameters: rest,
|
|
1610
|
+
organizationId: organizationId ??
|
|
1611
|
+
session?.organizationId ??
|
|
1612
|
+
this.config.organizationId,
|
|
1613
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1614
|
+
type: "ACTIVITY_TYPE_CREATE_USER_TAG",
|
|
1615
|
+
}, "createUserTagResult", stampWith);
|
|
1616
|
+
};
|
|
1617
|
+
this.stampCreateUserTag = async (input, stampWith) => {
|
|
1618
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1619
|
+
if (!activeStamper) {
|
|
1620
|
+
return undefined;
|
|
1621
|
+
}
|
|
1622
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1623
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1624
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_user_tag";
|
|
1625
|
+
const bodyWithType = {
|
|
1626
|
+
parameters,
|
|
1627
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1628
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1629
|
+
type: "ACTIVITY_TYPE_CREATE_USER_TAG",
|
|
1630
|
+
};
|
|
1631
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1632
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1633
|
+
return {
|
|
1634
|
+
body: stringifiedBody,
|
|
1635
|
+
stamp: stamp,
|
|
1636
|
+
url: fullUrl,
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
this.createUsers = async (input, stampWith) => {
|
|
1640
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1641
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1642
|
+
return this.activity("/public/v1/submit/create_users", {
|
|
1643
|
+
parameters: rest,
|
|
1644
|
+
organizationId: organizationId ??
|
|
1645
|
+
session?.organizationId ??
|
|
1646
|
+
this.config.organizationId,
|
|
1647
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1648
|
+
type: "ACTIVITY_TYPE_CREATE_USERS_V3",
|
|
1649
|
+
}, "createUsersResult", stampWith);
|
|
1650
|
+
};
|
|
1651
|
+
this.stampCreateUsers = async (input, stampWith) => {
|
|
1652
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1653
|
+
if (!activeStamper) {
|
|
1654
|
+
return undefined;
|
|
1655
|
+
}
|
|
1656
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1657
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1658
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_users";
|
|
1659
|
+
const bodyWithType = {
|
|
1660
|
+
parameters,
|
|
1661
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1662
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1663
|
+
type: "ACTIVITY_TYPE_CREATE_USERS_V3",
|
|
1664
|
+
};
|
|
1665
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1666
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1667
|
+
return {
|
|
1668
|
+
body: stringifiedBody,
|
|
1669
|
+
stamp: stamp,
|
|
1670
|
+
url: fullUrl,
|
|
1671
|
+
};
|
|
1672
|
+
};
|
|
1673
|
+
this.createWallet = async (input, stampWith) => {
|
|
1674
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1675
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1676
|
+
return this.activity("/public/v1/submit/create_wallet", {
|
|
1677
|
+
parameters: rest,
|
|
1678
|
+
organizationId: organizationId ??
|
|
1679
|
+
session?.organizationId ??
|
|
1680
|
+
this.config.organizationId,
|
|
1681
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1682
|
+
type: "ACTIVITY_TYPE_CREATE_WALLET",
|
|
1683
|
+
}, "createWalletResult", stampWith);
|
|
1684
|
+
};
|
|
1685
|
+
this.stampCreateWallet = async (input, stampWith) => {
|
|
1686
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1687
|
+
if (!activeStamper) {
|
|
1688
|
+
return undefined;
|
|
1689
|
+
}
|
|
1690
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1691
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1692
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_wallet";
|
|
1693
|
+
const bodyWithType = {
|
|
1694
|
+
parameters,
|
|
1695
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1696
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1697
|
+
type: "ACTIVITY_TYPE_CREATE_WALLET",
|
|
1698
|
+
};
|
|
1699
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1700
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1701
|
+
return {
|
|
1702
|
+
body: stringifiedBody,
|
|
1703
|
+
stamp: stamp,
|
|
1704
|
+
url: fullUrl,
|
|
1705
|
+
};
|
|
1706
|
+
};
|
|
1707
|
+
this.createWalletAccounts = async (input, stampWith) => {
|
|
1708
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1709
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1710
|
+
return this.activity("/public/v1/submit/create_wallet_accounts", {
|
|
1711
|
+
parameters: rest,
|
|
1712
|
+
organizationId: organizationId ??
|
|
1713
|
+
session?.organizationId ??
|
|
1714
|
+
this.config.organizationId,
|
|
1715
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1716
|
+
type: "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS",
|
|
1717
|
+
}, "createWalletAccountsResult", stampWith);
|
|
1718
|
+
};
|
|
1719
|
+
this.stampCreateWalletAccounts = async (input, stampWith) => {
|
|
1720
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1721
|
+
if (!activeStamper) {
|
|
1722
|
+
return undefined;
|
|
1723
|
+
}
|
|
1724
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1725
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1726
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_wallet_accounts";
|
|
1727
|
+
const bodyWithType = {
|
|
1728
|
+
parameters,
|
|
1729
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1730
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1731
|
+
type: "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS",
|
|
1732
|
+
};
|
|
1733
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1734
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1735
|
+
return {
|
|
1736
|
+
body: stringifiedBody,
|
|
1737
|
+
stamp: stamp,
|
|
1738
|
+
url: fullUrl,
|
|
1739
|
+
};
|
|
1740
|
+
};
|
|
1741
|
+
this.deleteApiKeys = async (input, stampWith) => {
|
|
1742
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1743
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1744
|
+
return this.activity("/public/v1/submit/delete_api_keys", {
|
|
1745
|
+
parameters: rest,
|
|
1746
|
+
organizationId: organizationId ??
|
|
1747
|
+
session?.organizationId ??
|
|
1748
|
+
this.config.organizationId,
|
|
1749
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1750
|
+
type: "ACTIVITY_TYPE_DELETE_API_KEYS",
|
|
1751
|
+
}, "deleteApiKeysResult", stampWith);
|
|
1752
|
+
};
|
|
1753
|
+
this.stampDeleteApiKeys = async (input, stampWith) => {
|
|
1754
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1755
|
+
if (!activeStamper) {
|
|
1756
|
+
return undefined;
|
|
1757
|
+
}
|
|
1758
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1759
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1760
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_api_keys";
|
|
1761
|
+
const bodyWithType = {
|
|
1762
|
+
parameters,
|
|
1763
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1764
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1765
|
+
type: "ACTIVITY_TYPE_DELETE_API_KEYS",
|
|
1766
|
+
};
|
|
1767
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1768
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1769
|
+
return {
|
|
1770
|
+
body: stringifiedBody,
|
|
1771
|
+
stamp: stamp,
|
|
1772
|
+
url: fullUrl,
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
this.deleteAuthenticators = async (input, stampWith) => {
|
|
1776
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1777
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1778
|
+
return this.activity("/public/v1/submit/delete_authenticators", {
|
|
1779
|
+
parameters: rest,
|
|
1780
|
+
organizationId: organizationId ??
|
|
1781
|
+
session?.organizationId ??
|
|
1782
|
+
this.config.organizationId,
|
|
1783
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1784
|
+
type: "ACTIVITY_TYPE_DELETE_AUTHENTICATORS",
|
|
1785
|
+
}, "deleteAuthenticatorsResult", stampWith);
|
|
1786
|
+
};
|
|
1787
|
+
this.stampDeleteAuthenticators = async (input, stampWith) => {
|
|
1788
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1789
|
+
if (!activeStamper) {
|
|
1790
|
+
return undefined;
|
|
1791
|
+
}
|
|
1792
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1793
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1794
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_authenticators";
|
|
1795
|
+
const bodyWithType = {
|
|
1796
|
+
parameters,
|
|
1797
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1798
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1799
|
+
type: "ACTIVITY_TYPE_DELETE_AUTHENTICATORS",
|
|
1800
|
+
};
|
|
1801
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1802
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1803
|
+
return {
|
|
1804
|
+
body: stringifiedBody,
|
|
1805
|
+
stamp: stamp,
|
|
1806
|
+
url: fullUrl,
|
|
1807
|
+
};
|
|
1808
|
+
};
|
|
1809
|
+
this.deleteFiatOnRampCredential = async (input, stampWith) => {
|
|
1810
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1811
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1812
|
+
return this.activity("/public/v1/submit/delete_fiat_on_ramp_credential", {
|
|
1813
|
+
parameters: rest,
|
|
1814
|
+
organizationId: organizationId ??
|
|
1815
|
+
session?.organizationId ??
|
|
1816
|
+
this.config.organizationId,
|
|
1817
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1818
|
+
type: "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL",
|
|
1819
|
+
}, "deleteFiatOnRampCredentialResult", stampWith);
|
|
1820
|
+
};
|
|
1821
|
+
this.stampDeleteFiatOnRampCredential = async (input, stampWith) => {
|
|
1822
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1823
|
+
if (!activeStamper) {
|
|
1824
|
+
return undefined;
|
|
1825
|
+
}
|
|
1826
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1827
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1828
|
+
const fullUrl = this.config.apiBaseUrl +
|
|
1829
|
+
"/public/v1/submit/delete_fiat_on_ramp_credential";
|
|
1830
|
+
const bodyWithType = {
|
|
1831
|
+
parameters,
|
|
1832
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1833
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1834
|
+
type: "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL",
|
|
1835
|
+
};
|
|
1836
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1837
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1838
|
+
return {
|
|
1839
|
+
body: stringifiedBody,
|
|
1840
|
+
stamp: stamp,
|
|
1841
|
+
url: fullUrl,
|
|
1842
|
+
};
|
|
1843
|
+
};
|
|
1844
|
+
this.deleteInvitation = async (input, stampWith) => {
|
|
1845
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1846
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1847
|
+
return this.activity("/public/v1/submit/delete_invitation", {
|
|
1848
|
+
parameters: rest,
|
|
1849
|
+
organizationId: organizationId ??
|
|
1850
|
+
session?.organizationId ??
|
|
1851
|
+
this.config.organizationId,
|
|
1852
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1853
|
+
type: "ACTIVITY_TYPE_DELETE_INVITATION",
|
|
1854
|
+
}, "deleteInvitationResult", stampWith);
|
|
1855
|
+
};
|
|
1856
|
+
this.stampDeleteInvitation = async (input, stampWith) => {
|
|
1857
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1858
|
+
if (!activeStamper) {
|
|
1859
|
+
return undefined;
|
|
1860
|
+
}
|
|
1861
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1862
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1863
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_invitation";
|
|
1864
|
+
const bodyWithType = {
|
|
1865
|
+
parameters,
|
|
1866
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1867
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1868
|
+
type: "ACTIVITY_TYPE_DELETE_INVITATION",
|
|
1869
|
+
};
|
|
1870
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1871
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1872
|
+
return {
|
|
1873
|
+
body: stringifiedBody,
|
|
1874
|
+
stamp: stamp,
|
|
1875
|
+
url: fullUrl,
|
|
1876
|
+
};
|
|
1877
|
+
};
|
|
1878
|
+
this.deleteOauth2Credential = async (input, stampWith) => {
|
|
1879
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1880
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1881
|
+
return this.activity("/public/v1/submit/delete_oauth2_credential", {
|
|
1882
|
+
parameters: rest,
|
|
1883
|
+
organizationId: organizationId ??
|
|
1884
|
+
session?.organizationId ??
|
|
1885
|
+
this.config.organizationId,
|
|
1886
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1887
|
+
type: "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL",
|
|
1888
|
+
}, "deleteOauth2CredentialResult", stampWith);
|
|
1889
|
+
};
|
|
1890
|
+
this.stampDeleteOauth2Credential = async (input, stampWith) => {
|
|
1891
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1892
|
+
if (!activeStamper) {
|
|
1893
|
+
return undefined;
|
|
1894
|
+
}
|
|
1895
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1896
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1897
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_oauth2_credential";
|
|
1898
|
+
const bodyWithType = {
|
|
1899
|
+
parameters,
|
|
1900
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1901
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1902
|
+
type: "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL",
|
|
1903
|
+
};
|
|
1904
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1905
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1906
|
+
return {
|
|
1907
|
+
body: stringifiedBody,
|
|
1908
|
+
stamp: stamp,
|
|
1909
|
+
url: fullUrl,
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1912
|
+
this.deleteOauthProviders = async (input, stampWith) => {
|
|
1913
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1914
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1915
|
+
return this.activity("/public/v1/submit/delete_oauth_providers", {
|
|
1916
|
+
parameters: rest,
|
|
1917
|
+
organizationId: organizationId ??
|
|
1918
|
+
session?.organizationId ??
|
|
1919
|
+
this.config.organizationId,
|
|
1920
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1921
|
+
type: "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS",
|
|
1922
|
+
}, "deleteOauthProvidersResult", stampWith);
|
|
1923
|
+
};
|
|
1924
|
+
this.stampDeleteOauthProviders = async (input, stampWith) => {
|
|
1925
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1926
|
+
if (!activeStamper) {
|
|
1927
|
+
return undefined;
|
|
1928
|
+
}
|
|
1929
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1930
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1931
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_oauth_providers";
|
|
1932
|
+
const bodyWithType = {
|
|
1933
|
+
parameters,
|
|
1934
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1935
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1936
|
+
type: "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS",
|
|
1937
|
+
};
|
|
1938
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1939
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1940
|
+
return {
|
|
1941
|
+
body: stringifiedBody,
|
|
1942
|
+
stamp: stamp,
|
|
1943
|
+
url: fullUrl,
|
|
1944
|
+
};
|
|
1945
|
+
};
|
|
1946
|
+
this.deletePolicies = async (input, stampWith) => {
|
|
1947
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1948
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1949
|
+
return this.activity("/public/v1/submit/delete_policies", {
|
|
1950
|
+
parameters: rest,
|
|
1951
|
+
organizationId: organizationId ??
|
|
1952
|
+
session?.organizationId ??
|
|
1953
|
+
this.config.organizationId,
|
|
1954
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1955
|
+
type: "ACTIVITY_TYPE_DELETE_POLICIES",
|
|
1956
|
+
}, "deletePoliciesResult", stampWith);
|
|
1957
|
+
};
|
|
1958
|
+
this.stampDeletePolicies = async (input, stampWith) => {
|
|
1959
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1960
|
+
if (!activeStamper) {
|
|
1961
|
+
return undefined;
|
|
1962
|
+
}
|
|
1963
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1964
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1965
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_policies";
|
|
1966
|
+
const bodyWithType = {
|
|
1967
|
+
parameters,
|
|
1968
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
1969
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1970
|
+
type: "ACTIVITY_TYPE_DELETE_POLICIES",
|
|
1971
|
+
};
|
|
1972
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
1973
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
1974
|
+
return {
|
|
1975
|
+
body: stringifiedBody,
|
|
1976
|
+
stamp: stamp,
|
|
1977
|
+
url: fullUrl,
|
|
1978
|
+
};
|
|
1979
|
+
};
|
|
1980
|
+
this.deletePolicy = async (input, stampWith) => {
|
|
1981
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
1982
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1983
|
+
return this.activity("/public/v1/submit/delete_policy", {
|
|
1984
|
+
parameters: rest,
|
|
1985
|
+
organizationId: organizationId ??
|
|
1986
|
+
session?.organizationId ??
|
|
1987
|
+
this.config.organizationId,
|
|
1988
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
1989
|
+
type: "ACTIVITY_TYPE_DELETE_POLICY",
|
|
1990
|
+
}, "deletePolicyResult", stampWith);
|
|
1991
|
+
};
|
|
1992
|
+
this.stampDeletePolicy = async (input, stampWith) => {
|
|
1993
|
+
const activeStamper = this.getStamper(stampWith);
|
|
1994
|
+
if (!activeStamper) {
|
|
1995
|
+
return undefined;
|
|
1996
|
+
}
|
|
1997
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
1998
|
+
const session = await this.storageManager?.getActiveSession();
|
|
1999
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_policy";
|
|
2000
|
+
const bodyWithType = {
|
|
2001
|
+
parameters,
|
|
2002
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2003
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2004
|
+
type: "ACTIVITY_TYPE_DELETE_POLICY",
|
|
2005
|
+
};
|
|
2006
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2007
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2008
|
+
return {
|
|
2009
|
+
body: stringifiedBody,
|
|
2010
|
+
stamp: stamp,
|
|
2011
|
+
url: fullUrl,
|
|
2012
|
+
};
|
|
2013
|
+
};
|
|
2014
|
+
this.deletePrivateKeyTags = async (input, stampWith) => {
|
|
2015
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2016
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2017
|
+
return this.activity("/public/v1/submit/delete_private_key_tags", {
|
|
2018
|
+
parameters: rest,
|
|
2019
|
+
organizationId: organizationId ??
|
|
2020
|
+
session?.organizationId ??
|
|
2021
|
+
this.config.organizationId,
|
|
2022
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2023
|
+
type: "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS",
|
|
2024
|
+
}, "deletePrivateKeyTagsResult", stampWith);
|
|
2025
|
+
};
|
|
2026
|
+
this.stampDeletePrivateKeyTags = async (input, stampWith) => {
|
|
2027
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2028
|
+
if (!activeStamper) {
|
|
2029
|
+
return undefined;
|
|
2030
|
+
}
|
|
2031
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2032
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2033
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_private_key_tags";
|
|
2034
|
+
const bodyWithType = {
|
|
2035
|
+
parameters,
|
|
2036
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2037
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2038
|
+
type: "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS",
|
|
2039
|
+
};
|
|
2040
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2041
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2042
|
+
return {
|
|
2043
|
+
body: stringifiedBody,
|
|
2044
|
+
stamp: stamp,
|
|
2045
|
+
url: fullUrl,
|
|
2046
|
+
};
|
|
2047
|
+
};
|
|
2048
|
+
this.deletePrivateKeys = async (input, stampWith) => {
|
|
2049
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2050
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2051
|
+
return this.activity("/public/v1/submit/delete_private_keys", {
|
|
2052
|
+
parameters: rest,
|
|
2053
|
+
organizationId: organizationId ??
|
|
2054
|
+
session?.organizationId ??
|
|
2055
|
+
this.config.organizationId,
|
|
2056
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2057
|
+
type: "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS",
|
|
2058
|
+
}, "deletePrivateKeysResult", stampWith);
|
|
2059
|
+
};
|
|
2060
|
+
this.stampDeletePrivateKeys = async (input, stampWith) => {
|
|
2061
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2062
|
+
if (!activeStamper) {
|
|
2063
|
+
return undefined;
|
|
2064
|
+
}
|
|
2065
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2066
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2067
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_private_keys";
|
|
2068
|
+
const bodyWithType = {
|
|
2069
|
+
parameters,
|
|
2070
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2071
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2072
|
+
type: "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS",
|
|
2073
|
+
};
|
|
2074
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2075
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2076
|
+
return {
|
|
2077
|
+
body: stringifiedBody,
|
|
2078
|
+
stamp: stamp,
|
|
2079
|
+
url: fullUrl,
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
this.deleteSmartContractInterface = async (input, stampWith) => {
|
|
2083
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2084
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2085
|
+
return this.activity("/public/v1/submit/delete_smart_contract_interface", {
|
|
2086
|
+
parameters: rest,
|
|
2087
|
+
organizationId: organizationId ??
|
|
2088
|
+
session?.organizationId ??
|
|
2089
|
+
this.config.organizationId,
|
|
2090
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2091
|
+
type: "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE",
|
|
2092
|
+
}, "deleteSmartContractInterfaceResult", stampWith);
|
|
2093
|
+
};
|
|
2094
|
+
this.stampDeleteSmartContractInterface = async (input, stampWith) => {
|
|
2095
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2096
|
+
if (!activeStamper) {
|
|
2097
|
+
return undefined;
|
|
2098
|
+
}
|
|
2099
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2100
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2101
|
+
const fullUrl = this.config.apiBaseUrl +
|
|
2102
|
+
"/public/v1/submit/delete_smart_contract_interface";
|
|
2103
|
+
const bodyWithType = {
|
|
2104
|
+
parameters,
|
|
2105
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2106
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2107
|
+
type: "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE",
|
|
2108
|
+
};
|
|
2109
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2110
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2111
|
+
return {
|
|
2112
|
+
body: stringifiedBody,
|
|
2113
|
+
stamp: stamp,
|
|
2114
|
+
url: fullUrl,
|
|
2115
|
+
};
|
|
2116
|
+
};
|
|
2117
|
+
this.deleteSubOrganization = async (input, stampWith) => {
|
|
2118
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2119
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2120
|
+
return this.activity("/public/v1/submit/delete_sub_organization", {
|
|
2121
|
+
parameters: rest,
|
|
2122
|
+
organizationId: organizationId ??
|
|
2123
|
+
session?.organizationId ??
|
|
2124
|
+
this.config.organizationId,
|
|
2125
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2126
|
+
type: "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION",
|
|
2127
|
+
}, "deleteSubOrganizationResult", stampWith);
|
|
2128
|
+
};
|
|
2129
|
+
this.stampDeleteSubOrganization = async (input, stampWith) => {
|
|
2130
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2131
|
+
if (!activeStamper) {
|
|
2132
|
+
return undefined;
|
|
2133
|
+
}
|
|
2134
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2135
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2136
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_sub_organization";
|
|
2137
|
+
const bodyWithType = {
|
|
2138
|
+
parameters,
|
|
2139
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2140
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2141
|
+
type: "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION",
|
|
2142
|
+
};
|
|
2143
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2144
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2145
|
+
return {
|
|
2146
|
+
body: stringifiedBody,
|
|
2147
|
+
stamp: stamp,
|
|
2148
|
+
url: fullUrl,
|
|
2149
|
+
};
|
|
2150
|
+
};
|
|
2151
|
+
this.deleteUserTags = async (input, stampWith) => {
|
|
2152
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2153
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2154
|
+
return this.activity("/public/v1/submit/delete_user_tags", {
|
|
2155
|
+
parameters: rest,
|
|
2156
|
+
organizationId: organizationId ??
|
|
2157
|
+
session?.organizationId ??
|
|
2158
|
+
this.config.organizationId,
|
|
2159
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2160
|
+
type: "ACTIVITY_TYPE_DELETE_USER_TAGS",
|
|
2161
|
+
}, "deleteUserTagsResult", stampWith);
|
|
2162
|
+
};
|
|
2163
|
+
this.stampDeleteUserTags = async (input, stampWith) => {
|
|
2164
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2165
|
+
if (!activeStamper) {
|
|
2166
|
+
return undefined;
|
|
2167
|
+
}
|
|
2168
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2169
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2170
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_user_tags";
|
|
2171
|
+
const bodyWithType = {
|
|
2172
|
+
parameters,
|
|
2173
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2174
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2175
|
+
type: "ACTIVITY_TYPE_DELETE_USER_TAGS",
|
|
2176
|
+
};
|
|
2177
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2178
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2179
|
+
return {
|
|
2180
|
+
body: stringifiedBody,
|
|
2181
|
+
stamp: stamp,
|
|
2182
|
+
url: fullUrl,
|
|
2183
|
+
};
|
|
2184
|
+
};
|
|
2185
|
+
this.deleteUsers = async (input, stampWith) => {
|
|
2186
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2187
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2188
|
+
return this.activity("/public/v1/submit/delete_users", {
|
|
2189
|
+
parameters: rest,
|
|
2190
|
+
organizationId: organizationId ??
|
|
2191
|
+
session?.organizationId ??
|
|
2192
|
+
this.config.organizationId,
|
|
2193
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2194
|
+
type: "ACTIVITY_TYPE_DELETE_USERS",
|
|
2195
|
+
}, "deleteUsersResult", stampWith);
|
|
2196
|
+
};
|
|
2197
|
+
this.stampDeleteUsers = async (input, stampWith) => {
|
|
2198
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2199
|
+
if (!activeStamper) {
|
|
2200
|
+
return undefined;
|
|
2201
|
+
}
|
|
2202
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2203
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2204
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_users";
|
|
2205
|
+
const bodyWithType = {
|
|
2206
|
+
parameters,
|
|
2207
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2208
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2209
|
+
type: "ACTIVITY_TYPE_DELETE_USERS",
|
|
2210
|
+
};
|
|
2211
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2212
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2213
|
+
return {
|
|
2214
|
+
body: stringifiedBody,
|
|
2215
|
+
stamp: stamp,
|
|
2216
|
+
url: fullUrl,
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
this.deleteWalletAccounts = async (input, stampWith) => {
|
|
2220
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2221
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2222
|
+
return this.activity("/public/v1/submit/delete_wallet_accounts", {
|
|
2223
|
+
parameters: rest,
|
|
2224
|
+
organizationId: organizationId ??
|
|
2225
|
+
session?.organizationId ??
|
|
2226
|
+
this.config.organizationId,
|
|
2227
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2228
|
+
type: "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS",
|
|
2229
|
+
}, "deleteWalletAccountsResult", stampWith);
|
|
2230
|
+
};
|
|
2231
|
+
this.stampDeleteWalletAccounts = async (input, stampWith) => {
|
|
2232
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2233
|
+
if (!activeStamper) {
|
|
2234
|
+
return undefined;
|
|
2235
|
+
}
|
|
2236
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2237
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2238
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_wallet_accounts";
|
|
2239
|
+
const bodyWithType = {
|
|
2240
|
+
parameters,
|
|
2241
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2242
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2243
|
+
type: "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS",
|
|
2244
|
+
};
|
|
2245
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2246
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2247
|
+
return {
|
|
2248
|
+
body: stringifiedBody,
|
|
2249
|
+
stamp: stamp,
|
|
2250
|
+
url: fullUrl,
|
|
2251
|
+
};
|
|
2252
|
+
};
|
|
2253
|
+
this.deleteWallets = async (input, stampWith) => {
|
|
2254
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2255
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2256
|
+
return this.activity("/public/v1/submit/delete_wallets", {
|
|
2257
|
+
parameters: rest,
|
|
2258
|
+
organizationId: organizationId ??
|
|
2259
|
+
session?.organizationId ??
|
|
2260
|
+
this.config.organizationId,
|
|
2261
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2262
|
+
type: "ACTIVITY_TYPE_DELETE_WALLETS",
|
|
2263
|
+
}, "deleteWalletsResult", stampWith);
|
|
2264
|
+
};
|
|
2265
|
+
this.stampDeleteWallets = async (input, stampWith) => {
|
|
2266
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2267
|
+
if (!activeStamper) {
|
|
2268
|
+
return undefined;
|
|
2269
|
+
}
|
|
2270
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2271
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2272
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_wallets";
|
|
2273
|
+
const bodyWithType = {
|
|
2274
|
+
parameters,
|
|
2275
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2276
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2277
|
+
type: "ACTIVITY_TYPE_DELETE_WALLETS",
|
|
2278
|
+
};
|
|
2279
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2280
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2281
|
+
return {
|
|
2282
|
+
body: stringifiedBody,
|
|
2283
|
+
stamp: stamp,
|
|
2284
|
+
url: fullUrl,
|
|
2285
|
+
};
|
|
2286
|
+
};
|
|
2287
|
+
this.emailAuth = async (input, stampWith) => {
|
|
2288
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2289
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2290
|
+
return this.activity("/public/v1/submit/email_auth", {
|
|
2291
|
+
parameters: rest,
|
|
2292
|
+
organizationId: organizationId ??
|
|
2293
|
+
session?.organizationId ??
|
|
2294
|
+
this.config.organizationId,
|
|
2295
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2296
|
+
type: "ACTIVITY_TYPE_EMAIL_AUTH_V3",
|
|
2297
|
+
}, "emailAuthResult", stampWith);
|
|
2298
|
+
};
|
|
2299
|
+
this.stampEmailAuth = async (input, stampWith) => {
|
|
2300
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2301
|
+
if (!activeStamper) {
|
|
2302
|
+
return undefined;
|
|
2303
|
+
}
|
|
2304
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2305
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2306
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/email_auth";
|
|
2307
|
+
const bodyWithType = {
|
|
2308
|
+
parameters,
|
|
2309
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2310
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2311
|
+
type: "ACTIVITY_TYPE_EMAIL_AUTH_V3",
|
|
2312
|
+
};
|
|
2313
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2314
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2315
|
+
return {
|
|
2316
|
+
body: stringifiedBody,
|
|
2317
|
+
stamp: stamp,
|
|
2318
|
+
url: fullUrl,
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
this.ethSendTransaction = async (input, stampWith) => {
|
|
2322
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2323
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2324
|
+
return this.activity("/public/v1/submit/eth_send_transaction", {
|
|
2325
|
+
parameters: rest,
|
|
2326
|
+
organizationId: organizationId ??
|
|
2327
|
+
session?.organizationId ??
|
|
2328
|
+
this.config.organizationId,
|
|
2329
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2330
|
+
type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION",
|
|
2331
|
+
}, "ethSendTransactionResult", stampWith);
|
|
2332
|
+
};
|
|
2333
|
+
this.stampEthSendTransaction = async (input, stampWith) => {
|
|
2334
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2335
|
+
if (!activeStamper) {
|
|
2336
|
+
return undefined;
|
|
2337
|
+
}
|
|
2338
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2339
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2340
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/eth_send_transaction";
|
|
2341
|
+
const bodyWithType = {
|
|
2342
|
+
parameters,
|
|
2343
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2344
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2345
|
+
type: "ACTIVITY_TYPE_ETH_SEND_TRANSACTION",
|
|
2346
|
+
};
|
|
2347
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2348
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2349
|
+
return {
|
|
2350
|
+
body: stringifiedBody,
|
|
2351
|
+
stamp: stamp,
|
|
2352
|
+
url: fullUrl,
|
|
2353
|
+
};
|
|
2354
|
+
};
|
|
2355
|
+
this.exportPrivateKey = async (input, stampWith) => {
|
|
2356
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2357
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2358
|
+
return this.activity("/public/v1/submit/export_private_key", {
|
|
2359
|
+
parameters: rest,
|
|
2360
|
+
organizationId: organizationId ??
|
|
2361
|
+
session?.organizationId ??
|
|
2362
|
+
this.config.organizationId,
|
|
2363
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2364
|
+
type: "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY",
|
|
2365
|
+
}, "exportPrivateKeyResult", stampWith);
|
|
2366
|
+
};
|
|
2367
|
+
this.stampExportPrivateKey = async (input, stampWith) => {
|
|
2368
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2369
|
+
if (!activeStamper) {
|
|
2370
|
+
return undefined;
|
|
2371
|
+
}
|
|
2372
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2373
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2374
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/export_private_key";
|
|
2375
|
+
const bodyWithType = {
|
|
2376
|
+
parameters,
|
|
2377
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2378
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2379
|
+
type: "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY",
|
|
2380
|
+
};
|
|
2381
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2382
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2383
|
+
return {
|
|
2384
|
+
body: stringifiedBody,
|
|
2385
|
+
stamp: stamp,
|
|
2386
|
+
url: fullUrl,
|
|
2387
|
+
};
|
|
2388
|
+
};
|
|
2389
|
+
this.exportWallet = async (input, stampWith) => {
|
|
2390
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2391
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2392
|
+
return this.activity("/public/v1/submit/export_wallet", {
|
|
2393
|
+
parameters: rest,
|
|
2394
|
+
organizationId: organizationId ??
|
|
2395
|
+
session?.organizationId ??
|
|
2396
|
+
this.config.organizationId,
|
|
2397
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2398
|
+
type: "ACTIVITY_TYPE_EXPORT_WALLET",
|
|
2399
|
+
}, "exportWalletResult", stampWith);
|
|
2400
|
+
};
|
|
2401
|
+
this.stampExportWallet = async (input, stampWith) => {
|
|
2402
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2403
|
+
if (!activeStamper) {
|
|
2404
|
+
return undefined;
|
|
2405
|
+
}
|
|
2406
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2407
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2408
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/export_wallet";
|
|
2409
|
+
const bodyWithType = {
|
|
2410
|
+
parameters,
|
|
2411
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2412
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2413
|
+
type: "ACTIVITY_TYPE_EXPORT_WALLET",
|
|
2414
|
+
};
|
|
2415
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2416
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2417
|
+
return {
|
|
2418
|
+
body: stringifiedBody,
|
|
2419
|
+
stamp: stamp,
|
|
2420
|
+
url: fullUrl,
|
|
2421
|
+
};
|
|
2422
|
+
};
|
|
2423
|
+
this.exportWalletAccount = async (input, stampWith) => {
|
|
2424
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2425
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2426
|
+
return this.activity("/public/v1/submit/export_wallet_account", {
|
|
2427
|
+
parameters: rest,
|
|
2428
|
+
organizationId: organizationId ??
|
|
2429
|
+
session?.organizationId ??
|
|
2430
|
+
this.config.organizationId,
|
|
2431
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2432
|
+
type: "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT",
|
|
2433
|
+
}, "exportWalletAccountResult", stampWith);
|
|
2434
|
+
};
|
|
2435
|
+
this.stampExportWalletAccount = async (input, stampWith) => {
|
|
2436
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2437
|
+
if (!activeStamper) {
|
|
2438
|
+
return undefined;
|
|
2439
|
+
}
|
|
2440
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2441
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2442
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/export_wallet_account";
|
|
2443
|
+
const bodyWithType = {
|
|
2444
|
+
parameters,
|
|
2445
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2446
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2447
|
+
type: "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT",
|
|
2448
|
+
};
|
|
2449
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2450
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2451
|
+
return {
|
|
2452
|
+
body: stringifiedBody,
|
|
2453
|
+
stamp: stamp,
|
|
2454
|
+
url: fullUrl,
|
|
2455
|
+
};
|
|
2456
|
+
};
|
|
2457
|
+
this.importPrivateKey = async (input, stampWith) => {
|
|
2458
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2459
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2460
|
+
return this.activity("/public/v1/submit/import_private_key", {
|
|
2461
|
+
parameters: rest,
|
|
2462
|
+
organizationId: organizationId ??
|
|
2463
|
+
session?.organizationId ??
|
|
2464
|
+
this.config.organizationId,
|
|
2465
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2466
|
+
type: "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY",
|
|
2467
|
+
}, "importPrivateKeyResult", stampWith);
|
|
2468
|
+
};
|
|
2469
|
+
this.stampImportPrivateKey = async (input, stampWith) => {
|
|
2470
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2471
|
+
if (!activeStamper) {
|
|
2472
|
+
return undefined;
|
|
2473
|
+
}
|
|
2474
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2475
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2476
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/import_private_key";
|
|
2477
|
+
const bodyWithType = {
|
|
2478
|
+
parameters,
|
|
2479
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2480
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2481
|
+
type: "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY",
|
|
2482
|
+
};
|
|
2483
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2484
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2485
|
+
return {
|
|
2486
|
+
body: stringifiedBody,
|
|
2487
|
+
stamp: stamp,
|
|
2488
|
+
url: fullUrl,
|
|
2489
|
+
};
|
|
2490
|
+
};
|
|
2491
|
+
this.importWallet = async (input, stampWith) => {
|
|
2492
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2493
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2494
|
+
return this.activity("/public/v1/submit/import_wallet", {
|
|
2495
|
+
parameters: rest,
|
|
2496
|
+
organizationId: organizationId ??
|
|
2497
|
+
session?.organizationId ??
|
|
2498
|
+
this.config.organizationId,
|
|
2499
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2500
|
+
type: "ACTIVITY_TYPE_IMPORT_WALLET",
|
|
2501
|
+
}, "importWalletResult", stampWith);
|
|
2502
|
+
};
|
|
2503
|
+
this.stampImportWallet = async (input, stampWith) => {
|
|
2504
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2505
|
+
if (!activeStamper) {
|
|
2506
|
+
return undefined;
|
|
2507
|
+
}
|
|
2508
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2509
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2510
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/import_wallet";
|
|
2511
|
+
const bodyWithType = {
|
|
2512
|
+
parameters,
|
|
2513
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2514
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2515
|
+
type: "ACTIVITY_TYPE_IMPORT_WALLET",
|
|
2516
|
+
};
|
|
2517
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2518
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2519
|
+
return {
|
|
2520
|
+
body: stringifiedBody,
|
|
2521
|
+
stamp: stamp,
|
|
2522
|
+
url: fullUrl,
|
|
2523
|
+
};
|
|
2524
|
+
};
|
|
2525
|
+
this.initFiatOnRamp = async (input, stampWith) => {
|
|
2526
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2527
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2528
|
+
return this.activity("/public/v1/submit/init_fiat_on_ramp", {
|
|
2529
|
+
parameters: rest,
|
|
2530
|
+
organizationId: organizationId ??
|
|
2531
|
+
session?.organizationId ??
|
|
2532
|
+
this.config.organizationId,
|
|
2533
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2534
|
+
type: "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP",
|
|
2535
|
+
}, "initFiatOnRampResult", stampWith);
|
|
2536
|
+
};
|
|
2537
|
+
this.stampInitFiatOnRamp = async (input, stampWith) => {
|
|
2538
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2539
|
+
if (!activeStamper) {
|
|
2540
|
+
return undefined;
|
|
2541
|
+
}
|
|
2542
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2543
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2544
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_fiat_on_ramp";
|
|
2545
|
+
const bodyWithType = {
|
|
2546
|
+
parameters,
|
|
2547
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2548
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2549
|
+
type: "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP",
|
|
2550
|
+
};
|
|
2551
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2552
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2553
|
+
return {
|
|
2554
|
+
body: stringifiedBody,
|
|
2555
|
+
stamp: stamp,
|
|
2556
|
+
url: fullUrl,
|
|
2557
|
+
};
|
|
2558
|
+
};
|
|
2559
|
+
this.initImportPrivateKey = async (input, stampWith) => {
|
|
2560
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2561
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2562
|
+
return this.activity("/public/v1/submit/init_import_private_key", {
|
|
2563
|
+
parameters: rest,
|
|
2564
|
+
organizationId: organizationId ??
|
|
2565
|
+
session?.organizationId ??
|
|
2566
|
+
this.config.organizationId,
|
|
2567
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2568
|
+
type: "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY",
|
|
2569
|
+
}, "initImportPrivateKeyResult", stampWith);
|
|
2570
|
+
};
|
|
2571
|
+
this.stampInitImportPrivateKey = async (input, stampWith) => {
|
|
2572
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2573
|
+
if (!activeStamper) {
|
|
2574
|
+
return undefined;
|
|
2575
|
+
}
|
|
2576
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2577
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2578
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_import_private_key";
|
|
2579
|
+
const bodyWithType = {
|
|
2580
|
+
parameters,
|
|
2581
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2582
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2583
|
+
type: "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY",
|
|
2584
|
+
};
|
|
2585
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2586
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2587
|
+
return {
|
|
2588
|
+
body: stringifiedBody,
|
|
2589
|
+
stamp: stamp,
|
|
2590
|
+
url: fullUrl,
|
|
2591
|
+
};
|
|
2592
|
+
};
|
|
2593
|
+
this.initImportWallet = async (input, stampWith) => {
|
|
2594
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2595
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2596
|
+
return this.activity("/public/v1/submit/init_import_wallet", {
|
|
2597
|
+
parameters: rest,
|
|
2598
|
+
organizationId: organizationId ??
|
|
2599
|
+
session?.organizationId ??
|
|
2600
|
+
this.config.organizationId,
|
|
2601
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2602
|
+
type: "ACTIVITY_TYPE_INIT_IMPORT_WALLET",
|
|
2603
|
+
}, "initImportWalletResult", stampWith);
|
|
2604
|
+
};
|
|
2605
|
+
this.stampInitImportWallet = async (input, stampWith) => {
|
|
2606
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2607
|
+
if (!activeStamper) {
|
|
2608
|
+
return undefined;
|
|
2609
|
+
}
|
|
2610
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2611
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2612
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_import_wallet";
|
|
2613
|
+
const bodyWithType = {
|
|
2614
|
+
parameters,
|
|
2615
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2616
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2617
|
+
type: "ACTIVITY_TYPE_INIT_IMPORT_WALLET",
|
|
2618
|
+
};
|
|
2619
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2620
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2621
|
+
return {
|
|
2622
|
+
body: stringifiedBody,
|
|
2623
|
+
stamp: stamp,
|
|
2624
|
+
url: fullUrl,
|
|
2625
|
+
};
|
|
2626
|
+
};
|
|
2627
|
+
this.initOtp = async (input, stampWith) => {
|
|
2628
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2629
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2630
|
+
return this.activity("/public/v1/submit/init_otp", {
|
|
2631
|
+
parameters: rest,
|
|
2632
|
+
organizationId: organizationId ??
|
|
2633
|
+
session?.organizationId ??
|
|
2634
|
+
this.config.organizationId,
|
|
2635
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2636
|
+
type: "ACTIVITY_TYPE_INIT_OTP_V2",
|
|
2637
|
+
}, "initOtpResult", stampWith);
|
|
2638
|
+
};
|
|
2639
|
+
this.stampInitOtp = async (input, stampWith) => {
|
|
2640
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2641
|
+
if (!activeStamper) {
|
|
2642
|
+
return undefined;
|
|
2643
|
+
}
|
|
2644
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2645
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2646
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_otp";
|
|
2647
|
+
const bodyWithType = {
|
|
2648
|
+
parameters,
|
|
2649
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2650
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2651
|
+
type: "ACTIVITY_TYPE_INIT_OTP_V2",
|
|
2652
|
+
};
|
|
2653
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2654
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2655
|
+
return {
|
|
2656
|
+
body: stringifiedBody,
|
|
2657
|
+
stamp: stamp,
|
|
2658
|
+
url: fullUrl,
|
|
2659
|
+
};
|
|
2660
|
+
};
|
|
2661
|
+
this.initOtpAuth = async (input, stampWith) => {
|
|
2662
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2663
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2664
|
+
return this.activity("/public/v1/submit/init_otp_auth", {
|
|
2665
|
+
parameters: rest,
|
|
2666
|
+
organizationId: organizationId ??
|
|
2667
|
+
session?.organizationId ??
|
|
2668
|
+
this.config.organizationId,
|
|
2669
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2670
|
+
type: "ACTIVITY_TYPE_INIT_OTP_AUTH_V3",
|
|
2671
|
+
}, "initOtpAuthResultV2", stampWith);
|
|
2672
|
+
};
|
|
2673
|
+
this.stampInitOtpAuth = async (input, stampWith) => {
|
|
2674
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2675
|
+
if (!activeStamper) {
|
|
2676
|
+
return undefined;
|
|
2677
|
+
}
|
|
2678
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2679
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2680
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_otp_auth";
|
|
2681
|
+
const bodyWithType = {
|
|
2682
|
+
parameters,
|
|
2683
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2684
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2685
|
+
type: "ACTIVITY_TYPE_INIT_OTP_AUTH_V3",
|
|
2686
|
+
};
|
|
2687
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2688
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2689
|
+
return {
|
|
2690
|
+
body: stringifiedBody,
|
|
2691
|
+
stamp: stamp,
|
|
2692
|
+
url: fullUrl,
|
|
2693
|
+
};
|
|
2694
|
+
};
|
|
2695
|
+
this.initUserEmailRecovery = async (input, stampWith) => {
|
|
2696
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2697
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2698
|
+
return this.activity("/public/v1/submit/init_user_email_recovery", {
|
|
2699
|
+
parameters: rest,
|
|
2700
|
+
organizationId: organizationId ??
|
|
2701
|
+
session?.organizationId ??
|
|
2702
|
+
this.config.organizationId,
|
|
2703
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2704
|
+
type: "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2",
|
|
2705
|
+
}, "initUserEmailRecoveryResult", stampWith);
|
|
2706
|
+
};
|
|
2707
|
+
this.stampInitUserEmailRecovery = async (input, stampWith) => {
|
|
2708
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2709
|
+
if (!activeStamper) {
|
|
2710
|
+
return undefined;
|
|
2711
|
+
}
|
|
2712
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2713
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2714
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_user_email_recovery";
|
|
2715
|
+
const bodyWithType = {
|
|
2716
|
+
parameters,
|
|
2717
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2718
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2719
|
+
type: "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2",
|
|
2720
|
+
};
|
|
2721
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2722
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2723
|
+
return {
|
|
2724
|
+
body: stringifiedBody,
|
|
2725
|
+
stamp: stamp,
|
|
2726
|
+
url: fullUrl,
|
|
2727
|
+
};
|
|
2728
|
+
};
|
|
2729
|
+
this.oauth = async (input, stampWith) => {
|
|
2730
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2731
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2732
|
+
return this.activity("/public/v1/submit/oauth", {
|
|
2733
|
+
parameters: rest,
|
|
2734
|
+
organizationId: organizationId ??
|
|
2735
|
+
session?.organizationId ??
|
|
2736
|
+
this.config.organizationId,
|
|
2737
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2738
|
+
type: "ACTIVITY_TYPE_OAUTH",
|
|
2739
|
+
}, "oauthResult", stampWith);
|
|
2740
|
+
};
|
|
2741
|
+
this.stampOauth = async (input, stampWith) => {
|
|
2742
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2743
|
+
if (!activeStamper) {
|
|
2744
|
+
return undefined;
|
|
2745
|
+
}
|
|
2746
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2747
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2748
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/oauth";
|
|
2749
|
+
const bodyWithType = {
|
|
2750
|
+
parameters,
|
|
2751
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2752
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2753
|
+
type: "ACTIVITY_TYPE_OAUTH",
|
|
2754
|
+
};
|
|
2755
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2756
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2757
|
+
return {
|
|
2758
|
+
body: stringifiedBody,
|
|
2759
|
+
stamp: stamp,
|
|
2760
|
+
url: fullUrl,
|
|
2761
|
+
};
|
|
2762
|
+
};
|
|
2763
|
+
this.oauth2Authenticate = async (input, stampWith) => {
|
|
2764
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2765
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2766
|
+
return this.activity("/public/v1/submit/oauth2_authenticate", {
|
|
2767
|
+
parameters: rest,
|
|
2768
|
+
organizationId: organizationId ??
|
|
2769
|
+
session?.organizationId ??
|
|
2770
|
+
this.config.organizationId,
|
|
2771
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2772
|
+
type: "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE",
|
|
2773
|
+
}, "oauth2AuthenticateResult", stampWith);
|
|
2774
|
+
};
|
|
2775
|
+
this.stampOauth2Authenticate = async (input, stampWith) => {
|
|
2776
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2777
|
+
if (!activeStamper) {
|
|
2778
|
+
return undefined;
|
|
2779
|
+
}
|
|
2780
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2781
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2782
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/oauth2_authenticate";
|
|
2783
|
+
const bodyWithType = {
|
|
2784
|
+
parameters,
|
|
2785
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2786
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2787
|
+
type: "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE",
|
|
2788
|
+
};
|
|
2789
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2790
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2791
|
+
return {
|
|
2792
|
+
body: stringifiedBody,
|
|
2793
|
+
stamp: stamp,
|
|
2794
|
+
url: fullUrl,
|
|
2795
|
+
};
|
|
2796
|
+
};
|
|
2797
|
+
this.oauthLogin = async (input, stampWith) => {
|
|
2798
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2799
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2800
|
+
return this.activity("/public/v1/submit/oauth_login", {
|
|
2801
|
+
parameters: rest,
|
|
2802
|
+
organizationId: organizationId ??
|
|
2803
|
+
session?.organizationId ??
|
|
2804
|
+
this.config.organizationId,
|
|
2805
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2806
|
+
type: "ACTIVITY_TYPE_OAUTH_LOGIN",
|
|
2807
|
+
}, "oauthLoginResult", stampWith);
|
|
2808
|
+
};
|
|
2809
|
+
this.stampOauthLogin = async (input, stampWith) => {
|
|
2810
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2811
|
+
if (!activeStamper) {
|
|
2812
|
+
return undefined;
|
|
2813
|
+
}
|
|
2814
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2815
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2816
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/oauth_login";
|
|
2817
|
+
const bodyWithType = {
|
|
2818
|
+
parameters,
|
|
2819
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2820
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2821
|
+
type: "ACTIVITY_TYPE_OAUTH_LOGIN",
|
|
2822
|
+
};
|
|
2823
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2824
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2825
|
+
return {
|
|
2826
|
+
body: stringifiedBody,
|
|
2827
|
+
stamp: stamp,
|
|
2828
|
+
url: fullUrl,
|
|
2829
|
+
};
|
|
2830
|
+
};
|
|
2831
|
+
this.otpAuth = async (input, stampWith) => {
|
|
2832
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2833
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2834
|
+
return this.activity("/public/v1/submit/otp_auth", {
|
|
2835
|
+
parameters: rest,
|
|
2836
|
+
organizationId: organizationId ??
|
|
2837
|
+
session?.organizationId ??
|
|
2838
|
+
this.config.organizationId,
|
|
2839
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2840
|
+
type: "ACTIVITY_TYPE_OTP_AUTH",
|
|
2841
|
+
}, "otpAuthResult", stampWith);
|
|
2842
|
+
};
|
|
2843
|
+
this.stampOtpAuth = async (input, stampWith) => {
|
|
2844
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2845
|
+
if (!activeStamper) {
|
|
2846
|
+
return undefined;
|
|
2847
|
+
}
|
|
2848
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2849
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2850
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/otp_auth";
|
|
2851
|
+
const bodyWithType = {
|
|
2852
|
+
parameters,
|
|
2853
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2854
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2855
|
+
type: "ACTIVITY_TYPE_OTP_AUTH",
|
|
2856
|
+
};
|
|
2857
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2858
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2859
|
+
return {
|
|
2860
|
+
body: stringifiedBody,
|
|
2861
|
+
stamp: stamp,
|
|
2862
|
+
url: fullUrl,
|
|
2863
|
+
};
|
|
2864
|
+
};
|
|
2865
|
+
this.otpLogin = async (input, stampWith) => {
|
|
2866
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2867
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2868
|
+
return this.activity("/public/v1/submit/otp_login", {
|
|
2869
|
+
parameters: rest,
|
|
2870
|
+
organizationId: organizationId ??
|
|
2871
|
+
session?.organizationId ??
|
|
2872
|
+
this.config.organizationId,
|
|
2873
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2874
|
+
type: "ACTIVITY_TYPE_OTP_LOGIN",
|
|
2875
|
+
}, "otpLoginResult", stampWith);
|
|
2876
|
+
};
|
|
2877
|
+
this.stampOtpLogin = async (input, stampWith) => {
|
|
2878
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2879
|
+
if (!activeStamper) {
|
|
2880
|
+
return undefined;
|
|
2881
|
+
}
|
|
2882
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2883
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2884
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/otp_login";
|
|
2885
|
+
const bodyWithType = {
|
|
2886
|
+
parameters,
|
|
2887
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2888
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2889
|
+
type: "ACTIVITY_TYPE_OTP_LOGIN",
|
|
2890
|
+
};
|
|
2891
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2892
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2893
|
+
return {
|
|
2894
|
+
body: stringifiedBody,
|
|
2895
|
+
stamp: stamp,
|
|
2896
|
+
url: fullUrl,
|
|
2897
|
+
};
|
|
2898
|
+
};
|
|
2899
|
+
this.recoverUser = async (input, stampWith) => {
|
|
2900
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2901
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2902
|
+
return this.activity("/public/v1/submit/recover_user", {
|
|
2903
|
+
parameters: rest,
|
|
2904
|
+
organizationId: organizationId ??
|
|
2905
|
+
session?.organizationId ??
|
|
2906
|
+
this.config.organizationId,
|
|
2907
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2908
|
+
type: "ACTIVITY_TYPE_RECOVER_USER",
|
|
2909
|
+
}, "recoverUserResult", stampWith);
|
|
2910
|
+
};
|
|
2911
|
+
this.stampRecoverUser = async (input, stampWith) => {
|
|
2912
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2913
|
+
if (!activeStamper) {
|
|
2914
|
+
return undefined;
|
|
2915
|
+
}
|
|
2916
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2917
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2918
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/recover_user";
|
|
2919
|
+
const bodyWithType = {
|
|
2920
|
+
parameters,
|
|
2921
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2922
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2923
|
+
type: "ACTIVITY_TYPE_RECOVER_USER",
|
|
2924
|
+
};
|
|
2925
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2926
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2927
|
+
return {
|
|
2928
|
+
body: stringifiedBody,
|
|
2929
|
+
stamp: stamp,
|
|
2930
|
+
url: fullUrl,
|
|
2931
|
+
};
|
|
2932
|
+
};
|
|
2933
|
+
this.rejectActivity = async (input, stampWith) => {
|
|
2934
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2935
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2936
|
+
return this.activityDecision("/public/v1/submit/reject_activity", {
|
|
2937
|
+
parameters: rest,
|
|
2938
|
+
organizationId: organizationId ??
|
|
2939
|
+
session?.organizationId ??
|
|
2940
|
+
this.config.organizationId,
|
|
2941
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2942
|
+
type: "ACTIVITY_TYPE_REJECT_ACTIVITY",
|
|
2943
|
+
}, stampWith);
|
|
2944
|
+
};
|
|
2945
|
+
this.stampRejectActivity = async (input, stampWith) => {
|
|
2946
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2947
|
+
if (!activeStamper) {
|
|
2948
|
+
return undefined;
|
|
2949
|
+
}
|
|
2950
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2951
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2952
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/reject_activity";
|
|
2953
|
+
const bodyWithType = {
|
|
2954
|
+
parameters,
|
|
2955
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2956
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2957
|
+
type: "ACTIVITY_TYPE_REJECT_ACTIVITY",
|
|
2958
|
+
};
|
|
2959
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2960
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2961
|
+
return {
|
|
2962
|
+
body: stringifiedBody,
|
|
2963
|
+
stamp: stamp,
|
|
2964
|
+
url: fullUrl,
|
|
2965
|
+
};
|
|
2966
|
+
};
|
|
2967
|
+
this.removeOrganizationFeature = async (input, stampWith) => {
|
|
2968
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2969
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2970
|
+
return this.activity("/public/v1/submit/remove_organization_feature", {
|
|
2971
|
+
parameters: rest,
|
|
2972
|
+
organizationId: organizationId ??
|
|
2973
|
+
session?.organizationId ??
|
|
2974
|
+
this.config.organizationId,
|
|
2975
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2976
|
+
type: "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE",
|
|
2977
|
+
}, "removeOrganizationFeatureResult", stampWith);
|
|
2978
|
+
};
|
|
2979
|
+
this.stampRemoveOrganizationFeature = async (input, stampWith) => {
|
|
2980
|
+
const activeStamper = this.getStamper(stampWith);
|
|
2981
|
+
if (!activeStamper) {
|
|
2982
|
+
return undefined;
|
|
2983
|
+
}
|
|
2984
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
2985
|
+
const session = await this.storageManager?.getActiveSession();
|
|
2986
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/remove_organization_feature";
|
|
2987
|
+
const bodyWithType = {
|
|
2988
|
+
parameters,
|
|
2989
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2990
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
2991
|
+
type: "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE",
|
|
2992
|
+
};
|
|
2993
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2994
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
2995
|
+
return {
|
|
2996
|
+
body: stringifiedBody,
|
|
2997
|
+
stamp: stamp,
|
|
2998
|
+
url: fullUrl,
|
|
2999
|
+
};
|
|
3000
|
+
};
|
|
3001
|
+
this.setOrganizationFeature = async (input, stampWith) => {
|
|
3002
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3003
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3004
|
+
return this.activity("/public/v1/submit/set_organization_feature", {
|
|
3005
|
+
parameters: rest,
|
|
3006
|
+
organizationId: organizationId ??
|
|
3007
|
+
session?.organizationId ??
|
|
3008
|
+
this.config.organizationId,
|
|
3009
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3010
|
+
type: "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE",
|
|
3011
|
+
}, "setOrganizationFeatureResult", stampWith);
|
|
3012
|
+
};
|
|
3013
|
+
this.stampSetOrganizationFeature = async (input, stampWith) => {
|
|
3014
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3015
|
+
if (!activeStamper) {
|
|
3016
|
+
return undefined;
|
|
3017
|
+
}
|
|
3018
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3019
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3020
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/set_organization_feature";
|
|
3021
|
+
const bodyWithType = {
|
|
3022
|
+
parameters,
|
|
3023
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3024
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3025
|
+
type: "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE",
|
|
3026
|
+
};
|
|
3027
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3028
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3029
|
+
return {
|
|
3030
|
+
body: stringifiedBody,
|
|
3031
|
+
stamp: stamp,
|
|
3032
|
+
url: fullUrl,
|
|
3033
|
+
};
|
|
3034
|
+
};
|
|
3035
|
+
this.signRawPayload = async (input, stampWith) => {
|
|
3036
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3037
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3038
|
+
return this.activity("/public/v1/submit/sign_raw_payload", {
|
|
3039
|
+
parameters: rest,
|
|
3040
|
+
organizationId: organizationId ??
|
|
3041
|
+
session?.organizationId ??
|
|
3042
|
+
this.config.organizationId,
|
|
3043
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3044
|
+
type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2",
|
|
3045
|
+
}, "signRawPayloadResult", stampWith);
|
|
3046
|
+
};
|
|
3047
|
+
this.stampSignRawPayload = async (input, stampWith) => {
|
|
3048
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3049
|
+
if (!activeStamper) {
|
|
3050
|
+
return undefined;
|
|
3051
|
+
}
|
|
3052
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3053
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3054
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sign_raw_payload";
|
|
3055
|
+
const bodyWithType = {
|
|
3056
|
+
parameters,
|
|
3057
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3058
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3059
|
+
type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2",
|
|
3060
|
+
};
|
|
3061
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3062
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3063
|
+
return {
|
|
3064
|
+
body: stringifiedBody,
|
|
3065
|
+
stamp: stamp,
|
|
3066
|
+
url: fullUrl,
|
|
3067
|
+
};
|
|
3068
|
+
};
|
|
3069
|
+
this.signRawPayloads = async (input, stampWith) => {
|
|
3070
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3071
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3072
|
+
return this.activity("/public/v1/submit/sign_raw_payloads", {
|
|
3073
|
+
parameters: rest,
|
|
3074
|
+
organizationId: organizationId ??
|
|
3075
|
+
session?.organizationId ??
|
|
3076
|
+
this.config.organizationId,
|
|
3077
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3078
|
+
type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS",
|
|
3079
|
+
}, "signRawPayloadsResult", stampWith);
|
|
3080
|
+
};
|
|
3081
|
+
this.stampSignRawPayloads = async (input, stampWith) => {
|
|
3082
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3083
|
+
if (!activeStamper) {
|
|
3084
|
+
return undefined;
|
|
3085
|
+
}
|
|
3086
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3087
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3088
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sign_raw_payloads";
|
|
3089
|
+
const bodyWithType = {
|
|
3090
|
+
parameters,
|
|
3091
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3092
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3093
|
+
type: "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS",
|
|
3094
|
+
};
|
|
3095
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3096
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3097
|
+
return {
|
|
3098
|
+
body: stringifiedBody,
|
|
3099
|
+
stamp: stamp,
|
|
3100
|
+
url: fullUrl,
|
|
3101
|
+
};
|
|
3102
|
+
};
|
|
3103
|
+
this.signTransaction = async (input, stampWith) => {
|
|
3104
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3105
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3106
|
+
return this.activity("/public/v1/submit/sign_transaction", {
|
|
3107
|
+
parameters: rest,
|
|
3108
|
+
organizationId: organizationId ??
|
|
3109
|
+
session?.organizationId ??
|
|
3110
|
+
this.config.organizationId,
|
|
3111
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3112
|
+
type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2",
|
|
3113
|
+
}, "signTransactionResult", stampWith);
|
|
3114
|
+
};
|
|
3115
|
+
this.stampSignTransaction = async (input, stampWith) => {
|
|
3116
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3117
|
+
if (!activeStamper) {
|
|
3118
|
+
return undefined;
|
|
3119
|
+
}
|
|
3120
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3121
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3122
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sign_transaction";
|
|
3123
|
+
const bodyWithType = {
|
|
3124
|
+
parameters,
|
|
3125
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3126
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3127
|
+
type: "ACTIVITY_TYPE_SIGN_TRANSACTION_V2",
|
|
3128
|
+
};
|
|
3129
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3130
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3131
|
+
return {
|
|
3132
|
+
body: stringifiedBody,
|
|
3133
|
+
stamp: stamp,
|
|
3134
|
+
url: fullUrl,
|
|
3135
|
+
};
|
|
3136
|
+
};
|
|
3137
|
+
this.solSendTransaction = async (input, stampWith) => {
|
|
3138
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3139
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3140
|
+
return this.activity("/public/v1/submit/sol_send_transaction", {
|
|
3141
|
+
parameters: rest,
|
|
3142
|
+
organizationId: organizationId ??
|
|
3143
|
+
session?.organizationId ??
|
|
3144
|
+
this.config.organizationId,
|
|
3145
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3146
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
|
|
3147
|
+
}, "solSendTransactionResult", stampWith);
|
|
3148
|
+
};
|
|
3149
|
+
this.stampSolSendTransaction = async (input, stampWith) => {
|
|
3150
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3151
|
+
if (!activeStamper) {
|
|
3152
|
+
return undefined;
|
|
3153
|
+
}
|
|
3154
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3155
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3156
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/sol_send_transaction";
|
|
3157
|
+
const bodyWithType = {
|
|
3158
|
+
parameters,
|
|
3159
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3160
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3161
|
+
type: "ACTIVITY_TYPE_SOL_SEND_TRANSACTION",
|
|
3162
|
+
};
|
|
3163
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3164
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3165
|
+
return {
|
|
3166
|
+
body: stringifiedBody,
|
|
3167
|
+
stamp: stamp,
|
|
3168
|
+
url: fullUrl,
|
|
3169
|
+
};
|
|
3170
|
+
};
|
|
3171
|
+
this.stampLogin = async (input, stampWith) => {
|
|
3172
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3173
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3174
|
+
return this.activity("/public/v1/submit/stamp_login", {
|
|
3175
|
+
parameters: rest,
|
|
3176
|
+
organizationId: organizationId ??
|
|
3177
|
+
session?.organizationId ??
|
|
3178
|
+
this.config.organizationId,
|
|
3179
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3180
|
+
type: "ACTIVITY_TYPE_STAMP_LOGIN",
|
|
3181
|
+
}, "stampLoginResult", stampWith);
|
|
3182
|
+
};
|
|
3183
|
+
this.stampStampLogin = async (input, stampWith) => {
|
|
3184
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3185
|
+
if (!activeStamper) {
|
|
3186
|
+
return undefined;
|
|
3187
|
+
}
|
|
3188
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3189
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3190
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/stamp_login";
|
|
3191
|
+
const bodyWithType = {
|
|
3192
|
+
parameters,
|
|
3193
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3194
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3195
|
+
type: "ACTIVITY_TYPE_STAMP_LOGIN",
|
|
3196
|
+
};
|
|
3197
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3198
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3199
|
+
return {
|
|
3200
|
+
body: stringifiedBody,
|
|
3201
|
+
stamp: stamp,
|
|
3202
|
+
url: fullUrl,
|
|
3203
|
+
};
|
|
3204
|
+
};
|
|
3205
|
+
this.updateFiatOnRampCredential = async (input, stampWith) => {
|
|
3206
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3207
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3208
|
+
return this.activity("/public/v1/submit/update_fiat_on_ramp_credential", {
|
|
3209
|
+
parameters: rest,
|
|
3210
|
+
organizationId: organizationId ??
|
|
3211
|
+
session?.organizationId ??
|
|
3212
|
+
this.config.organizationId,
|
|
3213
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3214
|
+
type: "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL",
|
|
3215
|
+
}, "updateFiatOnRampCredentialResult", stampWith);
|
|
3216
|
+
};
|
|
3217
|
+
this.stampUpdateFiatOnRampCredential = async (input, stampWith) => {
|
|
3218
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3219
|
+
if (!activeStamper) {
|
|
3220
|
+
return undefined;
|
|
3221
|
+
}
|
|
3222
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3223
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3224
|
+
const fullUrl = this.config.apiBaseUrl +
|
|
3225
|
+
"/public/v1/submit/update_fiat_on_ramp_credential";
|
|
3226
|
+
const bodyWithType = {
|
|
3227
|
+
parameters,
|
|
3228
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3229
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3230
|
+
type: "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL",
|
|
3231
|
+
};
|
|
3232
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3233
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3234
|
+
return {
|
|
3235
|
+
body: stringifiedBody,
|
|
3236
|
+
stamp: stamp,
|
|
3237
|
+
url: fullUrl,
|
|
3238
|
+
};
|
|
3239
|
+
};
|
|
3240
|
+
this.updateOauth2Credential = async (input, stampWith) => {
|
|
3241
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3242
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3243
|
+
return this.activity("/public/v1/submit/update_oauth2_credential", {
|
|
3244
|
+
parameters: rest,
|
|
3245
|
+
organizationId: organizationId ??
|
|
3246
|
+
session?.organizationId ??
|
|
3247
|
+
this.config.organizationId,
|
|
3248
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3249
|
+
type: "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL",
|
|
3250
|
+
}, "updateOauth2CredentialResult", stampWith);
|
|
3251
|
+
};
|
|
3252
|
+
this.stampUpdateOauth2Credential = async (input, stampWith) => {
|
|
3253
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3254
|
+
if (!activeStamper) {
|
|
3255
|
+
return undefined;
|
|
3256
|
+
}
|
|
3257
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3258
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3259
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_oauth2_credential";
|
|
3260
|
+
const bodyWithType = {
|
|
3261
|
+
parameters,
|
|
3262
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3263
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3264
|
+
type: "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL",
|
|
3265
|
+
};
|
|
3266
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3267
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3268
|
+
return {
|
|
3269
|
+
body: stringifiedBody,
|
|
3270
|
+
stamp: stamp,
|
|
3271
|
+
url: fullUrl,
|
|
3272
|
+
};
|
|
3273
|
+
};
|
|
3274
|
+
this.updateOrganizationName = async (input, stampWith) => {
|
|
3275
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3276
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3277
|
+
return this.activity("/public/v1/submit/update_organization_name", {
|
|
3278
|
+
parameters: rest,
|
|
3279
|
+
organizationId: organizationId ??
|
|
3280
|
+
session?.organizationId ??
|
|
3281
|
+
this.config.organizationId,
|
|
3282
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3283
|
+
type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
|
|
3284
|
+
}, "updateOrganizationNameResult", stampWith);
|
|
3285
|
+
};
|
|
3286
|
+
this.stampUpdateOrganizationName = async (input, stampWith) => {
|
|
3287
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3288
|
+
if (!activeStamper) {
|
|
3289
|
+
return undefined;
|
|
3290
|
+
}
|
|
3291
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3292
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3293
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_organization_name";
|
|
3294
|
+
const bodyWithType = {
|
|
3295
|
+
parameters,
|
|
3296
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3297
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3298
|
+
type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
|
|
3299
|
+
};
|
|
3300
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3301
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3302
|
+
return {
|
|
3303
|
+
body: stringifiedBody,
|
|
3304
|
+
stamp: stamp,
|
|
3305
|
+
url: fullUrl,
|
|
3306
|
+
};
|
|
3307
|
+
};
|
|
3308
|
+
this.updatePolicy = async (input, stampWith) => {
|
|
3309
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3310
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3311
|
+
return this.activity("/public/v1/submit/update_policy", {
|
|
3312
|
+
parameters: rest,
|
|
3313
|
+
organizationId: organizationId ??
|
|
3314
|
+
session?.organizationId ??
|
|
3315
|
+
this.config.organizationId,
|
|
3316
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3317
|
+
type: "ACTIVITY_TYPE_UPDATE_POLICY_V2",
|
|
3318
|
+
}, "updatePolicyResultV2", stampWith);
|
|
3319
|
+
};
|
|
3320
|
+
this.stampUpdatePolicy = async (input, stampWith) => {
|
|
3321
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3322
|
+
if (!activeStamper) {
|
|
3323
|
+
return undefined;
|
|
3324
|
+
}
|
|
3325
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3326
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3327
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_policy";
|
|
3328
|
+
const bodyWithType = {
|
|
3329
|
+
parameters,
|
|
3330
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3331
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3332
|
+
type: "ACTIVITY_TYPE_UPDATE_POLICY_V2",
|
|
3333
|
+
};
|
|
3334
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3335
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3336
|
+
return {
|
|
3337
|
+
body: stringifiedBody,
|
|
3338
|
+
stamp: stamp,
|
|
3339
|
+
url: fullUrl,
|
|
3340
|
+
};
|
|
3341
|
+
};
|
|
3342
|
+
this.updatePrivateKeyTag = async (input, stampWith) => {
|
|
3343
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3344
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3345
|
+
return this.activity("/public/v1/submit/update_private_key_tag", {
|
|
3346
|
+
parameters: rest,
|
|
3347
|
+
organizationId: organizationId ??
|
|
3348
|
+
session?.organizationId ??
|
|
3349
|
+
this.config.organizationId,
|
|
3350
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3351
|
+
type: "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG",
|
|
3352
|
+
}, "updatePrivateKeyTagResult", stampWith);
|
|
3353
|
+
};
|
|
3354
|
+
this.stampUpdatePrivateKeyTag = async (input, stampWith) => {
|
|
3355
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3356
|
+
if (!activeStamper) {
|
|
3357
|
+
return undefined;
|
|
3358
|
+
}
|
|
3359
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3360
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3361
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_private_key_tag";
|
|
3362
|
+
const bodyWithType = {
|
|
3363
|
+
parameters,
|
|
3364
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3365
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3366
|
+
type: "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG",
|
|
3367
|
+
};
|
|
3368
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3369
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3370
|
+
return {
|
|
3371
|
+
body: stringifiedBody,
|
|
3372
|
+
stamp: stamp,
|
|
3373
|
+
url: fullUrl,
|
|
3374
|
+
};
|
|
3375
|
+
};
|
|
3376
|
+
this.updateRootQuorum = async (input, stampWith) => {
|
|
3377
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3378
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3379
|
+
return this.activity("/public/v1/submit/update_root_quorum", {
|
|
3380
|
+
parameters: rest,
|
|
3381
|
+
organizationId: organizationId ??
|
|
3382
|
+
session?.organizationId ??
|
|
3383
|
+
this.config.organizationId,
|
|
3384
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3385
|
+
type: "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM",
|
|
3386
|
+
}, "updateRootQuorumResult", stampWith);
|
|
3387
|
+
};
|
|
3388
|
+
this.stampUpdateRootQuorum = async (input, stampWith) => {
|
|
3389
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3390
|
+
if (!activeStamper) {
|
|
3391
|
+
return undefined;
|
|
3392
|
+
}
|
|
3393
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3394
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3395
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_root_quorum";
|
|
3396
|
+
const bodyWithType = {
|
|
3397
|
+
parameters,
|
|
3398
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3399
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3400
|
+
type: "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM",
|
|
3401
|
+
};
|
|
3402
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3403
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3404
|
+
return {
|
|
3405
|
+
body: stringifiedBody,
|
|
3406
|
+
stamp: stamp,
|
|
3407
|
+
url: fullUrl,
|
|
3408
|
+
};
|
|
3409
|
+
};
|
|
3410
|
+
this.updateUser = async (input, stampWith) => {
|
|
3411
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3412
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3413
|
+
return this.activity("/public/v1/submit/update_user", {
|
|
3414
|
+
parameters: rest,
|
|
3415
|
+
organizationId: organizationId ??
|
|
3416
|
+
session?.organizationId ??
|
|
3417
|
+
this.config.organizationId,
|
|
3418
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3419
|
+
type: "ACTIVITY_TYPE_UPDATE_USER",
|
|
3420
|
+
}, "updateUserResult", stampWith);
|
|
3421
|
+
};
|
|
3422
|
+
this.stampUpdateUser = async (input, stampWith) => {
|
|
3423
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3424
|
+
if (!activeStamper) {
|
|
3425
|
+
return undefined;
|
|
3426
|
+
}
|
|
3427
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3428
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3429
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_user";
|
|
3430
|
+
const bodyWithType = {
|
|
3431
|
+
parameters,
|
|
3432
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3433
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3434
|
+
type: "ACTIVITY_TYPE_UPDATE_USER",
|
|
3435
|
+
};
|
|
3436
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3437
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3438
|
+
return {
|
|
3439
|
+
body: stringifiedBody,
|
|
3440
|
+
stamp: stamp,
|
|
3441
|
+
url: fullUrl,
|
|
3442
|
+
};
|
|
3443
|
+
};
|
|
3444
|
+
this.updateUserEmail = async (input, stampWith) => {
|
|
3445
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3446
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3447
|
+
return this.activity("/public/v1/submit/update_user_email", {
|
|
3448
|
+
parameters: rest,
|
|
3449
|
+
organizationId: organizationId ??
|
|
3450
|
+
session?.organizationId ??
|
|
3451
|
+
this.config.organizationId,
|
|
3452
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3453
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_EMAIL",
|
|
3454
|
+
}, "updateUserEmailResult", stampWith);
|
|
3455
|
+
};
|
|
3456
|
+
this.stampUpdateUserEmail = async (input, stampWith) => {
|
|
3457
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3458
|
+
if (!activeStamper) {
|
|
3459
|
+
return undefined;
|
|
3460
|
+
}
|
|
3461
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3462
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3463
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_user_email";
|
|
3464
|
+
const bodyWithType = {
|
|
3465
|
+
parameters,
|
|
3466
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3467
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3468
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_EMAIL",
|
|
3469
|
+
};
|
|
3470
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3471
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3472
|
+
return {
|
|
3473
|
+
body: stringifiedBody,
|
|
3474
|
+
stamp: stamp,
|
|
3475
|
+
url: fullUrl,
|
|
3476
|
+
};
|
|
3477
|
+
};
|
|
3478
|
+
this.updateUserName = async (input, stampWith) => {
|
|
3479
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3480
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3481
|
+
return this.activity("/public/v1/submit/update_user_name", {
|
|
3482
|
+
parameters: rest,
|
|
3483
|
+
organizationId: organizationId ??
|
|
3484
|
+
session?.organizationId ??
|
|
3485
|
+
this.config.organizationId,
|
|
3486
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3487
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_NAME",
|
|
3488
|
+
}, "updateUserNameResult", stampWith);
|
|
3489
|
+
};
|
|
3490
|
+
this.stampUpdateUserName = async (input, stampWith) => {
|
|
3491
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3492
|
+
if (!activeStamper) {
|
|
3493
|
+
return undefined;
|
|
3494
|
+
}
|
|
3495
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3496
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3497
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_user_name";
|
|
3498
|
+
const bodyWithType = {
|
|
3499
|
+
parameters,
|
|
3500
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3501
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3502
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_NAME",
|
|
3503
|
+
};
|
|
3504
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3505
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3506
|
+
return {
|
|
3507
|
+
body: stringifiedBody,
|
|
3508
|
+
stamp: stamp,
|
|
3509
|
+
url: fullUrl,
|
|
3510
|
+
};
|
|
3511
|
+
};
|
|
3512
|
+
this.updateUserPhoneNumber = async (input, stampWith) => {
|
|
3513
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3514
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3515
|
+
return this.activity("/public/v1/submit/update_user_phone_number", {
|
|
3516
|
+
parameters: rest,
|
|
3517
|
+
organizationId: organizationId ??
|
|
3518
|
+
session?.organizationId ??
|
|
3519
|
+
this.config.organizationId,
|
|
3520
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3521
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER",
|
|
3522
|
+
}, "updateUserPhoneNumberResult", stampWith);
|
|
3523
|
+
};
|
|
3524
|
+
this.stampUpdateUserPhoneNumber = async (input, stampWith) => {
|
|
3525
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3526
|
+
if (!activeStamper) {
|
|
3527
|
+
return undefined;
|
|
3528
|
+
}
|
|
3529
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3530
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3531
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_user_phone_number";
|
|
3532
|
+
const bodyWithType = {
|
|
3533
|
+
parameters,
|
|
3534
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3535
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3536
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER",
|
|
3537
|
+
};
|
|
3538
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3539
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3540
|
+
return {
|
|
3541
|
+
body: stringifiedBody,
|
|
3542
|
+
stamp: stamp,
|
|
3543
|
+
url: fullUrl,
|
|
3544
|
+
};
|
|
3545
|
+
};
|
|
3546
|
+
this.updateUserTag = async (input, stampWith) => {
|
|
3547
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3548
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3549
|
+
return this.activity("/public/v1/submit/update_user_tag", {
|
|
3550
|
+
parameters: rest,
|
|
3551
|
+
organizationId: organizationId ??
|
|
3552
|
+
session?.organizationId ??
|
|
3553
|
+
this.config.organizationId,
|
|
3554
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3555
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_TAG",
|
|
3556
|
+
}, "updateUserTagResult", stampWith);
|
|
3557
|
+
};
|
|
3558
|
+
this.stampUpdateUserTag = async (input, stampWith) => {
|
|
3559
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3560
|
+
if (!activeStamper) {
|
|
3561
|
+
return undefined;
|
|
3562
|
+
}
|
|
3563
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3564
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3565
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_user_tag";
|
|
3566
|
+
const bodyWithType = {
|
|
3567
|
+
parameters,
|
|
3568
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3569
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3570
|
+
type: "ACTIVITY_TYPE_UPDATE_USER_TAG",
|
|
3571
|
+
};
|
|
3572
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3573
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3574
|
+
return {
|
|
3575
|
+
body: stringifiedBody,
|
|
3576
|
+
stamp: stamp,
|
|
3577
|
+
url: fullUrl,
|
|
3578
|
+
};
|
|
3579
|
+
};
|
|
3580
|
+
this.updateWallet = async (input, stampWith) => {
|
|
3581
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3582
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3583
|
+
return this.activity("/public/v1/submit/update_wallet", {
|
|
3584
|
+
parameters: rest,
|
|
3585
|
+
organizationId: organizationId ??
|
|
3586
|
+
session?.organizationId ??
|
|
3587
|
+
this.config.organizationId,
|
|
3588
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3589
|
+
type: "ACTIVITY_TYPE_UPDATE_WALLET",
|
|
3590
|
+
}, "updateWalletResult", stampWith);
|
|
3591
|
+
};
|
|
3592
|
+
this.stampUpdateWallet = async (input, stampWith) => {
|
|
3593
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3594
|
+
if (!activeStamper) {
|
|
3595
|
+
return undefined;
|
|
3596
|
+
}
|
|
3597
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3598
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3599
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_wallet";
|
|
3600
|
+
const bodyWithType = {
|
|
3601
|
+
parameters,
|
|
3602
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3603
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3604
|
+
type: "ACTIVITY_TYPE_UPDATE_WALLET",
|
|
3605
|
+
};
|
|
3606
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3607
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3608
|
+
return {
|
|
3609
|
+
body: stringifiedBody,
|
|
3610
|
+
stamp: stamp,
|
|
3611
|
+
url: fullUrl,
|
|
3612
|
+
};
|
|
3613
|
+
};
|
|
3614
|
+
this.verifyOtp = async (input, stampWith) => {
|
|
3615
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3616
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3617
|
+
return this.activity("/public/v1/submit/verify_otp", {
|
|
3618
|
+
parameters: rest,
|
|
3619
|
+
organizationId: organizationId ??
|
|
3620
|
+
session?.organizationId ??
|
|
3621
|
+
this.config.organizationId,
|
|
3622
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3623
|
+
type: "ACTIVITY_TYPE_VERIFY_OTP",
|
|
3624
|
+
}, "verifyOtpResult", stampWith);
|
|
3625
|
+
};
|
|
3626
|
+
this.stampVerifyOtp = async (input, stampWith) => {
|
|
3627
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3628
|
+
if (!activeStamper) {
|
|
3629
|
+
return undefined;
|
|
3630
|
+
}
|
|
3631
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3632
|
+
const session = await this.storageManager?.getActiveSession();
|
|
3633
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/verify_otp";
|
|
3634
|
+
const bodyWithType = {
|
|
3635
|
+
parameters,
|
|
3636
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3637
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3638
|
+
type: "ACTIVITY_TYPE_VERIFY_OTP",
|
|
3639
|
+
};
|
|
3640
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3641
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3642
|
+
return {
|
|
3643
|
+
body: stringifiedBody,
|
|
3644
|
+
stamp: stamp,
|
|
3645
|
+
url: fullUrl,
|
|
3646
|
+
};
|
|
3647
|
+
};
|
|
3648
|
+
this.proxyGetAccount = async (input) => {
|
|
3649
|
+
return this.authProxyRequest("/v1/account", input);
|
|
3650
|
+
};
|
|
3651
|
+
this.proxyOAuth2Authenticate = async (input) => {
|
|
3652
|
+
return this.authProxyRequest("/v1/oauth2_authenticate", input);
|
|
3653
|
+
};
|
|
3654
|
+
this.proxyOAuthLogin = async (input) => {
|
|
3655
|
+
return this.authProxyRequest("/v1/oauth_login", input);
|
|
3656
|
+
};
|
|
3657
|
+
this.proxyInitOtp = async (input) => {
|
|
3658
|
+
return this.authProxyRequest("/v1/otp_init", input);
|
|
3659
|
+
};
|
|
3660
|
+
this.proxyInitOtpV2 = async (input) => {
|
|
3661
|
+
return this.authProxyRequest("/v1/otp_init_v2", input);
|
|
3662
|
+
};
|
|
3663
|
+
this.proxyOtpLogin = async (input) => {
|
|
3664
|
+
return this.authProxyRequest("/v1/otp_login", input);
|
|
3665
|
+
};
|
|
3666
|
+
this.proxyOtpLoginV2 = async (input) => {
|
|
3667
|
+
return this.authProxyRequest("/v1/otp_login_v2", input);
|
|
3668
|
+
};
|
|
3669
|
+
this.proxyVerifyOtp = async (input) => {
|
|
3670
|
+
return this.authProxyRequest("/v1/otp_verify", input);
|
|
3671
|
+
};
|
|
3672
|
+
this.proxyVerifyOtpV2 = async (input) => {
|
|
3673
|
+
return this.authProxyRequest("/v1/otp_verify_v2", input);
|
|
3674
|
+
};
|
|
3675
|
+
this.proxySignup = async (input) => {
|
|
3676
|
+
return this.authProxyRequest("/v1/signup", input);
|
|
3677
|
+
};
|
|
3678
|
+
this.proxySignupV2 = async (input) => {
|
|
3679
|
+
return this.authProxyRequest("/v1/signup_v2", input);
|
|
3680
|
+
};
|
|
3681
|
+
this.proxyGetWalletKitConfig = async (input) => {
|
|
3682
|
+
return this.authProxyRequest("/v1/wallet_kit_config", input);
|
|
3683
|
+
};
|
|
3684
|
+
this.config = config;
|
|
3685
|
+
if (config.apiKeyStamper) {
|
|
3686
|
+
this.apiKeyStamper = config.apiKeyStamper;
|
|
3687
|
+
}
|
|
3688
|
+
if (config.passkeyStamper) {
|
|
3689
|
+
this.passkeyStamper = config.passkeyStamper;
|
|
3690
|
+
}
|
|
3691
|
+
if (config.walletStamper) {
|
|
3692
|
+
this.walletStamper = config.walletStamper;
|
|
3693
|
+
}
|
|
3694
|
+
if (config.storageManager) {
|
|
3695
|
+
this.storageManager = config.storageManager;
|
|
3696
|
+
}
|
|
3697
|
+
if (config.defaultStamperType) {
|
|
3698
|
+
this.defaultStamperType = config.defaultStamperType;
|
|
3699
|
+
}
|
|
3700
|
+
else {
|
|
3701
|
+
// Set default stamper type based on available stampers
|
|
3702
|
+
if (this.apiKeyStamper) {
|
|
3703
|
+
this.defaultStamperType = enums.StamperType.ApiKey;
|
|
3704
|
+
}
|
|
3705
|
+
else if (this.passkeyStamper) {
|
|
3706
|
+
this.defaultStamperType = enums.StamperType.Passkey;
|
|
3707
|
+
}
|
|
3708
|
+
else if (this.walletStamper) {
|
|
3709
|
+
this.defaultStamperType = enums.StamperType.Wallet;
|
|
3710
|
+
}
|
|
3711
|
+
else {
|
|
3712
|
+
this.defaultStamperType = undefined;
|
|
3713
|
+
}
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
getStamper(stampWith) {
|
|
3717
|
+
if (!stampWith) {
|
|
3718
|
+
// Use default stamper type if none specified
|
|
3719
|
+
stampWith = this.defaultStamperType;
|
|
3720
|
+
}
|
|
3721
|
+
switch (stampWith) {
|
|
3722
|
+
case enums.StamperType.ApiKey:
|
|
3723
|
+
return this.apiKeyStamper;
|
|
3724
|
+
case enums.StamperType.Passkey:
|
|
3725
|
+
return this.passkeyStamper;
|
|
3726
|
+
case enums.StamperType.Wallet:
|
|
3727
|
+
return this.walletStamper;
|
|
3728
|
+
default:
|
|
3729
|
+
return this.apiKeyStamper;
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
sleep(ms) {
|
|
3733
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
3734
|
+
}
|
|
3735
|
+
/**
|
|
3736
|
+
* Poll for activity completion until terminal status or max retries.
|
|
3737
|
+
* @internal
|
|
3738
|
+
*/
|
|
3739
|
+
async pollForCompletion(activityId, stampWith) {
|
|
3740
|
+
const pollingDuration = this.config.activityPoller?.intervalMs ?? 1000;
|
|
3741
|
+
const maxRetries = this.config.activityPoller?.numRetries ?? 3;
|
|
3742
|
+
let attempts = 0;
|
|
3743
|
+
let activityData;
|
|
3744
|
+
do {
|
|
3745
|
+
await this.sleep(pollingDuration);
|
|
3746
|
+
activityData = (await this.getActivity({ activityId }, stampWith));
|
|
3747
|
+
attempts++;
|
|
3748
|
+
} while (!http.TERMINAL_ACTIVITY_STATUSES.includes(activityData.activity.status) &&
|
|
3749
|
+
attempts < maxRetries);
|
|
3750
|
+
return activityData;
|
|
3751
|
+
}
|
|
3752
|
+
/**
|
|
3753
|
+
* Extract and flatten result fields from a completed activity response.
|
|
3754
|
+
* @internal
|
|
3755
|
+
*/
|
|
3756
|
+
handleActivityResponse(activityData, resultKey) {
|
|
3757
|
+
const { result, status } = activityData.activity;
|
|
3758
|
+
if (status === "ACTIVITY_STATUS_COMPLETED" && result) {
|
|
3759
|
+
// If a specific resultKey was provided, use it
|
|
3760
|
+
if (resultKey && result[resultKey]) {
|
|
3761
|
+
return {
|
|
3762
|
+
...result[resultKey],
|
|
3763
|
+
...activityData,
|
|
3764
|
+
};
|
|
3765
|
+
}
|
|
3766
|
+
// Otherwise, try to find any result field and flatten it
|
|
3767
|
+
for (const key of Object.keys(result)) {
|
|
3768
|
+
if (key.endsWith("Result") && result[key]) {
|
|
3769
|
+
return {
|
|
3770
|
+
...result[key],
|
|
3771
|
+
...activityData,
|
|
3772
|
+
};
|
|
3773
|
+
}
|
|
3774
|
+
}
|
|
3775
|
+
}
|
|
3776
|
+
return activityData;
|
|
3777
|
+
}
|
|
3778
|
+
async request(url, body, stampWith) {
|
|
3779
|
+
const fullUrl = this.config.apiBaseUrl + url;
|
|
3780
|
+
const stringifiedBody = JSON.stringify(body);
|
|
3781
|
+
var headers = {
|
|
3782
|
+
"Content-Type": "application/json",
|
|
3783
|
+
"X-Client-Version": version.VERSION,
|
|
3784
|
+
};
|
|
3785
|
+
// Use the specified stamper for this request
|
|
3786
|
+
const activeStamper = this.getStamper(stampWith);
|
|
3787
|
+
if (activeStamper) {
|
|
3788
|
+
const stamp = await activeStamper.stamp(stringifiedBody);
|
|
3789
|
+
headers[stamp.stampHeaderName] = stamp.stampHeaderValue;
|
|
3790
|
+
}
|
|
3791
|
+
const response = await fetch(fullUrl, {
|
|
3792
|
+
method: "POST",
|
|
3793
|
+
headers: headers,
|
|
3794
|
+
body: stringifiedBody,
|
|
3795
|
+
redirect: "follow",
|
|
3796
|
+
});
|
|
3797
|
+
if (!response.ok) {
|
|
3798
|
+
let res;
|
|
3799
|
+
try {
|
|
3800
|
+
res = await response.json();
|
|
3801
|
+
}
|
|
3802
|
+
catch (_) {
|
|
3803
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
3804
|
+
}
|
|
3805
|
+
throw new error.ZeroXKeyRequestError(res);
|
|
3806
|
+
}
|
|
3807
|
+
const data = await response.json();
|
|
3808
|
+
return data;
|
|
3809
|
+
}
|
|
3810
|
+
async activity(url, body, resultKey, stampWith) {
|
|
3811
|
+
// Make the initial request
|
|
3812
|
+
let activityData = await this.request(url, body, stampWith);
|
|
3813
|
+
// Poll if not in terminal status
|
|
3814
|
+
if (!http.TERMINAL_ACTIVITY_STATUSES.includes(activityData.activity.status)) {
|
|
3815
|
+
activityData = await this.pollForCompletion(activityData.activity.id, stampWith);
|
|
3816
|
+
}
|
|
3817
|
+
return this.handleActivityResponse(activityData, resultKey);
|
|
3818
|
+
}
|
|
3819
|
+
async activityDecision(url, body, stampWith) {
|
|
3820
|
+
// Use the specified stamper for this request
|
|
3821
|
+
const activityData = (await this.request(url, body, stampWith));
|
|
3822
|
+
return {
|
|
3823
|
+
...activityData["activity"]["result"],
|
|
3824
|
+
...activityData,
|
|
3825
|
+
};
|
|
3826
|
+
}
|
|
3827
|
+
async authProxyRequest(url, body) {
|
|
3828
|
+
if (!this.config.authProxyUrl || !this.config.authProxyConfigId) {
|
|
3829
|
+
throw new sdkTypes.ZeroXKeyError("Auth Proxy URL or ID is not configured.", sdkTypes.ZeroXKeyErrorCodes.INVALID_CONFIGURATION);
|
|
3830
|
+
}
|
|
3831
|
+
const fullUrl = this.config.authProxyUrl + url;
|
|
3832
|
+
const stringifiedBody = JSON.stringify(body);
|
|
3833
|
+
var headers = {
|
|
3834
|
+
"Content-Type": "application/json",
|
|
3835
|
+
"X-Auth-Proxy-Config-ID": this.config.authProxyConfigId,
|
|
3836
|
+
};
|
|
3837
|
+
const response = await fetch(fullUrl, {
|
|
3838
|
+
method: "POST",
|
|
3839
|
+
headers: headers,
|
|
3840
|
+
body: stringifiedBody,
|
|
3841
|
+
});
|
|
3842
|
+
if (!response.ok) {
|
|
3843
|
+
let res;
|
|
3844
|
+
try {
|
|
3845
|
+
res = await response.json();
|
|
3846
|
+
}
|
|
3847
|
+
catch (_) {
|
|
3848
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
3849
|
+
}
|
|
3850
|
+
throw new error.ZeroXKeyRequestError(res);
|
|
3851
|
+
}
|
|
3852
|
+
const data = await response.json();
|
|
3853
|
+
return data;
|
|
3854
|
+
}
|
|
3855
|
+
/**
|
|
3856
|
+
* Submit a pre-signed request to ZeroXKey.
|
|
3857
|
+
*
|
|
3858
|
+
* Use this method to execute any TSignedRequest returned by the SDK's
|
|
3859
|
+
* stamping methods (stampCreateApiKeys, stampGetPolicies, stampGetWallets, etc.).
|
|
3860
|
+
*
|
|
3861
|
+
* Works for both query and activity requests:
|
|
3862
|
+
* - For queries: returns the response directly
|
|
3863
|
+
* - For activities: automatically polls until completion and extracts the result
|
|
3864
|
+
*
|
|
3865
|
+
* @param signedRequest - A TSignedRequest object returned by a stamping method
|
|
3866
|
+
* @param options - Optional configuration for the request
|
|
3867
|
+
* @param options.resultKey - For activity requests, the key to extract from the result (e.g., "createApiKeysResultV2")
|
|
3868
|
+
* @returns The parsed response, with activity result fields flattened if applicable
|
|
3869
|
+
*/
|
|
3870
|
+
async sendSignedRequest(signedRequest, options) {
|
|
3871
|
+
const headers = {
|
|
3872
|
+
"Content-Type": "application/json",
|
|
3873
|
+
"X-Client-Version": version.VERSION,
|
|
3874
|
+
[signedRequest.stamp.stampHeaderName]: signedRequest.stamp.stampHeaderValue,
|
|
3875
|
+
};
|
|
3876
|
+
const response = await fetch(signedRequest.url, {
|
|
3877
|
+
method: "POST",
|
|
3878
|
+
headers,
|
|
3879
|
+
body: signedRequest.body,
|
|
3880
|
+
});
|
|
3881
|
+
if (!response.ok) {
|
|
3882
|
+
let res;
|
|
3883
|
+
try {
|
|
3884
|
+
res = await response.json();
|
|
3885
|
+
}
|
|
3886
|
+
catch (_) {
|
|
3887
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
3888
|
+
}
|
|
3889
|
+
throw new error.ZeroXKeyRequestError(res);
|
|
3890
|
+
}
|
|
3891
|
+
const data = await response.json();
|
|
3892
|
+
// Check if this is an activity response that needs polling
|
|
3893
|
+
if (data.activity) {
|
|
3894
|
+
let activityData = data;
|
|
3895
|
+
// Poll if not in terminal status
|
|
3896
|
+
if (!http.TERMINAL_ACTIVITY_STATUSES.includes(activityData.activity.status)) {
|
|
3897
|
+
activityData = await this.pollForCompletion(activityData.activity.id);
|
|
3898
|
+
}
|
|
3899
|
+
return this.handleActivityResponse(activityData, options?.resultKey);
|
|
3900
|
+
}
|
|
3901
|
+
return data;
|
|
3902
|
+
}
|
|
3903
|
+
}
|
|
3904
|
+
|
|
3905
|
+
exports.ZeroXKeySDKClientBase = ZeroXKeySDKClientBase;
|
|
3906
|
+
//# sourceMappingURL=sdk-client-base.js.map
|