Skip to content

Commit

Permalink
Update helper type name, useUpdateInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
adairrr committed Jun 22, 2024
1 parent 4473c8f commit 092a808
Show file tree
Hide file tree
Showing 37 changed files with 146 additions and 52 deletions.
9 changes: 9 additions & 0 deletions examples/wagemos-cosmoskit-nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# wagemos-cosmoskit-nextjs

## 0.3.19

### Patch Changes

- Updated dependencies []:
- @abstract-money/core@1.3.3
- @abstract-money/react@1.3.6
- @abstract-money/provider-cosmoskit@5.0.6

## 0.3.18

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/wagemos-cosmoskit-nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wagemos-cosmoskit-nextjs",
"version": "0.3.18",
"version": "0.3.19",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
9 changes: 9 additions & 0 deletions examples/wagemos-graz-nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# wagemos-graz-nextjs

## 0.3.19

### Patch Changes

- Updated dependencies []:
- @abstract-money/core@1.3.3
- @abstract-money/react@1.3.6
- @abstract-money/provider-graz@5.0.6

## 0.3.18

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/wagemos-graz-nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wagemos-graz-nextjs",
"version": "0.3.18",
"version": "0.3.19",
"private": true,
"scripts": {
"dev": "NODE_OPTIONS='--inspect' next dev",
Expand Down
6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 0.1.0

## 1.3.3

### Patch Changes

- Update inner base type and include useUpdateInfo

## 1.3.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abstract-money/core",
"version": "1.3.2",
"version": "1.3.3",
"description": "Typings for Abstract smart contracts",
"homepage": "https://github.com/AbstractSDK/abstract.js#readme",
"author": "adairrr <adair@abstract.money>",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { IbcClientTypes } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { executeIbcAction } from './execute-ibc-action'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type CreateRemoteAccountParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Omit<
Extract<IbcClientTypes.ExecuteMsg, { register: unknown }>['register'],
'host_chain' | 'install_modules'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ManagerClient } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type CreateSubAccountParameters = WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Omit<
Parameters<typeof ManagerClient.prototype.createSubAccount>[0],
'accountId'
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/deposit.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { Asset, encodeAssetsTransfersMsgs } from '../../../utils/assets'
import { getAccountBaseAddressesFromApi } from '../public/get-account-base-addresses-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type DepositParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
assets: Asset[]
}
>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { CommonModuleNames } from '../../public/types'
import { getModuleAddress } from '../public/get-module-address'
import { getModuleVersion } from '../public/get-module-version'
import { executeOnModule } from './execute-on-module'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type ExecuteIbcActionParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
msg: IbcClientTypes.ExecuteMsg
}
>,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/execute-on-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { ModuleType } from '../../../codegen/gql/graphql'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { encodeModuleMsg } from '../../../utils/modules/encode-module-msg'
import { getAccountBaseAddressesFromApi } from '../public/get-account-base-addresses-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

type Base64EncodedJson = string

export type ExecuteOnModuleParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
moduleId: string
moduleType?: ModuleType
moduleMsg: Record<string, unknown> | Base64EncodedJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { IbcClientTypes, ManagerTypes } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { MaybeArray } from '../../../types/utils'
import { executeIbcAction } from './execute-ibc-action'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type ExecuteOnRemoteParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
hostChainName: string
managerMsg: MaybeArray<ManagerTypes.ExecuteMsg>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
executeOnModuleMsg,
} from '../../../utils/modules/encode-module-msg'
import { executeOnRemoteManager } from './execute-on-remote-manager'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

type Base64EncodedJson = string

export type ExecuteOnRemoteModuleParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
hostChainName: string
moduleId: string
moduleType?: ModuleType
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/execute-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { encodeModuleMsg } from '../../../utils/modules/encode-module-msg'
import { CommonModuleNames } from '../../public/types'
import { executeOnRemoteManager } from './execute-on-remote-manager'
import { executeOnRemoteModule } from './execute-on-remote-module'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type ExecuteOnRemoteParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
hostChainName: string
msgs: MaybeArray<ProxyTypes.CosmosMsgForEmpty>
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { ProxyExecuteMsgBuilder, ProxyTypes } from '../../../codegen/abstract'
import { ModuleType } from '../../../codegen/gql/graphql'
import { MaybeArray } from '../../../types/utils'
import { executeOnModule } from './execute-on-module'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { abstractModuleId } from '../../../utils/modules/abstract-module-id'
import { CommonModuleNames } from '../../public/types'
export type ExecuteParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
msgs: MaybeArray<ProxyTypes.CosmosMsgForEmpty>
}
>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getManagerClient } from '../../wallet/get-manager-client'
import { getAccountBaseAddressesFromApi } from '../public/get-account-base-addresses-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type GetManagerClientFromApiParameters = BaseWalletParameters
export type GetManagerClientFromApiParameters = BaseAccountWalletParameters

