@turnkey/sdk-browser 6.0.0 → 6.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.
@@ -629,6 +629,68 @@ class TurnkeySDKClientBase {
629
629
  url: fullUrl,
630
630
  };
631
631
  };
632
+ this.getTvcApp = async (input) => {
633
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
634
+ const session = sessionData ? utils.parseSession(sessionData) : null;
635
+ return this.request("/public/v1/query/get_tvc_app", {
636
+ ...input,
637
+ organizationId: input.organizationId ??
638
+ session?.organizationId ??
639
+ this.config.organizationId,
640
+ });
641
+ };
642
+ this.stampGetTvcApp = async (input) => {
643
+ if (!this.stamper) {
644
+ return undefined;
645
+ }
646
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
647
+ const session = sessionData ? utils.parseSession(sessionData) : null;
648
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_tvc_app";
649
+ const body = {
650
+ ...input,
651
+ organizationId: input.organizationId ??
652
+ session?.organizationId ??
653
+ this.config.organizationId,
654
+ };
655
+ const stringifiedBody = JSON.stringify(body);
656
+ const stamp = await this.stamper.stamp(stringifiedBody);
657
+ return {
658
+ body: stringifiedBody,
659
+ stamp: stamp,
660
+ url: fullUrl,
661
+ };
662
+ };
663
+ this.getTvcDeployment = async (input) => {
664
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
665
+ const session = sessionData ? utils.parseSession(sessionData) : null;
666
+ return this.request("/public/v1/query/get_tvc_deployment", {
667
+ ...input,
668
+ organizationId: input.organizationId ??
669
+ session?.organizationId ??
670
+ this.config.organizationId,
671
+ });
672
+ };
673
+ this.stampGetTvcDeployment = async (input) => {
674
+ if (!this.stamper) {
675
+ return undefined;
676
+ }
677
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
678
+ const session = sessionData ? utils.parseSession(sessionData) : null;
679
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_tvc_deployment";
680
+ const body = {
681
+ ...input,
682
+ organizationId: input.organizationId ??
683
+ session?.organizationId ??
684
+ this.config.organizationId,
685
+ };
686
+ const stringifiedBody = JSON.stringify(body);
687
+ const stamp = await this.stamper.stamp(stringifiedBody);
688
+ return {
689
+ body: stringifiedBody,
690
+ stamp: stamp,
691
+ url: fullUrl,
692
+ };
693
+ };
632
694
  this.getUser = async (input) => {
633
695
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
634
696
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -1064,6 +1126,68 @@ class TurnkeySDKClientBase {
1064
1126
  url: fullUrl,
1065
1127
  };
1066
1128
  };
1129
+ this.getTvcAppDeployments = async (input) => {
1130
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1131
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1132
+ return this.request("/public/v1/query/list_tvc_app_deployments", {
1133
+ ...input,
1134
+ organizationId: input.organizationId ??
1135
+ session?.organizationId ??
1136
+ this.config.organizationId,
1137
+ });
1138
+ };
1139
+ this.stampGetTvcAppDeployments = async (input) => {
1140
+ if (!this.stamper) {
1141
+ return undefined;
1142
+ }
1143
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1144
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1145
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_tvc_app_deployments";
1146
+ const body = {
1147
+ ...input,
1148
+ organizationId: input.organizationId ??
1149
+ session?.organizationId ??
1150
+ this.config.organizationId,
1151
+ };
1152
+ const stringifiedBody = JSON.stringify(body);
1153
+ const stamp = await this.stamper.stamp(stringifiedBody);
1154
+ return {
1155
+ body: stringifiedBody,
1156
+ stamp: stamp,
1157
+ url: fullUrl,
1158
+ };
1159
+ };
1160
+ this.getTvcApps = async (input) => {
1161
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1162
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1163
+ return this.request("/public/v1/query/list_tvc_apps", {
1164
+ ...input,
1165
+ organizationId: input.organizationId ??
1166
+ session?.organizationId ??
1167
+ this.config.organizationId,
1168
+ });
1169
+ };
1170
+ this.stampGetTvcApps = async (input) => {
1171
+ if (!this.stamper) {
1172
+ return undefined;
1173
+ }
1174
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1175
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1176
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_tvc_apps";
1177
+ const body = {
1178
+ ...input,
1179
+ organizationId: input.organizationId ??
1180
+ session?.organizationId ??
1181
+ this.config.organizationId,
1182
+ };
1183
+ const stringifiedBody = JSON.stringify(body);
1184
+ const stamp = await this.stamper.stamp(stringifiedBody);
1185
+ return {
1186
+ body: stringifiedBody,
1187
+ stamp: stamp,
1188
+ url: fullUrl,
1189
+ };
1190
+ };
1067
1191
  this.listUserTags = async (input = {}) => {
1068
1192
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1069
1193
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -1250,6 +1374,37 @@ class TurnkeySDKClientBase {
1250
1374
  url: fullUrl,
1251
1375
  };
1252
1376
  };
