@rhinestone/sdk 0.6.2 → 0.6.3
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.
|
@@ -5,7 +5,8 @@ declare function getHookAddress(_chainId?: number): Address;
|
|
|
5
5
|
declare function getSameChainModuleAddress(_chainId?: number): Address;
|
|
6
6
|
declare function getTargetModuleAddress(_chainId?: number): Address;
|
|
7
7
|
declare function getRhinestoneSpokePoolAddress(_chainId?: number): Address;
|
|
8
|
+
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
|
|
8
9
|
declare function getTokenAddress(tokenSymbol: string, chainId: number): Address;
|
|
9
10
|
declare function getChainById(chainId: number): Chain | undefined;
|
|
10
|
-
export { getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, };
|
|
11
|
+
export { getTokenSymbol, getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, };
|
|
11
12
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAe,MAAM,MAAM,CAAA;AAclD,iBAAS,cAAc,CAAC,KAAK,EAAE,KAAK,0UAoCnC;AAwCD,iBAAS,mBAAmB,CAC1B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,GACpB,MAAM,GAAG,IAAI,CAqJf;AAED,iBAAS,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,iBAAS,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,iBAAS,sBAAsB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAA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BAAsB,EACtB,6BAA6B,EAC7B,YAAY,GACb,CAAA"}
|
|
@@ -233,6 +233,16 @@ function getTargetModuleAddress(_chainId) {
|
|
|
233
233
|
function getRhinestoneSpokePoolAddress(_chainId) {
|
|
234
234
|
return '0x000000000060f6e853447881951574CDd0663530';
|
|
235
235
|
}
|
|
236
|
+
function getTokenSymbol(tokenAddress, chainId) {
|
|
237
|
+
const knownSymbols = ['ETH', 'WETH', 'USDC'];
|
|
238
|
+
for (const symbol of knownSymbols) {
|
|
239
|
+
const address = getTokenAddress(symbol, chainId);
|
|
240
|
+
if (address.toLowerCase() === tokenAddress.toLowerCase()) {
|
|
241
|
+
return symbol;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
throw new Error(`Unsupported token address ${tokenAddress} for chain ${chainId}`);
|
|
245
|
+
}
|
|
236
246
|
function getTokenAddress(tokenSymbol, chainId) {
|
|
237
247
|
if (tokenSymbol === 'ETH') {
|
|
238
248
|
return zeroAddress;
|
|
@@ -268,4 +278,4 @@ function getChainById(chainId) {
|
|
|
268
278
|
}
|
|
269
279
|
}
|
|
270
280
|
}
|
|
271
|
-
export { getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, };
|
|
281
|
+
export { getTokenSymbol, getTokenAddress, getTokenBalanceSlot, getWethAddress, getHookAddress, getSameChainModuleAddress, getTargetModuleAddress, getRhinestoneSpokePoolAddress, getChainById, };
|