export async function getManagerClientFromApi({
accountId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getProxyClient } from '../../wallet/get-proxy-client'
import { getAccountBaseAddressesFromApi } from '../public/get-account-base-addresses-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type GetProxyClientFromApiParameters = BaseWalletParameters
export type GetProxyClientFromApiParameters = BaseAccountWalletParameters

export async function getProxyClientFromApi({
accountId,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/install-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { ManagerClient, VersionControlTypes } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type InstallModulesParameters = WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Parameters<typeof ManagerClient.prototype.installModules>[0]
>

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/propose-owner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { ManagerClient } from '../../../codegen/abstract'
import { Action } from '../../../codegen/abstract/cosmwasm-codegen/Manager.types'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type ProposeOwnerParameters = WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Parameters<typeof ManagerClient.prototype.proposeOwner>[0]
>

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/remove-namespace.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getVersionControlClientFromApi } from '../../wallet/get-version-control-client-from-api'
import { getNamespace } from '../public/get-namespace'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type RevokeNamespaceParameters =
WithCosmWasmSignOptions<BaseWalletParameters>
WithCosmWasmSignOptions<BaseAccountWalletParameters>

export async function revokeNamespace({
accountId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { IbcClientTypes } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { executeIbcAction } from './execute-ibc-action'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type RequestFundsFromRemoteParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
hostChainName: string
}
>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { MaybeArray } from '../../../types/utils'
import { Asset, assetToNativeAsset } from '../../../utils/assets'
import { executeIbcAction } from './execute-ibc-action'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type SendFundsToRemoteParameters = Omit<
WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
hostChainName: string
assets: MaybeArray<Asset>
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/account/wallet/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { VersionControlTypes } from '../../../codegen/abstract'

export type BaseWalletParameters = {
export type BaseAccountWalletParameters = {
accountId: VersionControlTypes.AccountId
signingCosmWasmClient: SigningCosmWasmClient
apiUrl: string
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/uninstall-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { ManagerClient, VersionControlTypes } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type UninstallModulesParameters = WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Parameters<typeof ManagerClient.prototype.uninstallModule>[0]
>

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/update-info.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ManagerClient } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type UpdateInfoParameters = WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Parameters<typeof ManagerClient.prototype.updateInfo>[0]
>

Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/update-ownership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { ManagerClient } from '../../../codegen/abstract'
import { Action } from '../../../codegen/abstract/cosmwasm-codegen/Manager.types'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type UpdateOwnershipParameters = WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
update: Action
}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/update-status.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ManagerClient } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type UpdateStatusParameters = WithCosmWasmSignOptions<
BaseWalletParameters &
BaseAccountWalletParameters &
Parameters<typeof ManagerClient.prototype.updateStatus>[0]
>

Expand Down
10 changes: 7 additions & 3 deletions packages/core/src/actions/account/wallet/upgrade-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate'
import { ManagerClient, VersionControlTypes } from '../../../codegen/abstract'
import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { getManagerClientFromApi } from './get-manager-client-from-api'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type UpgradeModulesParameters = WithCosmWasmSignOptions<
BaseWalletParameters & Parameters<typeof ManagerClient.prototype.upgrade>[0]
BaseAccountWalletParameters &
Omit<Parameters<typeof ManagerClient.prototype.upgrade>[0], 'accountId'> & {
subAccountId?: number
}
>

export async function upgradeModules({
accountId,
subAccountId,
signingCosmWasmClient,
apiUrl,
sender,
Expand All @@ -19,7 +23,7 @@ export async function upgradeModules({
...rest
}: UpgradeModulesParameters) {
const managerClient = await getManagerClientFromApi({
accountId,
accountId: subAccountId ? { ...accountId, seq: subAccountId } : accountId,
signingCosmWasmClient,
sender,
apiUrl,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/actions/account/wallet/withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { WithCosmWasmSignOptions } from '../../../types/parameters'
import { Asset, encodeAssetsProxyTransferMsgs } from '../../../utils/assets'
import { getAccountBaseAddressesFromApi } from '../public/get-account-base-addresses-from-api'
import { execute } from './execute'
import { BaseWalletParameters } from './types'
import { BaseAccountWalletParameters } from './types'

export type WithdrawParameters = WithCosmWasmSignOptions<
BaseWalletParameters & {
BaseAccountWalletParameters & {
assets: Asset[]
recipient: string
}
Expand Down
Loading

0 comments on commit 092a808

Please sign in to comment.