-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ibc executions #74
Conversation
🦋 Changeset detectedLatest commit: 328ba92 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WithArgsAndCosmWasmSignOptions< | ||
BaseWalletParameters & { | ||
hostChainName: string | ||
assets: MaybeArray<Asset> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this should only be native assets since it only accepts native assets?
@@ -0,0 +1,16 @@ | |||
import { jsonToBinary } from '@abstract-money/core' | |||
import { ModuleType } from '../../codegen/gql/graphql' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module type might be the wrong one? Which one is preferred to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's always preferred to use types from the contracts codegen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IN the legacy SDK we used VariantKeys<ModuleReference>
which we could use from the contracts codegen... thoughts?
Size Change: +3.05 kB (+3%) Total Size: 113 kB
ℹ️ View Unchanged
|
Also - might be interesting to explore something where where the account can auto-detect whether it's remote or not - and perform the executions over IBC... though this would also prevent us in the future from adding duplex communication because the logic would be invalid. |
Extract<IbcClientTypes.ExecuteMsg, { register: unknown }>['register'], | ||
'host_chain' | ||
> & { | ||
hostChainName: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to call this remoteChainName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to stick with the names that we have in the contract to avoid confusion.
we can provide this one as an alias maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
examples/wagemos-cosmoskit-nextjs/src/app/_providers/cosmos-kit.tsx
Outdated
Show resolved
Hide resolved
examples/wagemos-cosmoskit-nextjs/src/app/_providers/cosmos-kit.tsx
Outdated
Show resolved
Hide resolved
const abstractConfig = createConfig({ provider: cosmosKitProvider }) | ||
const abstractConfig = createConfig({ | ||
provider: cosmosKitProvider, | ||
apiUrl: 'https://api.abstract.money/graphql', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i actually think it makes sense exporting mainnetApiUrl
and testnetApiUrl
from the SDK itself. most likely those are the ones devs will use in future. something to consider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract<IbcClientTypes.ExecuteMsg, { register: unknown }>['register'], | ||
'host_chain' | ||
> & { | ||
hostChainName: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to stick with the names that we have in the contract to avoid confusion.
we can provide this one as an alias maybe.
packages/core/src/actions/account/wallet/create-remote-account.ts
Outdated
Show resolved
Hide resolved
packages/core/src/actions/public/get-ibc-client-query-client.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,16 @@ | |||
import { jsonToBinary } from '@abstract-money/core' | |||
import { ModuleType } from '../../codegen/gql/graphql' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's always preferred to use types from the contracts codegen.
Co-authored-by: Vladyslav Dalechyn <vlad.dalechin@gmail.com>
examples/wagemos-cosmoskit-nextjs/src/app/_providers/cosmos-kit.tsx
Outdated
Show resolved
Hide resolved
…t.tsx Co-authored-by: Vladyslav Dalechyn <vlad.dalechin@gmail.com>
Co-authored-by: Vladyslav Dalechyn <vlad.dalechin@gmail.com>
Co-authored-by: Vladyslav Dalechyn <vlad.dalechin@gmail.com>
Co-authored-by: Vladyslav Dalechyn <vlad.dalechin@gmail.com>
|
||
type QueryOptions = Omit< | ||
UseQueryOptions<QueryFnData, QueryError, QueryData, QueryKey>, | ||
'queryFn' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we don't omit the queryKey
from the options in our queries doesn't this mean it could be "accidentially" (or purposefully) overridden? Is this something we'd like to enable?
Esp sinc the syntax has been changed to glob all the options together instead of having the query key, query function as first args to useQuery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left to be purposefully overriden, don't see it as a blocker rn.
rpc: chain.apis?.rpc?.length | ||
? [ | ||
chain.apis.rpc.find((rpc) => | ||
rpc.address.includes('polkachu'), | ||
) ?? chain.apis.rpc[0], | ||
] | ||
: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that looks odd, why do we have to do that?
@@ -0,0 +1,48 @@ | |||
import { PublicClient } from '@abstract-money/core' | |||
import { UseQueryOptions, useQuery } from '@tanstack/react-query' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use UseQueryParameters
instead
i.e.
import { UseQueryParameters, useQuery } from '../types/queries'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not critical though
|
||
type QueryOptions = Omit< | ||
UseQueryOptions<QueryFnData, QueryError, QueryData, QueryKey>, | ||
'queryFn' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left to be purposefully overriden, don't see it as a blocker rn.
This change adds the following to the wallet client:
Based on usage in https://gist.github.com/adairrr/ace71687418275bb9880ba054e8fb9e2
THis also adds an example, which is currently NOT functional.