@rhinestone/shared-configs 1.4.49 → 1.4.50
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 -2
- package/dist/src/chains.d.ts.map +1 -1
- package/dist/src/chains.js +7 -2
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -1
- package/dist/src/oft.d.ts +20 -0
- package/dist/src/oft.d.ts.map +1 -0
- package/dist/src/oft.js +72 -0
- package/package.json +1 -1
package/dist/configs/chains.json
CHANGED
|
@@ -299,7 +299,8 @@
|
|
|
299
299
|
"settlementLayers": [
|
|
300
300
|
"ACROSS",
|
|
301
301
|
"ECO",
|
|
302
|
-
"RELAY"
|
|
302
|
+
"RELAY",
|
|
303
|
+
"OFT"
|
|
303
304
|
],
|
|
304
305
|
"swapQuoters": [],
|
|
305
306
|
"tokens": [
|
|
@@ -309,7 +310,7 @@
|
|
|
309
310
|
"decimals": 18,
|
|
310
311
|
"balanceSlot": null,
|
|
311
312
|
"approvalSlot": null,
|
|
312
|
-
"supportsMultichain":
|
|
313
|
+
"supportsMultichain": true
|
|
313
314
|
},
|
|
314
315
|
{
|
|
315
316
|
"symbol": "USDT0",
|
package/dist/src/chains.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB,UAAU,KAAK;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,KAAK;IACb,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB,UAAU,KAAK;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,KAAK;IACb,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,CAgazC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/src/chains.js
CHANGED
|
@@ -220,25 +220,30 @@ const chains = {
|
|
|
220
220
|
],
|
|
221
221
|
},
|
|
222
222
|
"9745": {
|
|
223
|
-
settlementLayers: ["ACROSS", "ECO", "RELAY"],
|
|
223
|
+
settlementLayers: ["ACROSS", "ECO", "RELAY", "OFT"],
|
|
224
224
|
providers: ["DRPC", "Alchemy"],
|
|
225
225
|
swapQuoters: [],
|
|
226
226
|
tokens: [
|
|
227
227
|
{
|
|
228
|
+
symbol: "XPL",
|
|
228
229
|
address: "0x0000000000000000000000000000000000000000",
|
|
230
|
+
decimals: 18,
|
|
229
231
|
balanceSlot: null,
|
|
230
232
|
approvalSlot: null,
|
|
231
|
-
supportsMultichain:
|
|
233
|
+
supportsMultichain: true,
|
|
232
234
|
},
|
|
233
235
|
{
|
|
234
236
|
symbol: "USDT0",
|
|
235
237
|
address: "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb",
|
|
238
|
+
decimals: 6,
|
|
236
239
|
balanceSlot: 51,
|
|
237
240
|
approvalSlot: 52,
|
|
238
241
|
supportsMultichain: true,
|
|
239
242
|
},
|
|
240
243
|
{
|
|
244
|
+
symbol: "WXPL",
|
|
241
245
|
address: "0x6100E367285b01F48D07953803A2d8dCA5D19873",
|
|
246
|
+
decimals: 18,
|
|
242
247
|
balanceSlot: 3,
|
|
243
248
|
approvalSlot: 4,
|
|
244
249
|
supportsMultichain: false,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ChainEntry, ChainItem, ChainList, ChainRegistry, ProviderName, ProviderRegistry, SettlementLayer, SupportedChain, SupportedMainnet, SupportedOPStackMainnet, SupportedOPStackTestnet, SupportedTestnet, SwapQuoter } from "./types";
|
|
2
2
|
import { chains, EquivalentTokens, MainnetNetwork, mainnetChains, OPStackChains, TestnetNetwork, testnetChains, WrappedNativeTokens } from "./types";
|
|
3
|
+
import { getLayerZeroEid, getOftAdapter, getOftConfig, getOftSupportedChains, getSupportedOftTokens, hasOftSupport, OFT_REGISTRY } from "./oft";
|
|
4
|
+
import type { OftConfig } from "./oft";
|
|
3
5
|
declare const chainRegistry: ChainRegistry;
|
|
4
6
|
declare const providerRegistry: ProviderRegistry;
|
|
5
7
|
declare const mainnetChainList: ChainList;
|
|
6
8
|
declare const testnetChainList: ChainList;
|
|
7
|
-
export { chainRegistry, providerRegistry, mainnetChainList, testnetChainList, chains, mainnetChains, testnetChains, MainnetNetwork, OPStackChains, TestnetNetwork, EquivalentTokens, WrappedNativeTokens, };
|
|
8
|
-
export type { ChainList, ChainItem, ChainEntry, ChainRegistry, ProviderRegistry, ProviderName, SwapQuoter, SupportedMainnet, SupportedTestnet, SupportedChain, SupportedOPStackMainnet, SupportedOPStackTestnet, SettlementLayer, };
|
|
9
|
+
export { chainRegistry, providerRegistry, mainnetChainList, testnetChainList, chains, mainnetChains, testnetChains, MainnetNetwork, OPStackChains, TestnetNetwork, EquivalentTokens, WrappedNativeTokens, OFT_REGISTRY, getOftConfig, hasOftSupport, getSupportedOftTokens, getLayerZeroEid, getOftAdapter, getOftSupportedChains, };
|
|
10
|
+
export type { ChainList, ChainItem, ChainEntry, ChainRegistry, ProviderRegistry, ProviderName, SwapQuoter, SupportedMainnet, SupportedTestnet, SupportedChain, SupportedOPStackMainnet, SupportedOPStackTestnet, SettlementLayer, OftConfig, };
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,mBAAmB,EACpB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,mBAAmB,EACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACb,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,QAAA,MAAM,aAAa,EAAE,aAAkD,CAAC;AACxE,QAAA,MAAM,gBAAgB,EAAE,gBACkB,CAAC;AAC3C,QAAA,MAAM,gBAAgB,EAAE,SAA6C,CAAC;AACtE,QAAA,MAAM,gBAAgB,EAAE,SAA6C,CAAC;AAEtE,OAAO,EAEL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAEhB,MAAM,EACN,aAAa,EACb,aAAa,EAEb,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EAEnB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,qBAAqB,GACtB,CAAC;AACF,YAAY,EAEV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EAEV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EAEf,SAAS,GACV,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WrappedNativeTokens = exports.EquivalentTokens = exports.TestnetNetwork = exports.OPStackChains = exports.MainnetNetwork = exports.testnetChains = exports.mainnetChains = exports.chains = exports.testnetChainList = exports.mainnetChainList = exports.providerRegistry = exports.chainRegistry = void 0;
|
|
6
|
+
exports.getOftSupportedChains = exports.getOftAdapter = exports.getLayerZeroEid = exports.getSupportedOftTokens = exports.hasOftSupport = exports.getOftConfig = exports.OFT_REGISTRY = exports.WrappedNativeTokens = exports.EquivalentTokens = exports.TestnetNetwork = exports.OPStackChains = exports.MainnetNetwork = exports.testnetChains = exports.mainnetChains = exports.chains = exports.testnetChainList = exports.mainnetChainList = exports.providerRegistry = exports.chainRegistry = void 0;
|
|
7
7
|
const chains_json_1 = __importDefault(require("../configs/chains.json"));
|
|
8
8
|
const mainnets_json_1 = __importDefault(require("../configs/mainnets.json"));
|
|
9
9
|
const providers_json_1 = __importDefault(require("../configs/providers.json"));
|
|
@@ -17,6 +17,14 @@ Object.defineProperty(exports, "OPStackChains", { enumerable: true, get: functio
|
|
|
17
17
|
Object.defineProperty(exports, "TestnetNetwork", { enumerable: true, get: function () { return types_1.TestnetNetwork; } });
|
|
18
18
|
Object.defineProperty(exports, "testnetChains", { enumerable: true, get: function () { return types_1.testnetChains; } });
|
|
19
19
|
Object.defineProperty(exports, "WrappedNativeTokens", { enumerable: true, get: function () { return types_1.WrappedNativeTokens; } });
|
|
20
|
+
const oft_1 = require("./oft");
|
|
21
|
+
Object.defineProperty(exports, "getLayerZeroEid", { enumerable: true, get: function () { return oft_1.getLayerZeroEid; } });
|
|
22
|
+
Object.defineProperty(exports, "getOftAdapter", { enumerable: true, get: function () { return oft_1.getOftAdapter; } });
|
|
23
|
+
Object.defineProperty(exports, "getOftConfig", { enumerable: true, get: function () { return oft_1.getOftConfig; } });
|
|
24
|
+
Object.defineProperty(exports, "getOftSupportedChains", { enumerable: true, get: function () { return oft_1.getOftSupportedChains; } });
|
|
25
|
+
Object.defineProperty(exports, "getSupportedOftTokens", { enumerable: true, get: function () { return oft_1.getSupportedOftTokens; } });
|
|
26
|
+
Object.defineProperty(exports, "hasOftSupport", { enumerable: true, get: function () { return oft_1.hasOftSupport; } });
|
|
27
|
+
Object.defineProperty(exports, "OFT_REGISTRY", { enumerable: true, get: function () { return oft_1.OFT_REGISTRY; } });
|
|
20
28
|
const chainRegistry = chains_json_1.default;
|
|
21
29
|
exports.chainRegistry = chainRegistry;
|
|
22
30
|
const providerRegistry = providers_json_1.default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* OFT (Omnichain Fungible Token) registry
|
|
4
|
+
* USDT0: https://docs.usdt0.to/technical-documentation/usdt0-deployments
|
|
5
|
+
* LayerZero EIDs: https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts
|
|
6
|
+
*/
|
|
7
|
+
export interface OftConfig {
|
|
8
|
+
tokenSymbol: string;
|
|
9
|
+
adapters: Record<number, Address>;
|
|
10
|
+
tokens: Record<number, Address>;
|
|
11
|
+
layerZeroEids: Record<number, number>;
|
|
12
|
+
}
|
|
13
|
+
export declare const OFT_REGISTRY: Record<string, OftConfig>;
|
|
14
|
+
export declare function getOftConfig(tokenSymbol: string): OftConfig | undefined;
|
|
15
|
+
export declare function hasOftSupport(tokenSymbol: string): boolean;
|
|
16
|
+
export declare function getSupportedOftTokens(): string[];
|
|
17
|
+
export declare function getLayerZeroEid(tokenSymbol: string, chainId: number): number | undefined;
|
|
18
|
+
export declare function getOftAdapter(tokenSymbol: string, chainId: number): Address | undefined;
|
|
19
|
+
export declare function getOftSupportedChains(tokenSymbol: string): number[];
|
|
20
|
+
//# sourceMappingURL=oft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oft.d.ts","sourceRoot":"","sources":["../../src/oft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;GAIG;AAEH,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAuCD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAGlD,CAAC;AAEF,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEvE;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,OAAO,GAAG,SAAS,CAGrB;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAInE"}
|
package/dist/src/oft.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OFT_REGISTRY = void 0;
|
|
4
|
+
exports.getOftConfig = getOftConfig;
|
|
5
|
+
exports.hasOftSupport = hasOftSupport;
|
|
6
|
+
exports.getSupportedOftTokens = getSupportedOftTokens;
|
|
7
|
+
exports.getLayerZeroEid = getLayerZeroEid;
|
|
8
|
+
exports.getOftAdapter = getOftAdapter;
|
|
9
|
+
exports.getOftSupportedChains = getOftSupportedChains;
|
|
10
|
+
const USDT0_CONFIG = {
|
|
11
|
+
tokenSymbol: "USDT0",
|
|
12
|
+
adapters: {
|
|
13
|
+
// Mainnets
|
|
14
|
+
1: "0x33e9E20cE301006940b0AcFB5eB48f4180135F18", // Ethereum - Vault (EID: 30101)
|
|
15
|
+
10: "0xF03b4d9AC1D5d1E7c4cEf54C2A313b9fe051A0aD", // Optimism - OUpgradeable (EID: 30111)
|
|
16
|
+
137: "0x1AD415b613406d8386DF3CC23D47447Dbc6c2eA0", // Polygon - OUpgradeable (EID: 30109)
|
|
17
|
+
8453: "0x86Ed939B500E0E8b8DB4e07798419026C5c0341A", // Base - OUpgradeable (EID: 30184)
|
|
18
|
+
42161: "0x14E4A1B13bf7F943c8ff7C51fb60FA964A298D92", // Arbitrum - OUpgradeable (EID: 30110)
|
|
19
|
+
9745: "0x02ca37966753bDdDf11216B73B16C1dE756A7CF9", // Plasma - OUpgradeable (EID: 30383)
|
|
20
|
+
// future: add testnet adapters here
|
|
21
|
+
},
|
|
22
|
+
tokens: {
|
|
23
|
+
// Mainnets
|
|
24
|
+
1: "0xdAC17F958D2ee523a2206206994597C13D831ec7", // Ethereum - USDT (Tether USD)
|
|
25
|
+
10: "0x01bFF41798a0BcF287b996046Ca68b395DbC1071", // Optimism - USDT0 ArbitrumExtensionV2
|
|
26
|
+
137: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", // Polygon - USDT (Tether USD)
|
|
27
|
+
8453: "0x8b106206a5B00E8667B56C3F4165e6e6F53e5d04", // Base - USDT0 ArbitrumExtensionV2
|
|
28
|
+
42161: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", // Arbitrum - USDT ArbitrumExtensionV2
|
|
29
|
+
9745: "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb", // Plasma - TetherTokenOFTExtension (USDT0)
|
|
30
|
+
// future: add testnet tokens here
|
|
31
|
+
},
|
|
32
|
+
layerZeroEids: {
|
|
33
|
+
// Mainnets
|
|
34
|
+
1: 30101, // Ethereum
|
|
35
|
+
10: 30111, // Optimism
|
|
36
|
+
137: 30109, // Polygon
|
|
37
|
+
8453: 30184, // Base
|
|
38
|
+
42161: 30110, // Arbitrum
|
|
39
|
+
9745: 30383, // Plasma
|
|
40
|
+
// future: add testnet LayerZero EIDs here
|
|
41
|
+
11155111: 40161, // Sepolia
|
|
42
|
+
421614: 40231, // Arbitrum Sepolia
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
// maps token symbols to their OFT configs
|
|
46
|
+
exports.OFT_REGISTRY = {
|
|
47
|
+
USDT0: USDT0_CONFIG,
|
|
48
|
+
// future: add more OFT tokens here
|
|
49
|
+
};
|
|
50
|
+
function getOftConfig(tokenSymbol) {
|
|
51
|
+
return exports.OFT_REGISTRY[tokenSymbol];
|
|
52
|
+
}
|
|
53
|
+
function hasOftSupport(tokenSymbol) {
|
|
54
|
+
return tokenSymbol in exports.OFT_REGISTRY;
|
|
55
|
+
}
|
|
56
|
+
function getSupportedOftTokens() {
|
|
57
|
+
return Object.keys(exports.OFT_REGISTRY);
|
|
58
|
+
}
|
|
59
|
+
function getLayerZeroEid(tokenSymbol, chainId) {
|
|
60
|
+
const config = getOftConfig(tokenSymbol);
|
|
61
|
+
return config?.layerZeroEids[chainId];
|
|
62
|
+
}
|
|
63
|
+
function getOftAdapter(tokenSymbol, chainId) {
|
|
64
|
+
const config = getOftConfig(tokenSymbol);
|
|
65
|
+
return config?.adapters[chainId];
|
|
66
|
+
}
|
|
67
|
+
function getOftSupportedChains(tokenSymbol) {
|
|
68
|
+
const config = getOftConfig(tokenSymbol);
|
|
69
|
+
if (!config)
|
|
70
|
+
return [];
|
|
71
|
+
return Object.keys(config.adapters).map(Number);
|
|
72
|
+
}
|