@rhinestone/shared-configs 2.19.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3147,6 +3147,9 @@
3147
3147
  "cctp": {
3148
3148
  "domain": 5
3149
3149
  },
3150
+ "eco": {
3151
+ "portal": "EcooswwC1NggsckZyF5SeAL9WsgJs3UhPbrqY1apV73F"
3152
+ },
3150
3153
  "near": {
3151
3154
  "prefix": "sol"
3152
3155
  },
@@ -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
- const SETTLEMENT_CONFIG_KEYS = new Set(Object.values(SETTLEMENT_CONFIG_SCHEMA).map((entry) => entry.key));
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
+ });
@@ -3250,6 +3250,9 @@ const chains = {
3250
3250
  "cctp": {
3251
3251
  "domain": 5
3252
3252
  },
3253
+ "eco": {
3254
+ "portal": "EcooswwC1NggsckZyF5SeAL9WsgJs3UhPbrqY1apV73F"
3255
+ },
3253
3256
  "near": {
3254
3257
  "prefix": "sol"
3255
3258
  },
@@ -1,2 +1,2 @@
1
- declare const PACKAGE_VERSION = "2.19.0";
1
+ declare const PACKAGE_VERSION = "2.20.0";
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.19.0";
5
+ const PACKAGE_VERSION = "2.20.0";
6
6
  exports.PACKAGE_VERSION = PACKAGE_VERSION;
@@ -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`/`eco`/`relay` never appear. A key present for a layer NOT in
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/shared-configs",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "description": "Reusable configuration files for Rhinestone services",
5
5
  "author": {
6
6
  "name": "Rhinestone",