1377
+ this.validateTvcImage = async (input) => {
1378
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1379
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1380
+ return this.request("/public/v1/query/validate_tvc_image", {
1381
+ ...input,
1382
+ organizationId: input.organizationId ??
1383
+ session?.organizationId ??
1384
+ this.config.organizationId,
1385
+ });
1386
+ };
1387
+ this.stampValidateTvcImage = async (input) => {
1388
+ if (!this.stamper) {
1389
+ return undefined;
1390
+ }
1391
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1392
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1393
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/validate_tvc_image";
1394
+ const body = {
1395
+ ...input,
1396
+ organizationId: input.organizationId ??
1397
+ session?.organizationId ??
1398
+ this.config.organizationId,
1399
+ };
1400
+ const stringifiedBody = JSON.stringify(body);
1401
+ const stamp = await this.stamper.stamp(stringifiedBody);
1402
+ return {
1403
+ body: stringifiedBody,
1404
+ stamp: stamp,
1405
+ url: fullUrl,
1406
+ };
1407
+ };
1253
1408
  this.getWhoami = async (input = {}) => {
1254
1409
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1255
1410
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -1806,6 +1961,112 @@ class TurnkeySDKClientBase {
1806
1961
  url: fullUrl,
1807
1962
  };
1808
1963
  };
