@settlemint/sdk-js 2.4.0-prd61aaa2c → 2.4.0-prda9b71e5
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/README.md +5 -5
- package/dist/settlemint.cjs +31 -445
- package/dist/settlemint.cjs.map +1 -1
- package/dist/settlemint.d.cts +451 -40983
- package/dist/settlemint.d.ts +423 -40954
- package/dist/settlemint.js +31 -445
- package/dist/settlemint.js.map +1 -1
- package/package.json +2 -2
package/dist/settlemint.cjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* SettleMint SDK - Main Package */
|
|
2
1
|
//#region rolldown:runtime
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
@@ -142,9 +141,7 @@ const workspaceList = (gqlClient) => {
|
|
|
142
141
|
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
|
143
142
|
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
|
144
143
|
acc.push(workspace);
|
|
145
|
-
if (workspace.childWorkspaces)
|
|
146
|
-
acc.push(...workspace.childWorkspaces);
|
|
147
|
-
}
|
|
144
|
+
if (workspace.childWorkspaces) acc.push(...workspace.childWorkspaces);
|
|
148
145
|
return acc;
|
|
149
146
|
}, []);
|
|
150
147
|
return allWorkspaces.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -199,9 +196,7 @@ const workspaceDelete = (gqlClient) => {
|
|
|
199
196
|
const workspaceAddCredits = (gqlClient) => {
|
|
200
197
|
return async (workspaceId, amount) => {
|
|
201
198
|
const id = (0, __settlemint_sdk_utils_validation.validate)(__settlemint_sdk_utils_validation.IdSchema, workspaceId);
|
|
202
|
-
if (amount <= 0)
|
|
203
|
-
throw new Error("Credit amount must be a positive number");
|
|
204
|
-
}
|
|
199
|
+
if (amount <= 0) throw new Error("Credit amount must be a positive number");
|
|
205
200
|
const { addCredits: result } = await gqlClient.request(addCredits, {
|
|
206
201
|
workspaceId: id,
|
|
207
202
|
amount
|
|
@@ -378,9 +373,7 @@ const applicationAccessTokenCreate = (gqlClient) => {
|
|
|
378
373
|
...otherArgs,
|
|
379
374
|
applicationId: application.id
|
|
380
375
|
});
|
|
381
|
-
if (!applicationAccessToken.token)
|
|
382
|
-
throw new Error("Failed to create application access token");
|
|
383
|
-
}
|
|
376
|
+
if (!applicationAccessToken.token) throw new Error("Failed to create application access token");
|
|
384
377
|
return applicationAccessToken.token;
|
|
385
378
|
};
|
|
386
379
|
};
|
|
@@ -411,17 +404,15 @@ function setClusterServiceDefaults(args) {
|
|
|
411
404
|
*/
|
|
412
405
|
function setNetworkDefaults(args) {
|
|
413
406
|
const clusterServiceArgs = setClusterServiceDefaults(args);
|
|
414
|
-
if (args.consensusAlgorithm === "BESU_QBFT") {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
};
|
|
424
|
-
}
|
|
407
|
+
if (args.consensusAlgorithm === "BESU_QBFT") return {
|
|
408
|
+
...clusterServiceArgs,
|
|
409
|
+
chainId: args.chainId ?? 46040,
|
|
410
|
+
contractSizeLimit: args.contractSizeLimit ?? 2147483647,
|
|
411
|
+
evmStackSize: args.evmStackSize ?? 2048,
|
|
412
|
+
gasLimit: args.gasLimit ?? "9007199254740991",
|
|
413
|
+
gasPrice: args.gasPrice ?? 0,
|
|
414
|
+
secondsPerBlock: args.secondsPerBlock ?? 2
|
|
415
|
+
};
|
|
425
416
|
return clusterServiceArgs;
|
|
426
417
|
}
|
|
427
418
|
|
|
@@ -606,26 +597,6 @@ const restartBlockchainNetwork = graphql(`
|
|
|
606
597
|
}
|
|
607
598
|
`, [BlockchainNetworkFragment]);
|
|
608
599
|
/**
|
|
609
|
-
* Mutation to pause a blockchain network.
|
|
610
|
-
*/
|
|
611
|
-
const pauseBlockchainNetwork = graphql(`
|
|
612
|
-
mutation PauseBlockchainNetwork($uniqueName: String!) {
|
|
613
|
-
pauseBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
614
|
-
...BlockchainNetwork
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
`, [BlockchainNetworkFragment]);
|
|
618
|
-
/**
|
|
619
|
-
* Mutation to resume a blockchain network.
|
|
620
|
-
*/
|
|
621
|
-
const resumeBlockchainNetwork = graphql(`
|
|
622
|
-
mutation ResumeBlockchainNetwork($uniqueName: String!) {
|
|
623
|
-
resumeBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
624
|
-
...BlockchainNetwork
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
`, [BlockchainNetworkFragment]);
|
|
628
|
-
/**
|
|
629
600
|
* Creates a function to list blockchain networks for a given application.
|
|
630
601
|
*
|
|
631
602
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -694,28 +665,6 @@ const blockchainNetworkRestart = (gqlClient) => async (blockchainNetworkUniqueNa
|
|
|
694
665
|
const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
|
695
666
|
return blockchainNetwork;
|
|
696
667
|
};
|
|
697
|
-
/**
|
|
698
|
-
* Creates a function to pause a blockchain network.
|
|
699
|
-
*
|
|
700
|
-
* @param gqlClient - The GraphQL client instance
|
|
701
|
-
* @returns Function that pauses a network by unique name
|
|
702
|
-
* @throws If the network cannot be found or the pause fails
|
|
703
|
-
*/
|
|
704
|
-
const blockchainNetworkPause = (gqlClient) => async (blockchainNetworkUniqueName) => {
|
|
705
|
-
const { pauseBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(pauseBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
|
706
|
-
return blockchainNetwork;
|
|
707
|
-
};
|
|
708
|
-
/**
|
|
709
|
-
* Creates a function to resume a blockchain network.
|
|
710
|
-
*
|
|
711
|
-
* @param gqlClient - The GraphQL client instance
|
|
712
|
-
* @returns Function that resumes a network by unique name
|
|
713
|
-
* @throws If the network cannot be found or the resume fails
|
|
714
|
-
*/
|
|
715
|
-
const blockchainNetworkResume = (gqlClient) => async (blockchainNetworkUniqueName) => {
|
|
716
|
-
const { resumeBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(resumeBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
|
717
|
-
return blockchainNetwork;
|
|
718
|
-
};
|
|
719
668
|
|
|
720
669
|
//#endregion
|
|
721
670
|
//#region src/graphql/blockchain-node.ts
|
|
@@ -868,26 +817,6 @@ const restartBlockchainNode = graphql(`
|
|
|
868
817
|
}
|
|
869
818
|
`, [BlockchainNodeFragment]);
|
|
870
819
|
/**
|
|
871
|
-
* Mutation to pause a blockchain node.
|
|
872
|
-
*/
|
|
873
|
-
const pauseBlockchainNode = graphql(`
|
|
874
|
-
mutation PauseBlockchainNode($uniqueName: String!) {
|
|
875
|
-
pauseBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
876
|
-
...BlockchainNode
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
`, [BlockchainNodeFragment]);
|
|
880
|
-
/**
|
|
881
|
-
* Mutation to resume a blockchain node.
|
|
882
|
-
*/
|
|
883
|
-
const resumeBlockchainNode = graphql(`
|
|
884
|
-
mutation ResumeBlockchainNode($uniqueName: String!) {
|
|
885
|
-
resumeBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
886
|
-
...BlockchainNode
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
`, [BlockchainNodeFragment]);
|
|
890
|
-
/**
|
|
891
820
|
* Creates a function to list blockchain nodes for an application.
|
|
892
821
|
*
|
|
893
822
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -943,28 +872,6 @@ const blockchainNodeRestart = (gqlClient) => async (blockchainNodeUniqueName) =>
|
|
|
943
872
|
const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
|
944
873
|
return blockchainNode;
|
|
945
874
|
};
|
|
946
|
-
/**
|
|
947
|
-
* Creates a function to pause a blockchain node.
|
|
948
|
-
*
|
|
949
|
-
* @param gqlClient - The GraphQL client instance
|
|
950
|
-
* @returns Function that pauses a blockchain node by unique name
|
|
951
|
-
* @throws If the blockchain node cannot be found or the pause fails
|
|
952
|
-
*/
|
|
953
|
-
const blockchainNodePause = (gqlClient) => async (blockchainNodeUniqueName) => {
|
|
954
|
-
const { pauseBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(pauseBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
|
955
|
-
return blockchainNode;
|
|
956
|
-
};
|
|
957
|
-
/**
|
|
958
|
-
* Creates a function to resume a blockchain node.
|
|
959
|
-
*
|
|
960
|
-
* @param gqlClient - The GraphQL client instance
|
|
961
|
-
* @returns Function that resumes a blockchain node by unique name
|
|
962
|
-
* @throws If the blockchain node cannot be found or the resume fails
|
|
963
|
-
*/
|
|
964
|
-
const blockchainNodeResume = (gqlClient) => async (blockchainNodeUniqueName) => {
|
|
965
|
-
const { resumeBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(resumeBlockchainNode, { uniqueName: blockchainNodeUniqueName });
|
|
966
|
-
return blockchainNode;
|
|
967
|
-
};
|
|
968
875
|
|
|
969
876
|
//#endregion
|
|
970
877
|
//#region src/graphql/custom-deployment.ts
|
|
@@ -1069,26 +976,6 @@ const restartCustomDeployment = graphql(`
|
|
|
1069
976
|
}
|
|
1070
977
|
`, [CustomDeploymentFragment]);
|
|
1071
978
|
/**
|
|
1072
|
-
* Mutation to pause a custom deployment.
|
|
1073
|
-
*/
|
|
1074
|
-
const pauseCustomDeployment = graphql(`
|
|
1075
|
-
mutation PauseCustomDeployment($uniqueName: String!) {
|
|
1076
|
-
pauseCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
1077
|
-
...CustomDeployment
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
`, [CustomDeploymentFragment]);
|
|
1081
|
-
/**
|
|
1082
|
-
* Mutation to resume a custom deployment.
|
|
1083
|
-
*/
|
|
1084
|
-
const resumeCustomDeployment = graphql(`
|
|
1085
|
-
mutation ResumeCustomDeployment($uniqueName: String!) {
|
|
1086
|
-
resumeCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
1087
|
-
...CustomDeployment
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
`, [CustomDeploymentFragment]);
|
|
1091
|
-
/**
|
|
1092
979
|
* Creates a function to list custom deployments for an application.
|
|
1093
980
|
*
|
|
1094
981
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -1159,28 +1046,6 @@ const customDeploymentRestart = (gqlClient) => async (customDeploymentUniqueName
|
|
|
1159
1046
|
const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
|
1160
1047
|
return customDeployment;
|
|
1161
1048
|
};
|
|
1162
|
-
/**
|
|
1163
|
-
* Creates a function to pause a custom deployment.
|
|
1164
|
-
*
|
|
1165
|
-
* @param gqlClient - The GraphQL client instance
|
|
1166
|
-
* @returns Function that pauses a custom deployment by unique name
|
|
1167
|
-
* @throws If the custom deployment cannot be found or the pause fails
|
|
1168
|
-
*/
|
|
1169
|
-
const customDeploymentPause = (gqlClient) => async (customDeploymentUniqueName) => {
|
|
1170
|
-
const { pauseCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(pauseCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
|
1171
|
-
return customDeployment;
|
|
1172
|
-
};
|
|
1173
|
-
/**
|
|
1174
|
-
* Creates a function to resume a custom deployment.
|
|
1175
|
-
*
|
|
1176
|
-
* @param gqlClient - The GraphQL client instance
|
|
1177
|
-
* @returns Function that resumes a custom deployment by unique name
|
|
1178
|
-
* @throws If the custom deployment cannot be found or the resume fails
|
|
1179
|
-
*/
|
|
1180
|
-
const customDeploymentResume = (gqlClient) => async (customDeploymentUniqueName) => {
|
|
1181
|
-
const { resumeCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(resumeCustomDeployment, { uniqueName: customDeploymentUniqueName });
|
|
1182
|
-
return customDeployment;
|
|
1183
|
-
};
|
|
1184
1049
|
|
|
1185
1050
|
//#endregion
|
|
1186
1051
|
//#region src/graphql/foundry.ts
|
|
@@ -1289,26 +1154,6 @@ const restartLoadBalancer = graphql(`
|
|
|
1289
1154
|
}
|
|
1290
1155
|
`, [LoadBalancerFragment]);
|
|
1291
1156
|
/**
|
|
1292
|
-
* Mutation to pause a load balancer.
|
|
1293
|
-
*/
|
|
1294
|
-
const pauseLoadBalancer = graphql(`
|
|
1295
|
-
mutation PauseLoadBalancer($uniqueName: String!) {
|
|
1296
|
-
pauseLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
|
1297
|
-
...LoadBalancer
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
`, [LoadBalancerFragment]);
|
|
1301
|
-
/**
|
|
1302
|
-
* Mutation to resume a load balancer.
|
|
1303
|
-
*/
|
|
1304
|
-
const resumeLoadBalancer = graphql(`
|
|
1305
|
-
mutation ResumeLoadBalancer($uniqueName: String!) {
|
|
1306
|
-
resumeLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
|
1307
|
-
...LoadBalancer
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
`, [LoadBalancerFragment]);
|
|
1311
|
-
/**
|
|
1312
1157
|
* Creates a function to fetch a specific load balancer.
|
|
1313
1158
|
*
|
|
1314
1159
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -1369,28 +1214,6 @@ const loadBalancerRestart = (gqlClient) => async (loadBalancerUniqueName) => {
|
|
|
1369
1214
|
const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
|
1370
1215
|
return loadBalancer;
|
|
1371
1216
|
};
|
|
1372
|
-
/**
|
|
1373
|
-
* Creates a function to pause a load balancer.
|
|
1374
|
-
*
|
|
1375
|
-
* @param gqlClient - The GraphQL client instance
|
|
1376
|
-
* @returns Function that pauses a load balancer
|
|
1377
|
-
* @throws If the load balancer cannot be paused or the request fails
|
|
1378
|
-
*/
|
|
1379
|
-
const loadBalancerPause = (gqlClient) => async (loadBalancerUniqueName) => {
|
|
1380
|
-
const { pauseLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(pauseLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
|
1381
|
-
return loadBalancer;
|
|
1382
|
-
};
|
|
1383
|
-
/**
|
|
1384
|
-
* Creates a function to resume a load balancer.
|
|
1385
|
-
*
|
|
1386
|
-
* @param gqlClient - The GraphQL client instance
|
|
1387
|
-
* @returns Function that resumes a load balancer
|
|
1388
|
-
* @throws If the load balancer cannot be resumed or the request fails
|
|
1389
|
-
*/
|
|
1390
|
-
const loadBalancerResume = (gqlClient) => async (loadBalancerUniqueName) => {
|
|
1391
|
-
const { resumeLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(resumeLoadBalancer, { uniqueName: loadBalancerUniqueName });
|
|
1392
|
-
return loadBalancer;
|
|
1393
|
-
};
|
|
1394
1217
|
|
|
1395
1218
|
//#endregion
|
|
1396
1219
|
//#region src/graphql/insights.ts
|
|
@@ -1483,26 +1306,6 @@ const restartInsights = graphql(`
|
|
|
1483
1306
|
}
|
|
1484
1307
|
`, [InsightsFragment]);
|
|
1485
1308
|
/**
|
|
1486
|
-
* Mutation to pause insights.
|
|
1487
|
-
*/
|
|
1488
|
-
const pauseInsights = graphql(`
|
|
1489
|
-
mutation PauseInsights($uniqueName: String!) {
|
|
1490
|
-
pauseInsightsByUniqueName(uniqueName: $uniqueName) {
|
|
1491
|
-
...Insights
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
`, [InsightsFragment]);
|
|
1495
|
-
/**
|
|
1496
|
-
* Mutation to resume insights.
|
|
1497
|
-
*/
|
|
1498
|
-
const resumeInsights = graphql(`
|
|
1499
|
-
mutation ResumeInsights($uniqueName: String!) {
|
|
1500
|
-
resumeInsightsByUniqueName(uniqueName: $uniqueName) {
|
|
1501
|
-
...Insights
|
|
1502
|
-
}
|
|
1503
|
-
}
|
|
1504
|
-
`, [InsightsFragment]);
|
|
1505
|
-
/**
|
|
1506
1309
|
* Creates a function to list insights for an application.
|
|
1507
1310
|
*
|
|
1508
1311
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -1540,8 +1343,8 @@ const insightsCreate = (gqlClient) => {
|
|
|
1540
1343
|
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName,...otherArgs } = args;
|
|
1541
1344
|
const [application, blockchainNode, loadBalancer] = await Promise.all([
|
|
1542
1345
|
applicationRead(gqlClient)(applicationUniqueName),
|
|
1543
|
-
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(
|
|
1544
|
-
loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(
|
|
1346
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(void 0),
|
|
1347
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(void 0)
|
|
1545
1348
|
]);
|
|
1546
1349
|
const { createInsights: insights } = await gqlClient.request(createInsights, {
|
|
1547
1350
|
...otherArgs,
|
|
@@ -1563,28 +1366,6 @@ const insightsRestart = (gqlClient) => async (insightsUniqueName) => {
|
|
|
1563
1366
|
const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, { uniqueName: insightsUniqueName });
|
|
1564
1367
|
return insights;
|
|
1565
1368
|
};
|
|
1566
|
-
/**
|
|
1567
|
-
* Creates a function to pause insights.
|
|
1568
|
-
*
|
|
1569
|
-
* @param gqlClient - The GraphQL client instance
|
|
1570
|
-
* @returns Function that pauses insights by unique name
|
|
1571
|
-
* @throws If the insights cannot be found or the pause fails
|
|
1572
|
-
*/
|
|
1573
|
-
const insightsPause = (gqlClient) => async (insightsUniqueName) => {
|
|
1574
|
-
const { pauseInsightsByUniqueName: insights } = await gqlClient.request(pauseInsights, { uniqueName: insightsUniqueName });
|
|
1575
|
-
return insights;
|
|
1576
|
-
};
|
|
1577
|
-
/**
|
|
1578
|
-
* Creates a function to resume insights.
|
|
1579
|
-
*
|
|
1580
|
-
* @param gqlClient - The GraphQL client instance
|
|
1581
|
-
* @returns Function that resumes insights by unique name
|
|
1582
|
-
* @throws If the insights cannot be found or the resume fails
|
|
1583
|
-
*/
|
|
1584
|
-
const insightsResume = (gqlClient) => async (insightsUniqueName) => {
|
|
1585
|
-
const { resumeInsightsByUniqueName: insights } = await gqlClient.request(resumeInsights, { uniqueName: insightsUniqueName });
|
|
1586
|
-
return insights;
|
|
1587
|
-
};
|
|
1588
1369
|
|
|
1589
1370
|
//#endregion
|
|
1590
1371
|
//#region src/graphql/integration-tool.ts
|
|
@@ -1673,26 +1454,6 @@ const restartIntegrationTool = graphql(`
|
|
|
1673
1454
|
}
|
|
1674
1455
|
`, [IntegrationFragment]);
|
|
1675
1456
|
/**
|
|
1676
|
-
* Mutation to pause an integration.
|
|
1677
|
-
*/
|
|
1678
|
-
const pauseIntegrationTool = graphql(`
|
|
1679
|
-
mutation PauseIntegrationTool($uniqueName: String!) {
|
|
1680
|
-
pauseIntegrationByUniqueName(uniqueName: $uniqueName) {
|
|
1681
|
-
...Integration
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
`, [IntegrationFragment]);
|
|
1685
|
-
/**
|
|
1686
|
-
* Mutation to resume an integration.
|
|
1687
|
-
*/
|
|
1688
|
-
const resumeIntegrationTool = graphql(`
|
|
1689
|
-
mutation ResumeIntegrationTool($uniqueName: String!) {
|
|
1690
|
-
resumeIntegrationByUniqueName(uniqueName: $uniqueName) {
|
|
1691
|
-
...Integration
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
`, [IntegrationFragment]);
|
|
1695
|
-
/**
|
|
1696
1457
|
* Creates a function to list integration tools for an application.
|
|
1697
1458
|
*
|
|
1698
1459
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -1747,28 +1508,6 @@ const integrationToolRestart = (gqlClient) => async (integrationUniqueName) => {
|
|
|
1747
1508
|
const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, { uniqueName: integrationUniqueName });
|
|
1748
1509
|
return integration;
|
|
1749
1510
|
};
|
|
1750
|
-
/**
|
|
1751
|
-
* Creates a function to pause an integration tool.
|
|
1752
|
-
*
|
|
1753
|
-
* @param gqlClient - The GraphQL client instance
|
|
1754
|
-
* @returns Function that pauses integration tool by unique name
|
|
1755
|
-
* @throws If the integration tool cannot be found or the pause fails
|
|
1756
|
-
*/
|
|
1757
|
-
const integrationToolPause = (gqlClient) => async (integrationUniqueName) => {
|
|
1758
|
-
const { pauseIntegrationByUniqueName: integration } = await gqlClient.request(pauseIntegrationTool, { uniqueName: integrationUniqueName });
|
|
1759
|
-
return integration;
|
|
1760
|
-
};
|
|
1761
|
-
/**
|
|
1762
|
-
* Creates a function to resume an integration tool.
|
|
1763
|
-
*
|
|
1764
|
-
* @param gqlClient - The GraphQL client instance
|
|
1765
|
-
* @returns Function that resumes integration tool by unique name
|
|
1766
|
-
* @throws If the integration tool cannot be found or the resume fails
|
|
1767
|
-
*/
|
|
1768
|
-
const integrationToolResume = (gqlClient) => async (integrationUniqueName) => {
|
|
1769
|
-
const { resumeIntegrationByUniqueName: integration } = await gqlClient.request(resumeIntegrationTool, { uniqueName: integrationUniqueName });
|
|
1770
|
-
return integration;
|
|
1771
|
-
};
|
|
1772
1511
|
|
|
1773
1512
|
//#endregion
|
|
1774
1513
|
//#region src/graphql/storage.ts
|
|
@@ -1857,26 +1596,6 @@ const restartStorage = graphql(`
|
|
|
1857
1596
|
}
|
|
1858
1597
|
`, [StorageFragment]);
|
|
1859
1598
|
/**
|
|
1860
|
-
* Mutation to pause a storage.
|
|
1861
|
-
*/
|
|
1862
|
-
const pauseStorage = graphql(`
|
|
1863
|
-
mutation PauseStorage($uniqueName: String!) {
|
|
1864
|
-
pauseStorageByUniqueName(uniqueName: $uniqueName) {
|
|
1865
|
-
...Storage
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
`, [StorageFragment]);
|
|
1869
|
-
/**
|
|
1870
|
-
* Mutation to resume a storage.
|
|
1871
|
-
*/
|
|
1872
|
-
const resumeStorage = graphql(`
|
|
1873
|
-
mutation ResumeStorage($uniqueName: String!) {
|
|
1874
|
-
resumeStorageByUniqueName(uniqueName: $uniqueName) {
|
|
1875
|
-
...Storage
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
`, [StorageFragment]);
|
|
1879
|
-
/**
|
|
1880
1599
|
* Creates a function to list storages for an application.
|
|
1881
1600
|
*
|
|
1882
1601
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -1931,28 +1650,6 @@ const storageRestart = (gqlClient) => async (storageUniqueName) => {
|
|
|
1931
1650
|
const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, { uniqueName: storageUniqueName });
|
|
1932
1651
|
return storage;
|
|
1933
1652
|
};
|
|
1934
|
-
/**
|
|
1935
|
-
* Creates a function to pause a storage.
|
|
1936
|
-
*
|
|
1937
|
-
* @param gqlClient - The GraphQL client instance
|
|
1938
|
-
* @returns Function that pauses storage by unique name
|
|
1939
|
-
* @throws If the storage cannot be found or the pause fails
|
|
1940
|
-
*/
|
|
1941
|
-
const storagePause = (gqlClient) => async (storageUniqueName) => {
|
|
1942
|
-
const { pauseStorageByUniqueName: storage } = await gqlClient.request(pauseStorage, { uniqueName: storageUniqueName });
|
|
1943
|
-
return storage;
|
|
1944
|
-
};
|
|
1945
|
-
/**
|
|
1946
|
-
* Creates a function to resume a storage.
|
|
1947
|
-
*
|
|
1948
|
-
* @param gqlClient - The GraphQL client instance
|
|
1949
|
-
* @returns Function that resumes storage by unique name
|
|
1950
|
-
* @throws If the storage cannot be found or the resume fails
|
|
1951
|
-
*/
|
|
1952
|
-
const storageResume = (gqlClient) => async (storageUniqueName) => {
|
|
1953
|
-
const { resumeStorageByUniqueName: storage } = await gqlClient.request(resumeStorage, { uniqueName: storageUniqueName });
|
|
1954
|
-
return storage;
|
|
1955
|
-
};
|
|
1956
1653
|
|
|
1957
1654
|
//#endregion
|
|
1958
1655
|
//#region src/graphql/middleware.ts
|
|
@@ -2075,26 +1772,6 @@ const restartMiddleware = graphql(`
|
|
|
2075
1772
|
}
|
|
2076
1773
|
`, [MiddlewareFragment]);
|
|
2077
1774
|
/**
|
|
2078
|
-
* Mutation to pause a middleware.
|
|
2079
|
-
*/
|
|
2080
|
-
const pauseMiddleware = graphql(`
|
|
2081
|
-
mutation PauseMiddleware($uniqueName: String!) {
|
|
2082
|
-
pauseMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
2083
|
-
...Middleware
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
`, [MiddlewareFragment]);
|
|
2087
|
-
/**
|
|
2088
|
-
* Mutation to resume a middleware.
|
|
2089
|
-
*/
|
|
2090
|
-
const resumeMiddleware = graphql(`
|
|
2091
|
-
mutation ResumeMiddleware($uniqueName: String!) {
|
|
2092
|
-
resumeMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
2093
|
-
...Middleware
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
`, [MiddlewareFragment]);
|
|
2097
|
-
/**
|
|
2098
1775
|
* Creates a function to list middlewares for an application.
|
|
2099
1776
|
*
|
|
2100
1777
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -2148,9 +1825,9 @@ const middlewareCreate = (gqlClient) => {
|
|
|
2148
1825
|
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName,...otherArgs } = args;
|
|
2149
1826
|
const [application, blockchainNode, loadBalancer, storage] = await Promise.all([
|
|
2150
1827
|
applicationRead(gqlClient)(applicationUniqueName),
|
|
2151
|
-
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(
|
|
2152
|
-
loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(
|
|
2153
|
-
storageUniqueName ? storageRead(gqlClient)(storageUniqueName) : Promise.resolve(
|
|
1828
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(void 0),
|
|
1829
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(void 0),
|
|
1830
|
+
storageUniqueName ? storageRead(gqlClient)(storageUniqueName) : Promise.resolve(void 0)
|
|
2154
1831
|
]);
|
|
2155
1832
|
const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {
|
|
2156
1833
|
...otherArgs,
|
|
@@ -2173,28 +1850,6 @@ const middlewareRestart = (gqlClient) => async (middlewareUniqueName) => {
|
|
|
2173
1850
|
const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, { uniqueName: middlewareUniqueName });
|
|
2174
1851
|
return middleware;
|
|
2175
1852
|
};
|
|
2176
|
-
/**
|
|
2177
|
-
* Creates a function to pause a middleware.
|
|
2178
|
-
*
|
|
2179
|
-
* @param gqlClient - The GraphQL client instance
|
|
2180
|
-
* @returns Function that pauses middleware by unique name
|
|
2181
|
-
* @throws If the middleware cannot be found or the pause fails
|
|
2182
|
-
*/
|
|
2183
|
-
const middlewarePause = (gqlClient) => async (middlewareUniqueName) => {
|
|
2184
|
-
const { pauseMiddlewareByUniqueName: middleware } = await gqlClient.request(pauseMiddleware, { uniqueName: middlewareUniqueName });
|
|
2185
|
-
return middleware;
|
|
2186
|
-
};
|
|
2187
|
-
/**
|
|
2188
|
-
* Creates a function to resume a middleware.
|
|
2189
|
-
*
|
|
2190
|
-
* @param gqlClient - The GraphQL client instance
|
|
2191
|
-
* @returns Function that resumes middleware by unique name
|
|
2192
|
-
* @throws If the middleware cannot be found or the resume fails
|
|
2193
|
-
*/
|
|
2194
|
-
const middlewareResume = (gqlClient) => async (middlewareUniqueName) => {
|
|
2195
|
-
const { resumeMiddlewareByUniqueName: middleware } = await gqlClient.request(resumeMiddleware, { uniqueName: middlewareUniqueName });
|
|
2196
|
-
return middleware;
|
|
2197
|
-
};
|
|
2198
1853
|
|
|
2199
1854
|
//#endregion
|
|
2200
1855
|
//#region src/graphql/platform.ts
|
|
@@ -2359,26 +2014,6 @@ const restartPrivateKey = graphql(`
|
|
|
2359
2014
|
}
|
|
2360
2015
|
`, [PrivateKeyFragment]);
|
|
2361
2016
|
/**
|
|
2362
|
-
* Mutation to pause a private key.
|
|
2363
|
-
*/
|
|
2364
|
-
const pausePrivateKey = graphql(`
|
|
2365
|
-
mutation PausePrivateKey($uniqueName: String!) {
|
|
2366
|
-
pausePrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
2367
|
-
...PrivateKey
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
`, [PrivateKeyFragment]);
|
|
2371
|
-
/**
|
|
2372
|
-
* Mutation to resume a private key.
|
|
2373
|
-
*/
|
|
2374
|
-
const resumePrivateKey = graphql(`
|
|
2375
|
-
mutation ResumePrivateKey($uniqueName: String!) {
|
|
2376
|
-
resumePrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
2377
|
-
...PrivateKey
|
|
2378
|
-
}
|
|
2379
|
-
}
|
|
2380
|
-
`, [PrivateKeyFragment]);
|
|
2381
|
-
/**
|
|
2382
2017
|
* Creates a function to list private keys for an application.
|
|
2383
2018
|
*
|
|
2384
2019
|
* @param gqlClient - The GraphQL client instance
|
|
@@ -2416,7 +2051,7 @@ const privateKeyCreate = (gqlClient) => {
|
|
|
2416
2051
|
const { applicationUniqueName, blockchainNodeUniqueNames, relayerKeyUniqueName,...otherArgs } = args;
|
|
2417
2052
|
const application = await applicationRead(gqlClient)(applicationUniqueName);
|
|
2418
2053
|
const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))) : [];
|
|
2419
|
-
const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) :
|
|
2054
|
+
const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : void 0;
|
|
2420
2055
|
const platformConfig = await getPlatformConfig(gqlClient)();
|
|
2421
2056
|
const defaultProvider = platformConfig.deploymentEngineTargets.find((target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled));
|
|
2422
2057
|
const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);
|
|
@@ -2444,28 +2079,6 @@ const privateKeyRestart = (gqlClient) => async (privateKeyUniqueName) => {
|
|
|
2444
2079
|
const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, { uniqueName: privateKeyUniqueName });
|
|
2445
2080
|
return privateKey;
|
|
2446
2081
|
};
|
|
2447
|
-
/**
|
|
2448
|
-
* Creates a function to pause a private key.
|
|
2449
|
-
*
|
|
2450
|
-
* @param gqlClient - The GraphQL client instance
|
|
2451
|
-
* @returns Function that pauses private key by unique name
|
|
2452
|
-
* @throws If the private key cannot be found or the pause fails
|
|
2453
|
-
*/
|
|
2454
|
-
const privateKeyPause = (gqlClient) => async (privateKeyUniqueName) => {
|
|
2455
|
-
const { pausePrivateKeyByUniqueName: privateKey } = await gqlClient.request(pausePrivateKey, { uniqueName: privateKeyUniqueName });
|
|
2456
|
-
return privateKey;
|
|
2457
|
-
};
|
|
2458
|
-
/**
|
|
2459
|
-
* Creates a function to resume a private key.
|
|
2460
|
-
*
|
|
2461
|
-
* @param gqlClient - The GraphQL client instance
|
|
2462
|
-
* @returns Function that resumes private key by unique name
|
|
2463
|
-
* @throws If the private key cannot be found or the resume fails
|
|
2464
|
-
*/
|
|
2465
|
-
const privateKeyResume = (gqlClient) => async (privateKeyUniqueName) => {
|
|
2466
|
-
const { resumePrivateKeyByUniqueName: privateKey } = await gqlClient.request(resumePrivateKey, { uniqueName: privateKeyUniqueName });
|
|
2467
|
-
return privateKey;
|
|
2468
|
-
};
|
|
2469
2082
|
|
|
2470
2083
|
//#endregion
|
|
2471
2084
|
//#region src/helpers/client-options.schema.ts
|
|
@@ -2503,9 +2116,7 @@ async function getPincodeVerificationChallenges({ userWalletAddress, accessToken
|
|
|
2503
2116
|
}
|
|
2504
2117
|
});
|
|
2505
2118
|
if (!response.ok) {
|
|
2506
|
-
if (response.status === 404) {
|
|
2507
|
-
throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
|
|
2508
|
-
}
|
|
2119
|
+
if (response.status === 404) throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);
|
|
2509
2120
|
throw new Error("Failed to get verification challenge");
|
|
2510
2121
|
}
|
|
2511
2122
|
const verificationChallenges = await response.json();
|
|
@@ -2518,9 +2129,7 @@ async function getPincodeVerificationChallenges({ userWalletAddress, accessToken
|
|
|
2518
2129
|
* @returns The pincode verification challenge response.
|
|
2519
2130
|
*/
|
|
2520
2131
|
function getPincodeVerificationChallengeResponse({ verificationChallenge, pincode }) {
|
|
2521
|
-
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt)
|
|
2522
|
-
throw new Error("Could not authenticate pin code, invalid challenge format");
|
|
2523
|
-
}
|
|
2132
|
+
if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) throw new Error("Could not authenticate pin code, invalid challenge format");
|
|
2524
2133
|
const { secret, salt } = verificationChallenge.challenge;
|
|
2525
2134
|
return generateResponse(pincode, salt, secret);
|
|
2526
2135
|
}
|
|
@@ -2553,13 +2162,8 @@ function getPincodeVerificationChallengeResponse({ verificationChallenge, pincod
|
|
|
2553
2162
|
*/
|
|
2554
2163
|
function createSettleMintClient(options) {
|
|
2555
2164
|
(0, __settlemint_sdk_utils_runtime.ensureServer)();
|
|
2556
|
-
if (options.instance === __settlemint_sdk_utils_validation.STANDALONE_INSTANCE || options.instance === __settlemint_sdk_utils_validation.LOCAL_INSTANCE)
|
|
2557
|
-
|
|
2558
|
-
options.instance = "https://console.settlemint.com";
|
|
2559
|
-
} else {
|
|
2560
|
-
throw new Error("Standalone and local instances cannot connect to the SettleMint platform");
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2165
|
+
if (options.instance === __settlemint_sdk_utils_validation.STANDALONE_INSTANCE || options.instance === __settlemint_sdk_utils_validation.LOCAL_INSTANCE) if (options.anonymous) options.instance = "https://console.settlemint.com";
|
|
2166
|
+
else throw new Error("Standalone and local instances cannot connect to the SettleMint platform");
|
|
2563
2167
|
const validatedOptions = options.anonymous ? (0, __settlemint_sdk_utils_validation.validate)(zod_v4.z.object({
|
|
2564
2168
|
...ClientOptionsSchema.shape,
|
|
2565
2169
|
accessToken: zod_v4.z.literal("")
|
|
@@ -2599,75 +2203,57 @@ function createSettleMintClient(options) {
|
|
|
2599
2203
|
read: blockchainNetworkRead(gqlClient),
|
|
2600
2204
|
create: blockchainNetworkCreate(gqlClient),
|
|
2601
2205
|
delete: blockchainNetworkDelete(gqlClient),
|
|
2602
|
-
restart: blockchainNetworkRestart(gqlClient)
|
|
2603
|
-
pause: blockchainNetworkPause(gqlClient),
|
|
2604
|
-
resume: blockchainNetworkResume(gqlClient)
|
|
2206
|
+
restart: blockchainNetworkRestart(gqlClient)
|
|
2605
2207
|
},
|
|
2606
2208
|
blockchainNode: {
|
|
2607
2209
|
list: blockchainNodeList(gqlClient),
|
|
2608
2210
|
read: blockchainNodeRead(gqlClient),
|
|
2609
2211
|
create: blockchainNodeCreate(gqlClient),
|
|
2610
|
-
restart: blockchainNodeRestart(gqlClient)
|
|
2611
|
-
pause: blockchainNodePause(gqlClient),
|
|
2612
|
-
resume: blockchainNodeResume(gqlClient)
|
|
2212
|
+
restart: blockchainNodeRestart(gqlClient)
|
|
2613
2213
|
},
|
|
2614
2214
|
loadBalancer: {
|
|
2615
2215
|
list: loadBalancerList(gqlClient),
|
|
2616
2216
|
read: loadBalancerRead(gqlClient),
|
|
2617
2217
|
create: loadBalancerCreate(gqlClient),
|
|
2618
|
-
restart: loadBalancerRestart(gqlClient)
|
|
2619
|
-
pause: loadBalancerPause(gqlClient),
|
|
2620
|
-
resume: loadBalancerResume(gqlClient)
|
|
2218
|
+
restart: loadBalancerRestart(gqlClient)
|
|
2621
2219
|
},
|
|
2622
2220
|
middleware: {
|
|
2623
2221
|
list: middlewareList(gqlClient),
|
|
2624
2222
|
read: middlewareRead(gqlClient),
|
|
2625
2223
|
graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),
|
|
2626
2224
|
create: middlewareCreate(gqlClient),
|
|
2627
|
-
restart: middlewareRestart(gqlClient)
|
|
2628
|
-
pause: middlewarePause(gqlClient),
|
|
2629
|
-
resume: middlewareResume(gqlClient)
|
|
2225
|
+
restart: middlewareRestart(gqlClient)
|
|
2630
2226
|
},
|
|
2631
2227
|
integrationTool: {
|
|
2632
2228
|
list: integrationToolList(gqlClient),
|
|
2633
2229
|
read: integrationToolRead(gqlClient),
|
|
2634
2230
|
create: integrationToolCreate(gqlClient),
|
|
2635
|
-
restart: integrationToolRestart(gqlClient)
|
|
2636
|
-
pause: integrationToolPause(gqlClient),
|
|
2637
|
-
resume: integrationToolResume(gqlClient)
|
|
2231
|
+
restart: integrationToolRestart(gqlClient)
|
|
2638
2232
|
},
|
|
2639
2233
|
storage: {
|
|
2640
2234
|
list: storageList(gqlClient),
|
|
2641
2235
|
read: storageRead(gqlClient),
|
|
2642
2236
|
create: storageCreate(gqlClient),
|
|
2643
|
-
restart: storageRestart(gqlClient)
|
|
2644
|
-
pause: storagePause(gqlClient),
|
|
2645
|
-
resume: storageResume(gqlClient)
|
|
2237
|
+
restart: storageRestart(gqlClient)
|
|
2646
2238
|
},
|
|
2647
2239
|
privateKey: {
|
|
2648
2240
|
list: privateKeyList(gqlClient),
|
|
2649
2241
|
read: privatekeyRead(gqlClient),
|
|
2650
2242
|
create: privateKeyCreate(gqlClient),
|
|
2651
|
-
restart: privateKeyRestart(gqlClient)
|
|
2652
|
-
pause: privateKeyPause(gqlClient),
|
|
2653
|
-
resume: privateKeyResume(gqlClient)
|
|
2243
|
+
restart: privateKeyRestart(gqlClient)
|
|
2654
2244
|
},
|
|
2655
2245
|
insights: {
|
|
2656
2246
|
list: insightsList(gqlClient),
|
|
2657
2247
|
read: insightsRead(gqlClient),
|
|
2658
2248
|
create: insightsCreate(gqlClient),
|
|
2659
|
-
restart: insightsRestart(gqlClient)
|
|
2660
|
-
pause: insightsPause(gqlClient),
|
|
2661
|
-
resume: insightsResume(gqlClient)
|
|
2249
|
+
restart: insightsRestart(gqlClient)
|
|
2662
2250
|
},
|
|
2663
2251
|
customDeployment: {
|
|
2664
2252
|
list: customdeploymentList(gqlClient),
|
|
2665
2253
|
read: customdeploymentRead(gqlClient),
|
|
2666
2254
|
create: customdeploymentCreate(gqlClient),
|
|
2667
2255
|
update: customdeploymentUpdate(gqlClient),
|
|
2668
|
-
restart: customDeploymentRestart(gqlClient)
|
|
2669
|
-
pause: customDeploymentPause(gqlClient),
|
|
2670
|
-
resume: customDeploymentResume(gqlClient)
|
|
2256
|
+
restart: customDeploymentRestart(gqlClient)
|
|
2671
2257
|
},
|
|
2672
2258
|
foundry: { env: getEnv(gqlClient) },
|
|
2673
2259
|
applicationAccessToken: { create: applicationAccessTokenCreate(gqlClient) },
|