Skip to content

Commit

Permalink
Merge pull request #136 from AbstractSDK/adair/fixAccountAddress
Browse files Browse the repository at this point in the history
Make useAccountAddress return just address
  • Loading branch information
adairrr authored Oct 31, 2024
2 parents 4198b24 + 34c2fba commit 4be6f4d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ export async function getAccountAddressFromRegistry({
throw new Error(`Account not found: ${accountId}`)
}

return {
account: accounts[0],
}
return accounts[0]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function getAccountQueryClientFromApi({
cosmWasmClient,
apiUrl,
}: GetAccountQueryClientFromApiParameters) {
const { account } = await getAccountAddressFromApi({
const account = await getAccountAddressFromApi({
accountId,
cosmWasmClient,
apiUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/account/wallet/deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function deposit({
fee,
memo,
}: DepositParameters) {
const { account } = await getAccountAddressFromApi({
const account = await getAccountAddressFromApi({
accountId,
cosmWasmClient: signingCosmWasmClient,
apiUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function executeOnModule({
memo,
funds,
}: ExecuteOnModuleParameters) {
const { account } = await getAccountAddressFromApi({
const account = await getAccountAddressFromApi({
accountId,
cosmWasmClient: signingCosmWasmClient,
apiUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/account/wallet/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function execute({
fee,
memo,
}: ExecuteParameters) {
const { account } = await getAccountAddressFromApi({
const account = await getAccountAddressFromApi({
accountId,
cosmWasmClient: signingCosmWasmClient,
apiUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export async function getAccountClientFromApi({
apiUrl,
sender,
}: GetAccountClientFromApiParameters) {
const { account } = await getAccountAddressFromApi({
const account = await getAccountAddressFromApi({
accountId,
cosmWasmClient: signingCosmWasmClient,
apiUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/account/wallet/withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function withdraw({
assets,
recipient,
}: WithdrawParameters) {
const { account } = await getAccountAddressFromApi({
const account = await getAccountAddressFromApi({
accountId,
cosmWasmClient: signingCosmWasmClient,
apiUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ export function useAccountAddressFromApi<TData = QueryData>({

return useQuery({ queryKey, queryFn, ...query, enabled })
}

export const useAccountAddress = useAccountAddressFromApi

0 comments on commit 4be6f4d

Please sign in to comment.