1964
+ this.createTvcApp = async (input) => {
1965
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1966
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1967
+ const { organizationId, timestampMs, ...rest } = input;
1968
+ return this.command("/public/v1/submit/create_tvc_app", {
1969
+ parameters: rest,
1970
+ organizationId: organizationId ??
1971
+ session?.organizationId ??
1972
+ this.config.organizationId,
1973
+ timestampMs: timestampMs ?? String(Date.now()),
1974
+ type: "ACTIVITY_TYPE_CREATE_TVC_APP",
1975
+ }, "createTvcAppResult");
1976
+ };
1977
+ this.stampCreateTvcApp = async (input) => {
1978
+ if (!this.stamper) {
1979
+ return undefined;
1980
+ }
1981
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1982
+ const session = sessionData ? utils.parseSession(sessionData) : null;
1983
+ const { organizationId, timestampMs, ...parameters } = input;
1984
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_tvc_app";
1985
+ const bodyWithType = {
1986
+ parameters,
1987
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1988
+ timestampMs: timestampMs ?? String(Date.now()),
1989
+ type: "ACTIVITY_TYPE_CREATE_TVC_APP",
1990
+ };
1991
+ const stringifiedBody = JSON.stringify(bodyWithType);
1992
+ const stamp = await this.stamper.stamp(stringifiedBody);
1993
+ return {
1994
+ body: stringifiedBody,
1995
+ stamp: stamp,
1996
+ url: fullUrl,
1997
+ };
1998
+ };
1999
+ this.createTvcDeployment = async (input) => {
2000
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2001
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2002
+ const { organizationId, timestampMs, ...rest } = input;
2003
+ return this.command("/public/v1/submit/create_tvc_deployment", {
2004
+ parameters: rest,
2005
+ organizationId: organizationId ??
2006
+ session?.organizationId ??
2007
+ this.config.organizationId,
2008
+ timestampMs: timestampMs ?? String(Date.now()),
2009
+ type: "ACTIVITY_TYPE_CREATE_TVC_DEPLOYMENT",
2010
+ }, "createTvcDeploymentResult");
2011
+ };
2012
+ this.stampCreateTvcDeployment = async (input) => {
2013
+ if (!this.stamper) {
2014
+ return undefined;
2015
+ }
2016
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2017
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2018
+ const { organizationId, timestampMs, ...parameters } = input;
2019
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_tvc_deployment";
2020
+ const bodyWithType = {
2021
+ parameters,
2022
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2023
+ timestampMs: timestampMs ?? String(Date.now()),
2024
+ type: "ACTIVITY_TYPE_CREATE_TVC_DEPLOYMENT",
2025
+ };
2026
+ const stringifiedBody = JSON.stringify(bodyWithType);
2027
+ const stamp = await this.stamper.stamp(stringifiedBody);
2028
+ return {
2029
+ body: stringifiedBody,
2030
+ stamp: stamp,
2031
+ url: fullUrl,
2032
+ };
2033
+ };
2034
+ this.createTvcManifestApprovals = async (input) => {
2035
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2036
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2037
+ const { organizationId, timestampMs, ...rest } = input;
2038
+ return this.command("/public/v1/submit/create_tvc_manifest_approvals", {
2039
+ parameters: rest,
2040
+ organizationId: organizationId ??
2041
+ session?.organizationId ??
2042
+ this.config.organizationId,
2043
+ timestampMs: timestampMs ?? String(Date.now()),
2044
+ type: "ACTIVITY_TYPE_CREATE_TVC_MANIFEST_APPROVALS",
2045
+ }, "createTvcManifestApprovalsResult");
2046
+ };
2047
+ this.stampCreateTvcManifestApprovals = async (input) => {
2048
+ if (!this.stamper) {
2049
+ return undefined;
2050
+ }
2051
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2052
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2053
+ const { organizationId, timestampMs, ...parameters } = input;
2054
+ const fullUrl = this.config.apiBaseUrl +
2055
+ "/public/v1/submit/create_tvc_manifest_approvals";
2056
+ const bodyWithType = {
2057
+ parameters,
2058
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2059
+ timestampMs: timestampMs ?? String(Date.now()),
2060
+ type: "ACTIVITY_TYPE_CREATE_TVC_MANIFEST_APPROVALS",
2061
+ };
2062
+ const stringifiedBody = JSON.stringify(bodyWithType);
2063
+ const stamp = await this.stamper.stamp(stringifiedBody);
2064
+ return {
2065
+ body: stringifiedBody,
2066
+ stamp: stamp,
2067
+ url: fullUrl,
2068
+ };
2069
+ };
1809
2070
  this.createUserTag = async (input) => {
1810
2071
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
1811
2072
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -2403,6 +2664,77 @@ class TurnkeySDKClientBase {
2403
2664
  url: fullUrl,
2404
2665
  };
2405
2666
  };
