-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add host chain name helpers and fix bug with remote-account-ids
- Loading branch information
Showing
16 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@abstract-money/core", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "Typings for Abstract smart contracts", | ||
"homepage": "https://github.com/AbstractSDK/abstract.js#readme", | ||
"author": "adairrr <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/core/src/utils/chain-registry/chain-id-to-host-chain-name.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const CHAIN_ID_SEPARATOR = '-' | ||
|
||
export const chainIdToHostChainName = (chainId: string) => { | ||
return chainId.split(CHAIN_ID_SEPARATOR)[0] | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/core/src/utils/chain-registry/host-chain-name-to-name.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { chainIdToHostChainName, chains } from '@abstract-money/core' | ||
|
||
export function hostChainNameToName(hostChainName: string) { | ||
const chainName = chains.find( | ||
({ chain_name, chain_id }) => | ||
chain_name === hostChainName || | ||
chainIdToHostChainName(chain_id) === hostChainName, | ||
)?.chain_name | ||
if (!chainName) { | ||
throw new Error(`Chain not found by hostChain: ${hostChainName}`) | ||
} | ||
return chainName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export * from './assets' | ||
export * from './chains' | ||
export * from './chain-id-to-name' | ||
export * from './host-chain-name-to-name' | ||
export * from './chain-id-to-host-chain-name' | ||
export * from './chain-name-to-id' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@abstract-money/provider-cosmoskit", | ||
"version": "5.0.6", | ||
"version": "5.0.7", | ||
"description": "Provider for CosmosKit", | ||
"homepage": "https://github.com/AbstractSDK/abstract.js#readme", | ||
"author": "dalechyn <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@abstract-money/provider-graz", | ||
"version": "5.0.6", | ||
"version": "5.0.7", | ||
"description": "Provider for Graz", | ||
"homepage": "https://github.com/AbstractSDK/abstract.js#readme", | ||
"author": "dalechyn <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@abstract-money/react", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"description": "React Hooks for Abstract SDK", | ||
"homepage": "https://github.com/AbstractSDK/abstract.js#readme", | ||
"author": "dalechyn <[email protected]>", | ||
|