-
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.
Merge pull request #138 from AbstractSDK/adair/icaClientAddress
- Loading branch information
Showing
17 changed files
with
129 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@abstract-money/core": minor | ||
"@abstract-money/react": minor | ||
--- | ||
|
||
Expose the ICA Client |
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
21 changes: 21 additions & 0 deletions
21
packages/core/src/actions/public/get-ica-client-address-from-registry.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,21 @@ | ||
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' | ||
import { getAbstractModuleAddressFromRegistry } from './get-abstract-module-address-from-registry' | ||
import { CommonModuleNames } from './types' | ||
|
||
export type GetIcaClientAddressFromRegistryParameters = { | ||
cosmWasmClient: CosmWasmClient | ||
registryAddress: string | ||
version?: string | ||
} | ||
export async function getIcaClientAddressFromRegistry({ | ||
cosmWasmClient, | ||
registryAddress, | ||
version, | ||
}: GetIcaClientAddressFromRegistryParameters) { | ||
return getAbstractModuleAddressFromRegistry({ | ||
moduleName: CommonModuleNames.ICA_CLIENT, | ||
cosmWasmClient, | ||
registryAddress, | ||
version, | ||
}) | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/core/src/actions/public/get-ica-client-query-client-from-registry.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,23 @@ | ||
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' | ||
import { getIcaClientAddressFromRegistry } from './get-ica-client-address-from-registry' | ||
import { getIcaClientQueryClient } from './get-ica-client-query-client' | ||
|
||
export type GetIcaClientQueryClientFromRegistryParameters = { | ||
cosmWasmClient: CosmWasmClient | ||
registryAddress: string | ||
version?: string | ||
} | ||
|
||
export async function getIcaClientQueryClientFromRegistry({ | ||
cosmWasmClient, | ||
registryAddress, | ||
version, | ||
}: GetIcaClientQueryClientFromRegistryParameters) { | ||
const icaClientAddress = await getIcaClientAddressFromRegistry({ | ||
cosmWasmClient, | ||
registryAddress, | ||
version, | ||
}) | ||
|
||
return getIcaClientQueryClient({ cosmWasmClient, icaClientAddress }) | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/core/src/actions/public/get-ica-client-query-client.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,15 @@ | ||
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' | ||
|
||
import { IcaClientQueryClient } from '../../codegen/abstract' | ||
|
||
export type GetIcaClientQueryClientParameters = { | ||
cosmWasmClient: CosmWasmClient | ||
icaClientAddress: string | ||
} | ||
|
||
export function getIcaClientQueryClient({ | ||
cosmWasmClient, | ||
icaClientAddress, | ||
}: GetIcaClientQueryClientParameters) { | ||
return new IcaClientQueryClient(cosmWasmClient, icaClientAddress) | ||
} |
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,2 +1,2 @@ | ||
export * from './encoding' | ||
export * from './simulate-msgs' | ||
export * from './simulate-cosmos-msgs' |
1 change: 0 additions & 1 deletion
1
...es/core/src/utils/cosmos/simulate-msgs.ts → .../src/utils/cosmos/simulate-cosmos-msgs.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
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