@openzeppelin/ui-builder-adapter-stellar 1.8.0 → 1.8.2
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/index.cjs +42 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -39
- package/dist/index.js.map +1 -1
- package/dist/networks.cjs +2 -2
- package/dist/networks.cjs.map +1 -1
- package/dist/networks.js +2 -2
- package/dist/networks.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/getDefaultServiceConfig.test.ts +5 -5
- package/src/access-control/indexer-client.ts +2 -2
- package/src/configuration/network-services.ts +17 -14
- package/src/networks/mainnet.ts +1 -1
- package/src/networks/testnet.ts +1 -1
- package/src/query/handler.ts +32 -7
package/dist/index.cjs
CHANGED
|
@@ -1486,17 +1486,34 @@ async function checkStellarFunctionStateMutability(contractAddress, functionName
|
|
|
1486
1486
|
);
|
|
1487
1487
|
return true;
|
|
1488
1488
|
}
|
|
1489
|
-
const
|
|
1489
|
+
const storageChanges = (simulationResult.stateChanges ?? []).filter((change) => {
|
|
1490
|
+
try {
|
|
1491
|
+
const keyType = change.key.switch();
|
|
1492
|
+
if (keyType === import_stellar_sdk7.xdr.LedgerEntryType.contractCode()) {
|
|
1493
|
+
return false;
|
|
1494
|
+
}
|
|
1495
|
+
if (keyType === import_stellar_sdk7.xdr.LedgerEntryType.contractData()) {
|
|
1496
|
+
const dataKey = change.key.contractData().key();
|
|
1497
|
+
if (dataKey.switch() === import_stellar_sdk7.xdr.ScValType.scvLedgerKeyContractInstance()) {
|
|
1498
|
+
return false;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
return true;
|
|
1502
|
+
} catch {
|
|
1503
|
+
return true;
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
const hasStorageChanges = storageChanges.length > 0;
|
|
1490
1507
|
import_ui_utils9.logger.info(
|
|
1491
1508
|
"checkStellarFunctionStateMutability",
|
|
1492
1509
|
`[Check ${functionName}] State mutability check complete:`,
|
|
1493
1510
|
{
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
modifiesState:
|
|
1511
|
+
totalStateChanges: simulationResult.stateChanges?.length || 0,
|
|
1512
|
+
storageChangesCount: storageChanges.length,
|
|
1513
|
+
modifiesState: hasStorageChanges
|
|
1497
1514
|
}
|
|
1498
1515
|
);
|
|
1499
|
-
return
|
|
1516
|
+
return hasStorageChanges;
|
|
1500
1517
|
} catch (error) {
|
|
1501
1518
|
import_ui_utils9.logger.warn(
|
|
1502
1519
|
"checkStellarFunctionStateMutability",
|
|
@@ -2166,14 +2183,14 @@ var WalletsKitImplementation = class {
|
|
|
2166
2183
|
* @param address - The account address
|
|
2167
2184
|
* @returns Promise resolving to signed transaction
|
|
2168
2185
|
*/
|
|
2169
|
-
async signTransaction(
|
|
2186
|
+
async signTransaction(xdr14, address) {
|
|
2170
2187
|
if (!this.initialized) {
|
|
2171
2188
|
throw new Error("Wallet implementation not initialized");
|
|
2172
2189
|
}
|
|
2173
2190
|
const kit = this.getKitToUse();
|
|
2174
2191
|
const networkPassphrase = this.getWalletNetwork();
|
|
2175
2192
|
import_ui_utils12.logger.info(LOG_SYSTEM, "Signing transaction with wallet");
|
|
2176
|
-
return await kit.signTransaction(
|
|
2193
|
+
return await kit.signTransaction(xdr14, {
|
|
2177
2194
|
address,
|
|
2178
2195
|
networkPassphrase
|
|
2179
2196
|
});
|
|
@@ -2640,9 +2657,9 @@ function onStellarWalletConnectionChange(callback) {
|
|
|
2640
2657
|
}
|
|
2641
2658
|
});
|
|
2642
2659
|
}
|
|
2643
|
-
async function signTransaction(
|
|
2660
|
+
async function signTransaction(xdr14, address) {
|
|
2644
2661
|
const impl = await getStellarWalletImplementation();
|
|
2645
|
-
return impl.signTransaction(
|
|
2662
|
+
return impl.signTransaction(xdr14, address);
|
|
2646
2663
|
}
|
|
2647
2664
|
|
|
2648
2665
|
// src/transaction/eoa.ts
|
|
@@ -3343,7 +3360,7 @@ var import_ui_types7 = require("@openzeppelin/ui-types");
|
|
|
3343
3360
|
var import_ui_utils20 = require("@openzeppelin/ui-utils");
|
|
3344
3361
|
var LOG_SYSTEM3 = "StellarIndexerClient";
|
|
3345
3362
|
function getUserIndexerEndpoints(networkId) {
|
|
3346
|
-
const svcCfg = import_ui_utils20.userNetworkServiceConfigService.get(networkId, "indexer");
|
|
3363
|
+
const svcCfg = import_ui_utils20.userNetworkServiceConfigService.get(networkId, "access-control-indexer");
|
|
3347
3364
|
if (!svcCfg || typeof svcCfg !== "object") {
|
|
3348
3365
|
return void 0;
|
|
3349
3366
|
}
|
|
@@ -3385,7 +3402,7 @@ var StellarIndexerClient = class {
|
|
|
3385
3402
|
this.networkConfig = networkConfig;
|
|
3386
3403
|
this.unsubscribeFromConfigChanges = import_ui_utils20.userNetworkServiceConfigService.subscribe(
|
|
3387
3404
|
networkConfig.id,
|
|
3388
|
-
"indexer",
|
|
3405
|
+
"access-control-indexer",
|
|
3389
3406
|
() => {
|
|
3390
3407
|
import_ui_utils20.logger.info(
|
|
3391
3408
|
LOG_SYSTEM3,
|
|
@@ -5768,7 +5785,7 @@ function getStellarDefaultServiceConfig(networkConfig, serviceId) {
|
|
|
5768
5785
|
return { sorobanRpcUrl: networkConfig.sorobanRpcUrl };
|
|
5769
5786
|
}
|
|
5770
5787
|
break;
|
|
5771
|
-
case "indexer":
|
|
5788
|
+
case "access-control-indexer":
|
|
5772
5789
|
if (networkConfig.indexerUri && networkConfig.indexerWsUri) {
|
|
5773
5790
|
return {
|
|
5774
5791
|
indexerUri: networkConfig.indexerUri,
|
|
@@ -5797,26 +5814,27 @@ function getStellarNetworkServiceForms(exclude = []) {
|
|
|
5797
5814
|
]
|
|
5798
5815
|
},
|
|
5799
5816
|
{
|
|
5800
|
-
id: "indexer",
|
|
5801
|
-
label: "Indexer",
|
|
5802
|
-
description: "Optional GraphQL indexer endpoint for historical access control data",
|
|
5817
|
+
id: "access-control-indexer",
|
|
5818
|
+
label: "Access Control Indexer",
|
|
5819
|
+
description: "Optional GraphQL indexer endpoint for historical access control data. Overrides the default indexer URL for this network.",
|
|
5803
5820
|
supportsConnectionTest: true,
|
|
5821
|
+
requiredFeature: "access_control_indexer",
|
|
5804
5822
|
fields: [
|
|
5805
5823
|
{
|
|
5806
|
-
id: "stellar-indexer-uri",
|
|
5824
|
+
id: "stellar-access-control-indexer-uri",
|
|
5807
5825
|
name: "indexerUri",
|
|
5808
5826
|
type: "text",
|
|
5809
|
-
label: "Indexer GraphQL
|
|
5827
|
+
label: "Access Control Indexer GraphQL Endpoint",
|
|
5810
5828
|
placeholder: "https://indexer.example.com/graphql",
|
|
5811
5829
|
validation: { required: false, pattern: "^https?://.+" },
|
|
5812
5830
|
width: "full",
|
|
5813
|
-
helperText: "Optional. Used for querying historical access control events."
|
|
5831
|
+
helperText: "Optional. Used for querying historical access control events and role discovery."
|
|
5814
5832
|
},
|
|
5815
5833
|
{
|
|
5816
|
-
id: "stellar-indexer-ws-uri",
|
|
5834
|
+
id: "stellar-access-control-indexer-ws-uri",
|
|
5817
5835
|
name: "indexerWsUri",
|
|
5818
5836
|
type: "text",
|
|
5819
|
-
label: "Indexer GraphQL WebSocket Endpoint",
|
|
5837
|
+
label: "Access Control Indexer GraphQL WebSocket Endpoint",
|
|
5820
5838
|
placeholder: "wss://indexer.example.com/graphql",
|
|
5821
5839
|
validation: { required: false, pattern: "^wss?://.+" },
|
|
5822
5840
|
width: "full",
|
|
@@ -5835,7 +5853,7 @@ async function validateStellarNetworkServiceConfig(serviceId, values) {
|
|
|
5835
5853
|
};
|
|
5836
5854
|
return validateStellarRpcEndpoint(cfg);
|
|
5837
5855
|
}
|
|
5838
|
-
if (serviceId === "indexer") {
|
|
5856
|
+
if (serviceId === "access-control-indexer") {
|
|
5839
5857
|
if (values.indexerUri !== void 0 && values.indexerUri !== null && values.indexerUri !== "") {
|
|
5840
5858
|
if (!(0, import_ui_utils24.isValidUrl)(String(values.indexerUri))) {
|
|
5841
5859
|
return false;
|
|
@@ -5858,7 +5876,7 @@ async function testStellarNetworkServiceConnection(serviceId, values) {
|
|
|
5858
5876
|
};
|
|
5859
5877
|
return testStellarRpcConnection(cfg);
|
|
5860
5878
|
}
|
|
5861
|
-
if (serviceId === "indexer") {
|
|
5879
|
+
if (serviceId === "access-control-indexer") {
|
|
5862
5880
|
const indexerUri = values.indexerUri;
|
|
5863
5881
|
if (!indexerUri || typeof indexerUri !== "string" || indexerUri.trim() === "") {
|
|
5864
5882
|
return { success: true };
|
|
@@ -8583,7 +8601,7 @@ var stellarPublic = {
|
|
|
8583
8601
|
networkPassphrase: "Public Global Stellar Network ; September 2015",
|
|
8584
8602
|
explorerUrl: "https://stellar.expert/explorer/public",
|
|
8585
8603
|
iconComponent: import_react12.NetworkStellar,
|
|
8586
|
-
accessControlIndexerUrl: "https://openzeppelin-stellar-mainnet.graphql.subquery.network
|
|
8604
|
+
accessControlIndexerUrl: "https://openzeppelin-stellar-mainnet.graphql.subquery.network"
|
|
8587
8605
|
};
|
|
8588
8606
|
|
|
8589
8607
|
// src/networks/testnet.ts
|
|
@@ -8601,7 +8619,7 @@ var stellarTestnet = {
|
|
|
8601
8619
|
networkPassphrase: "Test SDF Network ; September 2015",
|
|
8602
8620
|
explorerUrl: "https://stellar.expert/explorer/testnet",
|
|
8603
8621
|
iconComponent: import_react13.NetworkStellar,
|
|
8604
|
-
accessControlIndexerUrl: "https://
|
|
8622
|
+
accessControlIndexerUrl: "https://openzeppelin-stellar-testnet.graphql.subquery.network"
|
|
8605
8623
|
};
|
|
8606
8624
|
|
|
8607
8625
|
// src/networks/index.ts
|