@turnkey/sdk-browser 8.3.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/__generated__/sdk-client-base.d.ts +12 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +202 -4
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +202 -4
- package/dist/__generated__/sdk-client-base.mjs.map +1 -1
- package/dist/__generated__/sdk_api_types.d.ts +32 -2
- package/dist/__generated__/sdk_api_types.d.ts.map +1 -1
- package/dist/__generated__/version.d.ts +1 -1
- package/dist/__generated__/version.js +1 -1
- package/dist/__generated__/version.mjs +1 -1
- package/dist/__inputs__/public_api.types.d.ts +410 -19
- package/dist/__inputs__/public_api.types.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -7,6 +7,37 @@ import { parseSession } from '../utils.mjs';
|
|
|
7
7
|
/* @generated by codegen. DO NOT EDIT BY HAND */
|
|
8
8
|
class TurnkeySDKClientBase {
|
|
9
9
|
constructor(config) {
|
|
10
|
+
this.getActivePolicies = async (input) => {
|
|
11
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
12
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
13
|
+
return this.request("/public/v1/query/get_active_policies", {
|
|
14
|
+
...input,
|
|
15
|
+
organizationId: input.organizationId ??
|
|
16
|
+
session?.organizationId ??
|
|
17
|
+
this.config.organizationId,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
this.stampGetActivePolicies = async (input) => {
|
|
21
|
+
if (!this.stamper) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
25
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
26
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_active_policies";
|
|
27
|
+
const body = {
|
|
28
|
+
...input,
|
|
29
|
+
organizationId: input.organizationId ??
|
|
30
|
+
session?.organizationId ??
|
|
31
|
+
this.config.organizationId,
|
|
32
|
+
};
|
|
33
|
+
const stringifiedBody = JSON.stringify(body);
|
|
34
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
35
|
+
return {
|
|
36
|
+
body: stringifiedBody,
|
|
37
|
+
stamp: stamp,
|
|
38
|
+
url: fullUrl,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
10
41
|
this.getActivity = async (input) => {
|
|
11
42
|
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
12
43
|
const session = sessionData ? parseSession(sessionData) : null;
|
|
@@ -1092,6 +1123,37 @@ class TurnkeySDKClientBase {
|
|
|
1092
1123
|
url: fullUrl,
|
|
1093
1124
|
};
|
|
1094
1125
|
};
|
|
1126
|
+
this.getVelocityControl = async (input) => {
|
|
1127
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
1128
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
1129
|
+
return this.request("/public/v1/query/get_velocity_control", {
|
|
1130
|
+
...input,
|
|
1131
|
+
organizationId: input.organizationId ??
|
|
1132
|
+
session?.organizationId ??
|
|
1133
|
+
this.config.organizationId,
|
|
1134
|
+
});
|
|
1135
|
+
};
|
|
1136
|
+
this.stampGetVelocityControl = async (input) => {
|
|
1137
|
+
if (!this.stamper) {
|
|
1138
|
+
return undefined;
|
|
1139
|
+
}
|
|
1140
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
1141
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
1142
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_velocity_control";
|
|
1143
|
+
const body = {
|
|
1144
|
+
...input,
|
|
1145
|
+
organizationId: input.organizationId ??
|
|
1146
|
+
session?.organizationId ??
|
|
1147
|
+
this.config.organizationId,
|
|
1148
|
+
};
|
|
1149
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1150
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1151
|
+
return {
|
|
1152
|
+
body: stringifiedBody,
|
|
1153
|
+
stamp: stamp,
|
|
1154
|
+
url: fullUrl,
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1095
1157
|
this.getWallet = async (input) => {
|
|
1096
1158
|
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
1097
1159
|
const session = sessionData ? parseSession(sessionData) : null;
|
|
@@ -1837,6 +1899,37 @@ class TurnkeySDKClientBase {
|
|
|
1837
1899
|
url: fullUrl,
|
|
1838
1900
|
};
|
|
1839
1901
|
};
|
|
1902
|
+
this.listVelocityControls = async (input) => {
|
|
1903
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
1904
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
1905
|
+
return this.request("/public/v1/query/list_velocity_controls", {
|
|
1906
|
+
...input,
|
|
1907
|
+
organizationId: input.organizationId ??
|
|
1908
|
+
session?.organizationId ??
|
|
1909
|
+
this.config.organizationId,
|
|
1910
|
+
});
|
|
1911
|
+
};
|
|
1912
|
+
this.stampListVelocityControls = async (input) => {
|
|
1913
|
+
if (!this.stamper) {
|
|
1914
|
+
return undefined;
|
|
1915
|
+
}
|
|
1916
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
1917
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
1918
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_velocity_controls";
|
|
1919
|
+
const body = {
|
|
1920
|
+
...input,
|
|
1921
|
+
organizationId: input.organizationId ??
|
|
1922
|
+
session?.organizationId ??
|
|
1923
|
+
this.config.organizationId,
|
|
1924
|
+
};
|
|
1925
|
+
const stringifiedBody = JSON.stringify(body);
|
|
1926
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
1927
|
+
return {
|
|
1928
|
+
body: stringifiedBody,
|
|
1929
|
+
stamp: stamp,
|
|
1930
|
+
url: fullUrl,
|
|
1931
|
+
};
|
|
1932
|
+
};
|
|
1840
1933
|
this.getVerifiedSubOrgIds = async (input) => {
|
|
1841
1934
|
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
1842
1935
|
const session = sessionData ? parseSession(sessionData) : null;
|
|
@@ -2698,7 +2791,7 @@ class TurnkeySDKClientBase {
|
|
|
2698
2791
|
session?.organizationId ??
|
|
2699
2792
|
this.config.organizationId,
|
|
2700
2793
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
2701
|
-
type: "
|
|
2794
|
+
type: "ACTIVITY_TYPE_CREATE_SWAP_QUOTE_V2",
|
|
2702
2795
|
}, "createSwapQuoteResult");
|
|
2703
2796
|
};
|
|
2704
2797
|
this.stampCreateSwapQuote = async (input) => {
|
|
@@ -2713,7 +2806,7 @@ class TurnkeySDKClientBase {
|
|
|
2713
2806
|
parameters,
|
|
2714
2807
|
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
2715
2808
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
2716
|
-
type: "
|
|
2809
|
+
type: "ACTIVITY_TYPE_CREATE_SWAP_QUOTE_V2",
|
|
2717
2810
|
};
|
|
2718
2811
|
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
2719
2812
|
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
@@ -2899,6 +2992,41 @@ class TurnkeySDKClientBase {
|
|
|
2899
2992
|
url: fullUrl,
|
|
2900
2993
|
};
|
|
2901
2994
|
};
|
|
2995
|
+
this.createVelocityControl = async (input) => {
|
|
2996
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
2997
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
2998
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
2999
|
+
return this.command("/public/v1/submit/create_velocity_control", {
|
|
3000
|
+
parameters: rest,
|
|
3001
|
+
organizationId: organizationId ??
|
|
3002
|
+
session?.organizationId ??
|
|
3003
|
+
this.config.organizationId,
|
|
3004
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3005
|
+
type: "ACTIVITY_TYPE_CREATE_VELOCITY_CONTROL",
|
|
3006
|
+
}, "createVelocityControlResult");
|
|
3007
|
+
};
|
|
3008
|
+
this.stampCreateVelocityControl = async (input) => {
|
|
3009
|
+
if (!this.stamper) {
|
|
3010
|
+
return undefined;
|
|
3011
|
+
}
|
|
3012
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
3013
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
3014
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3015
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_velocity_control";
|
|
3016
|
+
const bodyWithType = {
|
|
3017
|
+
parameters,
|
|
3018
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3019
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3020
|
+
type: "ACTIVITY_TYPE_CREATE_VELOCITY_CONTROL",
|
|
3021
|
+
};
|
|
3022
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3023
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3024
|
+
return {
|
|
3025
|
+
body: stringifiedBody,
|
|
3026
|
+
stamp: stamp,
|
|
3027
|
+
url: fullUrl,
|
|
3028
|
+
};
|
|
3029
|
+
};
|
|
2902
3030
|
this.createWallet = async (input) => {
|
|
2903
3031
|
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
2904
3032
|
const session = sessionData ? parseSession(sessionData) : null;
|
|
@@ -3602,6 +3730,41 @@ class TurnkeySDKClientBase {
|
|
|
3602
3730
|
url: fullUrl,
|
|
3603
3731
|
};
|
|
3604
3732
|
};
|
|
3733
|
+
this.deleteVelocityControl = async (input) => {
|
|
3734
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
3735
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
3736
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
3737
|
+
return this.command("/public/v1/submit/delete_velocity_control", {
|
|
3738
|
+
parameters: rest,
|
|
3739
|
+
organizationId: organizationId ??
|
|
3740
|
+
session?.organizationId ??
|
|
3741
|
+
this.config.organizationId,
|
|
3742
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3743
|
+
type: "ACTIVITY_TYPE_DELETE_VELOCITY_CONTROL",
|
|
3744
|
+
}, "deleteVelocityControlResult");
|
|
3745
|
+
};
|
|
3746
|
+
this.stampDeleteVelocityControl = async (input) => {
|
|
3747
|
+
if (!this.stamper) {
|
|
3748
|
+
return undefined;
|
|
3749
|
+
}
|
|
3750
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
3751
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
3752
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
3753
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_velocity_control";
|
|
3754
|
+
const bodyWithType = {
|
|
3755
|
+
parameters,
|
|
3756
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3757
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
3758
|
+
type: "ACTIVITY_TYPE_DELETE_VELOCITY_CONTROL",
|
|
3759
|
+
};
|
|
3760
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3761
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
3762
|
+
return {
|
|
3763
|
+
body: stringifiedBody,
|
|
3764
|
+
stamp: stamp,
|
|
3765
|
+
url: fullUrl,
|
|
3766
|
+
};
|
|
3767
|
+
};
|
|
3605
3768
|
this.deleteWalletAccounts = async (input) => {
|
|
3606
3769
|
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
3607
3770
|
const session = sessionData ? parseSession(sessionData) : null;
|
|
@@ -3962,7 +4125,7 @@ class TurnkeySDKClientBase {
|
|
|
3962
4125
|
session?.organizationId ??
|
|
3963
4126
|
this.config.organizationId,
|
|
3964
4127
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
3965
|
-
type: "
|
|
4128
|
+
type: "ACTIVITY_TYPE_EXECUTE_SWAP_V3",
|
|
3966
4129
|
}, "executeSwapResult");
|
|
3967
4130
|
};
|
|
3968
4131
|
this.stampExecuteSwap = async (input) => {
|
|
@@ -3977,7 +4140,7 @@ class TurnkeySDKClientBase {
|
|
|
3977
4140
|
parameters,
|
|
3978
4141
|
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
3979
4142
|
timestampMs: timestampMs ?? String(Date.now()),
|
|
3980
|
-
type: "
|
|
4143
|
+
type: "ACTIVITY_TYPE_EXECUTE_SWAP_V3",
|
|
3981
4144
|
};
|
|
3982
4145
|
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
3983
4146
|
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
@@ -4302,6 +4465,41 @@ class TurnkeySDKClientBase {
|
|
|
4302
4465
|
url: fullUrl,
|
|
4303
4466
|
};
|
|
4304
4467
|
};
|
|
4468
|
+
this.initImportSecrets = async (input) => {
|
|
4469
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
4470
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
4471
|
+
const { organizationId, timestampMs, ...rest } = input;
|
|
4472
|
+
return this.command("/public/v1/submit/init_import_secrets", {
|
|
4473
|
+
parameters: rest,
|
|
4474
|
+
organizationId: organizationId ??
|
|
4475
|
+
session?.organizationId ??
|
|
4476
|
+
this.config.organizationId,
|
|
4477
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
4478
|
+
type: "ACTIVITY_TYPE_INIT_IMPORT_SECRETS",
|
|
4479
|
+
}, "initImportSecretsResult");
|
|
4480
|
+
};
|
|
4481
|
+
this.stampInitImportSecrets = async (input) => {
|
|
4482
|
+
if (!this.stamper) {
|
|
4483
|
+
return undefined;
|
|
4484
|
+
}
|
|
4485
|
+
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
4486
|
+
const session = sessionData ? parseSession(sessionData) : null;
|
|
4487
|
+
const { organizationId, timestampMs, ...parameters } = input;
|
|
4488
|
+
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/init_import_secrets";
|
|
4489
|
+
const bodyWithType = {
|
|
4490
|
+
parameters,
|
|
4491
|
+
organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
|
|
4492
|
+
timestampMs: timestampMs ?? String(Date.now()),
|
|
4493
|
+
type: "ACTIVITY_TYPE_INIT_IMPORT_SECRETS",
|
|
4494
|
+
};
|
|
4495
|
+
const stringifiedBody = JSON.stringify(bodyWithType);
|
|
4496
|
+
const stamp = await this.stamper.stamp(stringifiedBody);
|
|
4497
|
+
return {
|
|
4498
|
+
body: stringifiedBody,
|
|
4499
|
+
stamp: stamp,
|
|
4500
|
+
url: fullUrl,
|
|
4501
|
+
};
|
|
4502
|
+
};
|
|
4305
4503
|
this.initImportWallet = async (input) => {
|
|
4306
4504
|
const sessionData = await getStorageValue(StorageKeys.Session);
|
|
4307
4505
|
const session = sessionData ? parseSession(sessionData) : null;
|