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