@settlemint/sdk-cli 2.1.4-pr734908a7 → 2.1.4-pr78131058
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/dist/cli.js +96 -600
- package/dist/cli.js.map +35 -42
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -4157,7 +4157,7 @@ var require_webcrypto = __commonJS((exports) => {
|
|
4157
4157
|
exports.gcm = /* @__PURE__ */ (() => generate(mode.GCM))();
|
4158
4158
|
});
|
4159
4159
|
|
4160
|
-
// ../../node_modules
|
4160
|
+
// ../../node_modules/@noble/hashes/_assert.js
|
4161
4161
|
var require__assert2 = __commonJS((exports) => {
|
4162
4162
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4163
4163
|
exports.anumber = anumber;
|
@@ -4199,7 +4199,7 @@ var require__assert2 = __commonJS((exports) => {
|
|
4199
4199
|
}
|
4200
4200
|
});
|
4201
4201
|
|
4202
|
-
// ../../node_modules
|
4202
|
+
// ../../node_modules/@noble/hashes/cryptoNode.js
|
4203
4203
|
var require_cryptoNode2 = __commonJS((exports) => {
|
4204
4204
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4205
4205
|
exports.crypto = undefined;
|
@@ -4207,7 +4207,7 @@ var require_cryptoNode2 = __commonJS((exports) => {
|
|
4207
4207
|
exports.crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && ("randomBytes" in nc) ? nc : undefined;
|
4208
4208
|
});
|
4209
4209
|
|
4210
|
-
// ../../node_modules
|
4210
|
+
// ../../node_modules/@noble/hashes/utils.js
|
4211
4211
|
var require_utils4 = __commonJS((exports) => {
|
4212
4212
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
4213
4213
|
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -4386,7 +4386,7 @@ var require_utils4 = __commonJS((exports) => {
|
|
4386
4386
|
}
|
4387
4387
|
});
|
4388
4388
|
|
4389
|
-
// ../../node_modules
|
4389
|
+
// ../../node_modules/@noble/hashes/_md.js
|
4390
4390
|
var require__md = __commonJS((exports) => {
|
4391
4391
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4392
4392
|
exports.HashMD = undefined;
|
@@ -4503,7 +4503,7 @@ var require__md = __commonJS((exports) => {
|
|
4503
4503
|
exports.HashMD = HashMD;
|
4504
4504
|
});
|
4505
4505
|
|
4506
|
-
// ../../node_modules
|
4506
|
+
// ../../node_modules/@noble/hashes/_u64.js
|
4507
4507
|
var require__u64 = __commonJS((exports) => {
|
4508
4508
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4509
4509
|
exports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = undefined;
|
@@ -4595,7 +4595,7 @@ var require__u64 = __commonJS((exports) => {
|
|
4595
4595
|
exports.default = u64;
|
4596
4596
|
});
|
4597
4597
|
|
4598
|
-
// ../../node_modules
|
4598
|
+
// ../../node_modules/@noble/hashes/sha512.js
|
4599
4599
|
var require_sha512 = __commonJS((exports) => {
|
4600
4600
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4601
4601
|
exports.sha384 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.SHA384 = exports.SHA512_256 = exports.SHA512_224 = exports.SHA512 = undefined;
|
@@ -4876,7 +4876,7 @@ var require_sha512 = __commonJS((exports) => {
|
|
4876
4876
|
exports.sha384 = (0, utils_js_1.wrapConstructor)(() => new SHA384);
|
4877
4877
|
});
|
4878
4878
|
|
4879
|
-
// ../../node_modules
|
4879
|
+
// ../../node_modules/@noble/curves/abstract/utils.js
|
4880
4880
|
var require_utils5 = __commonJS((exports) => {
|
4881
4881
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
4882
4882
|
Object.defineProperty(exports, "__esModule", { value: true });
|
@@ -5146,7 +5146,7 @@ var require_utils5 = __commonJS((exports) => {
|
|
5146
5146
|
}
|
5147
5147
|
});
|
5148
5148
|
|
5149
|
-
// ../../node_modules
|
5149
|
+
// ../../node_modules/@noble/curves/abstract/modular.js
|
5150
5150
|
var require_modular = __commonJS((exports) => {
|
5151
5151
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5152
5152
|
exports.isNegativeLE = undefined;
|
@@ -5481,7 +5481,7 @@ var require_modular = __commonJS((exports) => {
|
|
5481
5481
|
}
|
5482
5482
|
});
|
5483
5483
|
|
5484
|
-
// ../../node_modules
|
5484
|
+
// ../../node_modules/@noble/curves/abstract/curve.js
|
5485
5485
|
var require_curve = __commonJS((exports) => {
|
5486
5486
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5487
5487
|
exports.wNAF = wNAF;
|
@@ -5723,7 +5723,7 @@ var require_curve = __commonJS((exports) => {
|
|
5723
5723
|
}
|
5724
5724
|
});
|
5725
5725
|
|
5726
|
-
// ../../node_modules
|
5726
|
+
// ../../node_modules/@noble/curves/abstract/edwards.js
|
5727
5727
|
var require_edwards = __commonJS((exports) => {
|
5728
5728
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5729
5729
|
exports.twistedEdwards = twistedEdwards;
|
@@ -6085,7 +6085,7 @@ var require_edwards = __commonJS((exports) => {
|
|
6085
6085
|
}
|
6086
6086
|
});
|
6087
6087
|
|
6088
|
-
// ../../node_modules
|
6088
|
+
// ../../node_modules/@noble/curves/abstract/hash-to-curve.js
|
6089
6089
|
var require_hash_to_curve = __commonJS((exports) => {
|
6090
6090
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6091
6091
|
exports.expand_message_xmd = expand_message_xmd;
|
@@ -6232,7 +6232,7 @@ var require_hash_to_curve = __commonJS((exports) => {
|
|
6232
6232
|
}
|
6233
6233
|
});
|
6234
6234
|
|
6235
|
-
// ../../node_modules
|
6235
|
+
// ../../node_modules/@noble/curves/abstract/montgomery.js
|
6236
6236
|
var require_montgomery = __commonJS((exports) => {
|
6237
6237
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6238
6238
|
exports.montgomery = montgomery;
|
@@ -6357,7 +6357,7 @@ var require_montgomery = __commonJS((exports) => {
|
|
6357
6357
|
}
|
6358
6358
|
});
|
6359
6359
|
|
6360
|
-
// ../../node_modules
|
6360
|
+
// ../../node_modules/@noble/curves/ed25519.js
|
6361
6361
|
var require_ed25519 = __commonJS((exports) => {
|
6362
6362
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6363
6363
|
exports.hash_to_ristretto255 = exports.hashToRistretto255 = exports.RistrettoPoint = exports.encodeToCurve = exports.hashToCurve = exports.edwardsToMontgomery = exports.x25519 = exports.ed25519ph = exports.ed25519ctx = exports.ed25519 = exports.ED25519_TORSION_SUBGROUP = undefined;
|
@@ -6724,7 +6724,7 @@ var require_ed25519 = __commonJS((exports) => {
|
|
6724
6724
|
exports.hash_to_ristretto255 = exports.hashToRistretto255;
|
6725
6725
|
});
|
6726
6726
|
|
6727
|
-
// ../../node_modules
|
6727
|
+
// ../../node_modules/@noble/hashes/sha256.js
|
6728
6728
|
var require_sha256 = __commonJS((exports) => {
|
6729
6729
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6730
6730
|
exports.sha224 = exports.sha256 = exports.SHA256 = undefined;
|
@@ -6897,7 +6897,7 @@ var require_sha256 = __commonJS((exports) => {
|
|
6897
6897
|
exports.sha224 = (0, utils_js_1.wrapConstructor)(() => new SHA224);
|
6898
6898
|
});
|
6899
6899
|
|
6900
|
-
// ../../node_modules
|
6900
|
+
// ../../node_modules/@noble/hashes/hmac.js
|
6901
6901
|
var require_hmac = __commonJS((exports) => {
|
6902
6902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6903
6903
|
exports.hmac = exports.HMAC = undefined;
|
@@ -6971,7 +6971,7 @@ var require_hmac = __commonJS((exports) => {
|
|
6971
6971
|
exports.hmac.create = (hash, key) => new HMAC(hash, key);
|
6972
6972
|
});
|
6973
6973
|
|
6974
|
-
// ../../node_modules
|
6974
|
+
// ../../node_modules/@noble/curves/abstract/weierstrass.js
|
6975
6975
|
var require_weierstrass = __commonJS((exports) => {
|
6976
6976
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6977
6977
|
exports.DER = exports.DERErr = undefined;
|
@@ -7878,7 +7878,7 @@ var require_weierstrass = __commonJS((exports) => {
|
|
7878
7878
|
}
|
7879
7879
|
});
|
7880
7880
|
|
7881
|
-
// ../../node_modules
|
7881
|
+
// ../../node_modules/@noble/curves/_shortw_utils.js
|
7882
7882
|
var require__shortw_utils = __commonJS((exports) => {
|
7883
7883
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7884
7884
|
exports.getHash = getHash;
|
@@ -7900,7 +7900,7 @@ var require__shortw_utils = __commonJS((exports) => {
|
|
7900
7900
|
}
|
7901
7901
|
});
|
7902
7902
|
|
7903
|
-
// ../../node_modules
|
7903
|
+
// ../../node_modules/@noble/curves/secp256k1.js
|
7904
7904
|
var require_secp256k1 = __commonJS((exports) => {
|
7905
7905
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7906
7906
|
exports.encodeToCurve = exports.hashToCurve = exports.schnorr = exports.secp256k1 = undefined;
|
@@ -8226,7 +8226,7 @@ var require_elliptic = __commonJS((exports) => {
|
|
8226
8226
|
};
|
8227
8227
|
});
|
8228
8228
|
|
8229
|
-
// ../../node_modules
|
8229
|
+
// ../../node_modules/@noble/hashes/hkdf.js
|
8230
8230
|
var require_hkdf = __commonJS((exports) => {
|
8231
8231
|
Object.defineProperty(exports, "__esModule", { value: true });
|
8232
8232
|
exports.hkdf = undefined;
|
@@ -245084,11 +245084,8 @@ var DotEnvSchema = z.object({
|
|
245084
245084
|
SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
|
245085
245085
|
SETTLEMINT_APPLICATION: UniqueNameSchema.optional(),
|
245086
245086
|
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema.optional(),
|
245087
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: z.string().optional(),
|
245088
245087
|
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema.optional(),
|
245089
|
-
|
245090
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: UniqueNameSchema.optional(),
|
245091
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: UrlSchema.optional(),
|
245088
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema.optional(),
|
245092
245089
|
SETTLEMINT_HASURA: UniqueNameSchema.optional(),
|
245093
245090
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema.optional(),
|
245094
245091
|
SETTLEMINT_HASURA_ADMIN_SECRET: z.string().optional(),
|
@@ -245281,7 +245278,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
245281
245278
|
var package_default = {
|
245282
245279
|
name: "@settlemint/sdk-cli",
|
245283
245280
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
245284
|
-
version: "2.1.4-
|
245281
|
+
version: "2.1.4-pr78131058",
|
245285
245282
|
type: "module",
|
245286
245283
|
private: false,
|
245287
245284
|
license: "FSL-1.1-MIT",
|
@@ -245330,8 +245327,8 @@ var package_default = {
|
|
245330
245327
|
"@inquirer/input": "4.1.9",
|
245331
245328
|
"@inquirer/password": "4.0.12",
|
245332
245329
|
"@inquirer/select": "4.1.1",
|
245333
|
-
"@settlemint/sdk-js": "2.1.4-
|
245334
|
-
"@settlemint/sdk-utils": "2.1.4-
|
245330
|
+
"@settlemint/sdk-js": "2.1.4-pr78131058",
|
245331
|
+
"@settlemint/sdk-utils": "2.1.4-pr78131058",
|
245335
245332
|
"@types/node": "22.14.1",
|
245336
245333
|
"@types/semver": "7.7.0",
|
245337
245334
|
"@types/which": "3.0.4",
|
@@ -246744,11 +246741,8 @@ var DotEnvSchema2 = z.object({
|
|
246744
246741
|
SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
|
246745
246742
|
SETTLEMINT_APPLICATION: UniqueNameSchema2.optional(),
|
246746
246743
|
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema2.optional(),
|
246747
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: z.string().optional(),
|
246748
246744
|
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema2.optional(),
|
246749
|
-
|
246750
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: UniqueNameSchema2.optional(),
|
246751
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: UrlSchema2.optional(),
|
246745
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema2.optional(),
|
246752
246746
|
SETTLEMINT_HASURA: UniqueNameSchema2.optional(),
|
246753
246747
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
|
246754
246748
|
SETTLEMINT_HASURA_ADMIN_SECRET: z.string().optional(),
|
@@ -247647,61 +247641,11 @@ var BlockchainNetworkFragment = graphql(`
|
|
247647
247641
|
healthStatus
|
247648
247642
|
provider
|
247649
247643
|
region
|
247650
|
-
... on BesuQBFTBlockchainNetwork {
|
247651
|
-
chainId
|
247652
|
-
}
|
247653
|
-
... on BesuIbftv2BlockchainNetwork {
|
247654
|
-
chainId
|
247655
|
-
}
|
247656
|
-
... on GethPoWBlockchainNetwork {
|
247657
|
-
chainId
|
247658
|
-
}
|
247659
|
-
... on GethPoSRinkebyBlockchainNetwork {
|
247660
|
-
chainId
|
247661
|
-
}
|
247662
|
-
... on GethVenidiumBlockchainNetwork {
|
247663
|
-
chainId
|
247664
|
-
}
|
247665
|
-
... on GethGoerliBlockchainNetwork {
|
247666
|
-
chainId
|
247667
|
-
}
|
247668
|
-
... on AvalancheBlockchainNetwork {
|
247669
|
-
chainId
|
247670
|
-
}
|
247671
|
-
... on AvalancheFujiBlockchainNetwork {
|
247672
|
-
chainId
|
247673
|
-
}
|
247674
|
-
... on BscPoWBlockchainNetwork {
|
247675
|
-
chainId
|
247676
|
-
}
|
247677
|
-
... on BscPoWTestnetBlockchainNetwork {
|
247678
|
-
chainId
|
247679
|
-
}
|
247680
|
-
... on PolygonBlockchainNetwork {
|
247681
|
-
chainId
|
247682
|
-
}
|
247683
|
-
... on PolygonMumbaiBlockchainNetwork {
|
247684
|
-
chainId
|
247685
|
-
}
|
247686
|
-
... on PolygonEdgePoABlockchainNetwork {
|
247687
|
-
chainId
|
247688
|
-
}
|
247689
|
-
... on QuorumQBFTBlockchainNetwork {
|
247690
|
-
chainId
|
247691
|
-
}
|
247692
|
-
... on GethCliqueBlockchainNetwork {
|
247693
|
-
chainId
|
247694
|
-
}
|
247695
247644
|
blockchainNodes {
|
247696
247645
|
... on BlockchainNode {
|
247697
247646
|
id
|
247698
247647
|
name
|
247699
247648
|
uniqueName
|
247700
|
-
endpoints {
|
247701
|
-
id
|
247702
|
-
label
|
247703
|
-
displayValue
|
247704
|
-
}
|
247705
247649
|
}
|
247706
247650
|
}
|
247707
247651
|
}
|
@@ -247863,51 +247807,6 @@ var BlockchainNodeFragment = graphql(`
|
|
247863
247807
|
id
|
247864
247808
|
name
|
247865
247809
|
uniqueName
|
247866
|
-
... on BesuQBFTBlockchainNetwork {
|
247867
|
-
chainId
|
247868
|
-
}
|
247869
|
-
... on BesuIbftv2BlockchainNetwork {
|
247870
|
-
chainId
|
247871
|
-
}
|
247872
|
-
... on GethPoWBlockchainNetwork {
|
247873
|
-
chainId
|
247874
|
-
}
|
247875
|
-
... on GethPoSRinkebyBlockchainNetwork {
|
247876
|
-
chainId
|
247877
|
-
}
|
247878
|
-
... on GethVenidiumBlockchainNetwork {
|
247879
|
-
chainId
|
247880
|
-
}
|
247881
|
-
... on GethGoerliBlockchainNetwork {
|
247882
|
-
chainId
|
247883
|
-
}
|
247884
|
-
... on AvalancheBlockchainNetwork {
|
247885
|
-
chainId
|
247886
|
-
}
|
247887
|
-
... on AvalancheFujiBlockchainNetwork {
|
247888
|
-
chainId
|
247889
|
-
}
|
247890
|
-
... on BscPoWBlockchainNetwork {
|
247891
|
-
chainId
|
247892
|
-
}
|
247893
|
-
... on BscPoWTestnetBlockchainNetwork {
|
247894
|
-
chainId
|
247895
|
-
}
|
247896
|
-
... on PolygonBlockchainNetwork {
|
247897
|
-
chainId
|
247898
|
-
}
|
247899
|
-
... on PolygonMumbaiBlockchainNetwork {
|
247900
|
-
chainId
|
247901
|
-
}
|
247902
|
-
... on PolygonEdgePoABlockchainNetwork {
|
247903
|
-
chainId
|
247904
|
-
}
|
247905
|
-
... on QuorumQBFTBlockchainNetwork {
|
247906
|
-
chainId
|
247907
|
-
}
|
247908
|
-
... on GethCliqueBlockchainNetwork {
|
247909
|
-
chainId
|
247910
|
-
}
|
247911
247810
|
}
|
247912
247811
|
}
|
247913
247812
|
privateKeys {
|
@@ -248151,11 +248050,6 @@ var LoadBalancerFragment = graphql(`
|
|
248151
248050
|
healthStatus
|
248152
248051
|
provider
|
248153
248052
|
region
|
248154
|
-
endpoints {
|
248155
|
-
id
|
248156
|
-
label
|
248157
|
-
displayValue
|
248158
|
-
}
|
248159
248053
|
}
|
248160
248054
|
`);
|
248161
248055
|
var getLoadBalancer = graphql(`
|
@@ -248165,47 +248059,6 @@ var getLoadBalancer = graphql(`
|
|
248165
248059
|
}
|
248166
248060
|
}
|
248167
248061
|
`, [LoadBalancerFragment]);
|
248168
|
-
var getLoadBalancers = graphql(`
|
248169
|
-
query getLoadBalancers($applicationUniqueName: String!) {
|
248170
|
-
loadBalancersByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
248171
|
-
items {
|
248172
|
-
...LoadBalancer
|
248173
|
-
}
|
248174
|
-
}
|
248175
|
-
}
|
248176
|
-
`, [LoadBalancerFragment]);
|
248177
|
-
var createLoadBalancer = graphql(`
|
248178
|
-
mutation createLoadBalancer(
|
248179
|
-
$applicationId: ID!
|
248180
|
-
$blockchainNetworkId: ID!
|
248181
|
-
$name: String!
|
248182
|
-
$provider: String!
|
248183
|
-
$region: String!
|
248184
|
-
$size: ClusterServiceSize
|
248185
|
-
$type: ClusterServiceType
|
248186
|
-
$connectedNodes: [ID!]!
|
248187
|
-
) {
|
248188
|
-
createLoadBalancer(
|
248189
|
-
applicationId: $applicationId
|
248190
|
-
blockchainNetworkId: $blockchainNetworkId
|
248191
|
-
name: $name
|
248192
|
-
provider: $provider
|
248193
|
-
region: $region
|
248194
|
-
size: $size
|
248195
|
-
type: $type
|
248196
|
-
connectedNodes: $connectedNodes
|
248197
|
-
) {
|
248198
|
-
...LoadBalancer
|
248199
|
-
}
|
248200
|
-
}
|
248201
|
-
`, [LoadBalancerFragment]);
|
248202
|
-
var restartLoadBalancer = graphql(`
|
248203
|
-
mutation RestartLoadBalancer($uniqueName: String!) {
|
248204
|
-
restartLoadBalancerByUniqueName(uniqueName: $uniqueName) {
|
248205
|
-
...LoadBalancer
|
248206
|
-
}
|
248207
|
-
}
|
248208
|
-
`, [LoadBalancerFragment]);
|
248209
248062
|
var loadBalancerRead = (gqlClient) => {
|
248210
248063
|
return async (loadBalancerUniqueName) => {
|
248211
248064
|
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
|
@@ -248214,37 +248067,6 @@ var loadBalancerRead = (gqlClient) => {
|
|
248214
248067
|
return loadBalancer;
|
248215
248068
|
};
|
248216
248069
|
};
|
248217
|
-
var loadBalancerList = (gqlClient) => {
|
248218
|
-
return async (applicationUniqueName) => {
|
248219
|
-
const {
|
248220
|
-
loadBalancersByUniqueName: { items }
|
248221
|
-
} = await gqlClient.request(getLoadBalancers, { applicationUniqueName });
|
248222
|
-
return items;
|
248223
|
-
};
|
248224
|
-
};
|
248225
|
-
var loadBalancerCreate = (gqlClient) => {
|
248226
|
-
return async (args) => {
|
248227
|
-
const { applicationUniqueName, blockchainNetworkUniqueName, connectedNodesUniqueNames, ...otherArgs } = args;
|
248228
|
-
const [application, blockchainNetwork, connectedNodes] = await Promise.all([
|
248229
|
-
applicationRead(gqlClient)(applicationUniqueName),
|
248230
|
-
blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),
|
248231
|
-
Promise.all(connectedNodesUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName)))
|
248232
|
-
]);
|
248233
|
-
const { createLoadBalancer: loadBalancer } = await gqlClient.request(createLoadBalancer, {
|
248234
|
-
...otherArgs,
|
248235
|
-
applicationId: application.id,
|
248236
|
-
blockchainNetworkId: blockchainNetwork.id,
|
248237
|
-
connectedNodes: connectedNodes.map((node) => node.id)
|
248238
|
-
});
|
248239
|
-
return loadBalancer;
|
248240
|
-
};
|
248241
|
-
};
|
248242
|
-
var loadBalancerRestart = (gqlClient) => async (loadBalancerUniqueName) => {
|
248243
|
-
const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, {
|
248244
|
-
uniqueName: loadBalancerUniqueName
|
248245
|
-
});
|
248246
|
-
return loadBalancer;
|
248247
|
-
};
|
248248
248070
|
var InsightsFragment = graphql(`
|
248249
248071
|
fragment Insights on Insights {
|
248250
248072
|
__typename
|
@@ -248945,12 +248767,6 @@ function createSettleMintClient(options) {
|
|
248945
248767
|
create: blockchainNodeCreate(gqlClient),
|
248946
248768
|
restart: blockchainNodeRestart(gqlClient)
|
248947
248769
|
},
|
248948
|
-
loadBalancer: {
|
248949
|
-
list: loadBalancerList(gqlClient),
|
248950
|
-
read: loadBalancerRead(gqlClient),
|
248951
|
-
create: loadBalancerCreate(gqlClient),
|
248952
|
-
restart: loadBalancerRestart(gqlClient)
|
248953
|
-
},
|
248954
248770
|
middleware: {
|
248955
248771
|
list: middlewareList(gqlClient),
|
248956
248772
|
read: middlewareRead(gqlClient),
|
@@ -250325,7 +250141,7 @@ export const postgresPool = createPostgresPool(process.env.SETTLEMINT_HASURA_DAT
|
|
250325
250141
|
await installDependencies(PACKAGE_NAME, projectDir);
|
250326
250142
|
}
|
250327
250143
|
if (!databaseUrl) {
|
250328
|
-
|
250144
|
+
console.warn("[Codegen] Missing database environment variables");
|
250329
250145
|
}
|
250330
250146
|
}
|
250331
250147
|
|
@@ -251882,7 +251698,6 @@ async function codegenBlockscout(env2) {
|
|
251882
251698
|
__schema {
|
251883
251699
|
queryType { name }
|
251884
251700
|
mutationType { name }
|
251885
|
-
subscriptionType { name }
|
251886
251701
|
types {
|
251887
251702
|
...FullType
|
251888
251703
|
}
|
@@ -251964,6 +251779,10 @@ async function codegenBlockscout(env2) {
|
|
251964
251779
|
ofType {
|
251965
251780
|
kind
|
251966
251781
|
name
|
251782
|
+
ofType {
|
251783
|
+
kind
|
251784
|
+
name
|
251785
|
+
}
|
251967
251786
|
}
|
251968
251787
|
}
|
251969
251788
|
}
|
@@ -252081,68 +251900,6 @@ export const { client } = createServerMinioClient({
|
|
252081
251900
|
}
|
252082
251901
|
}
|
252083
251902
|
|
252084
|
-
// src/commands/codegen/codegen-viem.ts
|
252085
|
-
var PACKAGE_NAME7 = "@settlemint/sdk-viem";
|
252086
|
-
async function codegenViem(env2) {
|
252087
|
-
const chainId = env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID;
|
252088
|
-
if (!chainId) {
|
252089
|
-
return;
|
252090
|
-
}
|
252091
|
-
const loadBalancerRpcEndpoint = env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT;
|
252092
|
-
const blockchainNodeRpcEndpoint = env2.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT;
|
252093
|
-
if (!loadBalancerRpcEndpoint && !blockchainNodeRpcEndpoint) {
|
252094
|
-
return;
|
252095
|
-
}
|
252096
|
-
note("Generating Viem resources");
|
252097
|
-
const projectDir = await projectRoot3();
|
252098
|
-
if (!await isPackageInstalled(PACKAGE_NAME7, projectDir)) {
|
252099
|
-
await installDependencies(PACKAGE_NAME7, projectDir);
|
252100
|
-
}
|
252101
|
-
const imports = [];
|
252102
|
-
if (loadBalancerRpcEndpoint) {
|
252103
|
-
imports.push("getPublicClient");
|
252104
|
-
}
|
252105
|
-
if (blockchainNodeRpcEndpoint) {
|
252106
|
-
imports.push("getWalletClient");
|
252107
|
-
}
|
252108
|
-
const viemTemplate = [`import { ${imports.join(", ")} } from "${PACKAGE_NAME7}";`];
|
252109
|
-
if (loadBalancerRpcEndpoint) {
|
252110
|
-
viemTemplate.push(`
|
252111
|
-
/**
|
252112
|
-
* The public client. Use this if you need to read from the blockchain.
|
252113
|
-
*/
|
252114
|
-
export const publicClient = getPublicClient({
|
252115
|
-
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
252116
|
-
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
252117
|
-
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,
|
252118
|
-
});`);
|
252119
|
-
}
|
252120
|
-
if (blockchainNodeRpcEndpoint) {
|
252121
|
-
viemTemplate.push(`
|
252122
|
-
/**
|
252123
|
-
* The wallet client. Use this if you need to write to the blockchain.
|
252124
|
-
*/
|
252125
|
-
export const walletClient = getWalletClient({
|
252126
|
-
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
252127
|
-
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
252128
|
-
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
252129
|
-
})();
|
252130
|
-
|
252131
|
-
/**
|
252132
|
-
* The wallet client for HD wallets. Use this if you need to write to the blockchain.
|
252133
|
-
* HD wallets require a challenge response to be sent with the request.
|
252134
|
-
*/
|
252135
|
-
export const hdWalletClient = getWalletClient({
|
252136
|
-
chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,
|
252137
|
-
chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,
|
252138
|
-
rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT!,
|
252139
|
-
});`);
|
252140
|
-
}
|
252141
|
-
await writeTemplate(viemTemplate.join(`
|
252142
|
-
`), "/lib/settlemint", "viem.ts");
|
252143
|
-
note("Viem resources generated successfully");
|
252144
|
-
}
|
252145
|
-
|
252146
251903
|
// src/commands/codegen.ts
|
252147
251904
|
function codegenCommand() {
|
252148
251905
|
return new Command("codegen").option("--prod", "Connect to your production environment").option("--thegraph-subgraph-names <subgraph-names...>", "The name(s) of the TheGraph subgraph(s) to generate (skip if you want to generate all)").description("Generate GraphQL and REST types and queries").usage(createExamples([
|
@@ -252172,7 +251929,6 @@ function codegenCommand() {
|
|
252172
251929
|
},
|
252173
251930
|
stopMessage: "Tested GraphQL schemas"
|
252174
251931
|
});
|
252175
|
-
await codegenViem(env2);
|
252176
251932
|
if (hasura) {
|
252177
251933
|
note("Generating Hasura resources");
|
252178
251934
|
await codegenHasura(env2);
|
@@ -252434,7 +252190,6 @@ async function applicationPrompt(env2, applications, accept) {
|
|
252434
252190
|
}
|
252435
252191
|
|
252436
252192
|
// src/prompts/cluster-service/service.prompt.ts
|
252437
|
-
var ALL2 = "All";
|
252438
252193
|
async function servicePrompt({
|
252439
252194
|
env: env2,
|
252440
252195
|
services,
|
@@ -252443,17 +252198,13 @@ async function servicePrompt({
|
|
252443
252198
|
defaultHandler,
|
252444
252199
|
isRequired = false,
|
252445
252200
|
isCi = is_in_ci_default,
|
252446
|
-
singleOptionMessage
|
252447
|
-
allowAll = false
|
252201
|
+
singleOptionMessage
|
252448
252202
|
}) {
|
252449
252203
|
if (services.length === 0) {
|
252450
252204
|
return;
|
252451
252205
|
}
|
252452
|
-
const selectedService = services.find((service) =>
|
252206
|
+
const selectedService = services.find((service) => service.uniqueName === env2[envKey]);
|
252453
252207
|
const autoAccept = isCi || accept;
|
252454
|
-
if (autoAccept && allowAll) {
|
252455
|
-
return services;
|
252456
|
-
}
|
252457
252208
|
if (autoAccept && selectedService) {
|
252458
252209
|
return selectedService;
|
252459
252210
|
}
|
@@ -252461,7 +252212,7 @@ async function servicePrompt({
|
|
252461
252212
|
return;
|
252462
252213
|
}
|
252463
252214
|
if (isRequired && services.length === 1) {
|
252464
|
-
if (singleOptionMessage
|
252215
|
+
if (singleOptionMessage) {
|
252465
252216
|
note(singleOptionMessage(services[0].uniqueName));
|
252466
252217
|
}
|
252467
252218
|
return services[0];
|
@@ -252470,37 +252221,13 @@ async function servicePrompt({
|
|
252470
252221
|
name: `${service.name} (${service.uniqueName})`,
|
252471
252222
|
value: service
|
252472
252223
|
}));
|
252473
|
-
if (allowAll) {
|
252474
|
-
choices.unshift({
|
252475
|
-
name: ALL2,
|
252476
|
-
value: services
|
252477
|
-
});
|
252478
|
-
}
|
252479
252224
|
if (!isRequired) {
|
252480
252225
|
choices.push({
|
252481
252226
|
name: "None",
|
252482
252227
|
value: undefined
|
252483
252228
|
});
|
252484
252229
|
}
|
252485
|
-
return defaultHandler({
|
252486
|
-
defaultService: selectedService,
|
252487
|
-
choices
|
252488
|
-
});
|
252489
|
-
}
|
252490
|
-
|
252491
|
-
// src/utils/cluster-service.ts
|
252492
|
-
function isValidPrivateKey(privateKey) {
|
252493
|
-
return privateKey.privateKeyType !== "HD_ECDSA_P256";
|
252494
|
-
}
|
252495
|
-
function hasValidPrivateKey(service) {
|
252496
|
-
return (service.privateKeys ?? []).some(isValidPrivateKey);
|
252497
|
-
}
|
252498
|
-
function hasPrivateKey(service) {
|
252499
|
-
const keys = service.privateKeys ?? [];
|
252500
|
-
return keys.length > 0;
|
252501
|
-
}
|
252502
|
-
function isRunning(service) {
|
252503
|
-
return service === undefined || service?.status === "COMPLETED";
|
252230
|
+
return defaultHandler({ defaultService: selectedService, choices });
|
252504
252231
|
}
|
252505
252232
|
|
252506
252233
|
// src/prompts/cluster-service/blockchain-node.prompt.ts
|
@@ -252511,8 +252238,7 @@ async function blockchainNodePrompt({
|
|
252511
252238
|
singleOptionMessage,
|
252512
252239
|
promptMessage,
|
252513
252240
|
filterRunningOnly = false,
|
252514
|
-
isRequired = false
|
252515
|
-
allowAll = false
|
252241
|
+
isRequired = false
|
252516
252242
|
}) {
|
252517
252243
|
return servicePrompt({
|
252518
252244
|
env: env2,
|
@@ -252521,25 +252247,14 @@ async function blockchainNodePrompt({
|
|
252521
252247
|
envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
|
252522
252248
|
isRequired,
|
252523
252249
|
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
252524
|
-
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) =>
|
252525
|
-
return Array.isArray(node) ? true : isRunning(node);
|
252526
|
-
}).map((item) => {
|
252527
|
-
if (Array.isArray(item.value)) {
|
252528
|
-
return {
|
252529
|
-
...item,
|
252530
|
-
value: item.value.filter(isRunning)
|
252531
|
-
};
|
252532
|
-
}
|
252533
|
-
return item;
|
252534
|
-
}) : choices;
|
252250
|
+
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
252535
252251
|
return esm_default3({
|
252536
252252
|
message: promptMessage ?? "Which blockchain node do you want to connect to?",
|
252537
252253
|
choices: filteredChoices,
|
252538
252254
|
default: defaultNode
|
252539
252255
|
});
|
252540
252256
|
},
|
252541
|
-
singleOptionMessage
|
252542
|
-
allowAll
|
252257
|
+
singleOptionMessage
|
252543
252258
|
});
|
252544
252259
|
}
|
252545
252260
|
|
@@ -252844,8 +252559,7 @@ async function servicesSpinner(settlemint, applicationUniqueName, types2) {
|
|
252844
252559
|
storages,
|
252845
252560
|
privateKeys,
|
252846
252561
|
insights,
|
252847
|
-
customDeployments
|
252848
|
-
loadBalancers
|
252562
|
+
customDeployments
|
252849
252563
|
] = await Promise.all([
|
252850
252564
|
shouldFetch("blockchain-network") ? settlemint.blockchainNetwork.list(applicationUniqueName) : Promise.resolve([]),
|
252851
252565
|
shouldFetch("blockchain-node") ? settlemint.blockchainNode.list(applicationUniqueName) : Promise.resolve([]),
|
@@ -252854,8 +252568,7 @@ async function servicesSpinner(settlemint, applicationUniqueName, types2) {
|
|
252854
252568
|
shouldFetch("storage") ? settlemint.storage.list(applicationUniqueName) : Promise.resolve([]),
|
252855
252569
|
shouldFetch("private-key") ? settlemint.privateKey.list(applicationUniqueName) : Promise.resolve([]),
|
252856
252570
|
shouldFetch("insights") ? settlemint.insights.list(applicationUniqueName) : Promise.resolve([]),
|
252857
|
-
shouldFetch("custom-deployment") ? settlemint.customDeployment.list(applicationUniqueName) : Promise.resolve([])
|
252858
|
-
shouldFetch("load-balancer") ? settlemint.loadBalancer.list(applicationUniqueName) : Promise.resolve([])
|
252571
|
+
shouldFetch("custom-deployment") ? settlemint.customDeployment.list(applicationUniqueName) : Promise.resolve([])
|
252859
252572
|
]);
|
252860
252573
|
return {
|
252861
252574
|
blockchainNetworks,
|
@@ -252865,8 +252578,7 @@ async function servicesSpinner(settlemint, applicationUniqueName, types2) {
|
|
252865
252578
|
storages,
|
252866
252579
|
privateKeys,
|
252867
252580
|
insights,
|
252868
|
-
customDeployments
|
252869
|
-
loadBalancers
|
252581
|
+
customDeployments
|
252870
252582
|
};
|
252871
252583
|
}
|
252872
252584
|
});
|
@@ -252905,11 +252617,8 @@ async function writeEnvSpinner(prod, env2) {
|
|
252905
252617
|
SETTLEMINT_WORKSPACE: env2.SETTLEMINT_WORKSPACE,
|
252906
252618
|
SETTLEMINT_APPLICATION: env2.SETTLEMINT_APPLICATION,
|
252907
252619
|
SETTLEMINT_BLOCKCHAIN_NETWORK: env2.SETTLEMINT_BLOCKCHAIN_NETWORK,
|
252908
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: env2.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID,
|
252909
252620
|
SETTLEMINT_BLOCKCHAIN_NODE: env2.SETTLEMINT_BLOCKCHAIN_NODE,
|
252910
|
-
|
252911
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER,
|
252912
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT,
|
252621
|
+
SETTLEMINT_LOAD_BALANCER: env2.SETTLEMINT_LOAD_BALANCER,
|
252913
252622
|
SETTLEMINT_HASURA: env2.SETTLEMINT_HASURA,
|
252914
252623
|
SETTLEMINT_HASURA_ENDPOINT: env2.SETTLEMINT_HASURA_ENDPOINT,
|
252915
252624
|
SETTLEMINT_THEGRAPH: env2.SETTLEMINT_THEGRAPH,
|
@@ -252944,14 +252653,6 @@ async function writeEnvSpinner(prod, env2) {
|
|
252944
252653
|
});
|
252945
252654
|
}
|
252946
252655
|
|
252947
|
-
// src/utils/blockchain-network.ts
|
252948
|
-
function getBlockchainNetworkChainId(blockchainNetwork) {
|
252949
|
-
if (!blockchainNetwork) {
|
252950
|
-
return;
|
252951
|
-
}
|
252952
|
-
return "chainId" in blockchainNetwork && typeof blockchainNetwork.chainId === "number" ? blockchainNetwork.chainId.toString() : undefined;
|
252953
|
-
}
|
252954
|
-
|
252955
252656
|
// src/utils/get-cluster-service-endpoint.ts
|
252956
252657
|
async function getGraphEndpoint(settlemint, service, graphName) {
|
252957
252658
|
if (!service || service.__typename !== "HAGraphMiddleware") {
|
@@ -253025,51 +252726,6 @@ function getMinioEndpoints(service) {
|
|
253025
252726
|
SETTLEMINT_MINIO_SECRET_KEY: service?.credentials.find((credential) => credential.id.includes("secret-key"))?.displayValue
|
253026
252727
|
};
|
253027
252728
|
}
|
253028
|
-
function getBlockchainNodeEndpoints(service) {
|
253029
|
-
if (!service) {
|
253030
|
-
return {};
|
253031
|
-
}
|
253032
|
-
return {
|
253033
|
-
SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("json-rpc"))?.displayValue
|
253034
|
-
};
|
253035
|
-
}
|
253036
|
-
function getBlockchainNodeOrLoadBalancerEndpoints(service) {
|
253037
|
-
if (!service) {
|
253038
|
-
return {};
|
253039
|
-
}
|
253040
|
-
return {
|
253041
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT: service.endpoints.find((endpoint) => endpoint.id.includes("json-rpc"))?.displayValue
|
253042
|
-
};
|
253043
|
-
}
|
253044
|
-
|
253045
|
-
// src/prompts/cluster-service/blockchain-node-or-load-balancer.prompt.ts
|
253046
|
-
async function blockchainNodeOrLoadBalancerPrompt({
|
253047
|
-
env: env2,
|
253048
|
-
nodes,
|
253049
|
-
loadBalancers,
|
253050
|
-
accept,
|
253051
|
-
singleOptionMessage,
|
253052
|
-
promptMessage,
|
253053
|
-
filterRunningOnly = false,
|
253054
|
-
isRequired = false
|
253055
|
-
}) {
|
253056
|
-
return servicePrompt({
|
253057
|
-
env: env2,
|
253058
|
-
services: [...loadBalancers, ...nodes],
|
253059
|
-
accept,
|
253060
|
-
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
253061
|
-
isRequired,
|
253062
|
-
defaultHandler: async ({ defaultService: defaultNode, choices }) => {
|
253063
|
-
const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
|
253064
|
-
return esm_default3({
|
253065
|
-
message: promptMessage ?? "Which blockchain node or load balancer do you want to connect to?",
|
253066
|
-
choices: filteredChoices,
|
253067
|
-
default: defaultNode
|
253068
|
-
});
|
253069
|
-
},
|
253070
|
-
singleOptionMessage
|
253071
|
-
});
|
253072
|
-
}
|
253073
252729
|
|
253074
252730
|
// src/commands/connect.ts
|
253075
252731
|
function connectCommand() {
|
@@ -253090,30 +252746,11 @@ function connectCommand() {
|
|
253090
252746
|
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
253091
252747
|
const application = await applicationPrompt(env2, workspace?.applications ?? [], acceptDefaults);
|
253092
252748
|
const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, acceptDefaults);
|
253093
|
-
const {
|
253094
|
-
middlewares,
|
253095
|
-
integrationTools,
|
253096
|
-
storages,
|
253097
|
-
privateKeys,
|
253098
|
-
insights,
|
253099
|
-
customDeployments,
|
253100
|
-
blockchainNodes,
|
253101
|
-
loadBalancers
|
253102
|
-
} = await servicesSpinner(settlemint, application.uniqueName);
|
253103
|
-
const nodesWithPrivateKey = blockchainNodes.filter(hasPrivateKey);
|
252749
|
+
const { middlewares, integrationTools, storages, privateKeys, insights, customDeployments, blockchainNodes } = await servicesSpinner(settlemint, application.uniqueName);
|
253104
252750
|
const blockchainNode = await blockchainNodePrompt({
|
253105
252751
|
env: env2,
|
253106
|
-
nodes:
|
253107
|
-
accept: acceptDefaults
|
253108
|
-
promptMessage: "Which blockchain node do you want to use for sending transactions?"
|
253109
|
-
});
|
253110
|
-
const nodesWithoutPrivateKey = blockchainNodes.filter((node) => !hasPrivateKey(node));
|
253111
|
-
const loadBalancerOrBlockchainNode = await blockchainNodeOrLoadBalancerPrompt({
|
253112
|
-
env: env2,
|
253113
|
-
nodes: nodesWithoutPrivateKey,
|
253114
|
-
loadBalancers,
|
253115
|
-
accept: acceptDefaults,
|
253116
|
-
promptMessage: "Which load balancer or blockchain node do you want to use for read operations?"
|
252752
|
+
nodes: blockchainNodes,
|
252753
|
+
accept: acceptDefaults
|
253117
252754
|
});
|
253118
252755
|
const hasura = await hasuraPrompt({
|
253119
252756
|
env: env2,
|
@@ -253179,15 +252816,10 @@ function connectCommand() {
|
|
253179
252816
|
uniqueName: blockchainNode.blockchainNetwork?.uniqueName
|
253180
252817
|
},
|
253181
252818
|
blockchainNode && {
|
253182
|
-
type: "Blockchain Node
|
252819
|
+
type: "Blockchain Node",
|
253183
252820
|
name: blockchainNode.name,
|
253184
252821
|
uniqueName: blockchainNode.uniqueName
|
253185
252822
|
},
|
253186
|
-
loadBalancerOrBlockchainNode && {
|
253187
|
-
type: "Load Balancer or Blockchain Node (use for read operations)",
|
253188
|
-
name: loadBalancerOrBlockchainNode.name,
|
253189
|
-
uniqueName: loadBalancerOrBlockchainNode.uniqueName
|
253190
|
-
},
|
253191
252823
|
hasura && {
|
253192
252824
|
type: "Hasura",
|
253193
252825
|
name: hasura.name,
|
@@ -253237,11 +252869,7 @@ function connectCommand() {
|
|
253237
252869
|
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
253238
252870
|
SETTLEMINT_APPLICATION: application.uniqueName,
|
253239
252871
|
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
253240
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID: getBlockchainNetworkChainId(blockchainNode?.blockchainNetwork),
|
253241
252872
|
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
253242
|
-
...getBlockchainNodeEndpoints(blockchainNode),
|
253243
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: loadBalancerOrBlockchainNode?.uniqueName,
|
253244
|
-
...getBlockchainNodeOrLoadBalancerEndpoints(loadBalancerOrBlockchainNode),
|
253245
252873
|
SETTLEMINT_HASURA: hasura?.uniqueName,
|
253246
252874
|
...getHasuraEndpoints(hasura),
|
253247
252875
|
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
@@ -256583,8 +256211,7 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
256583
256211
|
"integration tool": "integrationTool",
|
256584
256212
|
storage: "storage",
|
256585
256213
|
insights: "insights",
|
256586
|
-
"application access token": "applicationAccessToken"
|
256587
|
-
"load balancer": "loadBalancer"
|
256214
|
+
"application access token": "applicationAccessToken"
|
256588
256215
|
};
|
256589
256216
|
var LABELS_MAP = {
|
256590
256217
|
application: { singular: "application", plural: "applications", command: "app" },
|
@@ -256605,8 +256232,7 @@ var LABELS_MAP = {
|
|
256605
256232
|
singular: "application access token",
|
256606
256233
|
plural: "application access tokens",
|
256607
256234
|
command: "application-access-token"
|
256608
|
-
}
|
256609
|
-
"load balancer": { singular: "load balancer", plural: "load balancers", command: "load-balancer" }
|
256235
|
+
}
|
256610
256236
|
};
|
256611
256237
|
|
256612
256238
|
// src/spinners/service.spinner.ts
|
@@ -257108,10 +256734,7 @@ function getCreateCommand({
|
|
257108
256734
|
usePersonalAccessToken = true,
|
257109
256735
|
requiresDeployment = true
|
257110
256736
|
}) {
|
257111
|
-
const cmd2 = new Command(sanitizeCommandName(name3)).description(`Create a new ${subType ? `${subType} ${type4}` : type4} in the SettleMint platform.`).usage(createExamples(examples)).argument("<name>", `The ${subType ? `${subType} ${type4}` : type4} name`).option("-a, --accept-defaults", "Accept the default values").option("-d, --default", `Save as default ${type4}`).option("--prod", "Connect to production environment");
|
257112
|
-
if (alias) {
|
257113
|
-
cmd2.alias(alias);
|
257114
|
-
}
|
256737
|
+
const cmd2 = new Command(sanitizeCommandName(name3)).alias(alias).description(`Create a new ${subType ? `${subType} ${type4}` : type4} in the SettleMint platform.`).usage(createExamples(examples)).argument("<name>", `The ${subType ? `${subType} ${type4}` : type4} name`).option("-a, --accept-defaults", "Accept the default values").option("-d, --default", `Save as default ${type4}`).option("--prod", "Connect to production environment");
|
257115
256738
|
if (requiresDeployment) {
|
257116
256739
|
cmd2.option("-w, --wait", "Wait until deployed").option("-r, --restart-if-timeout", "Restart if wait time is exceeded");
|
257117
256740
|
}
|
@@ -257181,10 +256804,7 @@ function getCreateCommand({
|
|
257181
256804
|
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
|
257182
256805
|
}
|
257183
256806
|
if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
|
257184
|
-
|
257185
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = newNode.blockchainNetwork.uniqueName;
|
257186
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID = getBlockchainNetworkChainId(newNode.blockchainNetwork);
|
257187
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT = getBlockchainNodeEndpoints(newNode).SETTLEMINT_BLOCKCHAIN_NODE_JSON_RPC_ENDPOINT;
|
256807
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
|
257188
256808
|
}
|
257189
256809
|
await writeEnvSpinner(!!prod, newEnv);
|
257190
256810
|
note(`${capitalizeFirstLetter2(type4)} ${result.name} set as default`);
|
@@ -257256,11 +256876,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
257256
256876
|
return {
|
257257
256877
|
SETTLEMINT_APPLICATION: applicationUniqueName,
|
257258
256878
|
SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
|
257259
|
-
|
257260
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
257261
|
-
...getBlockchainNodeEndpoints(blockchainNode),
|
257262
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: undefined,
|
257263
|
-
...getBlockchainNodeOrLoadBalancerEndpoints(undefined)
|
256879
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName
|
257264
256880
|
};
|
257265
256881
|
}
|
257266
256882
|
};
|
@@ -257706,14 +257322,12 @@ function blockscoutInsightsCreateCommand() {
|
|
257706
257322
|
return missingApplication();
|
257707
257323
|
}
|
257708
257324
|
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
257709
|
-
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.
|
257325
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
257710
257326
|
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
257711
257327
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257712
|
-
const
|
257713
|
-
const node = await blockchainNodeOrLoadBalancerPrompt({
|
257328
|
+
const node = await blockchainNodePrompt({
|
257714
257329
|
env: env2,
|
257715
257330
|
nodes: blockchainNodes,
|
257716
|
-
loadBalancers,
|
257717
257331
|
accept: acceptDefaults,
|
257718
257332
|
isRequired: true
|
257719
257333
|
});
|
@@ -257826,107 +257440,6 @@ function integrationToolCreateCommand() {
|
|
257826
257440
|
return cmd2;
|
257827
257441
|
}
|
257828
257442
|
|
257829
|
-
// src/commands/platform/load-balancer/evm/create.ts
|
257830
|
-
function loadBalancerEvmCreateCommand() {
|
257831
|
-
return getCreateCommand({
|
257832
|
-
name: "evm",
|
257833
|
-
type: "load balancer",
|
257834
|
-
subType: "EVM",
|
257835
|
-
execute: (cmd2, baseAction) => {
|
257836
|
-
addClusterServiceArgs(cmd2).option("--app, --application <application>", "The application unique name to create the load balancer in (defaults to application from env)").option("--blockchain-nodes <blockchainNodes...>", "Blockchain node unique names where the load balancer connects to (must be from the same network)").action(async (name3, { application, provider, region, size, type: type4, blockchainNodes, acceptDefaults, ...defaultArgs }) => {
|
257837
|
-
return baseAction({
|
257838
|
-
...defaultArgs,
|
257839
|
-
acceptDefaults,
|
257840
|
-
provider,
|
257841
|
-
region
|
257842
|
-
}, async ({ settlemint, env: env2, showSpinner, provider: provider2, region: region2 }) => {
|
257843
|
-
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
257844
|
-
if (!applicationUniqueName) {
|
257845
|
-
return missingApplication();
|
257846
|
-
}
|
257847
|
-
let networkUniqueName;
|
257848
|
-
let connectedNodesUniqueNames = blockchainNodes;
|
257849
|
-
if (!connectedNodesUniqueNames) {
|
257850
|
-
const networks = await serviceSpinner("blockchain network", () => settlemint.blockchainNetwork.list(applicationUniqueName));
|
257851
|
-
const network = await blockchainNetworkPrompt({
|
257852
|
-
env: env2,
|
257853
|
-
networks,
|
257854
|
-
accept: acceptDefaults,
|
257855
|
-
isRequired: true
|
257856
|
-
});
|
257857
|
-
if (!network) {
|
257858
|
-
return nothingSelectedError("blockchain network");
|
257859
|
-
}
|
257860
|
-
networkUniqueName = network.uniqueName;
|
257861
|
-
const blockchainNodes2 = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257862
|
-
const connectedNodes = await blockchainNodePrompt({
|
257863
|
-
env: env2,
|
257864
|
-
nodes: blockchainNodes2.filter((node) => node.blockchainNetwork?.uniqueName === network.uniqueName),
|
257865
|
-
accept: acceptDefaults,
|
257866
|
-
promptMessage: "Which blockchain node do you want to connect the load balancer to?",
|
257867
|
-
allowAll: true
|
257868
|
-
});
|
257869
|
-
connectedNodesUniqueNames = Array.isArray(connectedNodes) ? blockchainNodes2.map((node) => node.uniqueName) : connectedNodes ? [connectedNodes.uniqueName] : [];
|
257870
|
-
}
|
257871
|
-
if (connectedNodesUniqueNames.length === 0) {
|
257872
|
-
return cancel2("A load balancer must connect to at least one blockchain node");
|
257873
|
-
}
|
257874
|
-
if (!networkUniqueName) {
|
257875
|
-
const applicationBlockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257876
|
-
const selectedBlockchainNodes = applicationBlockchainNodes.filter((node) => connectedNodesUniqueNames.includes(node.uniqueName));
|
257877
|
-
if (selectedBlockchainNodes.length === 0) {
|
257878
|
-
return cancel2(`Blockchain node(s) '${connectedNodesUniqueNames.join(", ")}' are not part of the application '${applicationUniqueName}'`);
|
257879
|
-
}
|
257880
|
-
const onTheSameNetwork = selectedBlockchainNodes.every((node) => node.blockchainNetwork?.uniqueName === selectedBlockchainNodes[0].blockchainNetwork?.uniqueName);
|
257881
|
-
if (!onTheSameNetwork) {
|
257882
|
-
return cancel2("Blockchain nodes must be on the same network");
|
257883
|
-
}
|
257884
|
-
networkUniqueName = selectedBlockchainNodes[0].blockchainNetwork?.uniqueName;
|
257885
|
-
}
|
257886
|
-
const result = await showSpinner(() => settlemint.loadBalancer.create({
|
257887
|
-
applicationUniqueName,
|
257888
|
-
name: name3,
|
257889
|
-
blockchainNetworkUniqueName: networkUniqueName,
|
257890
|
-
provider: provider2,
|
257891
|
-
region: region2,
|
257892
|
-
size,
|
257893
|
-
type: type4,
|
257894
|
-
connectedNodesUniqueNames
|
257895
|
-
}));
|
257896
|
-
return {
|
257897
|
-
result,
|
257898
|
-
mapDefaultEnv: () => {
|
257899
|
-
return {
|
257900
|
-
SETTLEMINT_APPLICATION: applicationUniqueName,
|
257901
|
-
SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName
|
257902
|
-
};
|
257903
|
-
}
|
257904
|
-
};
|
257905
|
-
});
|
257906
|
-
});
|
257907
|
-
},
|
257908
|
-
examples: [
|
257909
|
-
{
|
257910
|
-
description: "Create an EVM load balancer and save as default",
|
257911
|
-
command: "platform create load-balancer evm my-lb --accept-defaults -d"
|
257912
|
-
},
|
257913
|
-
{
|
257914
|
-
description: "Create an EVM load balancer and connect to specific blockchain nodes",
|
257915
|
-
command: "platform create load-balancer evm my-lb --blockchain-network my-network --accept-defaults"
|
257916
|
-
},
|
257917
|
-
{
|
257918
|
-
description: "Create an EVM load balancer in a different application",
|
257919
|
-
command: "platform create load-balancer evm my-lb --application my-app --accept-defaults"
|
257920
|
-
}
|
257921
|
-
]
|
257922
|
-
});
|
257923
|
-
}
|
257924
|
-
|
257925
|
-
// src/commands/platform/load-balancer/create.ts
|
257926
|
-
function loadBalancerCreateCommand() {
|
257927
|
-
return new Command("load-balancer").alias("lb").description("Create a load balancer in the SettleMint platform").addCommand(loadBalancerEvmCreateCommand());
|
257928
|
-
}
|
257929
|
-
|
257930
257443
|
// src/commands/platform/middleware/graph/create.ts
|
257931
257444
|
function graphMiddlewareCreateCommand() {
|
257932
257445
|
return getCreateCommand({
|
@@ -257935,7 +257448,7 @@ function graphMiddlewareCreateCommand() {
|
|
257935
257448
|
subType: "The Graph",
|
257936
257449
|
alias: "gr",
|
257937
257450
|
execute: (cmd2, baseAction) => {
|
257938
|
-
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name
|
257451
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name3, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
|
257939
257452
|
return baseAction({
|
257940
257453
|
...defaultArgs,
|
257941
257454
|
acceptDefaults,
|
@@ -257947,32 +257460,24 @@ function graphMiddlewareCreateCommand() {
|
|
257947
257460
|
return missingApplication();
|
257948
257461
|
}
|
257949
257462
|
let blockchainNodeUniqueName = blockchainNode;
|
257950
|
-
|
257951
|
-
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
257463
|
+
if (!blockchainNodeUniqueName) {
|
257952
257464
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
257953
|
-
const
|
257954
|
-
const nodeOrLoadbalancer = await blockchainNodeOrLoadBalancerPrompt({
|
257465
|
+
const node = await blockchainNodePrompt({
|
257955
257466
|
env: env2,
|
257956
257467
|
nodes: blockchainNodes,
|
257957
|
-
loadBalancers,
|
257958
257468
|
accept: acceptDefaults,
|
257959
257469
|
isRequired: true
|
257960
257470
|
});
|
257961
|
-
if (!
|
257962
|
-
return nothingSelectedError("blockchain node
|
257963
|
-
}
|
257964
|
-
if (nodeOrLoadbalancer.__typename?.endsWith("LoadBalancer")) {
|
257965
|
-
loadBalancerUniqueName = nodeOrLoadbalancer.uniqueName;
|
257966
|
-
} else {
|
257967
|
-
blockchainNodeUniqueName = nodeOrLoadbalancer.uniqueName;
|
257471
|
+
if (!node) {
|
257472
|
+
return nothingSelectedError("blockchain node");
|
257968
257473
|
}
|
257474
|
+
blockchainNodeUniqueName = node.uniqueName;
|
257969
257475
|
}
|
257970
257476
|
const result = await showSpinner(() => settlemint.middleware.create({
|
257971
257477
|
name: name3,
|
257972
257478
|
applicationUniqueName,
|
257973
257479
|
interface: "HA_GRAPH",
|
257974
257480
|
blockchainNodeUniqueName,
|
257975
|
-
loadBalancerUniqueName,
|
257976
257481
|
provider: provider2,
|
257977
257482
|
region: region2,
|
257978
257483
|
size,
|
@@ -258038,12 +257543,12 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
258038
257543
|
return missingApplication();
|
258039
257544
|
}
|
258040
257545
|
let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
258041
|
-
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.
|
257546
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
258042
257547
|
if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
|
258043
257548
|
const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
|
258044
257549
|
const node = await blockchainNodePrompt({
|
258045
257550
|
env: env2,
|
258046
|
-
nodes: blockchainNodes
|
257551
|
+
nodes: blockchainNodes,
|
258047
257552
|
accept: acceptDefaults,
|
258048
257553
|
isRequired: true
|
258049
257554
|
});
|
@@ -258421,7 +257926,7 @@ function storageCreateCommand() {
|
|
258421
257926
|
|
258422
257927
|
// src/commands/platform/create.ts
|
258423
257928
|
function createCommand3() {
|
258424
|
-
return new Command("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand())
|
257929
|
+
return new Command("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(blockchainNodeCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand());
|
258425
257930
|
}
|
258426
257931
|
|
258427
257932
|
// src/prompts/delete-confirmation.prompt.ts
|
@@ -258661,19 +258166,6 @@ function integrationToolRestartCommand() {
|
|
258661
258166
|
return new Command("integration-tool").alias("it").description("Restart an integration tool service in the SettleMint platform").addCommand(hasuraRestartCommand());
|
258662
258167
|
}
|
258663
258168
|
|
258664
|
-
// src/commands/platform/load-balancer/restart.ts
|
258665
|
-
function loadBalancerRestartCommand() {
|
258666
|
-
return getRestartCommand({
|
258667
|
-
name: "load-balancer",
|
258668
|
-
type: "load balancer",
|
258669
|
-
alias: "lb",
|
258670
|
-
envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
|
258671
|
-
restartFunction: async (settlemint, id) => {
|
258672
|
-
return settlemint.loadBalancer.restart(id);
|
258673
|
-
}
|
258674
|
-
});
|
258675
|
-
}
|
258676
|
-
|
258677
258169
|
// src/commands/platform/middleware/graph/restart.ts
|
258678
258170
|
function graphRestartCommand() {
|
258679
258171
|
return getRestartCommand({
|
@@ -258740,7 +258232,7 @@ function storageRestartCommand() {
|
|
258740
258232
|
|
258741
258233
|
// src/commands/platform/restart.ts
|
258742
258234
|
function restartCommand() {
|
258743
|
-
const cmd2 = new Command("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(storageRestartCommand())
|
258235
|
+
const cmd2 = new Command("restart").description("Restart a resource in the SettleMint platform").addCommand(blockchainNetworkRestartCommand()).addCommand(customDeploymentRestartCommand()).addCommand(insightsRestartCommand()).addCommand(integrationToolRestartCommand()).addCommand(middlewareRestartCommand()).addCommand(storageRestartCommand());
|
258744
258236
|
return cmd2;
|
258745
258237
|
}
|
258746
258238
|
|
@@ -259583,6 +259075,38 @@ function getStatusAction(status) {
|
|
259583
259075
|
return "Please try again later.";
|
259584
259076
|
}
|
259585
259077
|
|
259078
|
+
// src/prompts/smart-contract-set/address.prompt.ts
|
259079
|
+
async function addressPrompt({
|
259080
|
+
env: env2,
|
259081
|
+
accept,
|
259082
|
+
prod,
|
259083
|
+
node,
|
259084
|
+
hardhatConfig
|
259085
|
+
}) {
|
259086
|
+
const possiblePrivateKeys = node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)) ?? [];
|
259087
|
+
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
259088
|
+
const defaultPossible = accept && defaultAddress;
|
259089
|
+
if (defaultPossible) {
|
259090
|
+
if (possiblePrivateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
|
259091
|
+
return defaultAddress;
|
259092
|
+
}
|
259093
|
+
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
259094
|
+
Please select another key or activate this key on the node and try again.`, "warn");
|
259095
|
+
}
|
259096
|
+
const address = await esm_default3({
|
259097
|
+
message: "Which private key do you want to deploy from?",
|
259098
|
+
choices: possiblePrivateKeys.map(({ address: address2, name: name3 }) => ({
|
259099
|
+
name: name3,
|
259100
|
+
value: address2
|
259101
|
+
})),
|
259102
|
+
default: defaultAddress ?? possiblePrivateKeys[0]?.address
|
259103
|
+
});
|
259104
|
+
return address;
|
259105
|
+
}
|
259106
|
+
function validPrivateKey(privateKey) {
|
259107
|
+
return privateKey.privateKeyType !== "HD_ECDSA_P256";
|
259108
|
+
}
|
259109
|
+
|
259586
259110
|
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
259587
259111
|
async function selectTargetNode({
|
259588
259112
|
env: env2,
|
@@ -259606,7 +259130,6 @@ async function selectTargetNode({
|
|
259606
259130
|
nodes: validNodes,
|
259607
259131
|
accept: autoAccept,
|
259608
259132
|
isRequired: true,
|
259609
|
-
filterRunningOnly: true,
|
259610
259133
|
promptMessage: "Which blockchain node do you want to connect to? (Only nodes with private keys activated are shown)",
|
259611
259134
|
singleOptionMessage: (node2) => `Using '${node2}' - the only node with active private keys. To use a different node, ensure it has a private key activated.`
|
259612
259135
|
});
|
@@ -259628,7 +259151,7 @@ function validateNode(node, cancelOnError = true) {
|
|
259628
259151
|
}
|
259629
259152
|
return false;
|
259630
259153
|
}
|
259631
|
-
if (
|
259154
|
+
if (node.privateKeys?.filter((privateKey) => validPrivateKey(privateKey)).length === 0) {
|
259632
259155
|
if (cancelOnError) {
|
259633
259156
|
cancel2(`The specified blockchain node '${node.uniqueName}' does not have an ECDSA P256 or HSM ECDSA P256 private key activated. Please activate an ECDSA P256 or HSM ECDSA P256 private key on your node and try again.`);
|
259634
259157
|
}
|
@@ -259643,33 +259166,6 @@ function validateNode(node, cancelOnError = true) {
|
|
259643
259166
|
return true;
|
259644
259167
|
}
|
259645
259168
|
|
259646
|
-
// src/prompts/smart-contract-set/address.prompt.ts
|
259647
|
-
async function addressPrompt({
|
259648
|
-
accept,
|
259649
|
-
node,
|
259650
|
-
hardhatConfig
|
259651
|
-
}) {
|
259652
|
-
const possiblePrivateKeys = node.privateKeys?.filter(isValidPrivateKey) ?? [];
|
259653
|
-
const defaultAddress = hardhatConfig.networks?.btp?.from ?? possiblePrivateKeys[0]?.address;
|
259654
|
-
const defaultPossible = accept && defaultAddress;
|
259655
|
-
if (defaultPossible) {
|
259656
|
-
if (possiblePrivateKeys.some((privateKey) => privateKey.address?.toLowerCase() === defaultAddress?.toLowerCase())) {
|
259657
|
-
return defaultAddress;
|
259658
|
-
}
|
259659
|
-
note(`Private key with address '${defaultAddress}' is not activated on the node '${node.uniqueName}'.
|
259660
|
-
Please select another key or activate this key on the node and try again.`, "warn");
|
259661
|
-
}
|
259662
|
-
const address = await esm_default3({
|
259663
|
-
message: "Which private key do you want to deploy from?",
|
259664
|
-
choices: possiblePrivateKeys.map(({ address: address2, name: name3 }) => ({
|
259665
|
-
name: name3,
|
259666
|
-
value: address2
|
259667
|
-
})),
|
259668
|
-
default: defaultAddress
|
259669
|
-
});
|
259670
|
-
return address;
|
259671
|
-
}
|
259672
|
-
|
259673
259169
|
// src/utils/smart-contract-set/hardhat-config.ts
|
259674
259170
|
async function getHardhatConfigData(envConfig) {
|
259675
259171
|
try {
|
@@ -259759,7 +259255,7 @@ function hardhatDeployRemoteCommand() {
|
|
259759
259255
|
}
|
259760
259256
|
let address = defaultSender ?? null;
|
259761
259257
|
if (!defaultSender) {
|
259762
|
-
address = await addressPrompt({ accept: autoAccept, node, hardhatConfig });
|
259258
|
+
address = await addressPrompt({ env: env2, accept: autoAccept, prod, node, hardhatConfig });
|
259763
259259
|
}
|
259764
259260
|
if (!address) {
|
259765
259261
|
return nothingSelectedError("private key");
|
@@ -260405,4 +259901,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
260405
259901
|
// src/cli.ts
|
260406
259902
|
sdkCliCommand();
|
260407
259903
|
|
260408
|
-
//# debugId=
|
259904
|
+
//# debugId=9541FB5A02ABBED164756E2164756E21
|