diff --git a/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx b/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx index 4be84ed4e..343d58567 100644 --- a/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx +++ b/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx @@ -1,58 +1,57 @@ import { Chain } from "@chain-registry/types"; -import { WindowWithNamada } from "@namada/types"; import { mapUndefined } from "@namada/utils"; import { OnSubmitTransferParams, TransferModule, } from "App/Transfer/TransferModule"; -import { accountBalanceAtom, defaultAccountAtom } from "atoms/accounts"; -import { chainAtom, chainParametersAtom } from "atoms/chain"; -import { availableChainsAtom, chainRegistryAtom } from "atoms/integrations"; -import BigNumber from "bignumber.js"; +import { defaultAccountAtom } from "atoms/accounts"; +import { namadaTransparentAssetsAtom } from "atoms/balance"; +import { defaultGasConfigFamily } from "atoms/fees"; +import { + availableChainsAtom, + chainRegistryAtom, + createIbcTxAtom, +} from "atoms/integrations"; import { useWalletManager } from "hooks/useWalletManager"; import { wallets } from "integrations"; import { KeplrWalletManager } from "integrations/Keplr"; import { useAtomValue } from "jotai"; -import { useState } from "react"; +import { broadcastTx } from "lib/query"; +import { useEffect, useState } from "react"; import namadaChainRegistry from "registry/namada.json"; import { namadaAsset } from "registry/namadaAsset"; -import { Address, AddressWithAssetAndAmountMap } from "types"; -import { getSdkInstance } from "utils/sdk"; +import { Address } from "types"; import { IbcTopHeader } from "./IbcTopHeader"; const defaultChainId = "cosmoshub-4"; const keplr = new KeplrWalletManager(); -const namada = (window as WindowWithNamada).namada!; export const IbcWithdraw: React.FC = () => { const namadaAccount = useAtomValue(defaultAccountAtom); const chainRegistry = useAtomValue(chainRegistryAtom); const availableChains = useAtomValue(availableChainsAtom); - const namadaChainParams = useAtomValue(chainParametersAtom); - const namadaChain = useAtomValue(chainAtom); const [selectedAssetAddress, setSelectedAssetAddress] = useState
(); - // TODO: remove hardcoding and display assets other than NAM - const availableAmount = useAtomValue(accountBalanceAtom).data; - const availableAssets: AddressWithAssetAndAmountMap = - availableAmount ? - { - [namadaAsset.address]: { - asset: namadaAsset, - originalAddress: namadaAsset.address, - amount: availableAmount, - }, - } - : {}; - - const GAS_PRICE = BigNumber(0.000001); // 0.000001 NAM - const GAS_LIMIT = BigNumber(1_000_000); - const transactionFee = { - originalAddress: namadaAsset.address, - asset: namadaAsset, - amount: GAS_PRICE.multipliedBy(GAS_LIMIT), - }; + const { data: availableAssets } = useAtomValue(namadaTransparentAssetsAtom); + + const availableAmount = mapUndefined( + (address) => availableAssets?.[address]?.amount, + selectedAssetAddress + ); + + const { data: gasConfig } = useAtomValue( + defaultGasConfigFamily(["IbcTransfer"]) + ); + + const transactionFee = mapUndefined( + ({ gasLimit, gasPrice }) => ({ + originalAddress: namadaAsset.address, + asset: namadaAsset, + amount: gasPrice.multipliedBy(gasLimit), + }), + gasConfig + ); const { walletAddress: keplrAddress, @@ -64,40 +63,68 @@ export const IbcWithdraw: React.FC = () => { connectToChainId(chainId || defaultChainId); }; + const { + mutate: createIbcTx, + isSuccess, + isError, + error: ibcTxError, + data: ibcTxData, + } = useAtomValue(createIbcTxAtom); + + // TODO: properly notify the user on error + useEffect(() => { + if (isError) { + console.error(ibcTxError); + } + }, [isError]); + + useEffect(() => { + if (isSuccess) { + const { encodedTxData, signedTxs } = ibcTxData; + signedTxs.forEach((signedTx) => + broadcastTx( + encodedTxData, + signedTx, + encodedTxData.meta?.props, + "IbcTransfer" + ) + ); + } + }, [isSuccess]); + const submitIbcTransfer = async ({ amount, destinationAddress, ibcOptions, memo, }: OnSubmitTransferParams): Promise => { - const wrapperTxProps = { - token: namadaChain.data!.nativeTokenAddress, - feeAmount: GAS_PRICE, - gasLimit: GAS_LIMIT, - chainId: namadaChain.data!.chainId, - publicKey: namadaAccount.data!.publicKey, - }; - const sdk = await getSdkInstance(); - const tx = await sdk.tx.buildIbcTransfer(wrapperTxProps, { - source: namadaAccount.data!.address, - receiver: destinationAddress, - token: namadaChain.data!.nativeTokenAddress, - amount: amount!, + const selectedAsset = mapUndefined( + (address) => availableAssets?.[address], + selectedAssetAddress + ); + + if (typeof selectedAsset === "undefined") { + throw new Error("No selected asset"); + } + + const channelId = ibcOptions?.sourceChannel; + if (typeof channelId === "undefined") { + throw new Error("No channel ID is set"); + } + + if (typeof gasConfig === "undefined") { + throw new Error("No gas config"); + } + + createIbcTx({ + destinationAddress, + token: selectedAsset, + amount, portId: "transfer", - channelId: ibcOptions?.sourceChannel || "", - timeoutHeight: undefined, - timeoutSecOffset: undefined, - shieldingData: undefined, + channelId, + gasConfig, memo, }); - - const signedTxBytes = await namada.sign({ - signer: namadaAccount.data!.address, - txs: [tx], - checksums: namadaChainParams.data!.checksums, - }); - - await sdk.rpc.broadcastTx(signedTxBytes![0], wrapperTxProps); }; const onChangeChain = (chain: Chain): void => { diff --git a/apps/namadillo/src/atoms/balance/index.ts b/apps/namadillo/src/atoms/balance/index.ts new file mode 100644 index 000000000..4e0d46d9a --- /dev/null +++ b/apps/namadillo/src/atoms/balance/index.ts @@ -0,0 +1 @@ +export * from "./atoms"; diff --git a/apps/namadillo/src/atoms/fees/atoms.ts b/apps/namadillo/src/atoms/fees/atoms.ts index 9695471df..514ab894e 100644 --- a/apps/namadillo/src/atoms/fees/atoms.ts +++ b/apps/namadillo/src/atoms/fees/atoms.ts @@ -1,4 +1,3 @@ -import { GasLimitTableInnerTxKindEnum as GasLimitTableIndexer } from "@anomaorg/namada-indexer-client"; import { defaultAccountAtom } from "atoms/accounts"; import { indexerApiAtom } from "atoms/api"; import { nativeTokenAddressAtom } from "atoms/chain"; @@ -8,33 +7,10 @@ import { atom } from "jotai"; import { atomWithQuery } from "jotai-tanstack-query"; import { atomFamily } from "jotai/utils"; import { isPublicKeyRevealed } from "lib/query"; -import { GasConfig, GasTable, TxKind } from "types"; +import { GasConfig, GasTable } from "types"; +import { TxKind } from "types/txKind"; import { fetchGasLimit, fetchMinimumGasPrice } from "./services"; -// TODO: I think we should find a better solution for this -export const txKindFromIndexer = ( - txKind: GasLimitTableIndexer -): TxKind | undefined => { - switch (txKind) { - case GasLimitTableIndexer.Bond: - return "Bond"; - case GasLimitTableIndexer.Unbond: - return "Unbond"; - case GasLimitTableIndexer.Redelegation: - return "Redelegate"; - case GasLimitTableIndexer.Withdraw: - return "Withdraw"; - case GasLimitTableIndexer.ClaimRewards: - return "ClaimRewards"; - case GasLimitTableIndexer.VoteProposal: - return "VoteProposal"; - case GasLimitTableIndexer.RevealPk: - return "RevealPk"; - default: - return undefined; - } -}; - export const gasCostTxKindAtom = atom(undefined); export const gasLimitsAtom = atomWithQuery((get) => { diff --git a/apps/namadillo/src/atoms/fees/services.ts b/apps/namadillo/src/atoms/fees/services.ts index 657dad217..5c3709a14 100644 --- a/apps/namadillo/src/atoms/fees/services.ts +++ b/apps/namadillo/src/atoms/fees/services.ts @@ -1,24 +1,53 @@ -import { DefaultApi } from "@anomaorg/namada-indexer-client"; +import { + DefaultApi, + GasLimitTableInnerTxKindEnum as GasLimitTableIndexer, +} from "@anomaorg/namada-indexer-client"; +import { assertNever, mapUndefined } from "@namada/utils"; import BigNumber from "bignumber.js"; import invariant from "invariant"; import { GasTable } from "types"; -import { txKindFromIndexer } from "./atoms"; +import { TxKind, txKinds } from "types/txKind"; + +const txKindToIndexer = (txKind: TxKind): GasLimitTableIndexer => { + switch (txKind) { + case "Bond": + return GasLimitTableIndexer.Bond; + case "Unbond": + return GasLimitTableIndexer.Unbond; + case "Redelegate": + return GasLimitTableIndexer.Redelegation; + case "Withdraw": + return GasLimitTableIndexer.Withdraw; + case "ClaimRewards": + return GasLimitTableIndexer.ClaimRewards; + case "VoteProposal": + return GasLimitTableIndexer.VoteProposal; + case "RevealPk": + return GasLimitTableIndexer.RevealPk; + case "Unknown": + case "IbcTransfer": // TODO: don't use unknown once indexer is updated + return GasLimitTableIndexer.Unknown; + default: + return assertNever(txKind); + } +}; export const fetchGasLimit = async (api: DefaultApi): Promise => { const gasTableResponse = await api.apiV1GasTokenGet("native"); - const gasTable = gasTableResponse.data.reduce( - (acc, { gasLimit, txKind: indexerTxKind }) => { - const txKind = txKindFromIndexer(indexerTxKind); - if (txKind) { - const perKind = acc[txKind] || {}; - acc[txKind] = { ...perKind, native: new BigNumber(gasLimit) }; - } - return acc; - }, - {} as GasTable - ); - return gasTable; + return txKinds.reduce((acc, txKind) => { + const indexerTxKind = txKindToIndexer(txKind); + const gasLimit = gasTableResponse.data.find( + (entry) => entry.txKind === indexerTxKind + )?.gasLimit; + const maybeBigNumber = mapUndefined(BigNumber, gasLimit); + + if (typeof maybeBigNumber === "undefined" || maybeBigNumber.isNaN()) { + throw new Error("Couldn't decode gas table"); + } else { + return { ...acc, [txKind]: { native: maybeBigNumber } }; + } + }, {} as GasTable); }; export const fetchMinimumGasPrice = async ( diff --git a/apps/namadillo/src/atoms/integrations/atoms.ts b/apps/namadillo/src/atoms/integrations/atoms.ts index ff06ace82..29a034fc1 100644 --- a/apps/namadillo/src/atoms/integrations/atoms.ts +++ b/apps/namadillo/src/atoms/integrations/atoms.ts @@ -1,12 +1,22 @@ import { AssetList, Chain } from "@chain-registry/types"; -import { ExtensionKey } from "@namada/types"; +import { ExtensionKey, IbcTransferProps } from "@namada/types"; +import { defaultAccountAtom } from "atoms/accounts"; +import { chainAtom } from "atoms/chain"; import { settingsAtom } from "atoms/settings"; import { queryDependentFn } from "atoms/utils"; +import BigNumber from "bignumber.js"; import { atom } from "jotai"; import { atomWithMutation, atomWithQuery } from "jotai-tanstack-query"; import { atomFamily, atomWithStorage } from "jotai/utils"; -import { ChainId, ChainRegistryEntry } from "types"; +import { TransactionPair } from "lib/query"; import { + AddressWithAsset, + ChainId, + ChainRegistryEntry, + GasConfig, +} from "types"; +import { + createIbcTx, getKnownChains, ibcAddressToDenomTrace, mapCoinsToAssets, @@ -107,3 +117,47 @@ export const availableAssetsAtom = atom((get) => { const settings = get(settingsAtom); return getKnownChains(settings.enableTestnets).map(({ assets }) => assets); }); + +type CreateIbcTxArgs = { + destinationAddress: string; + token: AddressWithAsset; + amount: BigNumber; + portId: string; + channelId: string; + memo?: string; + gasConfig: GasConfig; +}; + +export const createIbcTxAtom = atomWithMutation((get) => { + const account = get(defaultAccountAtom); + const chain = get(chainAtom); + + return { + enabled: account.isSuccess && chain.isSuccess, + mutationKey: ["create-ibc-tx"], + mutationFn: async ({ + destinationAddress, + token, + amount, + portId, + channelId, + memo, + gasConfig, + }: CreateIbcTxArgs): Promise> => { + if (typeof account.data === "undefined") { + throw new Error("no account"); + } + return createIbcTx( + account.data, + destinationAddress, + token, + amount, + portId, + channelId, + gasConfig, + chain.data!, + memo + ); + }, + }; +}); diff --git a/apps/namadillo/src/atoms/integrations/functions.ts b/apps/namadillo/src/atoms/integrations/functions.ts index 96464a825..ef4e992cc 100644 --- a/apps/namadillo/src/atoms/integrations/functions.ts +++ b/apps/namadillo/src/atoms/integrations/functions.ts @@ -2,6 +2,7 @@ import { Asset, Chain } from "@chain-registry/types"; import { Coin } from "@cosmjs/launchpad"; import { QueryClient, setupIbcExtension } from "@cosmjs/stargate"; import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; +import { Account, IbcTransferProps } from "@namada/types"; import { mapUndefined } from "@namada/utils"; import BigNumber from "bignumber.js"; import * as celestia from "chain-registry/mainnet/celestia"; @@ -16,12 +17,17 @@ import * as elysTestnet from "chain-registry/testnet/elystestnet"; import * as osmosisTestnet from "chain-registry/testnet/osmosistestnet"; import * as stargazeTestnet from "chain-registry/testnet/stargazetestnet"; import { DenomTrace } from "cosmjs-types/ibc/applications/transfer/v1/transfer"; +import { TransactionPair, buildTxPair } from "lib/query"; import { + AddressWithAsset, AddressWithAssetAndAmount, AddressWithAssetAndAmountMap, ChainRegistryEntry, + ChainSettings, + GasConfig, } from "types"; -import { toDisplayAmount } from "utils"; +import { toBaseAmount, toDisplayAmount } from "utils"; +import { getSdkInstance } from "utils/sdk"; import housefireAssets from "namada-chain-registry/namadahousefire/assetlist.json"; import housefireChain from "namada-chain-registry/namadahousefire/chain.json"; @@ -276,3 +282,40 @@ export const getRestApiAddressByIndex = (chain: Chain, index = 0): string => { availableRestApis[Math.min(index, availableRestApis.length - 1)]; return randomRestApi.address; }; + +export const createIbcTx = async ( + account: Account, + destinationAddress: string, + token: AddressWithAsset, + amount: BigNumber, + portId: string, + channelId: string, + gasConfig: GasConfig, + chain: ChainSettings, + memo?: string +): Promise> => { + const { tx } = await getSdkInstance(); + + // SDK expects IBC amounts in base denom + const amountInBaseDenom = toBaseAmount(token.asset, amount); + + const ibcTransferProps = { + source: account.address, + receiver: destinationAddress, + token: token.originalAddress, + amountInBaseDenom, + portId, + channelId, + memo, + }; + + const transactionPair = await buildTxPair( + account, + gasConfig, + chain, + [ibcTransferProps], + tx.buildIbcTransfer, + account.address + ); + return transactionPair; +}; diff --git a/apps/namadillo/src/types.d.ts b/apps/namadillo/src/types.d.ts index f35b343c0..027fe1f60 100644 --- a/apps/namadillo/src/types.d.ts +++ b/apps/namadillo/src/types.d.ts @@ -6,6 +6,7 @@ import { import { AssetList, Chain, IBCInfo } from "@chain-registry/types"; import { ChainKey, ClaimRewardsMsgValue, ExtensionKey } from "@namada/types"; import BigNumber from "bignumber.js"; +import { TxKind } from "types/txKind"; declare module "*.module.css" { const content: Record; @@ -145,16 +146,6 @@ export type BuildTxAtomParams = { gasConfig: GasConfig; }; -export type TxKind = - | "Bond" - | "Unbond" - | "Redelegate" - | "Withdraw" - | "ClaimRewards" - | "VoteProposal" - | "RevealPk" - | "Unknown"; - export type SortOptions = "asc" | "desc" | undefined; export type SortedColumnPair = [id: T, SortOptions] | undefined; diff --git a/apps/namadillo/src/types/events.ts b/apps/namadillo/src/types/events.ts index 49de64e14..c33316528 100644 --- a/apps/namadillo/src/types/events.ts +++ b/apps/namadillo/src/types/events.ts @@ -6,7 +6,8 @@ import { VoteProposalProps, WithdrawProps, } from "@namada/types"; -import { ClaimRewardsProps, TxKind } from "types"; +import { ClaimRewardsProps } from "types"; +import { TxKind } from "types/txKind"; export type TransactionEventsClasses = Partial; diff --git a/apps/namadillo/src/types/txKind.ts b/apps/namadillo/src/types/txKind.ts new file mode 100644 index 000000000..2ff38547a --- /dev/null +++ b/apps/namadillo/src/types/txKind.ts @@ -0,0 +1,13 @@ +export const txKinds = [ + "Bond", + "Unbond", + "Redelegate", + "Withdraw", + "ClaimRewards", + "VoteProposal", + "RevealPk", + "IbcTransfer", + "Unknown", +] as const; + +export type TxKind = (typeof txKinds)[number]; diff --git a/packages/integrations/src/Keplr.ts b/packages/integrations/src/Keplr.ts index 797d45a22..2e69eb0b4 100644 --- a/packages/integrations/src/Keplr.ts +++ b/packages/integrations/src/Keplr.ts @@ -166,7 +166,7 @@ class Keplr implements Integration { source, receiver, token, - amount, + amountInBaseDenom, portId = "transfer", channelId, } = props.ibcProps; @@ -189,7 +189,7 @@ class Keplr implements Integration { .sendIbcTokens( source, receiver, - coin(amount.toString(), minDenom), + coin(amountInBaseDenom.toString(), minDenom), portId, channelId, // TODO: Should we enable timeout height versus timestamp? diff --git a/packages/sdk/docs/classes/Crypto.md b/packages/sdk/docs/classes/Crypto.md index fc47082e4..bf4a4adaf 100644 --- a/packages/sdk/docs/classes/Crypto.md +++ b/packages/sdk/docs/classes/Crypto.md @@ -40,7 +40,7 @@ Class Crypto handles AES encryption tasks #### Defined in -[sdk/src/crypto/crypto.ts:20](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L20) +[sdk/src/crypto/crypto.ts:20](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L20) ## Properties @@ -52,7 +52,7 @@ WebAssembly Memory for crypto #### Defined in -[sdk/src/crypto/crypto.ts:20](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L20) +[sdk/src/crypto/crypto.ts:20](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L20) ## Methods @@ -75,7 +75,7 @@ decrypted text #### Defined in -[sdk/src/crypto/crypto.ts:115](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L115) +[sdk/src/crypto/crypto.ts:115](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L115) ___ @@ -100,7 +100,7 @@ crypto record #### Defined in -[sdk/src/crypto/crypto.ts:61](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L61) +[sdk/src/crypto/crypto.ts:61](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L61) ___ @@ -126,7 +126,7 @@ array of encrypted bytes #### Defined in -[sdk/src/crypto/crypto.ts:98](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L98) +[sdk/src/crypto/crypto.ts:98](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L98) ___ @@ -153,7 +153,7 @@ crypto record used for storage #### Defined in -[sdk/src/crypto/crypto.ts:30](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L30) +[sdk/src/crypto/crypto.ts:30](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L30) ___ @@ -178,4 +178,4 @@ encryption parameters #### Defined in -[sdk/src/crypto/crypto.ts:73](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/crypto.ts#L73) +[sdk/src/crypto/crypto.ts:73](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/crypto.ts#L73) diff --git a/packages/sdk/docs/classes/Ledger.md b/packages/sdk/docs/classes/Ledger.md index fd8fc2fb0..760f19e32 100644 --- a/packages/sdk/docs/classes/Ledger.md +++ b/packages/sdk/docs/classes/Ledger.md @@ -18,9 +18,11 @@ Functionality for interacting with NamadaApp for Ledger Hardware Wallets - [closeTransport](Ledger.md#closetransport) - [getAddressAndPublicKey](Ledger.md#getaddressandpublickey) +- [getShieldedKeys](Ledger.md#getshieldedkeys) - [queryErrors](Ledger.md#queryerrors) - [showAddressAndPublicKey](Ledger.md#showaddressandpublickey) - [sign](Ledger.md#sign) +- [signMasp](Ledger.md#signmasp) - [status](Ledger.md#status) - [init](Ledger.md#init) @@ -42,7 +44,7 @@ Functionality for interacting with NamadaApp for Ledger Hardware Wallets #### Defined in -[sdk/src/ledger.ts:53](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L53) +[sdk/src/ledger.ts:68](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L68) ## Properties @@ -54,7 +56,7 @@ Inititalized NamadaApp class from Zondax package #### Defined in -[sdk/src/ledger.ts:53](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L53) +[sdk/src/ledger.ts:68](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L68) ## Methods @@ -75,13 +77,13 @@ void #### Defined in -[sdk/src/ledger.ts:174](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L174) +[sdk/src/ledger.ts:245](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L245) ___ ### getAddressAndPublicKey -▸ **getAddressAndPublicKey**(`path?`): `Promise`\<[`AddressAndPublicKey`](../modules.md#addressandpublickey)\> +▸ **getAddressAndPublicKey**(`path?`): `Promise`\<[`LedgerAddressAndPublicKey`](../modules.md#ledgeraddressandpublickey)\> Get address and public key associated with optional path, otherwise, use default path Throw exception if app is not initialized. @@ -94,7 +96,7 @@ Throw exception if app is not initialized. #### Returns -`Promise`\<[`AddressAndPublicKey`](../modules.md#addressandpublickey)\> +`Promise`\<[`LedgerAddressAndPublicKey`](../modules.md#ledgeraddressandpublickey)\> Address and public key @@ -102,7 +104,35 @@ Address and public key #### Defined in -[sdk/src/ledger.ts:96](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L96) +[sdk/src/ledger.ts:111](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L111) + +___ + +### getShieldedKeys + +▸ **getShieldedKeys**(`path?`, `promptUser?`): `Promise`\<[`LedgerShieldedKeys`](../modules.md#ledgershieldedkeys)\> + +Prompt user to get viewing and proof gen key associated with optional path, otherwise, use default path. +Throw exception if app is not initialized. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `path?` | `string` | `DEFAULT_LEDGER_BIP44_PATH` | Bip44 path for deriving key | +| `promptUser?` | `boolean` | `true` | boolean to determine whether to display on Ledger device and require approval | + +#### Returns + +`Promise`\<[`LedgerShieldedKeys`](../modules.md#ledgershieldedkeys)\> + +ShieldedKeys + +**`Async`** + +#### Defined in + +[sdk/src/ledger.ts:157](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L157) ___ @@ -123,13 +153,13 @@ Error message if error is found #### Defined in -[sdk/src/ledger.ts:157](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L157) +[sdk/src/ledger.ts:228](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L228) ___ ### showAddressAndPublicKey -▸ **showAddressAndPublicKey**(`path?`): `Promise`\<[`AddressAndPublicKey`](../modules.md#addressandpublickey)\> +▸ **showAddressAndPublicKey**(`path?`): `Promise`\<[`LedgerAddressAndPublicKey`](../modules.md#ledgeraddressandpublickey)\> Prompt user to get address and public key associated with optional path, otherwise, use default path. Throw exception if app is not initialized. @@ -142,7 +172,7 @@ Throw exception if app is not initialized. #### Returns -`Promise`\<[`AddressAndPublicKey`](../modules.md#addressandpublickey)\> +`Promise`\<[`LedgerAddressAndPublicKey`](../modules.md#ledgeraddressandpublickey)\> Address and public key @@ -150,7 +180,7 @@ Address and public key #### Defined in -[sdk/src/ledger.ts:116](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L116) +[sdk/src/ledger.ts:131](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L131) ___ @@ -178,7 +208,35 @@ Response signature #### Defined in -[sdk/src/ledger.ts:142](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L142) +[sdk/src/ledger.ts:196](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L196) + +___ + +### signMasp + +▸ **signMasp**(`tx`, `path?`): `Promise`\<`ResponseSign`\> + +Sign a Masp tx with the shielded keys associated with the provided (or default) path. +Throw exception if app is not initialized. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `tx` | `Uint8Array` | `undefined` | masp tx data blob to sign | +| `path?` | `string` | `DEFAULT_LEDGER_BIP44_PATH` | Bip44 path for signing account | + +#### Returns + +`Promise`\<`ResponseSign`\> + +Response signature + +**`Async`** + +#### Defined in + +[sdk/src/ledger.ts:213](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L213) ___ @@ -199,7 +257,7 @@ Version and info of NamadaApp #### Defined in -[sdk/src/ledger.ts:79](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L79) +[sdk/src/ledger.ts:94](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L94) ___ @@ -225,4 +283,4 @@ Ledger class instance #### Defined in -[sdk/src/ledger.ts:61](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L61) +[sdk/src/ledger.ts:76](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L76) diff --git a/packages/sdk/docs/classes/Masp.md b/packages/sdk/docs/classes/Masp.md index a2c67cf3e..1942f6a51 100644 --- a/packages/sdk/docs/classes/Masp.md +++ b/packages/sdk/docs/classes/Masp.md @@ -42,7 +42,7 @@ Class representing utilities related to MASP #### Defined in -[sdk/src/masp.ts:10](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L10) +[sdk/src/masp.ts:10](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L10) ## Properties @@ -54,7 +54,7 @@ Instance of Sdk struct from wasm lib #### Defined in -[sdk/src/masp.ts:10](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L10) +[sdk/src/masp.ts:10](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L10) ## Methods @@ -81,7 +81,7 @@ void #### Defined in -[sdk/src/masp.ts:70](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L70) +[sdk/src/masp.ts:70](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L70) ___ @@ -108,7 +108,7 @@ void #### Defined in -[sdk/src/masp.ts:48](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L48) +[sdk/src/masp.ts:48](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L48) ___ @@ -135,7 +135,7 @@ void #### Defined in -[sdk/src/masp.ts:59](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L59) +[sdk/src/masp.ts:59](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L59) ___ @@ -161,7 +161,7 @@ void #### Defined in -[sdk/src/masp.ts:27](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L27) +[sdk/src/masp.ts:27](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L27) ___ @@ -181,7 +181,7 @@ True if MASP parameters are loaded #### Defined in -[sdk/src/masp.ts:17](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L17) +[sdk/src/masp.ts:17](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L17) ___ @@ -207,7 +207,7 @@ void #### Defined in -[sdk/src/masp.ts:37](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L37) +[sdk/src/masp.ts:37](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L37) ___ @@ -226,4 +226,4 @@ the MASP address #### Defined in -[sdk/src/masp.ts:79](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/masp.ts#L79) +[sdk/src/masp.ts:79](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/masp.ts#L79) diff --git a/packages/sdk/docs/classes/Mnemonic.md b/packages/sdk/docs/classes/Mnemonic.md index 06ff758fc..ba0db2777 100644 --- a/packages/sdk/docs/classes/Mnemonic.md +++ b/packages/sdk/docs/classes/Mnemonic.md @@ -38,7 +38,7 @@ Class for accessing mnemonic functionality from wasm #### Defined in -[sdk/src/mnemonic.ts:18](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/mnemonic.ts#L18) +[sdk/src/mnemonic.ts:18](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/mnemonic.ts#L18) ## Properties @@ -50,7 +50,7 @@ Memory accessor for crypto lib #### Defined in -[sdk/src/mnemonic.ts:18](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/mnemonic.ts#L18) +[sdk/src/mnemonic.ts:18](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/mnemonic.ts#L18) ## Methods @@ -74,7 +74,7 @@ An array of words #### Defined in -[sdk/src/mnemonic.ts:25](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/mnemonic.ts#L25) +[sdk/src/mnemonic.ts:25](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/mnemonic.ts#L25) ___ @@ -99,7 +99,7 @@ Seed bytes #### Defined in -[sdk/src/mnemonic.ts:43](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/mnemonic.ts#L43) +[sdk/src/mnemonic.ts:43](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/mnemonic.ts#L43) ___ @@ -129,4 +129,4 @@ Object with validation result and error message if invalid #### Defined in -[sdk/src/mnemonic.ts:61](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/mnemonic.ts#L61) +[sdk/src/mnemonic.ts:61](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/mnemonic.ts#L61) diff --git a/packages/sdk/docs/classes/Rpc.md b/packages/sdk/docs/classes/Rpc.md index 5a7936ef9..09ac71b7b 100644 --- a/packages/sdk/docs/classes/Rpc.md +++ b/packages/sdk/docs/classes/Rpc.md @@ -51,7 +51,7 @@ API for executing RPC requests with Namada #### Defined in -[sdk/src/rpc/rpc.ts:36](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L36) +[sdk/src/rpc/rpc.ts:36](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L36) ## Properties @@ -63,7 +63,7 @@ Instance of Query struct from wasm lib #### Defined in -[sdk/src/rpc/rpc.ts:38](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L38) +[sdk/src/rpc/rpc.ts:38](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L38) ___ @@ -75,7 +75,7 @@ Instance of Sdk struct from wasm lib #### Defined in -[sdk/src/rpc/rpc.ts:37](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L37) +[sdk/src/rpc/rpc.ts:37](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L37) ## Methods @@ -102,7 +102,7 @@ TxResponseProps object #### Defined in -[sdk/src/rpc/rpc.ts:223](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L223) +[sdk/src/rpc/rpc.ts:223](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L223) ___ @@ -122,7 +122,7 @@ Array of all validator addresses #### Defined in -[sdk/src/rpc/rpc.ts:78](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L78) +[sdk/src/rpc/rpc.ts:78](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L78) ___ @@ -149,7 +149,7 @@ Query balances from chain #### Defined in -[sdk/src/rpc/rpc.ts:48](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L48) +[sdk/src/rpc/rpc.ts:48](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L48) ___ @@ -169,7 +169,7 @@ Object #### Defined in -[sdk/src/rpc/rpc.ts:203](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L203) +[sdk/src/rpc/rpc.ts:203](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L203) ___ @@ -195,7 +195,7 @@ Promise resolving to delegators votes #### Defined in -[sdk/src/rpc/rpc.ts:102](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L102) +[sdk/src/rpc/rpc.ts:102](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L102) ___ @@ -215,7 +215,7 @@ Query gas costs #### Defined in -[sdk/src/rpc/rpc.ts:194](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L194) +[sdk/src/rpc/rpc.ts:194](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L194) ___ @@ -235,7 +235,7 @@ Address of native token #### Defined in -[sdk/src/rpc/rpc.ts:57](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L57) +[sdk/src/rpc/rpc.ts:57](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L57) ___ @@ -262,7 +262,7 @@ String of public key if found #### Defined in -[sdk/src/rpc/rpc.ts:68](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L68) +[sdk/src/rpc/rpc.ts:68](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L68) ___ @@ -288,7 +288,7 @@ Promise resolving to pending ethereum transfers #### Defined in -[sdk/src/rpc/rpc.ts:185](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L185) +[sdk/src/rpc/rpc.ts:185](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L185) ___ @@ -314,7 +314,7 @@ Promise resolving to staking positions #### Defined in -[sdk/src/rpc/rpc.ts:139](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L139) +[sdk/src/rpc/rpc.ts:139](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L139) ___ @@ -340,7 +340,7 @@ Promise resolving to staking totals #### Defined in -[sdk/src/rpc/rpc.ts:112](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L112) +[sdk/src/rpc/rpc.ts:112](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L112) ___ @@ -364,7 +364,7 @@ Total bonds amount #### Defined in -[sdk/src/rpc/rpc.ts:175](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L175) +[sdk/src/rpc/rpc.ts:175](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L175) ___ @@ -391,7 +391,7 @@ Promise resolving to total delegations #### Defined in -[sdk/src/rpc/rpc.ts:89](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L89) +[sdk/src/rpc/rpc.ts:89](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L89) ___ @@ -415,4 +415,4 @@ Sync the shielded context #### Defined in -[sdk/src/rpc/rpc.ts:241](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/rpc.ts#L241) +[sdk/src/rpc/rpc.ts:241](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/rpc.ts#L241) diff --git a/packages/sdk/docs/classes/Sdk.md b/packages/sdk/docs/classes/Sdk.md index 340f322fe..206172a5f 100644 --- a/packages/sdk/docs/classes/Sdk.md +++ b/packages/sdk/docs/classes/Sdk.md @@ -64,7 +64,7 @@ API for interacting with Namada SDK #### Defined in -[sdk/src/sdk.ts:24](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L24) +[sdk/src/sdk.ts:24](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L24) ## Properties @@ -76,7 +76,7 @@ Memory accessor for crypto lib #### Defined in -[sdk/src/sdk.ts:27](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L27) +[sdk/src/sdk.ts:27](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L27) ___ @@ -88,7 +88,7 @@ Address of chain's native token #### Defined in -[sdk/src/sdk.ts:29](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L29) +[sdk/src/sdk.ts:29](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L29) ___ @@ -100,7 +100,7 @@ Instance of Query struct from wasm lib #### Defined in -[sdk/src/sdk.ts:26](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L26) +[sdk/src/sdk.ts:26](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L26) ___ @@ -112,7 +112,7 @@ Instance of Sdk struct from wasm lib #### Defined in -[sdk/src/sdk.ts:25](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L25) +[sdk/src/sdk.ts:25](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L25) ___ @@ -124,7 +124,7 @@ RPC url #### Defined in -[sdk/src/sdk.ts:28](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L28) +[sdk/src/sdk.ts:28](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L28) ## Accessors @@ -142,7 +142,7 @@ Utilities for encrypting and decrypting data #### Defined in -[sdk/src/sdk.ts:174](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L174) +[sdk/src/sdk.ts:174](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L174) ___ @@ -160,7 +160,7 @@ key-related functionality #### Defined in -[sdk/src/sdk.ts:150](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L150) +[sdk/src/sdk.ts:150](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L150) ___ @@ -178,7 +178,7 @@ Masp utilities for handling params #### Defined in -[sdk/src/sdk.ts:166](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L166) +[sdk/src/sdk.ts:166](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L166) ___ @@ -196,7 +196,7 @@ mnemonic-related functionality #### Defined in -[sdk/src/sdk.ts:142](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L142) +[sdk/src/sdk.ts:142](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L142) ___ @@ -214,7 +214,7 @@ rpc client #### Defined in -[sdk/src/sdk.ts:126](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L126) +[sdk/src/sdk.ts:126](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L126) ___ @@ -232,7 +232,7 @@ Non-Tx signing functionality #### Defined in -[sdk/src/sdk.ts:158](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L158) +[sdk/src/sdk.ts:158](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L158) ___ @@ -250,7 +250,7 @@ tx-related functionality #### Defined in -[sdk/src/sdk.ts:134](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L134) +[sdk/src/sdk.ts:134](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L134) ___ @@ -268,7 +268,7 @@ Version from package.json #### Defined in -[sdk/src/sdk.ts:182](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L182) +[sdk/src/sdk.ts:182](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L182) ## Methods @@ -286,7 +286,7 @@ Utilities for encrypting and decrypting data #### Defined in -[sdk/src/sdk.ts:101](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L101) +[sdk/src/sdk.ts:101](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L101) ___ @@ -304,7 +304,7 @@ key-related functionality #### Defined in -[sdk/src/sdk.ts:77](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L77) +[sdk/src/sdk.ts:77](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L77) ___ @@ -322,7 +322,7 @@ Masp utilities for handling params #### Defined in -[sdk/src/sdk.ts:93](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L93) +[sdk/src/sdk.ts:93](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L93) ___ @@ -340,7 +340,7 @@ mnemonic-related functionality #### Defined in -[sdk/src/sdk.ts:69](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L69) +[sdk/src/sdk.ts:69](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L69) ___ @@ -358,7 +358,7 @@ Namada RPC client #### Defined in -[sdk/src/sdk.ts:53](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L53) +[sdk/src/sdk.ts:53](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L53) ___ @@ -376,7 +376,7 @@ Non-Tx signing functionality #### Defined in -[sdk/src/sdk.ts:85](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L85) +[sdk/src/sdk.ts:85](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L85) ___ @@ -394,7 +394,7 @@ Tx-related functionality #### Defined in -[sdk/src/sdk.ts:61](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L61) +[sdk/src/sdk.ts:61](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L61) ___ @@ -410,7 +410,7 @@ Return SDK Package version #### Defined in -[sdk/src/sdk.ts:118](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L118) +[sdk/src/sdk.ts:118](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L118) ___ @@ -436,7 +436,7 @@ Class for interacting with NamadaApp for Ledger Hardware Wallets #### Defined in -[sdk/src/sdk.ts:111](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L111) +[sdk/src/sdk.ts:111](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L111) ___ @@ -461,4 +461,4 @@ this instance of Sdk #### Defined in -[sdk/src/sdk.ts:38](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/sdk.ts#L38) +[sdk/src/sdk.ts:38](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/sdk.ts#L38) diff --git a/packages/sdk/docs/classes/Signing.md b/packages/sdk/docs/classes/Signing.md index 86e274cd1..00dbca647 100644 --- a/packages/sdk/docs/classes/Signing.md +++ b/packages/sdk/docs/classes/Signing.md @@ -40,7 +40,7 @@ Signing constructor #### Defined in -[sdk/src/signing.ts:14](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/signing.ts#L14) +[sdk/src/signing.ts:14](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/signing.ts#L14) ## Properties @@ -52,7 +52,7 @@ Instance of Sdk struct from wasm lib #### Defined in -[sdk/src/signing.ts:14](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/signing.ts#L14) +[sdk/src/signing.ts:14](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/signing.ts#L14) ## Methods @@ -78,7 +78,7 @@ signed tx bytes - Promise resolving to Uint8Array #### Defined in -[sdk/src/signing.ts:23](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/signing.ts#L23) +[sdk/src/signing.ts:23](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/signing.ts#L23) ___ @@ -103,7 +103,7 @@ hash and signature #### Defined in -[sdk/src/signing.ts:41](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/signing.ts#L41) +[sdk/src/signing.ts:41](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/signing.ts#L41) ___ @@ -129,4 +129,4 @@ void #### Defined in -[sdk/src/signing.ts:52](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/signing.ts#L52) +[sdk/src/signing.ts:52](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/signing.ts#L52) diff --git a/packages/sdk/docs/classes/Tx.md b/packages/sdk/docs/classes/Tx.md index 3a39d4c7d..96cc0f20c 100644 --- a/packages/sdk/docs/classes/Tx.md +++ b/packages/sdk/docs/classes/Tx.md @@ -54,7 +54,7 @@ SDK functionality related to transactions #### Defined in -[sdk/src/tx/tx.ts:56](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L56) +[sdk/src/tx/tx.ts:56](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L56) ## Properties @@ -66,7 +66,7 @@ Instance of Sdk struct from wasm lib #### Defined in -[sdk/src/tx/tx.ts:56](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L56) +[sdk/src/tx/tx.ts:56](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L56) ## Methods @@ -91,7 +91,7 @@ Append signature for transactions signed by Ledger Hardware Wallet #### Defined in -[sdk/src/tx/tx.ts:373](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L373) +[sdk/src/tx/tx.ts:375](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L375) ___ @@ -115,7 +115,7 @@ a serialized TxMsgValue type #### Defined in -[sdk/src/tx/tx.ts:356](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L356) +[sdk/src/tx/tx.ts:358](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L358) ___ @@ -142,7 +142,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:178](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L178) +[sdk/src/tx/tx.ts:178](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L178) ___ @@ -169,7 +169,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:335](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L335) +[sdk/src/tx/tx.ts:337](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L337) ___ @@ -196,7 +196,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:288](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L288) +[sdk/src/tx/tx.ts:290](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L290) ___ @@ -205,6 +205,8 @@ ___ ▸ **buildIbcTransfer**(`wrapperTxProps`, `ibcTransferProps`): `Promise`\<`TxMsgValue`\> Build Ibc Transfer Tx +`ibcTransferProps.amountInBaseDenom` is the amount in the **base** denom +e.g. the value of 1 NAM should be BigNumber(1_000_000), not BigNumber(1). #### Parameters @@ -223,7 +225,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:265](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L265) +[sdk/src/tx/tx.ts:267](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L267) ___ @@ -250,7 +252,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:242](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L242) +[sdk/src/tx/tx.ts:242](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L242) ___ @@ -276,7 +278,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:165](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L165) +[sdk/src/tx/tx.ts:165](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L165) ___ @@ -303,7 +305,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:90](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L90) +[sdk/src/tx/tx.ts:90](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L90) ___ @@ -330,7 +332,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:115](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L115) +[sdk/src/tx/tx.ts:115](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L115) ___ @@ -357,7 +359,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:65](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L65) +[sdk/src/tx/tx.ts:65](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L65) ___ @@ -384,7 +386,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:199](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L199) +[sdk/src/tx/tx.ts:199](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L199) ___ @@ -411,7 +413,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:141](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L141) +[sdk/src/tx/tx.ts:141](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L141) ___ @@ -438,7 +440,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:311](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L311) +[sdk/src/tx/tx.ts:313](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L313) ___ @@ -465,7 +467,7 @@ promise that resolves to an TxMsgValue #### Defined in -[sdk/src/tx/tx.ts:221](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L221) +[sdk/src/tx/tx.ts:221](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L221) ___ @@ -490,7 +492,7 @@ a TxDetails object #### Defined in -[sdk/src/tx/tx.ts:426](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L426) +[sdk/src/tx/tx.ts:428](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L428) ___ @@ -514,7 +516,7 @@ Serialized WrapperTxMsgValue #### Defined in -[sdk/src/tx/tx.ts:414](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L414) +[sdk/src/tx/tx.ts:416](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L416) ___ @@ -544,7 +546,7 @@ promise that resolves to the shielding memo #### Defined in -[sdk/src/tx/tx.ts:489](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L489) +[sdk/src/tx/tx.ts:491](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L491) ___ @@ -568,4 +570,4 @@ array of inner Tx hashes #### Defined in -[sdk/src/tx/tx.ts:508](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/tx/tx.ts#L508) +[sdk/src/tx/tx.ts:510](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/tx/tx.ts#L510) diff --git a/packages/sdk/docs/enums/KdfType.md b/packages/sdk/docs/enums/KdfType.md index e2bd3d5d9..2bbbda54c 100644 --- a/packages/sdk/docs/enums/KdfType.md +++ b/packages/sdk/docs/enums/KdfType.md @@ -17,7 +17,7 @@ #### Defined in -[sdk/src/crypto/types.ts:38](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/types.ts#L38) +[sdk/src/crypto/types.ts:38](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/types.ts#L38) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[sdk/src/crypto/types.ts:39](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/types.ts#L39) +[sdk/src/crypto/types.ts:39](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/types.ts#L39) diff --git a/packages/sdk/docs/modules.md b/packages/sdk/docs/modules.md index 8f5ecc4ad..33c4f561e 100644 --- a/packages/sdk/docs/modules.md +++ b/packages/sdk/docs/modules.md @@ -24,7 +24,6 @@ ### Type Aliases - [Address](modules.md#address) -- [AddressAndPublicKey](modules.md#addressandpublickey) - [Argon2Params](modules.md#argon2params) - [Balance](modules.md#balance) - [Bonds](modules.md#bonds) @@ -32,6 +31,8 @@ - [DelegationTotals](modules.md#delegationtotals) - [DelegatorsVotes](modules.md#delegatorsvotes) - [EncryptionParams](modules.md#encryptionparams) +- [LedgerAddressAndPublicKey](modules.md#ledgeraddressandpublickey) +- [LedgerShieldedKeys](modules.md#ledgershieldedkeys) - [LedgerStatus](modules.md#ledgerstatus) - [ShieldedKeys](modules.md#shieldedkeys) - [StakingPositions](modules.md#stakingpositions) @@ -43,7 +44,6 @@ ### Variables - [Argon2Config](modules.md#argon2config) -- [DEFAULT\_LEDGER\_BIP44\_PATH](modules.md#default_ledger_bip44_path) - [TxTypeLabel](modules.md#txtypelabel) ### Functions @@ -69,24 +69,7 @@ Address and public key type #### Defined in -[sdk/src/keys/types.ts:4](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/keys/types.ts#L4) - -___ - -### AddressAndPublicKey - -Ƭ **AddressAndPublicKey**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `address` | `string` | -| `publicKey` | `string` | - -#### Defined in - -[sdk/src/ledger.ts:16](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L16) +[sdk/src/keys/types.ts:4](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/keys/types.ts#L4) ___ @@ -96,7 +79,7 @@ ___ #### Defined in -[sdk/src/crypto/types.ts:23](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/types.ts#L23) +[sdk/src/crypto/types.ts:23](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/types.ts#L23) ___ @@ -109,7 +92,7 @@ Balance #### Defined in -[sdk/src/rpc/types.ts:69](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L69) +[sdk/src/rpc/types.ts:69](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L69) ___ @@ -128,7 +111,7 @@ ___ #### Defined in -[sdk/src/rpc/types.ts:27](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L27) +[sdk/src/rpc/types.ts:27](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L27) ___ @@ -156,7 +139,7 @@ ___ #### Defined in -[sdk/src/crypto/types.ts:42](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/types.ts#L42) +[sdk/src/crypto/types.ts:42](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/types.ts#L42) ___ @@ -169,7 +152,7 @@ Record #### Defined in -[sdk/src/rpc/types.ts:51](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L51) +[sdk/src/rpc/types.ts:51](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L51) ___ @@ -182,7 +165,7 @@ Record #### Defined in -[sdk/src/rpc/types.ts:57](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L57) +[sdk/src/rpc/types.ts:57](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L57) ___ @@ -201,7 +184,46 @@ ___ #### Defined in -[sdk/src/crypto/types.ts:30](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/types.ts#L30) +[sdk/src/crypto/types.ts:30](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/types.ts#L30) + +___ + +### LedgerAddressAndPublicKey + +Ƭ **LedgerAddressAndPublicKey**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `publicKey` | `string` | + +#### Defined in + +[sdk/src/ledger.ts:19](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L19) + +___ + +### LedgerShieldedKeys + +Ƭ **LedgerShieldedKeys**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `proofGenerationKey` | \{ `ak?`: `string` ; `nsk?`: `string` } | +| `proofGenerationKey.ak?` | `string` | +| `proofGenerationKey.nsk?` | `string` | +| `viewingKey` | \{ `ivk?`: `string` ; `ovk?`: `string` ; `viewKey?`: `string` } | +| `viewingKey.ivk?` | `string` | +| `viewingKey.ovk?` | `string` | +| `viewingKey.viewKey?` | `string` | + +#### Defined in + +[sdk/src/ledger.ts:20](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L20) ___ @@ -218,7 +240,7 @@ ___ #### Defined in -[sdk/src/ledger.ts:17](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L17) +[sdk/src/ledger.ts:32](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L32) ___ @@ -238,7 +260,7 @@ Shielded keys and address #### Defined in -[sdk/src/keys/types.ts:19](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/keys/types.ts#L19) +[sdk/src/keys/types.ts:19](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/keys/types.ts#L19) ___ @@ -255,7 +277,7 @@ ___ #### Defined in -[sdk/src/rpc/types.ts:42](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L42) +[sdk/src/rpc/types.ts:42](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L42) ___ @@ -275,7 +297,7 @@ ___ #### Defined in -[sdk/src/rpc/types.ts:19](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L19) +[sdk/src/rpc/types.ts:19](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L19) ___ @@ -285,7 +307,7 @@ ___ #### Defined in -[shared/src/types.ts:3](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/shared/src/types.ts#L3) +[shared/src/types.ts:3](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/shared/src/types.ts#L3) ___ @@ -297,7 +319,7 @@ Public and private keypair with address #### Defined in -[sdk/src/keys/types.ts:12](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/keys/types.ts#L12) +[sdk/src/keys/types.ts:12](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/keys/types.ts#L12) ___ @@ -317,7 +339,7 @@ ___ #### Defined in -[sdk/src/rpc/types.ts:34](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/rpc/types.ts#L34) +[sdk/src/rpc/types.ts:34](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/rpc/types.ts#L34) ## Variables @@ -335,17 +357,7 @@ ___ #### Defined in -[sdk/src/crypto/types.ts:3](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/crypto/types.ts#L3) - -___ - -### DEFAULT\_LEDGER\_BIP44\_PATH - -• `Const` **DEFAULT\_LEDGER\_BIP44\_PATH**: `string` - -#### Defined in - -[sdk/src/ledger.ts:40](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L40) +[sdk/src/crypto/types.ts:3](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/crypto/types.ts#L3) ___ @@ -355,7 +367,7 @@ ___ #### Defined in -[shared/src/types.ts:28](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/shared/src/types.ts#L28) +[shared/src/types.ts:28](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/shared/src/types.ts#L28) ## Functions @@ -375,7 +387,7 @@ Transport object #### Defined in -[sdk/src/ledger.ts:36](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L36) +[sdk/src/ledger.ts:51](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L51) ___ @@ -395,7 +407,7 @@ Transport object #### Defined in -[sdk/src/ledger.ts:27](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/ledger.ts#L27) +[sdk/src/ledger.ts:42](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/ledger.ts#L42) ___ @@ -415,4 +427,4 @@ ___ #### Defined in -[sdk/src/keys/keys.ts:173](https://github.com/anoma/namada-interface/blob/f4c1ee3fc8f46d98479687b9b4b0b2ae8ecd87bd/packages/sdk/src/keys/keys.ts#L173) +[sdk/src/keys/keys.ts:213](https://github.com/anoma/namada-interface/blob/8c19036008c55f9cc79e84b260bdad17f18a9709/packages/sdk/src/keys/keys.ts#L213) diff --git a/packages/sdk/src/tx/tx.ts b/packages/sdk/src/tx/tx.ts index afbb4b6c9..75bf07ee4 100644 --- a/packages/sdk/src/tx/tx.ts +++ b/packages/sdk/src/tx/tx.ts @@ -257,6 +257,8 @@ export class Tx { /** * Build Ibc Transfer Tx + * `ibcTransferProps.amountInBaseDenom` is the amount in the **base** denom + * e.g. the value of 1 NAM should be BigNumber(1_000_000), not BigNumber(1). * @async * @param wrapperTxProps - properties of the transaction * @param ibcTransferProps - properties of the ibc transfer tx diff --git a/packages/shared/lib/src/sdk/args.rs b/packages/shared/lib/src/sdk/args.rs index ac490160e..ea1aa04fe 100644 --- a/packages/shared/lib/src/sdk/args.rs +++ b/packages/shared/lib/src/sdk/args.rs @@ -701,7 +701,7 @@ pub struct IbcTransferMsg { source: String, receiver: String, token: String, - amount: String, + amount_in_base_denom: String, port_id: String, channel_id: String, timeout_height: Option, @@ -715,7 +715,7 @@ impl IbcTransferMsg { source: String, receiver: String, token: String, - amount: String, + amount_in_base_denom: String, port_id: String, channel_id: String, timeout_height: Option, @@ -727,7 +727,7 @@ impl IbcTransferMsg { source, receiver, token, - amount, + amount_in_base_denom, port_id, channel_id, timeout_height, @@ -758,7 +758,7 @@ pub fn ibc_transfer_tx_args( source, receiver, token, - amount, + amount_in_base_denom, port_id, channel_id, timeout_height, @@ -770,8 +770,14 @@ pub fn ibc_transfer_tx_args( let source_address = Address::from_str(&source)?; let source = TransferSource::Address(source_address); let token = Address::from_str(&token)?; - let denom_amount = DenominatedAmount::from_str(&amount).expect("Amount to be valid."); - let amount = InputAmount::Unvalidated(denom_amount); + let amount = Amount::from_str( + &amount_in_base_denom, + 0u8 + ).expect("Amount to be valid."); + // Using InputAmount::Validated because the amount is already in the base + // denom. If Unvalidated is used, the SDK will change the denom based on the + // token address, which complicates knowing which amount to pass to this function. + let amount = InputAmount::Validated(amount.into()); let port_id = PortId::from_str(&port_id).expect("Port id to be valid"); let channel_id = ChannelId::from_str(&channel_id).expect("Channel id to be valid"); let ibc_shielding_data = match shielding_data { diff --git a/packages/types/src/tx/schema/ibcTransfer.ts b/packages/types/src/tx/schema/ibcTransfer.ts index a9a38e5c2..faa037d92 100644 --- a/packages/types/src/tx/schema/ibcTransfer.ts +++ b/packages/types/src/tx/schema/ibcTransfer.ts @@ -15,7 +15,7 @@ export class IbcTransferMsgValue { token!: string; @field(BigNumberSerializer) - amount!: BigNumber; + amountInBaseDenom!: BigNumber; @field({ type: "string" }) portId!: string;