2667
+ this.deleteTvcAppAndDeployments = async (input) => {
2668
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2669
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2670
+ const { organizationId, timestampMs, ...rest } = input;
2671
+ return this.command("/public/v1/submit/delete_tvc_app_and_deployments", {
2672
+ parameters: rest,
2673
+ organizationId: organizationId ??
2674
+ session?.organizationId ??
2675
+ this.config.organizationId,
2676
+ timestampMs: timestampMs ?? String(Date.now()),
2677
+ type: "ACTIVITY_TYPE_DELETE_TVC_APP_AND_DEPLOYMENTS",
2678
+ }, "deleteTvcAppAndDeploymentsResult");
2679
+ };
2680
+ this.stampDeleteTvcAppAndDeployments = async (input) => {
2681
+ if (!this.stamper) {
2682
+ return undefined;
2683
+ }
2684
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2685
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2686
+ const { organizationId, timestampMs, ...parameters } = input;
2687
+ const fullUrl = this.config.apiBaseUrl +
2688
+ "/public/v1/submit/delete_tvc_app_and_deployments";
2689
+ const bodyWithType = {
2690
+ parameters,
2691
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2692
+ timestampMs: timestampMs ?? String(Date.now()),
2693
+ type: "ACTIVITY_TYPE_DELETE_TVC_APP_AND_DEPLOYMENTS",
2694
+ };
2695
+ const stringifiedBody = JSON.stringify(bodyWithType);
2696
+ const stamp = await this.stamper.stamp(stringifiedBody);
2697
+ return {
2698
+ body: stringifiedBody,
2699
+ stamp: stamp,
2700
+ url: fullUrl,
2701
+ };
2702
+ };
2703
+ this.deleteTvcDeployment = async (input) => {
2704
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2705
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2706
+ const { organizationId, timestampMs, ...rest } = input;
2707
+ return this.command("/public/v1/submit/delete_tvc_deployment", {
2708
+ parameters: rest,
2709
+ organizationId: organizationId ??
2710
+ session?.organizationId ??
2711
+ this.config.organizationId,
2712
+ timestampMs: timestampMs ?? String(Date.now()),
2713
+ type: "ACTIVITY_TYPE_DELETE_TVC_DEPLOYMENT",
2714
+ }, "deleteTvcDeploymentResult");
2715
+ };
2716
+ this.stampDeleteTvcDeployment = async (input) => {
2717
+ if (!this.stamper) {
2718
+ return undefined;
2719
+ }
2720
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2721
+ const session = sessionData ? utils.parseSession(sessionData) : null;
2722
+ const { organizationId, timestampMs, ...parameters } = input;
2723
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_tvc_deployment";
2724
+ const bodyWithType = {
2725
+ parameters,
2726
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2727
+ timestampMs: timestampMs ?? String(Date.now()),
2728
+ type: "ACTIVITY_TYPE_DELETE_TVC_DEPLOYMENT",
2729
+ };
2730
+ const stringifiedBody = JSON.stringify(bodyWithType);
2731
+ const stamp = await this.stamper.stamp(stringifiedBody);
2732
+ return {
2733
+ body: stringifiedBody,
2734
+ stamp: stamp,
2735
+ url: fullUrl,
2736
+ };
2737
+ };
2406
2738
  this.deleteUserTags = async (input) => {
2407
2739
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
2408
2740
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -3346,6 +3678,41 @@ class TurnkeySDKClientBase {
3346
3678
  url: fullUrl,
3347
3679
  };
3348
3680
  };
3681
+ this.restoreTvcDeployment = async (input) => {
3682
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3683
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3684
+ const { organizationId, timestampMs, ...rest } = input;
3685
+ return this.command("/public/v1/submit/restore_tvc_deployment", {
3686
+ parameters: rest,
3687
+ organizationId: organizationId ??
3688
+ session?.organizationId ??
3689
+ this.config.organizationId,
3690
+ timestampMs: timestampMs ?? String(Date.now()),
3691
+ type: "ACTIVITY_TYPE_RESTORE_TVC_DEPLOYMENT",
3692
+ }, "restoreTvcDeploymentResult");
3693
+ };
3694
+ this.stampRestoreTvcDeployment = async (input) => {
3695
+ if (!this.stamper) {
3696
+ return undefined;
3697
+ }
3698
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3699
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3700
+ const { organizationId, timestampMs, ...parameters } = input;
3701
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/restore_tvc_deployment";
3702
+ const bodyWithType = {
3703
+ parameters,
3704
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3705
+ timestampMs: timestampMs ?? String(Date.now()),
3706
+ type: "ACTIVITY_TYPE_RESTORE_TVC_DEPLOYMENT",
3707
+ };
3708
+ const stringifiedBody = JSON.stringify(bodyWithType);
3709
+ const stamp = await this.stamper.stamp(stringifiedBody);
3710
+ return {
3711
+ body: stringifiedBody,
3712
+ stamp: stamp,
3713
+ url: fullUrl,
3714
+ };
3715
+ };
3349
3716
  this.setIpAllowlist = async (input) => {
3350
3717
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3351
3718
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -3416,6 +3783,41 @@ class TurnkeySDKClientBase {
3416
3783
  url: fullUrl,
3417
3784
  };
3418
3785
  };
