@rhinestone/shared-configs 2.19.0 → 2.20.1
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/configs/chains.json +3 -0
- package/dist/scripts/validation.js +30 -1
- package/dist/src/__tests__/ecoSolanaPortal.test.d.ts +1 -0
- package/dist/src/__tests__/ecoSolanaPortal.test.js +13 -0
- package/dist/src/chains.js +3 -0
- package/dist/src/generated/packageVersion.d.ts +1 -1
- package/dist/src/generated/packageVersion.js +1 -1
- package/dist/src/types.d.ts +15 -1
- package/package.json +1 -1
package/dist/configs/chains.json
CHANGED
|
@@ -128,8 +128,19 @@ const SETTLEMENT_CONFIG_SCHEMA = {
|
|
|
128
128
|
// absent for a destination-only chain, which nothing originates from.
|
|
129
129
|
const SETTLEMENT_CONFIG_OPTIONAL = {
|
|
130
130
|
rhino: { bridgeContract: isNonEmptyString },
|
|
131
|
+
eco: { portal: isNonEmptyString },
|
|
131
132
|
};
|
|
132
|
-
|
|
133
|
+
// Layers whose whole payload is optional: only some chains need addressing, so
|
|
134
|
+
// its absence is not a missing address. ECO's Portal reaches consumers through
|
|
135
|
+
// the contracts block on every EVM chain and appears here only where that
|
|
136
|
+
// block's shape rules the address out.
|
|
137
|
+
const SETTLEMENT_CONFIG_PAYLOAD_OPTIONAL = {
|
|
138
|
+
ECO: 'eco',
|
|
139
|
+
};
|
|
140
|
+
const SETTLEMENT_CONFIG_KEYS = new Set([
|
|
141
|
+
...Object.values(SETTLEMENT_CONFIG_SCHEMA).map((entry) => entry.key),
|
|
142
|
+
...Object.values(SETTLEMENT_CONFIG_PAYLOAD_OPTIONAL),
|
|
143
|
+
]);
|
|
133
144
|
/**
|
|
134
145
|
* Cross-checks `settlementConfig` against `settlementLayers`.
|
|
135
146
|
*
|
|
@@ -175,6 +186,24 @@ function settlementConfigProblems(chain) {
|
|
|
175
186
|
}
|
|
176
187
|
}
|
|
177
188
|
}
|
|
189
|
+
for (const [layer, key] of Object.entries(SETTLEMENT_CONFIG_PAYLOAD_OPTIONAL)) {
|
|
190
|
+
const payload = cfg[key];
|
|
191
|
+
if (payload === undefined)
|
|
192
|
+
continue;
|
|
193
|
+
if (!layers.has(layer)) {
|
|
194
|
+
problems.push(`settlementConfig.${key} is present but ${layer} is not in settlementLayers`);
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (!isObject(payload)) {
|
|
198
|
+
problems.push(`settlementConfig.${key} is not an object`);
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
for (const [field, check] of Object.entries(SETTLEMENT_CONFIG_OPTIONAL[key] ?? {})) {
|
|
202
|
+
if (!isAbsentOr(payload[field], check)) {
|
|
203
|
+
problems.push(`settlementConfig.${key}.${field} is invalid`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
178
207
|
// A non-EVM chain's 1Click asset ids are not derivable from the on-chain
|
|
179
208
|
// address, so every token on one has to carry its own. Missing it is not a
|
|
180
209
|
// degraded route: `toNearAssetId` throws mid-plan.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const bun_test_1 = require("bun:test");
|
|
4
|
+
const index_1 = require("../index");
|
|
5
|
+
(0, bun_test_1.describe)('Eco Solana Portal facts', () => {
|
|
6
|
+
(0, bun_test_1.it)('publishes the program used by a mainnet Eco fund', () => {
|
|
7
|
+
// source: Solana mainnet tx 4cjamn8DihznQMXvcPqApQ5W7bLAjR3Ke2n4vovhRneDUGoMKhruxwqog9AWyDS9sER1KCnqJ59BqEd4Wbqiwr1g;
|
|
8
|
+
// getAccountInfo at slot 447838236 confirms this program is executable.
|
|
9
|
+
const solana = index_1.chainRegistry[String(index_1.MainnetNetwork.SOLANA)];
|
|
10
|
+
(0, bun_test_1.expect)(solana.settlementLayers).toContain('ECO');
|
|
11
|
+
(0, bun_test_1.expect)(solana.settlementConfig?.eco?.portal).toBe('EcooswwC1NggsckZyF5SeAL9WsgJs3UhPbrqY1apV73F');
|
|
12
|
+
});
|
|
13
|
+
});
|
package/dist/src/chains.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const PACKAGE_VERSION = "2.
|
|
1
|
+
declare const PACKAGE_VERSION = "2.20.1";
|
|
2
2
|
export { PACKAGE_VERSION };
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PACKAGE_VERSION = void 0;
|
|
4
4
|
// Auto-generated by scripts/generate.ts. Do not edit manually.
|
|
5
|
-
const PACKAGE_VERSION = "2.
|
|
5
|
+
const PACKAGE_VERSION = "2.20.1";
|
|
6
6
|
exports.PACKAGE_VERSION = PACKAGE_VERSION;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -200,6 +200,18 @@ interface RhinoChainConfig {
|
|
|
200
200
|
bridgeContract?: string;
|
|
201
201
|
}
|
|
202
202
|
/** Circle CCTP's domain id for this chain. `0` is Ethereum, not "unset". */
|
|
203
|
+
/**
|
|
204
|
+
* Where Eco's Portal lives on a chain the contracts block cannot express.
|
|
205
|
+
*
|
|
206
|
+
* Absent on every EVM chain, whose Portal reaches consumers as `ecoPortal`
|
|
207
|
+
* there. Present only where that block's shape rules the address out — a base58
|
|
208
|
+
* program id — and where something calls the Portal directly rather than
|
|
209
|
+
* reading it off a quote.
|
|
210
|
+
*/
|
|
211
|
+
interface EcoChainConfig {
|
|
212
|
+
/** The Portal program `fund` and `publish` are called on, base58. */
|
|
213
|
+
portal: string;
|
|
214
|
+
}
|
|
203
215
|
interface CctpChainConfig {
|
|
204
216
|
domain: number;
|
|
205
217
|
}
|
|
@@ -251,11 +263,13 @@ interface LzChainConfig {
|
|
|
251
263
|
* which these third-party addresses would corrupt.
|
|
252
264
|
*
|
|
253
265
|
* Absent, or a layer's key absent, means that layer needs no addressing here —
|
|
254
|
-
* `across
|
|
266
|
+
* `across` and `relay` never appear, and `eco` only where the contracts block
|
|
267
|
+
* cannot express its Portal. A key present for a layer NOT in
|
|
255
268
|
* `settlementLayers` should not occur; consumers gate on `settlementLayers`.
|
|
256
269
|
*/
|
|
257
270
|
interface SettlementConfig {
|
|
258
271
|
rhino?: RhinoChainConfig;
|
|
272
|
+
eco?: EcoChainConfig;
|
|
259
273
|
cctp?: CctpChainConfig;
|
|
260
274
|
near?: NearChainConfig;
|
|
261
275
|
oft?: OftChainConfig;
|