3786
+ this.updateTvcAppLiveDeployment = async (input) => {
3787
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3788
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3789
+ const { organizationId, timestampMs, ...rest } = input;
3790
+ return this.command("/public/v1/submit/set_tvc_app_live_deployment", {
3791
+ parameters: rest,
3792
+ organizationId: organizationId ??
3793
+ session?.organizationId ??
3794
+ this.config.organizationId,
3795
+ timestampMs: timestampMs ?? String(Date.now()),
3796
+ type: "ACTIVITY_TYPE_UPDATE_TVC_APP_LIVE_DEPLOYMENT",
3797
+ }, "updateTvcAppLiveDeploymentResult");
3798
+ };
3799
+ this.stampUpdateTvcAppLiveDeployment = async (input) => {
3800
+ if (!this.stamper) {
3801
+ return undefined;
3802
+ }
3803
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3804
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3805
+ const { organizationId, timestampMs, ...parameters } = input;
3806
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/set_tvc_app_live_deployment";
3807
+ const bodyWithType = {
3808
+ parameters,
3809
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3810
+ timestampMs: timestampMs ?? String(Date.now()),
3811
+ type: "ACTIVITY_TYPE_UPDATE_TVC_APP_LIVE_DEPLOYMENT",
3812
+ };
3813
+ const stringifiedBody = JSON.stringify(bodyWithType);
3814
+ const stamp = await this.stamper.stamp(stringifiedBody);
3815
+ return {
3816
+ body: stringifiedBody,
3817
+ stamp: stamp,
3818
+ url: fullUrl,
3819
+ };
3820
+ };
3419
3821
  this.signRawPayload = async (input) => {
3420
3822
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3421
3823
  const session = sessionData ? utils.parseSession(sessionData) : null;
@@ -3556,6 +3958,147 @@ class TurnkeySDKClientBase {
3556
3958
  url: fullUrl,
3557
3959
  };
3558
3960
  };
3961
+ this.sparkClaimTransfer = async (input) => {
3962
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3963
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3964
+ const { organizationId, timestampMs, ...rest } = input;
3965
+ return this.command("/public/v1/submit/spark_claim_transfer", {
3966
+ parameters: rest,
3967
+ organizationId: organizationId ??
3968
+ session?.organizationId ??
3969
+ this.config.organizationId,
3970
+ timestampMs: timestampMs ?? String(Date.now()),
3971
+ type: "ACTIVITY_TYPE_SPARK_CLAIM_TRANSFER",
3972
+ }, "sparkClaimTransferResult");
3973
+ };
3974
+ this.stampSparkClaimTransfer = async (input) => {
3975
+ if (!this.stamper) {
3976
+ return undefined;
3977
+ }
3978
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3979
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3980
+ const { organizationId, timestampMs, ...parameters } = input;
3981
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/spark_claim_transfer";
3982
+ const bodyWithType = {
3983
+ parameters,
3984
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3985
+ timestampMs: timestampMs ?? String(Date.now()),
3986
+ type: "ACTIVITY_TYPE_SPARK_CLAIM_TRANSFER",
3987
+ };
3988
+ const stringifiedBody = JSON.stringify(bodyWithType);
3989
+ const stamp = await this.stamper.stamp(stringifiedBody);
3990
+ return {
3991
+ body: stringifiedBody,
3992
+ stamp: stamp,
3993
+ url: fullUrl,
3994
+ };
3995
+ };
3996
+ this.sparkPrepareLightningReceive = async (input) => {
3997
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3998
+ const session = sessionData ? utils.parseSession(sessionData) : null;
3999
+ const { organizationId, timestampMs, ...rest } = input;
4000
+ return this.command("/public/v1/submit/spark_prepare_lightning_receive", {
4001
+ parameters: rest,
4002
+ organizationId: organizationId ??
4003
+ session?.organizationId ??
4004
+ this.config.organizationId,
4005
+ timestampMs: timestampMs ?? String(Date.now()),
4006
+ type: "ACTIVITY_TYPE_SPARK_PREPARE_LIGHTNING_RECEIVE",
4007
+ }, "sparkPrepareLightningReceiveResult");
4008
+ };
4009
+ this.stampSparkPrepareLightningReceive = async (input) => {
4010
+ if (!this.stamper) {
4011
+ return undefined;
4012
+ }
4013
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
4014
+ const session = sessionData ? utils.parseSession(sessionData) : null;
4015
+ const { organizationId, timestampMs, ...parameters } = input;
4016
+ const fullUrl = this.config.apiBaseUrl +
4017
+ "/public/v1/submit/spark_prepare_lightning_receive";
4018
+ const bodyWithType = {
4019
+ parameters,
4020
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4021
+ timestampMs: timestampMs ?? String(Date.now()),
4022
+ type: "ACTIVITY_TYPE_SPARK_PREPARE_LIGHTNING_RECEIVE",
4023
+ };
4024
+ const stringifiedBody = JSON.stringify(bodyWithType);
4025
+ const stamp = await this.stamper.stamp(stringifiedBody);
4026
+ return {
4027
+ body: stringifiedBody,
4028
+ stamp: stamp,
4029
+ url: fullUrl,
4030
+ };
4031
+ };
4032
+ this.sparkPrepareTransfer = async (input) => {
4033
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
4034
+ const session = sessionData ? utils.parseSession(sessionData) : null;
4035
+ const { organizationId, timestampMs, ...rest } = input;
4036
+ return this.command("/public/v1/submit/spark_prepare_transfer", {
4037
+ parameters: rest,
4038
+ organizationId: organizationId ??
4039
+ session?.organizationId ??
4040
+ this.config.organizationId,
4041
+ timestampMs: timestampMs ?? String(Date.now()),
4042
+ type: "ACTIVITY_TYPE_SPARK_PREPARE_TRANSFER",
4043
+ }, "sparkPrepareTransferResult");
4044
+ };
4045
+ this.stampSparkPrepareTransfer = async (input) => {
4046
+ if (!this.stamper) {
4047
+ return undefined;
4048
+ }
4049
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
4050
+ const session = sessionData ? utils.parseSession(sessionData) : null;
4051
+ const { organizationId, timestampMs, ...parameters } = input;
4052
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/spark_prepare_transfer";
4053
+ const bodyWithType = {
4054
+ parameters,
4055
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4056
+ timestampMs: timestampMs ?? String(Date.now()),
4057
+ type: "ACTIVITY_TYPE_SPARK_PREPARE_TRANSFER",
4058
+ };
4059
+ const stringifiedBody = JSON.stringify(bodyWithType);
4060
+ const stamp = await this.stamper.stamp(stringifiedBody);
4061
+ return {
4062
+ body: stringifiedBody,
4063
+ stamp: stamp,
4064
+ url: fullUrl,
4065
+ };
4066
+ };
4067
+ this.sparkSignFrost = async (input) => {
4068
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
4069
+ const session = sessionData ? utils.parseSession(sessionData) : null;
4070
+ const { organizationId, timestampMs, ...rest } = input;
4071
+ return this.command("/public/v1/submit/spark_sign_frost", {
4072
+ parameters: rest,
4073
+ organizationId: organizationId ??
4074
+ session?.organizationId ??
4075
+ this.config.organizationId,
4076
+ timestampMs: timestampMs ?? String(Date.now()),
4077
+ type: "ACTIVITY_TYPE_SPARK_SIGN_FROST",
4078
+ }, "sparkSignFrostResult");
4079
+ };
4080
+ this.stampSparkSignFrost = async (input) => {
4081
+ if (!this.stamper) {
4082
+ return undefined;
4083
+ }
4084
+ const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
4085
+ const session = sessionData ? utils.parseSession(sessionData) : null;
4086
+ const { organizationId, timestampMs, ...parameters } = input;
4087
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/spark_sign_frost";
4088
+ const bodyWithType = {
4089
+ parameters,
4090
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
4091
+ timestampMs: timestampMs ?? String(Date.now()),
4092
+ type: "ACTIVITY_TYPE_SPARK_SIGN_FROST",
4093
+ };
4094
+ const stringifiedBody = JSON.stringify(bodyWithType);
4095
+ const stamp = await this.stamper.stamp(stringifiedBody);
4096
+ return {
4097
+ body: stringifiedBody,
4098
+ stamp: stamp,
4099
+ url: fullUrl,
4100
+ };
4101
+ };
3559
4102
  this.stampLogin = async (input) => {
3560
4103
  const sessionData = await storage.getStorageValue(storage.StorageKeys.Session);
3561
4104
  const session = sessionData ? utils.parseSession(sessionData) : null;