diff --git a/README.md b/README.md new file mode 100644 index 000000000..bc2528c88 --- /dev/null +++ b/README.md @@ -0,0 +1,308 @@ +@interlay/interbtc-api / [Exports](modules.md) + +# interbtc-api + +## About + +The interBTC TypeScript library connects the Polkadot and Kusama ecosystems with Bitcoin. It allows the creation of iBTC on Polkadot and kBTC on Kusama, fungible "wrapped" tokens that represent Bitcoin. Wrapped tokens are backed by Bitcoin 1:1 and allow redeeming of the equivalent amount of Bitcoins by relying on a collateralized third-party (Vaults). +In comparison to other bridge constructions (like tBTC, wBTC, or RenVM) _anyone_ can become an intermediary by depositing collateral making interBTC the only truly open system. + +The bridge itself follows the detailed specification: Explore the specification » + +It is implemented as a collection of open-source Substrate modules using Rust: Explore the implementation » + +### Built with + +- [TypeScript](https://github.com/Microsoft/TypeScript) +- [polkadot-js](https://polkadot.js.org/) +- [nvm](https://github.com/nvm-sh/nvm) +- [yarn](https://github.com/yarnpkg/yarn) +- [docker-compose](https://docs.docker.com/compose/) + +You can visit [bridge.interlay.io](https://bridge.interlay.io/) to see the library in action. + +## Usage + +The library assumes you have a version of the [Interlay or Kintsugi networks](https://github.com/interlay/interbtc) running locally or remotely. + +### Creating an API Instance + +To use the library, you will first need to create a PolkadotJS `APIPromise` instance, +and then instantiate a `InterBtcApi` instance. + +```ts +import { createInterBtcApi } from "@interlay/interbtc"; + +// If you are using a local development environment +// const PARACHAIN_ENDPOINT = "ws://127.0.0.1:9944"; +// if you want to use the Interlay-hosted beta network +const PARACHAIN_ENDPOINT = "wss://api.interlay.io/parachain"; +const bitcoinNetwork = "mainnet"; +const interBTC = await createInterBtcApi(PARACHAIN_ENDPOINT, bitcoinNetwork); + +// When finished using the API, disconnect to allow Node scripts to gracefully terminate +interBTC.disconnect(); +``` + +### Attaching an Account + +To emit transactions, an `account` has to be set. +The account should conform to the `AddressOrPair` interface. +If the account is not of the `KeyringPair` type, then a signer must also +be provided (such as an injected extension signer, from the Polkadot wallet). +See more details here: https://polkadot.js.org/docs/extension/usage/ + +```ts +import { createTestKeyring } from "@polkadot/keyring/testing"; +const keyring = createTestKeyring(); +const keypair = keyring.getPairs()[0]; +interBTC.setAccount(keypair); +``` + +The different functionalities are then exposed through the `InterBtcApi` instance. + +### Issuing + +From the account you set, you can then request to issue (mint) interBTC. + +```ts +import { BitcoinAmount } from "@interlay/monetary-js"; +// amount of BTC to convert to interBTC +// NOTE: the bridge fees will be deducted from this. For example, if you request 1 BTC, you will receive about 0.995 interBTC +const amount = BitcoinAmount.from.BTC(0.001); +// request to issue interBTC +const requestResults = await interBTC.issue.request(amount); +// the request results includes the BTC address(es) and the BTC that should be sent to the Vault(s) +// NOTE: the library will automatically distribute issue requests across multiple Vaults if no single Vault can fulfill the request. +// Most of the time, a single Vault will be able to fulfill the request. +``` + +Send BTC using the wallet of your choice or the regtest node (see below). + +### Redeeming + +To exchange interBTC back for physical BTC, you can then request to redeem (burn) interBTC. + +```ts +import { BitcoinAmount } from "@interlay/monetary-js"; +// the amount wrapped tokens to redeem +// NOTE: the bridge fees will be deducted from this +const amount = BitcoinAmount.from.BTC(0.001); +// your BTC address +const btcAddress = "tb123...."; +// the request results includes the BTC address(es) and the BTC that should be sent to the Vault(s) +// NOTE: the library will automatically distribute redeem requests across multiple Vaults if no single Vault can fulfill the request. +// Most of the time, a single Vault will be able to fulfill the request. +const requestResults = await interBTC.redeem.request(amount, btcAddress); +``` + +One or more Vaults will send BTC to the address specified within the expiry period. + +### Creating an AccountId Instance + +Certain API calls require a parameter of type `AccountId`, which represents the Polkadot/Kusama account and can be instantiated as follows + +```ts +const accountId = await interBTC.api.createType( + "AccountId", + "5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT" +); +``` + +### More examples + +There are many examples in the integration tests, showing how to use this library. Take a look at them here: https://github.com/interlay/interbtc-api/tree/master/test/integration + +## Development + +### Fork this repository + +Follow Github's instructions on [how to fork a repository](https://docs.github.com/en/get-started/quickstart/fork-a-repo) to create your own fork. + +### Clone your repository + +```bash +git@github.com:/interbtc-api.git +cd interbtc-api +``` + +### Setting up a local development environment + +Start by setting your Node version via `nvm` + +```bash +nvm use +``` + +(If necessary, `nvm` will guide you on how to install the version.) + +Next, install the dependencies + +```bash +yarn install +``` + +Finally, build the library + +```bash +yarn build +``` + +### Testing + +To run unit tests only, use + +```bash +yarn test:unit +``` + +#### Start the parachain locally for integration tests + +Note that the parachain needs to be running for all tests to run. + +```bash +docker-compose up +``` + +The default parachain runtime is Kintsugi. + +#### Run all tests + +Then, to run all tests: + +```bash +yarn test +``` + +#### Run integration tests only + +```bash +yarn test:integration +``` + +NOTE: While the parachain is starting up, there will be warnings from the integration tests until it can locate the locally running test vaults. Expect the startup to take around 2-3 minutes, and only start the integration tests after that time frame. + +Another option is to check the logs, i.e. for `vault_1` you can use this: + +```bash +docker-compose logs -f vault_1 +``` + +NOTE: The optional `-f` flag attaches the terminal to the log output, you will need to Ctrl + C to exit. Alternatively, omit the flag to just get the current latest log entries. + +#### Stop the local parachain + +To stop the locally running parachain, run: + +```bash +docker-compose down -v +``` + +NOTE: This will remove the volumes attached to the images. So your chain will start next time in a clean/wiped state. + +### Updating types + +We only need to update types when we have changed to newer docker images for the parachain / clients. + +Run the parachain (as shown above) and update the metadata: + +```bash +yarn update-metadata +``` + +Then, update the metadata by building the library: + +```bash +yarn build +``` + +### Usage as script + +This repository contains a number of scripts for various use cases. Check `package.json` for all of the available scripts. + +**Query Undercollateralized borrowers** + +Given a `PARACHAIN_ENDPOINT` (e.g. `wss://api-dev-kintsugi.interlay.io/parachain`), the following will print a table with all undercollateralized borrowers on that network. +```bash +yarn install +yarn undercollateralized-borrowers --parachain-endpoint PARACHAIN_ENDPOINT +``` + +## Help + +### Bitcoin Regtest + +Regtest is a local Bitcoin instance that allows you to practically anything including sending transactions, mining blocks, and generating new addresses. +For a full overview, [head over to the Bitcoin developer documentation](https://developer.bitcoin.org/examples/testing.html#regtest-mode). + +**Sending Transactions** + +For the issue process, you need to send a transaction. On regtest this can be achieved with: + +```shell +bitcoin-cli -regtest -rpcwallet=Alice sendtoaddress VAULT_ADDRESS AMOUNT +``` + +**Mining Blocks** + +In regtest, blocks are not automatically produced. After you sent a transaction, you need to mine e.g., 1 block: + +```shell +bitcoin-cli -regtest generatetoaddress 1 $(bitcoin-cli -regtest getnewaddress) +``` + +**Getting Balances** + +You can query the balance of your wallet like so: + +```shell +bitcoin-cli -regtest -rpcwallet=Alice getbalance +``` + +### Docker + +You can hard-reset the docker dependency setup with the following commands: + +```shell +docker kill $(docker ps -q) +docker rm $(docker ps -a -q) +docker rmi $(docker images -q) +docker volume rm $(docker volume ls -q) +``` + +## Contributing + +Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. + +1. Set up git so you can [sign your commits](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work) (Alternative link: [GitHub: Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)) +Unsigned PRs cannot be merged, so do not skip this step. +2. Fork the Project +3. Create your Feature Branch (git checkout -b yourname/AmazingFeature) +4. Commit your Changes (git commit -m 'Add some AmazingFeature') +5. Push to the Branch (git push origin yourname/AmazingFeature) +6. Open a Pull Request with a description of feature you are adding + +If you are searching for a place to start or would like to discuss features, reach out to us: + +- [Discord](https://discord.com/invite/interlay) + +## License + +(C) Copyright 2022 [Interlay](https://www.interlay.io) Ltd + +interbtc-js is licensed under the terms of the Apache License (Version 2.0). See [LICENSE](LICENSE). + +## Contact + +Website: [Interlay.io](https://www.interlay.io) + +Twitter: [@interlayHQ](https://twitter.com/InterlayHQ) + +Email: contact@interlay.io + +## Acknowledgements + +We would like to thank the following teams for their continuous support: + +- [Web3 Foundation](https://web3.foundation/) +- [Parity Technologies](https://www.parity.io/) diff --git a/_sidebar.md b/_sidebar.md new file mode 100644 index 000000000..d14e6e4b1 --- /dev/null +++ b/_sidebar.md @@ -0,0 +1,3177 @@ +### BTC Bridge Classes + +- [DefaultInterBtcApi](classes/DefaultInterBtcApi.md) + +### Other Classes + +- [BitcoinCoreClient](classes/BitcoinCoreClient.md) +- [BitcoinMerkleProof](classes/BitcoinMerkleProof.md) +- [ChainBalance](classes/ChainBalance.md) +- [DefaultAMMAPI](classes/DefaultAMMAPI.md) +- [DefaultAssetRegistryAPI](classes/DefaultAssetRegistryAPI.md) +- [DefaultBTCRelayAPI](classes/DefaultBTCRelayAPI.md) +- [DefaultConstantsAPI](classes/DefaultConstantsAPI.md) +- [DefaultElectrsAPI](classes/DefaultElectrsAPI.md) +- [DefaultEscrowAPI](classes/DefaultEscrowAPI.md) +- [DefaultFeeAPI](classes/DefaultFeeAPI.md) +- [DefaultIssueAPI](classes/DefaultIssueAPI.md) +- [DefaultLoansAPI](classes/DefaultLoansAPI.md) +- [DefaultNominationAPI](classes/DefaultNominationAPI.md) +- [DefaultOracleAPI](classes/DefaultOracleAPI.md) +- [DefaultRedeemAPI](classes/DefaultRedeemAPI.md) +- [DefaultReplaceAPI](classes/DefaultReplaceAPI.md) +- [DefaultRewardsAPI](classes/DefaultRewardsAPI.md) +- [DefaultSystemAPI](classes/DefaultSystemAPI.md) +- [DefaultTokensAPI](classes/DefaultTokensAPI.md) +- [DefaultTransactionAPI](classes/DefaultTransactionAPI.md) +- [DefaultVaultsAPI](classes/DefaultVaultsAPI.md) +- [StableLiquidityMetaPool](classes/StableLiquidityMetaPool.md) +- [StableLiquidityPool](classes/StableLiquidityPool.md) +- [StandardLiquidityPool](classes/StandardLiquidityPool.md) +- [Trade](classes/Trade.md) +- [VaultExt](classes/VaultExt.md) + +### Bitcoin Core Interfaces + +- [ElectrsAPI](interfaces/ElectrsAPI.md) + +### BTC Bridge Interfaces + +- [AssetRegistryAPI](interfaces/AssetRegistryAPI.md) +- [BTCRelayAPI](interfaces/BTCRelayAPI.md) +- [EscrowAPI](interfaces/EscrowAPI.md) +- [FeeAPI](interfaces/FeeAPI.md) +- [IssueAPI](interfaces/IssueAPI.md) +- [NominationAPI](interfaces/NominationAPI.md) +- [OracleAPI](interfaces/OracleAPI.md) +- [RedeemAPI](interfaces/RedeemAPI.md) +- [ReplaceAPI](interfaces/ReplaceAPI.md) +- [SystemAPI](interfaces/SystemAPI.md) +- [TokensAPI](interfaces/TokensAPI.md) +- [VaultsAPI](interfaces/VaultsAPI.md) + +### BTC Bridge +The type Big represents Wrapped or Collateral token denominations, +while the type BN represents Planck or Satoshi denominations. Interfaces + +- [ConstantsAPI](interfaces/ConstantsAPI.md) + +### Lending protocol Interfaces + +- [LoansAPI](interfaces/LoansAPI.md) + +### Other Interfaces + +- [AMMAPI](interfaces/AMMAPI.md) +- [AccruedRewards](interfaces/AccruedRewards.md) +- [BalanceWrapper](interfaces/BalanceWrapper.md) +- [BorrowPosition](interfaces/BorrowPosition.md) +- [CollateralPosition](interfaces/CollateralPosition.md) +- [CurrencyId](interfaces/CurrencyId.md) +- [DecodedRequest](interfaces/DecodedRequest.md) +- [DecodedRequestExt](interfaces/DecodedRequestExt.md) +- [DryRunResult](interfaces/DryRunResult.md) +- [ExtrinsicData](interfaces/ExtrinsicData.md) +- [ForeignAssetId](interfaces/ForeignAssetId.md) +- [FundAccountJsonRpcRequest](interfaces/FundAccountJsonRpcRequest.md) +- [H256Le](interfaces/H256Le.md) +- [InterBtcApi](interfaces/InterBtcApi.md) +- [InterbtcForeignAssetId](interfaces/InterbtcForeignAssetId.md) +- [InterbtcLendTokenId](interfaces/InterbtcLendTokenId.md) +- [InterbtcLpToken](interfaces/InterbtcLpToken.md) +- [InterbtcPrimitivesCurrencyId](interfaces/InterbtcPrimitivesCurrencyId.md) +- [InterbtcPrimitivesTokenSymbol](interfaces/InterbtcPrimitivesTokenSymbol.md) +- [InterbtcPrimitivesVaultId](interfaces/InterbtcPrimitivesVaultId.md) +- [InterbtcStablePoolId](interfaces/InterbtcStablePoolId.md) +- [Issue](interfaces/Issue.md) +- [IssueResult](interfaces/IssueResult.md) +- [LendTokenId](interfaces/LendTokenId.md) +- [LendingStats](interfaces/LendingStats.md) +- [Liquidity](interfaces/Liquidity.md) +- [LiquidityPoolBase](interfaces/LiquidityPoolBase.md) +- [LoanAsset](interfaces/LoanAsset.md) +- [LoanMarket](interfaces/LoanMarket.md) +- [LoanPosition](interfaces/LoanPosition.md) +- [LoansMarket](interfaces/LoansMarket.md) +- [LpToken](interfaces/LpToken.md) +- [MultiPathElementStableMeta](interfaces/MultiPathElementStableMeta.md) +- [MultiPathElementStablePlain](interfaces/MultiPathElementStablePlain.md) +- [MultiPathElementStandard](interfaces/MultiPathElementStandard.md) +- [NumberOrHex](interfaces/NumberOrHex.md) +- [Rate](interfaces/Rate.md) +- [Ratio](interfaces/Ratio.md) +- [Redeem](interfaces/Redeem.md) +- [RefundRequestExt](interfaces/RefundRequestExt.md) +- [ReplaceRequestExt](interfaces/ReplaceRequestExt.md) +- [RewardsAPI](interfaces/RewardsAPI.md) +- [Shortfall](interfaces/Shortfall.md) +- [SignedFixedPoint](interfaces/SignedFixedPoint.md) +- [StablePoolId](interfaces/StablePoolId.md) +- [SystemVaultExt](interfaces/SystemVaultExt.md) +- [TokenSymbol](interfaces/TokenSymbol.md) +- [TradingPair](interfaces/TradingPair.md) +- [TransactionAPI](interfaces/TransactionAPI.md) +- [TransactionInput](interfaces/TransactionInput.md) +- [TransactionOutput](interfaces/TransactionOutput.md) +- [UnsignedFixedPoint](interfaces/UnsignedFixedPoint.md) +- [VaultCurrencyPair](interfaces/VaultCurrencyPair.md) +- [VaultId](interfaces/VaultId.md) +- [VaultRegistryVault](interfaces/VaultRegistryVault.md) + +### Type Aliases + +- [AccountLiquidity](modules.md#accountliquidity) +- [BitcoinNetwork](modules.md#bitcoinnetwork) +- [BlockHeader](modules.md#blockheader) +- [CollateralCurrencyExt](modules.md#collateralcurrencyext) +- [CollateralIdLiteral](modules.md#collateralidliteral) +- [CurrencyExt](modules.md#currencyext) +- [CurrencyIdentifier](modules.md#currencyidentifier) +- [ForeignAsset](modules.md#foreignasset) +- [GovernanceCurrency](modules.md#governancecurrency) +- [GovernanceIdLiteral](modules.md#governanceidliteral) +- [HexString](modules.md#hexstring) +- [LendToken](modules.md#lendtoken) +- [LiquidityPool](modules.md#liquiditypool) +- [LoanAction](modules.md#loanaction) +- [LpCurrency](modules.md#lpcurrency) +- [MerkleProof](modules.md#merkleproof) +- [MultiPath](modules.md#multipath) +- [MultiPathElement](modules.md#multipathelement) +- [MultiPathElementStable](modules.md#multipathelementstable) +- [PHANTOM\_DEFAULT](modules.md#phantom_default) +- [PooledCurrencies](modules.md#pooledcurrencies) +- [StableLpToken](modules.md#stablelptoken) +- [StakedBalance](modules.md#stakedbalance) +- [StandardLpToken](modules.md#standardlptoken) +- [StandardPooledTokenIdentifier](modules.md#standardpooledtokenidentifier) +- [TickerToData](modules.md#tickertodata) +- [Transaction](modules.md#transaction) +- [TransactionInputSource](modules.md#transactioninputsource) +- [TransactionLocktime](modules.md#transactionlocktime) +- [TxStatus](modules.md#txstatus) +- [UndercollateralizedPosition](modules.md#undercollateralizedposition) +- [VotingCurrency](modules.md#votingcurrency) +- [WrappedAmount](modules.md#wrappedamount) +- [WrappedCurrency](modules.md#wrappedcurrency) +- [WrappedIdLiteral](modules.md#wrappedidliteral) + +### Variables + +- [ACCOUNT\_NOT\_SET\_ERROR\_MESSAGE](modules.md#account_not_set_error_message) +- [ATOMIC\_UNIT](modules.md#atomic_unit) +- [BLOCK\_TIME\_SECONDS](modules.md#block_time_seconds) +- [FIXEDI128\_SCALING\_FACTOR](modules.md#fixedi128_scaling_factor) +- [GovernanceCurrency](modules.md#governancecurrency-1) +- [IGNORED\_ERROR\_MESSAGES](modules.md#ignored_error_messages) +- [LOANS\_REWARD\_INDEX\_SCALING\_FACTOR](modules.md#loans_reward_index_scaling_factor) +- [MS\_PER\_YEAR](modules.md#ms_per_year) +- [PERMILL\_BASE](modules.md#permill_base) +- [SLEEP\_TIME\_MS](modules.md#sleep_time_ms) +- [STABLE\_POOLS\_APPROXIMATION\_PRECISION](modules.md#stable_pools_approximation_precision) +- [VotingCurrency](modules.md#votingcurrency-1) +- [WrappedAmount](modules.md#wrappedamount-1) +- [WrappedCurrency](modules.md#wrappedcurrency-1) + +### Functions + +- [addHexPrefix](modules.md#addhexprefix) +- [addressOrPairAsAccountId](modules.md#addressorpairasaccountid) +- [adjustToThreshold](modules.md#adjusttothreshold) +- [allocateAmountsToVaults](modules.md#allocateamountstovaults) +- [atomicToBaseAmount](modules.md#atomictobaseamount) +- [btcAddressFromParams](modules.md#btcaddressfromparams) +- [bufferToHexString](modules.md#buffertohexstring) +- [calculateAnnualizedRewardAmount](modules.md#calculateannualizedrewardamount) +- [calculateBorrowLimit](modules.md#calculateborrowlimit) +- [calculateBorrowLimitBtcChangeFactory](modules.md#calculateborrowlimitbtcchangefactory) +- [calculateCollateralAmountBtc](modules.md#calculatecollateralamountbtc) +- [calculateLtv](modules.md#calculateltv) +- [calculateLtvAndThresholdsChangeFactory](modules.md#calculateltvandthresholdschangefactory) +- [calculateThreshold](modules.md#calculatethreshold) +- [calculateTotalBorrowedBtcChange](modules.md#calculatetotalborrowedbtcchange) +- [computeLazyDistribution](modules.md#computelazydistribution) +- [computePriceImpact](modules.md#computepriceimpact) +- [convertMoment](modules.md#convertmoment) +- [createAPIRegistry](modules.md#createapiregistry) +- [createExchangeRateOracleKey](modules.md#createexchangerateoraclekey) +- [createFeeEstimationOracleKey](modules.md#createfeeestimationoraclekey) +- [createInterBtcApi](modules.md#createinterbtcapi) +- [createProvider](modules.md#createprovider) +- [createSubstrateAPI](modules.md#createsubstrateapi) +- [currencyIdToMonetaryCurrency](modules.md#currencyidtomonetarycurrency) +- [decodeBtcAddress](modules.md#decodebtcaddress) +- [decodeBytesAsString](modules.md#decodebytesasstring) +- [decodeFixedPointType](modules.md#decodefixedpointtype) +- [decodeNumberOrHex](modules.md#decodenumberorhex) +- [decodePermill](modules.md#decodepermill) +- [decodeRpcVaultId](modules.md#decoderpcvaultid) +- [encodeBtcAddress](modules.md#encodebtcaddress) +- [encodeSwapParamsForStandardAndStablePools](modules.md#encodeswapparamsforstandardandstablepools) +- [encodeSwapParamsForStandardPoolsOnly](modules.md#encodeswapparamsforstandardpoolsonly) +- [encodeUnsignedFixedPoint](modules.md#encodeunsignedfixedpoint) +- [encodeVaultId](modules.md#encodevaultid) +- [ensureHashEncoded](modules.md#ensurehashencoded) +- [filterNonEmptyPools](modules.md#filternonemptypools) +- [findBestTradeRecursively](modules.md#findbesttraderecursively) +- [getAPITypes](modules.md#getapitypes) +- [getAllTradingPairs](modules.md#getalltradingpairs) +- [getBitcoinNetwork](modules.md#getbitcoinnetwork) +- [getCollateralCurrencies](modules.md#getcollateralcurrencies) +- [getCurrencyIdentifier](modules.md#getcurrencyidentifier) +- [getForeignAssetFromId](modules.md#getforeignassetfromid) +- [getIssueRequestsFromExtrinsicResult](modules.md#getissuerequestsfromextrinsicresult) +- [getRPCTypes](modules.md#getrpctypes) +- [getRedeemRequestsFromExtrinsicResult](modules.md#getredeemrequestsfromextrinsicresult) +- [getRequestIdsFromEvents](modules.md#getrequestidsfromevents) +- [getRuntimeDefs](modules.md#getruntimedefs) +- [getSS58Prefix](modules.md#getss58prefix) +- [getStableLpTokenFromCurrencyId](modules.md#getstablelptokenfromcurrencyid) +- [getStableSwapOutputAmount](modules.md#getstableswapoutputamount) +- [getStandardLpTokenFromCurrencyId](modules.md#getstandardlptokenfromcurrencyid) +- [getTotalAmountBtc](modules.md#gettotalamountbtc) +- [getTxProof](modules.md#gettxproof) +- [getUnderlyingCurrencyFromLendTokenId](modules.md#getunderlyingcurrencyfromlendtokenid) +- [intoAccountTruncating](modules.md#intoaccounttruncating) +- [isCurrency](modules.md#iscurrency) +- [isCurrencyEqual](modules.md#iscurrencyequal) +- [isForeignAsset](modules.md#isforeignasset) +- [isLendToken](modules.md#islendtoken) +- [isStableLpToken](modules.md#isstablelptoken) +- [isStableMetaMultiPathElement](modules.md#isstablemetamultipathelement) +- [isStableMetaPool](modules.md#isstablemetapool) +- [isStableMultiPathElement](modules.md#isstablemultipathelement) +- [isStablePlainMultiPathElement](modules.md#isstableplainmultipathelement) +- [isStablePool](modules.md#isstablepool) +- [isStandardLpToken](modules.md#isstandardlptoken) +- [isStandardMultiPathElement](modules.md#isstandardmultipathelement) +- [isStandardPool](modules.md#isstandardpool) +- [issueAndRedeem](modules.md#issueandredeem) +- [issueSingle](modules.md#issuesingle) +- [monetaryAmountToRawString](modules.md#monetaryamounttorawstring) +- [newAccountId](modules.md#newaccountid) +- [newCollateralBTCExchangeRate](modules.md#newcollateralbtcexchangerate) +- [newCurrencyId](modules.md#newcurrencyid) +- [newExtrinsicStatus](modules.md#newextrinsicstatus) +- [newForeignAssetId](modules.md#newforeignassetid) +- [newMonetaryAmount](modules.md#newmonetaryamount) +- [newVaultCurrencyPair](modules.md#newvaultcurrencypair) +- [newVaultId](modules.md#newvaultid) +- [parseEscrowLockedBalance](modules.md#parseescrowlockedbalance) +- [parseIssueRequest](modules.md#parseissuerequest) +- [parseOrmlTokensAccountData](modules.md#parseormltokensaccountdata) +- [parseRedeemRequest](modules.md#parseredeemrequest) +- [parseRedeemRequestStatus](modules.md#parseredeemrequeststatus) +- [parseReplaceRequest](modules.md#parsereplacerequest) +- [parseSystemVault](modules.md#parsesystemvault) +- [queryNominationsMap](modules.md#querynominationsmap) +- [redeem](modules.md#redeem) +- [reverseEndianness](modules.md#reverseendianness) +- [reverseEndiannessHex](modules.md#reverseendiannesshex) +- [setRawStorage](modules.md#setrawstorage) +- [setStorageAtKey](modules.md#setstorageatkey) +- [sleep](modules.md#sleep) +- [storageKeyToNthInner](modules.md#storagekeytonthinner) +- [stripHexPrefix](modules.md#striphexprefix) +- [toVoting](modules.md#tovoting) +- [tokenSymbolToCurrency](modules.md#tokensymboltocurrency) +- [uint8ArrayToString](modules.md#uint8arraytostring) +- [unwrapRawExchangeRate](modules.md#unwraprawexchangerate) +- [waitForBlockFinalization](modules.md#waitforblockfinalization) +- [waitForBlockRelaying](modules.md#waitforblockrelaying) + +## Type Aliases + +### AccountLiquidity + +Ƭ **AccountLiquidity**: `Object` + +The liquidity status of an account, based on the value of its collateral and loans. +* `liquidity` is `max(totalCollateralValueAsWrapped - totalBorrowedValueAsWrapped, 0)`, where each +item in the `totalCollateralValueAsWrapped` sum is first scaled down by the collateralization +required by that market (e.g `100 satoshi * 0.75 + 150 satoshi * 0.8`, where `0.75` and `0.8` +are the collateralization thresholds). +* `shortfall` is very similar to liquidity: `max(totalBorrowedValueAsWrapped - totalCollateralValueAsWrapped, 0)` +so it is only positive when the total borrowed amount exceeds what the collateral can cover. + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `liquidity` | `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\> | +| `shortfall` | `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\> | + +#### Defined in + +[src/types/loans.ts:70](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L70) + +___ + +### BitcoinNetwork + +Ƭ **BitcoinNetwork**: ``"mainnet"`` \| ``"testnet"`` \| ``"regtest"`` + +#### Defined in + +[src/types/bitcoin.ts:3](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L3) + +___ + +### BlockHeader + +Ƭ **BlockHeader**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `hashPrevBlock` | [`HexString`](modules.md#hexstring) | +| `hash_` | [`HexString`](modules.md#hexstring) | +| `merkleRoot` | [`HexString`](modules.md#hexstring) | +| `nonce` | `number` | +| `target` | [`HexString`](modules.md#hexstring) | +| `timestamp` | `number` | +| `version` | `number` | + +#### Defined in + +[src/types/bitcoin.ts:5](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L5) + +___ + +### CollateralCurrencyExt + +Ƭ **CollateralCurrencyExt**: `CollateralCurrency` \| [`ForeignAsset`](modules.md#foreignasset) \| [`LendToken`](modules.md#lendtoken) + +#### Defined in + +[src/types/currency.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L52) + +___ + +### CollateralIdLiteral + +Ƭ **CollateralIdLiteral**: [`DOT`](enums/CurrencyIdLiteral.md#dot) \| [`KSM`](enums/CurrencyIdLiteral.md#ksm) \| [`KINT`](enums/CurrencyIdLiteral.md#kint) \| [`INTR`](enums/CurrencyIdLiteral.md#intr) + +#### Defined in + +[src/types/currency.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L30) + +___ + +### CurrencyExt + +Ƭ **CurrencyExt**: `Currency` \| [`ForeignAsset`](modules.md#foreignasset) \| [`LendToken`](modules.md#lendtoken) \| [`LpCurrency`](modules.md#lpcurrency) + +#### Defined in + +[src/types/currency.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L53) + +___ + +### CurrencyIdentifier + +Ƭ **CurrencyIdentifier**: `NativeCurrencyIdentifier` \| `ForeignAssetIdentifier` \| `LendTokenIdentifier` \| `StableLpTokenIdentifier` \| `StandardLpTokenIdentifier` + +#### Defined in + +[src/types/currency.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L94) + +___ + +### ForeignAsset + +Ƭ **ForeignAsset**: `Currency` & { `foreignAsset`: { `coingeckoId`: `string` ; `id`: `number` } } + +#### Defined in + +[src/types/currency.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L39) + +___ + +### GovernanceCurrency + +Ƭ **GovernanceCurrency**: typeof [`GovernanceCurrency`](modules.md#governancecurrency-1)[`number`] + +#### Defined in + +[src/types/currency.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L61) + +[src/types/currency.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L62) + +___ + +### GovernanceIdLiteral + +Ƭ **GovernanceIdLiteral**: [`INTR`](enums/CurrencyIdLiteral.md#intr) \| [`KINT`](enums/CurrencyIdLiteral.md#kint) + +#### Defined in + +[src/types/currency.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L29) + +___ + +### HexString + +Ƭ **HexString**: \`0x${string}\` + +#### Defined in + +[src/types/encoding.ts:1](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/encoding.ts#L1) + +___ + +### LendToken + +Ƭ **LendToken**: `Currency` & { `lendToken`: { `id`: `number` } } + +#### Defined in + +[src/types/currency.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L40) + +___ + +### LiquidityPool + +Ƭ **LiquidityPool**: [`StandardLiquidityPool`](classes/StandardLiquidityPool.md) \| [`StableLiquidityPool`](classes/StableLiquidityPool.md) \| [`StableLiquidityMetaPool`](classes/StableLiquidityMetaPool.md) + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:6](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L6) + +___ + +### LoanAction + +Ƭ **LoanAction**: ``"lend"`` \| ``"withdraw"`` \| ``"borrow"`` \| ``"repay"`` + +#### Defined in + +[src/types/loans.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L19) + +___ + +### LpCurrency + +Ƭ **LpCurrency**: [`StandardLpToken`](modules.md#standardlptoken) \| [`StableLpToken`](modules.md#stablelptoken) + +#### Defined in + +[src/types/currency.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L51) + +___ + +### MerkleProof + +Ƭ **MerkleProof**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `blockHeader` | [`BlockHeader`](modules.md#blockheader) | +| `flagBits` | `boolean`[] | +| `hashes` | [`HexString`](modules.md#hexstring)[] | +| `transactionsCount` | `number` | + +#### Defined in + +[src/types/bitcoin.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L15) + +___ + +### MultiPath + +Ƭ **MultiPath**: [`MultiPathElement`](modules.md#multipathelement)[] + +#### Defined in + +[src/parachain/amm/trade/types.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L57) + +___ + +### MultiPathElement + +Ƭ **MultiPathElement**: [`MultiPathElementStandard`](interfaces/MultiPathElementStandard.md) \| [`MultiPathElementStable`](modules.md#multipathelementstable) + +#### Defined in + +[src/parachain/amm/trade/types.ts:46](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L46) + +___ + +### MultiPathElementStable + +Ƭ **MultiPathElementStable**: [`MultiPathElementStablePlain`](interfaces/MultiPathElementStablePlain.md) \| [`MultiPathElementStableMeta`](interfaces/MultiPathElementStableMeta.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L45) + +___ + +### PHANTOM\_DEFAULT + +Ƭ **PHANTOM\_DEFAULT**: ``"default"`` + +#### Defined in + +src/interfaces/default/types.ts:153 + +___ + +### PooledCurrencies + +Ƭ **PooledCurrencies**: `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\>[] + +#### Defined in + +[src/parachain/amm/types.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L24) + +___ + +### StableLpToken + +Ƭ **StableLpToken**: `Currency` & { `stableLpToken`: { `poolId`: `number` } } + +#### Defined in + +[src/types/currency.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L48) + +___ + +### StakedBalance + +Ƭ **StakedBalance**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`GovernanceCurrency`](modules.md#governancecurrency-1)\> | +| `endBlock` | `number` | + +#### Defined in + +[src/types/currency.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L67) + +___ + +### StandardLpToken + +Ƭ **StandardLpToken**: `Currency` & { `lpToken`: { `token0`: `StandardLpUnderlyingToken` ; `token1`: `StandardLpUnderlyingToken` } } + +#### Defined in + +[src/types/currency.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L44) + +___ + +### StandardPooledTokenIdentifier + +Ƭ **StandardPooledTokenIdentifier**: `NativeCurrencyIdentifier` \| `ForeignAssetIdentifier` \| `StableLpTokenIdentifier` + +#### Defined in + +[src/types/currency.ts:88](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L88) + +___ + +### TickerToData + +Ƭ **TickerToData**<`T`\>: `Object` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Index signature + +▪ [ticker: `string`]: `T` + +#### Defined in + +[src/types/loans.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L53) + +___ + +### Transaction + +Ƭ **Transaction**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `inputs` | [`TransactionInput`](interfaces/TransactionInput.md)[] | +| `lockAt` | [`TransactionLocktime`](modules.md#transactionlocktime) | +| `outputs` | [`TransactionOutput`](interfaces/TransactionOutput.md)[] | +| `version` | `number` | + +#### Defined in + +[src/types/bitcoin.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L48) + +___ + +### TransactionInputSource + +Ƭ **TransactionInputSource**: ``"coinbase"`` \| { `fromOutput`: [[`HexString`](modules.md#hexstring), `number`] } + +#### Defined in + +[src/types/bitcoin.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L22) + +___ + +### TransactionLocktime + +Ƭ **TransactionLocktime**: { `time`: `number` } \| { `blockHeight`: `number` } + +#### Defined in + +[src/types/bitcoin.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L40) + +___ + +### TxStatus + +Ƭ **TxStatus**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `blockHash?` | `string` | +| `blockHeight?` | `number` | +| `confirmations` | `number` | +| `confirmed` | `boolean` | + +#### Defined in + +[src/types/bitcoin.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L55) + +___ + +### UndercollateralizedPosition + +Ƭ **UndercollateralizedPosition**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `borrowPositions` | [`BorrowPosition`](interfaces/BorrowPosition.md)[] | +| `collateralPositions` | [`CollateralPosition`](interfaces/CollateralPosition.md)[] | +| `shortfall` | `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\> | + +#### Defined in + +[src/types/loans.ts:75](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L75) + +___ + +### VotingCurrency + +Ƭ **VotingCurrency**: typeof [`VotingCurrency`](modules.md#votingcurrency-1)[`number`] + +#### Defined in + +[src/types/currency.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L64) + +[src/types/currency.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L65) + +___ + +### WrappedAmount + +Ƭ **WrappedAmount**: typeof [`WrappedAmount`](modules.md#wrappedamount-1)[`number`] + +#### Defined in + +[src/types/currency.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L58) + +[src/types/currency.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L59) + +___ + +### WrappedCurrency + +Ƭ **WrappedCurrency**: typeof [`WrappedCurrency`](modules.md#wrappedcurrency-1)[`number`] + +#### Defined in + +[src/types/currency.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L55) + +[src/types/currency.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L56) + +___ + +### WrappedIdLiteral + +Ƭ **WrappedIdLiteral**: [`INTERBTC`](enums/CurrencyIdLiteral.md#interbtc) \| [`KBTC`](enums/CurrencyIdLiteral.md#kbtc) + +#### Defined in + +[src/types/currency.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L28) + +## Variables + +### ACCOUNT\_NOT\_SET\_ERROR\_MESSAGE + +• `Const` **ACCOUNT\_NOT\_SET\_ERROR\_MESSAGE**: ``"cannot sign transaction without setting account"`` + +#### Defined in + +[src/utils/constants.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L13) + +___ + +### ATOMIC\_UNIT + +• `Const` **ATOMIC\_UNIT**: ``0`` + +#### Defined in + +[src/utils/currency.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L42) + +___ + +### BLOCK\_TIME\_SECONDS + +• `Const` **BLOCK\_TIME\_SECONDS**: ``12`` + +#### Defined in + +[src/utils/constants.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L17) + +___ + +### FIXEDI128\_SCALING\_FACTOR + +• `Const` **FIXEDI128\_SCALING\_FACTOR**: ``18`` + +#### Defined in + +[src/utils/constants.ts:4](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L4) + +___ + +### GovernanceCurrency + +• `Const` **GovernanceCurrency**: `Currency`[] + +#### Defined in + +[src/types/currency.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L61) + +[src/types/currency.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L62) + +___ + +### IGNORED\_ERROR\_MESSAGES + +• `Const` **IGNORED\_ERROR\_MESSAGES**: `string`[] + +#### Defined in + +[src/utils/constants.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L11) + +___ + +### LOANS\_REWARD\_INDEX\_SCALING\_FACTOR + +• `Const` **LOANS\_REWARD\_INDEX\_SCALING\_FACTOR**: `number` + +#### Defined in + +[src/utils/constants.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L28) + +___ + +### MS\_PER\_YEAR + +• `Const` **MS\_PER\_YEAR**: `Big` + +#### Defined in + +[src/utils/constants.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L15) + +___ + +### PERMILL\_BASE + +• `Const` **PERMILL\_BASE**: ``1000000`` + +#### Defined in + +[src/utils/constants.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L7) + +___ + +### SLEEP\_TIME\_MS + +• `Const` **SLEEP\_TIME\_MS**: ``1000`` + +#### Defined in + +[src/utils/constants.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L19) + +___ + +### STABLE\_POOLS\_APPROXIMATION\_PRECISION + +• `Const` **STABLE\_POOLS\_APPROXIMATION\_PRECISION**: `Big` + +#### Defined in + +[src/utils/constants.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L26) + +___ + +### VotingCurrency + +• `Const` **VotingCurrency**: `Currency`[] + +#### Defined in + +[src/types/currency.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L64) + +[src/types/currency.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L65) + +___ + +### WrappedAmount + +• `Const` **WrappedAmount**: typeof `InterBtcAmount`[] + +#### Defined in + +[src/types/currency.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L58) + +[src/types/currency.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L59) + +___ + +### WrappedCurrency + +• `Const` **WrappedCurrency**: `Currency`[] + +#### Defined in + +[src/types/currency.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L55) + +[src/types/currency.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L56) + +## Functions + +### addHexPrefix + +▸ **addHexPrefix**(`str`): `string` + +Ensure the `0x` hex prefix is present + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/encoding.ts:85](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L85) + +___ + +### addressOrPairAsAccountId + +▸ **addressOrPairAsAccountId**(`api`, `addyOrpair`): `AccountId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `addyOrpair` | `AddressOrPair` | + +#### Returns + +`AccountId` + +#### Defined in + +[src/utils/encoding.ts:222](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L222) + +___ + +### adjustToThreshold + +▸ **adjustToThreshold**(`amount`, `threshold`): `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `threshold` | `Big` | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/utils/loans.ts:36](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L36) + +___ + +### allocateAmountsToVaults + +▸ **allocateAmountsToVaults**(`vaultsWithAvailableAmounts`, `amountToAllocate`): `Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\>\> + +Given a list of vaults with availabilities (e.g. collateral for issue, tokens +for redeem) and an amount to allocate, selects one or more vaults to fulfil +the request. +If the amount cannot be allocated by a single vault, greedily selects the vault +with highest available amount and tries again for the remainder. If at leaast +one vault can fulfil a request alone, a random one among them is selected. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultsWithAvailableAmounts` | `Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | +| `amountToAllocate` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\>\> + +#### Defined in + +[src/utils/issueRedeem.ts:81](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L81) + +___ + +### atomicToBaseAmount + +▸ **atomicToBaseAmount**(`atomicAmount`, `currency`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `atomicAmount` | `BigSource` | +| `currency` | `Currency` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/currency.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L48) + +___ + +### btcAddressFromParams + +▸ **btcAddressFromParams**(`registry`, `params`): `BitcoinAddress` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `registry` | `TypeRegistry` | +| `params` | { `p2pkh`: `string` \| `H160` } \| { `p2sh`: `string` \| `H160` } \| { `p2wpkhv0`: `string` \| `H160` } | + +#### Returns + +`BitcoinAddress` + +#### Defined in + +[src/utils/bitcoin.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L82) + +___ + +### bufferToHexString + +▸ **bufferToHexString**(`buffer`): [`HexString`](modules.md#hexstring) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `buffer` | `Buffer` | + +#### Returns + +[`HexString`](modules.md#hexstring) + +#### Defined in + +[src/utils/encoding.ts:401](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L401) + +___ + +### calculateAnnualizedRewardAmount + +▸ **calculateAnnualizedRewardAmount**(`amountPerBlock`, `blockTimeMs`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amountPerBlock` | `Big` | +| `blockTimeMs` | `number` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/rewards.ts:4](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/rewards.ts#L4) + +___ + +### calculateBorrowLimit + +▸ **calculateBorrowLimit**(`totalBorrowedAmount`, `totalCollateralThresholdAdjustedAmount`): `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `totalBorrowedAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `totalCollateralThresholdAdjustedAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/utils/loans.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L39) + +___ + +### calculateBorrowLimitBtcChangeFactory + +▸ **calculateBorrowLimitBtcChangeFactory**(`loanAssets`, `totalBorrowedBtc`, `totalCollateralThresholdAdjustedCollateralBtc`): (`action`: [`LoanAction`](modules.md#loanaction), `amount`: `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\>) => `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `loanAssets` | [`TickerToData`](modules.md#tickertodata)<[`LoanAsset`](interfaces/LoanAsset.md)\> | +| `totalBorrowedBtc` | `MonetaryAmount`<`Currency`\> | +| `totalCollateralThresholdAdjustedCollateralBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`fn` + +▸ (`action`, `amount`): `MonetaryAmount`<`Currency`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +##### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L76) + +___ + +### calculateCollateralAmountBtc + +▸ **calculateCollateralAmountBtc**(`action`, `currentCollateralAmountBtc`, `actionAmountBtc`): `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `currentCollateralAmountBtc` | `MonetaryAmount`<`Currency`\> | +| `actionAmountBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L21) + +___ + +### calculateLtv + +▸ **calculateLtv**(`collateralAmount`, `borrowedAmount`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `borrowedAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/loans.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L65) + +___ + +### calculateLtvAndThresholdsChangeFactory + +▸ **calculateLtvAndThresholdsChangeFactory**(`loanAssets`, `totalBorrowedBtc`, `totalCollateralBtc`, `totalCollateralThresholdAdjustedCollateralBtc`, `totalLiquidationThresholdAdjustedCollateralBtc`): (`action`: [`LoanAction`](modules.md#loanaction), `amount`: `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\>) => { `collateralThresholdWeightedAverage`: `Big` ; `liquidationThresholdWeightedAverage`: `Big` ; `ltv`: `Big` } + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `loanAssets` | [`TickerToData`](modules.md#tickertodata)<[`LoanAsset`](interfaces/LoanAsset.md)\> | +| `totalBorrowedBtc` | `MonetaryAmount`<`Currency`\> | +| `totalCollateralBtc` | `MonetaryAmount`<`Currency`\> | +| `totalCollateralThresholdAdjustedCollateralBtc` | `MonetaryAmount`<`Currency`\> | +| `totalLiquidationThresholdAdjustedCollateralBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`fn` + +▸ (`action`, `amount`): `Object` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +##### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `collateralThresholdWeightedAverage` | `Big` | +| `liquidationThresholdWeightedAverage` | `Big` | +| `ltv` | `Big` | + +#### Defined in + +[src/utils/loans.ts:98](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L98) + +___ + +### calculateThreshold + +▸ **calculateThreshold**(`collateralAmount`, `thresholdAdjustedCollateralAmount`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `thresholdAdjustedCollateralAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/loans.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L55) + +___ + +### calculateTotalBorrowedBtcChange + +▸ **calculateTotalBorrowedBtcChange**(`action`, `currentTotalBorrowedBtc`, `actionAmountBtc`): `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `currentTotalBorrowedBtc` | `MonetaryAmount`<`Currency`\> | +| `actionAmountBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:6](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L6) + +___ + +### computeLazyDistribution + +▸ **computeLazyDistribution**(`stake`, `perToken`, `tally`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stake` | `Big` | +| `perToken` | `Big` | +| `tally` | `Big` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/currency.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L44) + +___ + +### computePriceImpact + +▸ **computePriceImpact**(`path`, `inputAmount`, `outputAmount`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `path` | [`MultiPath`](modules.md#multipath) | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `outputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/trade/utils.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/utils.ts#L64) + +___ + +### convertMoment + +▸ **convertMoment**(`moment`): `Date` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `moment` | `Moment` | + +#### Returns + +`Date` + +#### Defined in + +[src/utils/encoding.ts:335](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L335) + +___ + +### createAPIRegistry + +▸ **createAPIRegistry**(): `TypeRegistry` + +#### Returns + +`TypeRegistry` + +#### Defined in + +[src/factory.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L62) + +___ + +### createExchangeRateOracleKey + +▸ **createExchangeRateOracleKey**(`api`, `collateralCurrency`): `InterbtcPrimitivesOracleKey` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `collateralCurrency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +`InterbtcPrimitivesOracleKey` + +#### Defined in + +[src/utils/currency.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L76) + +___ + +### createFeeEstimationOracleKey + +▸ **createFeeEstimationOracleKey**(`api`): `InterbtcPrimitivesOracleKey` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Returns + +`InterbtcPrimitivesOracleKey` + +#### Defined in + +[src/utils/currency.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L72) + +___ + +### createInterBtcApi + +▸ **createInterBtcApi**(`endpoint`, `network?`, `account?`, `autoConnect?`): `Promise`<[`InterBtcApi`](interfaces/InterBtcApi.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `endpoint` | `string` | `undefined` | +| `network` | [`BitcoinNetwork`](modules.md#bitcoinnetwork) | `"mainnet"` | +| `account?` | `AddressOrPair` | `undefined` | +| `autoConnect?` | `number` \| ``false`` | `undefined` | + +#### Returns + +`Promise`<[`InterBtcApi`](interfaces/InterBtcApi.md)\> + +#### Defined in + +[src/factory.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L44) + +___ + +### createProvider + +▸ **createProvider**(`endpoint`, `autoConnect?`): `ProviderInterface` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endpoint` | `string` | +| `autoConnect?` | `number` \| ``false`` | + +#### Returns + +`ProviderInterface` + +#### Defined in + +[src/factory.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L14) + +___ + +### createSubstrateAPI + +▸ **createSubstrateAPI**(`endpoint`, `autoConnect?`, `noInitWarn?`): `Promise`<`ApiPromise`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endpoint` | `string` | +| `autoConnect?` | `number` \| ``false`` | +| `noInitWarn?` | `boolean` | + +#### Returns + +`Promise`<`ApiPromise`\> + +#### Defined in + +[src/factory.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L24) + +___ + +### currencyIdToMonetaryCurrency + +▸ **currencyIdToMonetaryCurrency**(`api`, `currencyId`): `Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `currencyId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | + +#### Returns + +`Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/utils/currency.ts:185](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L185) + +___ + +### decodeBtcAddress + +▸ **decodeBtcAddress**(`address`, `network`): { `p2pkh`: `string` } \| { `p2sh`: `string` } \| { `p2wpkhv0`: `string` } \| { `p2wshv0`: `string` } + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `network` | `Network` | + +#### Returns + +{ `p2pkh`: `string` } \| { `p2sh`: `string` } \| { `p2wpkhv0`: `string` } \| { `p2wshv0`: `string` } + +#### Defined in + +[src/utils/bitcoin.ts:92](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L92) + +___ + +### decodeBytesAsString + +▸ **decodeBytesAsString**(`bytes`): `string` + +Convert Bytes to a string. Will remove `0x` prefix if present. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bytes` | `Bytes` | Bytes to decode | + +#### Returns + +`string` + +the decoded string + +#### Defined in + +[src/utils/encoding.ts:133](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L133) + +___ + +### decodeFixedPointType + +▸ **decodeFixedPointType**(`x`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `x` | [`SignedFixedPoint`](interfaces/SignedFixedPoint.md) \| [`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/encoding.ts:122](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L122) + +___ + +### decodeNumberOrHex + +▸ **decodeNumberOrHex**(`value`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | [`NumberOrHex`](interfaces/NumberOrHex.md) | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/encoding.ts:386](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L386) + +___ + +### decodePermill + +▸ **decodePermill**(`amount`, `inPercentage?`): `Big` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `amount` | `Permill` | `undefined` | +| `inPercentage` | `boolean` | `false` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/encoding.ts:378](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L378) + +___ + +### decodeRpcVaultId + +▸ **decodeRpcVaultId**(`api`, `vaultId`): `Promise`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultId` | [`VaultId`](interfaces/VaultId.md) | + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md)\> + +#### Defined in + +[src/utils/encoding.ts:191](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L191) + +___ + +### encodeBtcAddress + +▸ **encodeBtcAddress**(`address`, `network`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `BitcoinAddress` | +| `network` | `Network` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/bitcoin.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L30) + +___ + +### encodeSwapParamsForStandardAndStablePools + +▸ **encodeSwapParamsForStandardAndStablePools**(`api`, `trade`, `minimumAmountOut`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `trade` | [`Trade`](classes/Trade.md) | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `amountIn` | `string` | +| `amountOutMin` | `string` | +| `path` | ({ `Stable`: { `basePoolId`: `number` ; `fromCurrency`: [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) ; `mode`: `string` ; `poolId`: `number` ; `toCurrency`: [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) } } \| { `Normal`: [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md)[] })[] | + +#### Defined in + +[src/parachain/amm/encoding.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/encoding.ts#L25) + +___ + +### encodeSwapParamsForStandardPoolsOnly + +▸ **encodeSwapParamsForStandardPoolsOnly**(`api`, `trade`, `minimumAmountOut`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `trade` | [`Trade`](classes/Trade.md) | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `amountIn` | `string` | +| `amountOutMin` | `string` | +| `path` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md)[] | + +#### Defined in + +[src/parachain/amm/encoding.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/encoding.ts#L8) + +___ + +### encodeUnsignedFixedPoint + +▸ **encodeUnsignedFixedPoint**(`api`, `x`): [`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `x` | `Big` | + +#### Returns + +[`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) + +#### Defined in + +[src/utils/encoding.ts:137](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L137) + +___ + +### encodeVaultId + +▸ **encodeVaultId**(`api`, `id`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `id` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/utils/encoding.ts:343](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L343) + +___ + +### ensureHashEncoded + +▸ **ensureHashEncoded**(`api`, `hash`): `H256` + +Ensure a hash value is an encoded H256 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | The polkadot API promise used to encode if necessary | +| `hash` | `string` \| `H256` | The either H256 or string encoded hash | + +#### Returns + +`H256` + +#### Defined in + +[src/utils/encoding.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L94) + +___ + +### filterNonEmptyPools + +▸ **filterNonEmptyPools**(`pools`): [`LiquidityPool`](modules.md#liquiditypool)[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pools` | [`LiquidityPool`](modules.md#liquiditypool)[] | + +#### Returns + +[`LiquidityPool`](modules.md#liquiditypool)[] + +#### Defined in + +[src/parachain/amm/liquidity-pool/utils.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/utils.ts#L16) + +___ + +### findBestTradeRecursively + +▸ **findBestTradeRecursively**(`inputAmount`, `outputCurrency`, `pairs`, `hopLimit`, `path?`, `initialInputAmount?`): ``null`` \| [`Trade`](classes/Trade.md) + +Recursive function to find best trade path for provided trading pairs, +input amount, output currencies and limited amount of hops between +pools. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | `undefined` | Input currency amount to be exchanged. | +| `outputCurrency` | [`CurrencyExt`](modules.md#currencyext) | `undefined` | Output currency to be received. | +| `pairs` | [`TradingPair`](interfaces/TradingPair.md)[] | `undefined` | Array of all trading pairs to include in search. | +| `hopLimit` | `number` | `undefined` | Maximum number of hops between liquidity pools. | +| `path` | [`MultiPath`](modules.md#multipath) | `[]` | Recursively generated parameter containing current trading path. | +| `initialInputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | `inputAmount` | Initial input amount. | + +#### Returns + +``null`` \| [`Trade`](classes/Trade.md) + +#### Defined in + +[src/parachain/amm/utils.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/utils.ts#L20) + +___ + +### getAPITypes + +▸ **getAPITypes**(): `RegistryTypes` + +#### Returns + +`RegistryTypes` + +#### Defined in + +[src/factory.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L54) + +___ + +### getAllTradingPairs + +▸ **getAllTradingPairs**(`pools`): [`TradingPair`](interfaces/TradingPair.md)[] + +Get all trading pairs based on provided pools. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pools` | [`LiquidityPool`](modules.md#liquiditypool)[] | + +#### Returns + +[`TradingPair`](interfaces/TradingPair.md)[] + +All trading pairs. + +#### Defined in + +[src/parachain/amm/liquidity-pool/utils.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/utils.ts#L25) + +___ + +### getBitcoinNetwork + +▸ **getBitcoinNetwork**(`network?`): `Network` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `network` | [`BitcoinNetwork`](modules.md#bitcoinnetwork) | `"mainnet"` | + +#### Returns + +`Network` + +#### Defined in + +[src/interbtc-api.ts:32](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L32) + +___ + +### getCollateralCurrencies + +▸ **getCollateralCurrencies**(`api`): `Promise`<[`CollateralCurrencyExt`](modules.md#collateralcurrencyext)[]\> + +Get all collateral currencies (tokens as well as foreign assets). + +Will return all collateral currencies for which the parachain has a system collateral ceiling value +greater than zero. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | ApiPromise instance to query the parachain | + +#### Returns + +`Promise`<[`CollateralCurrencyExt`](modules.md#collateralcurrencyext)[]\> + +An array of collateral currencies. + +#### Defined in + +[src/utils/currency.ts:103](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L103) + +___ + +### getCurrencyIdentifier + +▸ **getCurrencyIdentifier**(`currency`): [`CurrencyIdentifier`](modules.md#currencyidentifier) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +[`CurrencyIdentifier`](modules.md#currencyidentifier) + +#### Defined in + +[src/utils/currency.ts:166](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L166) + +___ + +### getForeignAssetFromId + +▸ **getForeignAssetFromId**(`api`, `id`): `Promise`<[`ForeignAsset`](modules.md#foreignasset)\> + +Get foreign asset by its id. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `id` | `number` \| `u32` | The id of the foreign asset. | + +#### Returns + +`Promise`<[`ForeignAsset`](modules.md#foreignasset)\> + +The foreign asset. + +#### Defined in + +[src/utils/currency.ts:233](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L233) + +___ + +### getIssueRequestsFromExtrinsicResult + +▸ **getIssueRequestsFromExtrinsicResult**(`interBtcApi`, `result`): `Promise`<[`Issue`](interfaces/Issue.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | +| `result` | `ISubmittableResult` | + +#### Returns + +`Promise`<[`Issue`](interfaces/Issue.md)[]\> + +#### Defined in + +[src/utils/issueRedeem.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L55) + +___ + +### getRPCTypes + +▸ **getRPCTypes**(): `Record`<`string`, `Record`<`string`, `DefinitionRpc` \| `DefinitionRpcSub`\>\> + +#### Returns + +`Record`<`string`, `Record`<`string`, `DefinitionRpc` \| `DefinitionRpcSub`\>\> + +#### Defined in + +[src/factory.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L58) + +___ + +### getRedeemRequestsFromExtrinsicResult + +▸ **getRedeemRequestsFromExtrinsicResult**(`interBtcApi`, `result`): `Promise`<[`Redeem`](interfaces/Redeem.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | +| `result` | `ISubmittableResult` | + +#### Returns + +`Promise`<[`Redeem`](interfaces/Redeem.md)[]\> + +#### Defined in + +[src/utils/issueRedeem.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L64) + +___ + +### getRequestIdsFromEvents + +▸ **getRequestIdsFromEvents**(`events`, `eventToFind`, `api`): `Hash`[] + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `events` | `EventRecord`[] | The EventRecord array returned after sending a transaction | +| `eventToFind` | `AugmentedEvent`<`ApiTypes`, `AnyTuple`\> | - | +| `api` | `ApiPromise` | - | + +#### Returns + +`Hash`[] + +The id associated with the transaction. If the EventRecord array does not +contain required events, the function throws an error. + +#### Defined in + +[src/utils/issueRedeem.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L37) + +___ + +### getRuntimeDefs + +▸ **getRuntimeDefs**(): `DefinitionsCall` + +#### Returns + +`DefinitionsCall` + +#### Defined in + +[src/factory.ts:125](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L125) + +___ + +### getSS58Prefix + +▸ **getSS58Prefix**(`api`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Returns + +`number` + +#### Defined in + +[src/utils/encoding.ts:374](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L374) + +___ + +### getStableLpTokenFromCurrencyId + +▸ **getStableLpTokenFromCurrencyId**(`api`, `currencyId`): `Promise`<[`StableLpToken`](modules.md#stablelptoken)\> + +Get stable LP token currency lib type from currencyId primitive. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `currencyId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | Id of stable LP token. | + +#### Returns + +`Promise`<[`StableLpToken`](modules.md#stablelptoken)\> + +Lib type currency object for stable LP token. + +#### Defined in + +[src/utils/currency.ts:308](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L308) + +___ + +### getStableSwapOutputAmount + +▸ **getStableSwapOutputAmount**(`path`, `inputAmount`): `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `path` | [`MultiPathElementStable`](modules.md#multipathelementstable) | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/liquidity-pool/utils.ts:177](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/utils.ts#L177) + +___ + +### getStandardLpTokenFromCurrencyId + +▸ **getStandardLpTokenFromCurrencyId**(`api`, `currencyId`): `Promise`<[`StandardLpToken`](modules.md#standardlptoken)\> + +Get standard LP token currency lib type from currencyId primitive. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `currencyId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | Id of standard LP token. | + +#### Returns + +`Promise`<[`StandardLpToken`](modules.md#standardlptoken)\> + +Lib type currency object for standard LP token. + +#### Defined in + +[src/utils/currency.ts:277](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L277) + +___ + +### getTotalAmountBtc + +▸ **getTotalAmountBtc**(`positions`, `loanAssets`): `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `positions` | [`LoanPosition`](interfaces/LoanPosition.md)[] | +| `loanAssets` | [`TickerToData`](modules.md#tickertodata)<[`LoanAsset`](interfaces/LoanAsset.md)\> | + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L45) + +___ + +### getTxProof + +▸ **getTxProof**(`electrsAPI`, `userTxId`): `Promise`<{ `coinbaseProof`: `PartialTxProof` ; `userTxProof`: `PartialTxProof` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `electrsAPI` | [`ElectrsAPI`](interfaces/ElectrsAPI.md) | +| `userTxId` | `string` | + +#### Returns + +`Promise`<{ `coinbaseProof`: `PartialTxProof` ; `userTxProof`: `PartialTxProof` }\> + +#### Defined in + +[src/utils/bitcoin.ts:181](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L181) + +___ + +### getUnderlyingCurrencyFromLendTokenId + +▸ **getUnderlyingCurrencyFromLendTokenId**(`api`, `lendTokenId`): `Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +Get underlying currency of lend token id, + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `lendTokenId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | Currency id of the lend token to get currency from | + +#### Returns + +`Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +Underlying CurrencyExt for provided lend token + +#### Defined in + +[src/utils/currency.ts:260](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L260) + +___ + +### intoAccountTruncating + +▸ **intoAccountTruncating**(`api`, `palletId`): `AccountId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `palletId` | `Uint8Array` | + +#### Returns + +`AccountId` + +#### Defined in + +[src/utils/encoding.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L47) + +___ + +### isCurrency + +▸ **isCurrency**(`currencyExt`): currencyExt is Currency + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is Currency + +#### Defined in + +[src/utils/currency.ts:138](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L138) + +___ + +### isCurrencyEqual + +▸ **isCurrencyEqual**(`currency`, `otherCurrency`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | +| `otherCurrency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +`boolean` + +#### Defined in + +[src/utils/currency.ts:147](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L147) + +___ + +### isForeignAsset + +▸ **isForeignAsset**(`currencyExt`): currencyExt is ForeignAsset + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is ForeignAsset + +#### Defined in + +[src/utils/currency.ts:118](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L118) + +___ + +### isLendToken + +▸ **isLendToken**(`currencyExt`): currencyExt is LendToken + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is LendToken + +#### Defined in + +[src/utils/currency.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L124) + +___ + +### isStableLpToken + +▸ **isStableLpToken**(`currencyExt`): currencyExt is StableLpToken + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is StableLpToken + +#### Defined in + +[src/utils/currency.ts:134](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L134) + +___ + +### isStableMetaMultiPathElement + +▸ **isStableMetaMultiPathElement**(`pathElement`): pathElement is MultiPathElementStableMeta + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStableMeta + +#### Defined in + +[src/parachain/amm/trade/types.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L52) + +___ + +### isStableMetaPool + +▸ **isStableMetaPool**(`pool`): pool is StableLiquidityMetaPool + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pool` | [`LiquidityPool`](modules.md#liquiditypool) | + +#### Returns + +pool is StableLiquidityMetaPool + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L11) + +___ + +### isStableMultiPathElement + +▸ **isStableMultiPathElement**(`pathElement`): pathElement is MultiPathElementStable + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStable + +#### Defined in + +[src/parachain/amm/trade/types.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L50) + +___ + +### isStablePlainMultiPathElement + +▸ **isStablePlainMultiPathElement**(`pathElement`): pathElement is MultiPathElementStablePlain + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStablePlain + +#### Defined in + +[src/parachain/amm/trade/types.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L54) + +___ + +### isStablePool + +▸ **isStablePool**(`pool`): pool is StableLiquidityPool \| StableLiquidityMetaPool + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pool` | [`LiquidityPool`](modules.md#liquiditypool) | + +#### Returns + +pool is StableLiquidityPool \| StableLiquidityMetaPool + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L9) + +___ + +### isStandardLpToken + +▸ **isStandardLpToken**(`currencyExt`): currencyExt is StandardLpToken + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is StandardLpToken + +#### Defined in + +[src/utils/currency.ts:130](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L130) + +___ + +### isStandardMultiPathElement + +▸ **isStandardMultiPathElement**(`pathElement`): pathElement is MultiPathElementStandard + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStandard + +#### Defined in + +[src/parachain/amm/trade/types.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L48) + +___ + +### isStandardPool + +▸ **isStandardPool**(`pool`): pool is StandardLiquidityPool + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pool` | [`LiquidityPool`](modules.md#liquiditypool) | + +#### Returns + +pool is StandardLiquidityPool + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L8) + +___ + +### issueAndRedeem + +▸ **issueAndRedeem**(`InterBtcApi`, `bitcoinCoreClient`, `account`, `vaultId?`, `issueAmount?`, `redeemAmount?`, `autoExecuteIssue?`, `autoExecuteRedeem?`, `triggerRefund?`, `atomic?`): `Promise`<[[`Issue`](interfaces/Issue.md), [`Redeem`](interfaces/Redeem.md)]\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `InterBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | `undefined` | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | `undefined` | +| `account` | `KeyringPair` | `undefined` | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `issueAmount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `redeemAmount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `autoExecuteIssue` | `boolean` | `true` | +| `autoExecuteRedeem` | [`ExecuteRedeem`](enums/ExecuteRedeem.md) | `ExecuteRedeem.Auto` | +| `triggerRefund` | `boolean` | `false` | +| `atomic` | `boolean` | `true` | + +#### Returns + +`Promise`<[[`Issue`](interfaces/Issue.md), [`Redeem`](interfaces/Redeem.md)]\> + +#### Defined in + +[src/utils/issueRedeem.ts:255](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L255) + +___ + +### issueSingle + +▸ **issueSingle**(`interBtcApi`, `bitcoinCoreClient`, `issuingAccount`, `amount`, `vaultId?`, `autoExecute?`, `triggerRefund?`, `atomic?`): `Promise`<[`IssueResult`](interfaces/IssueResult.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | `undefined` | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | `undefined` | +| `issuingAccount` | `KeyringPair` | `undefined` | +| `amount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `autoExecute` | `boolean` | `true` | +| `triggerRefund` | `boolean` | `false` | +| `atomic` | `boolean` | `true` | + +#### Returns + +`Promise`<[`IssueResult`](interfaces/IssueResult.md)\> + +#### Defined in + +[src/utils/issueRedeem.ts:121](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L121) + +___ + +### monetaryAmountToRawString + +▸ **monetaryAmountToRawString**(`amount`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`string` + +#### Defined in + +[src/utils/encoding.ts:393](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L393) + +___ + +### newAccountId + +▸ **newAccountId**(`api`, `accountId`): `AccountId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `accountId` | `string` | + +#### Returns + +`AccountId` + +#### Defined in + +[src/utils/encoding.ts:176](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L176) + +___ + +### newCollateralBTCExchangeRate + +▸ **newCollateralBTCExchangeRate**(`rate`, `counterCurrency`, `useBaseUnits?`): `ExchangeRate`<`Bitcoin`, `Currency`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `rate` | `Big` | `undefined` | +| `counterCurrency` | `Currency` | `undefined` | +| `useBaseUnits` | `boolean` | `false` | + +#### Returns + +`ExchangeRate`<`Bitcoin`, `Currency`\> + +#### Defined in + +[src/utils/currency.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L61) + +___ + +### newCurrencyId + +▸ **newCurrencyId**(`api`, `currency`): `InterbtcPrimitivesCurrencyId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +`InterbtcPrimitivesCurrencyId` + +#### Defined in + +[src/utils/encoding.ts:213](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L213) + +___ + +### newExtrinsicStatus + +▸ **newExtrinsicStatus**(`api`, `type`): `ExtrinsicStatus` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `type` | ``"Ready"`` \| ``"Future"`` \| ``"Broadcast"`` \| ``"InBlock"`` \| ``"Retracted"`` \| ``"FinalityTimeout"`` \| ``"Finalized"`` \| ``"Usurped"`` \| ``"Dropped"`` \| ``"Invalid"`` | + +#### Returns + +`ExtrinsicStatus` + +#### Defined in + +[src/utils/encoding.ts:397](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L397) + +___ + +### newForeignAssetId + +▸ **newForeignAssetId**(`api`, `id`): `u32` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `id` | `number` | + +#### Returns + +`u32` + +#### Defined in + +[src/utils/encoding.ts:218](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L218) + +___ + +### newMonetaryAmount + +▸ **newMonetaryAmount**<`CurrencyT`\>(`amount`, `currency`, `base?`): `MonetaryAmount`<`CurrencyT`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `CurrencyT` | extends [`CurrencyExt`](modules.md#currencyext) | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `amount` | `BigSource` | `undefined` | +| `currency` | `CurrencyT` | `undefined` | +| `base` | `boolean` | `false` | + +#### Returns + +`MonetaryAmount`<`CurrencyT`\> + +#### Defined in + +[src/utils/currency.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L52) + +___ + +### newVaultCurrencyPair + +▸ **newVaultCurrencyPair**(`api`, `collateralCurrency`, `wrappedCurrency`): `InterbtcPrimitivesVaultCurrencyPair` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `collateralCurrency` | [`CollateralCurrencyExt`](modules.md#collateralcurrencyext) | +| `wrappedCurrency` | `Currency` | + +#### Returns + +`InterbtcPrimitivesVaultCurrencyPair` + +#### Defined in + +[src/utils/encoding.ts:200](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L200) + +___ + +### newVaultId + +▸ **newVaultId**(`api`, `accountId`, `collateralCurrency`, `wrappedCurrency`): [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `accountId` | `string` | +| `collateralCurrency` | [`CollateralCurrencyExt`](modules.md#collateralcurrencyext) | +| `wrappedCurrency` | `Currency` | + +#### Returns + +[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/utils/encoding.ts:180](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L180) + +___ + +### parseEscrowLockedBalance + +▸ **parseEscrowLockedBalance**(`governanceCurrency`, `escrowLockedBalance`): [`StakedBalance`](modules.md#stakedbalance) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `governanceCurrency` | `Currency` | +| `escrowLockedBalance` | `EscrowLockedBalance` | + +#### Returns + +[`StakedBalance`](modules.md#stakedbalance) + +#### Defined in + +[src/types/currency.ts:133](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L133) + +___ + +### parseIssueRequest + +▸ **parseIssueRequest**(`api`, `vaultsAPI`, `req`, `network`, `id`): `Promise`<[`Issue`](interfaces/Issue.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultsAPI` | [`VaultsAPI`](interfaces/VaultsAPI.md) | +| `req` | `InterbtcPrimitivesIssueIssueRequest` | +| `network` | `Network` | +| `id` | `string` \| `H256` | + +#### Returns + +`Promise`<[`Issue`](interfaces/Issue.md)\> + +#### Defined in + +[src/utils/encoding.ts:250](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L250) + +___ + +### parseOrmlTokensAccountData + +▸ **parseOrmlTokensAccountData**(`data`, `currency`): [`ChainBalance`](classes/ChainBalance.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `OrmlTokensAccountData` | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +[`ChainBalance`](classes/ChainBalance.md) + +#### Defined in + +[src/types/currency.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L124) + +___ + +### parseRedeemRequest + +▸ **parseRedeemRequest**(`api`, `vaultsAPI`, `req`, `network`, `id`, `redeemPeriod`, `activeBlockCount`): `Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultsAPI` | [`VaultsAPI`](interfaces/VaultsAPI.md) | +| `req` | `InterbtcPrimitivesRedeemRedeemRequest` | +| `network` | `Network` | +| `id` | `string` \| `H256` | +| `redeemPeriod` | `number` | +| `activeBlockCount` | `number` | + +#### Returns + +`Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Defined in + +[src/utils/encoding.ts:308](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L308) + +___ + +### parseRedeemRequestStatus + +▸ **parseRedeemRequestStatus**(`req`, `redeemPeriod`, `activeBlockCount`): [`RedeemStatus`](enums/RedeemStatus.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `req` | `InterbtcPrimitivesRedeemRedeemRequest` | +| `redeemPeriod` | `number` | +| `activeBlockCount` | `number` | + +#### Returns + +[`RedeemStatus`](enums/RedeemStatus.md) + +#### Defined in + +[src/utils/encoding.ts:278](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L278) + +___ + +### parseReplaceRequest + +▸ **parseReplaceRequest**(`api`, `req`, `network`, `wrappedCurrency`, `id`): `Promise`<[`ReplaceRequestExt`](interfaces/ReplaceRequestExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `req` | `InterbtcPrimitivesReplaceReplaceRequest` | +| `network` | `Network` | +| `wrappedCurrency` | `Currency` | +| `id` | `string` \| `H256` | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](interfaces/ReplaceRequestExt.md)\> + +#### Defined in + +[src/utils/encoding.ts:227](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L227) + +___ + +### parseSystemVault + +▸ **parseSystemVault**(`api`, `vault`, `wrappedCurrency`, `collateralCurrency`): `Promise`<[`SystemVaultExt`](interfaces/SystemVaultExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vault` | `VaultRegistrySystemVault` | +| `wrappedCurrency` | `Currency` | +| `collateralCurrency` | [`CollateralCurrencyExt`](modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<[`SystemVaultExt`](interfaces/SystemVaultExt.md)\> + +#### Defined in + +[src/utils/encoding.ts:158](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L158) + +___ + +### queryNominationsMap + +▸ **queryNominationsMap**(`api`, `map`, `vaultId`): `Promise`<`number` \| `undefined`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `map` | `Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `number`\> | +| `vaultId` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | + +#### Returns + +`Promise`<`number` \| `undefined`\> + +#### Defined in + +[src/utils/encoding.ts:361](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L361) + +___ + +### redeem + +▸ **redeem**(`interBtcApi`, `bitcoinCoreClient`, `redeemingAccount`, `amount`, `vaultId?`, `autoExecute?`, `atomic?`, `timeout?`): `Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | `undefined` | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | `undefined` | +| `redeemingAccount` | `KeyringPair` | `undefined` | +| `amount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `autoExecute` | [`ExecuteRedeem`](enums/ExecuteRedeem.md) | `ExecuteRedeem.Auto` | +| `atomic` | `boolean` | `true` | +| `timeout` | `number` | `undefined` | + +#### Returns + +`Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Defined in + +[src/utils/issueRedeem.ts:211](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L211) + +___ + +### reverseEndianness + +▸ **reverseEndianness**(`bytes`): `Uint8Array` + +Converts endianness of a Uint8Array + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bytes` | `Uint8Array` | Uint8Array, to be converted LE<>BE | + +#### Returns + +`Uint8Array` + +#### Defined in + +[src/utils/encoding.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L55) + +___ + +### reverseEndiannessHex + +▸ **reverseEndiannessHex**(`hex`): `string` + +Reverse the endianness of the given hex string + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hex` | `string` | + +#### Returns + +`string` + +**`Dev`** + +Will remove `0x` prefix if present + +#### Defined in + +[src/utils/encoding.ts:107](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L107) + +___ + +### setRawStorage + +▸ **setRawStorage**(`api`, `key`, `value`, `account`, `isLittleEndian?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | `undefined` | +| `key` | `string` | `undefined` | +| `value` | `Codec` | `undefined` | +| `account` | `AddressOrPair` | `undefined` | +| `isLittleEndian` | `boolean` | `true` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/storage.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/storage.ts#L8) + +___ + +### setStorageAtKey + +▸ **setStorageAtKey**(`api`, `key`, `data`, `sudoAccount`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `key` | `string` | +| `data` | \`0x${string}\` | +| `sudoAccount` | `AddressOrPair` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/storage.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/storage.ts#L18) + +___ + +### sleep + +▸ **sleep**(`ms`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ms` | `number` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/constants.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L21) + +___ + +### storageKeyToNthInner + +▸ **storageKeyToNthInner**<`T`\>(`s`, `n?`): `T` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `Codec` | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `s` | `StorageKey`<`T`[]\> | `undefined` | +| `n` | `number` | `0` | + +#### Returns + +`T` + +#### Defined in + +[src/utils/encoding.ts:145](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L145) + +___ + +### stripHexPrefix + +▸ **stripHexPrefix**(`str`): `string` + +Remove the `0x` hex prefix if present + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/encoding.ts:77](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L77) + +___ + +### toVoting + +▸ **toVoting**(`governanceCurrency`): `Currency` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `governanceCurrency` | `Currency` | + +#### Returns + +`Currency` + +#### Defined in + +[src/utils/currency.ts:84](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L84) + +___ + +### tokenSymbolToCurrency + +▸ **tokenSymbolToCurrency**(`tokenSymbol`): `Currency` + +A method that will only try to find a hard-coded currencies. +Only for use when we are certain the currency is not a foreign asset. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `tokenSymbol` | [`InterbtcPrimitivesTokenSymbol`](interfaces/InterbtcPrimitivesTokenSymbol.md) | the InterbtcPrimitivesTokenSymbol to look up | + +#### Returns + +`Currency` + +#### Defined in + +[src/utils/currency.ts:211](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L211) + +___ + +### uint8ArrayToString + +▸ **uint8ArrayToString**(`bytes`): `string` + +Converts a Uint8Array to string + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bytes` | `Uint8Array` | + +#### Returns + +`string` + +**`Dev`** + +Will remove `0x` prefix if present + +#### Defined in + +[src/utils/encoding.ts:118](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L118) + +___ + +### unwrapRawExchangeRate + +▸ **unwrapRawExchangeRate**(`option`): [`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) \| `undefined` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `option` | `Option`<[`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md)\> | + +#### Returns + +[`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) \| `undefined` + +#### Defined in + +[src/utils/encoding.ts:339](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L339) + +___ + +### waitForBlockFinalization + +▸ **waitForBlockFinalization**(`bitcoinCoreClient`, `btcRelayAPI`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | +| `btcRelayAPI` | [`BTCRelayAPI`](interfaces/BTCRelayAPI.md) | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin.ts:219](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L219) + +___ + +### waitForBlockRelaying + +▸ **waitForBlockRelaying**(`btcRelayAPI`, `blockHash`, `sleepMs?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `btcRelayAPI` | [`BTCRelayAPI`](interfaces/BTCRelayAPI.md) | `undefined` | +| `blockHash` | `string` | `undefined` | +| `sleepMs` | `number` | `SLEEP_TIME_MS` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin.ts:208](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L208) diff --git a/classes/BitcoinCoreClient.md b/classes/BitcoinCoreClient.md new file mode 100644 index 000000000..cdb782583 --- /dev/null +++ b/classes/BitcoinCoreClient.md @@ -0,0 +1,212 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / BitcoinCoreClient + +# Class: BitcoinCoreClient + +## Table of contents + +### Constructors + +- [constructor](BitcoinCoreClient.md#constructor) + +### Properties + +- [client](BitcoinCoreClient.md#client) + +### Methods + +- [broadcastTx](BitcoinCoreClient.md#broadcasttx) +- [createOrLoadWallet](BitcoinCoreClient.md#createorloadwallet) +- [createWallet](BitcoinCoreClient.md#createwallet) +- [formatRawTxInput](BitcoinCoreClient.md#formatrawtxinput) +- [getBestBlockHash](BitcoinCoreClient.md#getbestblockhash) +- [loadWallet](BitcoinCoreClient.md#loadwallet) +- [mineBlocks](BitcoinCoreClient.md#mineblocks) +- [sendBtcTxAndMine](BitcoinCoreClient.md#sendbtctxandmine) + +## Constructors + +### constructor + +• **new BitcoinCoreClient**(`network`, `host`, `username`, `password`, `port`, `wallet`) + +Initialize the Bitcoin-core client, which is a js equivalent to bitcoin-cli + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `network` | `string` | Bitcoin network (mainnet, testnet, regtest) | +| `host` | `string` | URL of Bitcoin node (e.g. localhost) | +| `username` | `string` | User for RPC authentication | +| `password` | `string` | Password for RPC authentication | +| `port` | `string` | Bitcoin node connection port (e.g. 18443) | +| `wallet` | `string` | Wallet to use if several are available. See https://github.com/ruimarinho/bitcoin-core#multiwallet | + +#### Defined in + +[src/utils/bitcoin-core-client.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L26) + +## Properties + +### client + +• **client**: `any` + +#### Defined in + +[src/utils/bitcoin-core-client.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L15) + +## Methods + +### broadcastTx + +▸ **broadcastTx**(`recipient`, `amount`, `data?`): `Promise`<{ `rawTx`: `string` ; `txid`: `string` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `recipient` | `string` | +| `amount` | `MonetaryAmount`<`Currency`\> | +| `data?` | `string` | + +#### Returns + +`Promise`<{ `rawTx`: `string` ; `txid`: `string` }\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L61) + +___ + +### createOrLoadWallet + +▸ **createOrLoadWallet**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:106](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L106) + +___ + +### createWallet + +▸ **createWallet**(`name`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `name` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:98](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L98) + +___ + +### formatRawTxInput + +▸ **formatRawTxInput**(`recipient`, `amount`, `data?`): `RecipientsToUtxoAmounts`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `recipient` | `string` | +| `amount` | `Big` | +| `data?` | `string` | + +#### Returns + +`RecipientsToUtxoAmounts`[] + +#### Defined in + +[src/utils/bitcoin-core-client.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L52) + +___ + +### getBestBlockHash + +▸ **getBestBlockHash**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L94) + +___ + +### loadWallet + +▸ **loadWallet**(`name`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `name` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:102](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L102) + +___ + +### mineBlocks + +▸ **mineBlocks**(`n`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `n` | `number` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:88](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L88) + +___ + +### sendBtcTxAndMine + +▸ **sendBtcTxAndMine**(`recipient`, `amount`, `blocksToMine`, `data?`): `Promise`<{ `rawTx`: `string` ; `txid`: `string` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `recipient` | `string` | +| `amount` | `MonetaryAmount`<`Currency`\> | +| `blocksToMine` | `number` | +| `data?` | `string` | + +#### Returns + +`Promise`<{ `rawTx`: `string` ; `txid`: `string` }\> + +#### Defined in + +[src/utils/bitcoin-core-client.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin-core-client.ts#L37) diff --git a/classes/BitcoinMerkleProof.md b/classes/BitcoinMerkleProof.md new file mode 100644 index 000000000..6106fb0b9 --- /dev/null +++ b/classes/BitcoinMerkleProof.md @@ -0,0 +1,96 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / BitcoinMerkleProof + +# Class: BitcoinMerkleProof + +## Table of contents + +### Constructors + +- [constructor](BitcoinMerkleProof.md#constructor) + +### Properties + +- [blockHeader](BitcoinMerkleProof.md#blockheader) +- [flagBits](BitcoinMerkleProof.md#flagbits) +- [hashes](BitcoinMerkleProof.md#hashes) +- [transactionsCount](BitcoinMerkleProof.md#transactionscount) + +### Methods + +- [fromHex](BitcoinMerkleProof.md#fromhex) + +## Constructors + +### constructor + +• **new BitcoinMerkleProof**(`buffer`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `buffer` | `Buffer` | + +#### Defined in + +[src/utils/bitcoin.ts:234](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L234) + +## Properties + +### blockHeader + +• **blockHeader**: `Block` + +#### Defined in + +[src/utils/bitcoin.ts:229](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L229) + +___ + +### flagBits + +• **flagBits**: `boolean`[] + +#### Defined in + +[src/utils/bitcoin.ts:232](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L232) + +___ + +### hashes + +• **hashes**: \`0x${string}\`[] + +#### Defined in + +[src/utils/bitcoin.ts:231](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L231) + +___ + +### transactionsCount + +• **transactionsCount**: `number` + +#### Defined in + +[src/utils/bitcoin.ts:230](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L230) + +## Methods + +### fromHex + +▸ `Static` **fromHex**(`hex`): [`BitcoinMerkleProof`](BitcoinMerkleProof.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hex` | `string` | + +#### Returns + +[`BitcoinMerkleProof`](BitcoinMerkleProof.md) + +#### Defined in + +[src/utils/bitcoin.ts:261](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L261) diff --git a/classes/ChainBalance.md b/classes/ChainBalance.md new file mode 100644 index 000000000..ae430ff14 --- /dev/null +++ b/classes/ChainBalance.md @@ -0,0 +1,93 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ChainBalance + +# Class: ChainBalance + +## Table of contents + +### Constructors + +- [constructor](ChainBalance.md#constructor) + +### Properties + +- [currency](ChainBalance.md#currency) +- [free](ChainBalance.md#free) +- [reserved](ChainBalance.md#reserved) +- [transferable](ChainBalance.md#transferable) + +### Methods + +- [toString](ChainBalance.md#tostring) + +## Constructors + +### constructor + +• **new ChainBalance**(`currency`, `free?`, `transferable?`, `reserved?`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | +| `free?` | `BigSource` | +| `transferable?` | `BigSource` | +| `reserved?` | `BigSource` | + +#### Defined in + +[src/types/currency.ts:107](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L107) + +## Properties + +### currency + +• **currency**: [`CurrencyExt`](../modules.md#currencyext) + +#### Defined in + +[src/types/currency.ts:105](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L105) + +___ + +### free + +• **free**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/currency.ts:102](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L102) + +___ + +### reserved + +• **reserved**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/currency.ts:104](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L104) + +___ + +### transferable + +• **transferable**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/currency.ts:103](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L103) + +## Methods + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +#### Defined in + +[src/types/currency.ts:118](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L118) diff --git a/classes/DefaultAMMAPI.md b/classes/DefaultAMMAPI.md new file mode 100644 index 000000000..099514850 --- /dev/null +++ b/classes/DefaultAMMAPI.md @@ -0,0 +1,859 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultAMMAPI + +# Class: DefaultAMMAPI + +## Implements + +- [`AMMAPI`](../interfaces/AMMAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultAMMAPI.md#constructor) + +### Properties + +- [api](DefaultAMMAPI.md#api) +- [tokensAPI](DefaultAMMAPI.md#tokensapi) + +### Methods + +- [\_getClaimableFarmingRewardsByPool](DefaultAMMAPI.md#_getclaimablefarmingrewardsbypool) +- [\_getFarmingRewardCurrencyIds](DefaultAMMAPI.md#_getfarmingrewardcurrencyids) +- [\_getLiquidityDepositStablePoolParams](DefaultAMMAPI.md#_getliquiditydepositstablepoolparams) +- [\_getLiquidityDepositStandardPoolParams](DefaultAMMAPI.md#_getliquiditydepositstandardpoolparams) +- [\_getLiquidityWithdrawalStablePoolParams](DefaultAMMAPI.md#_getliquiditywithdrawalstablepoolparams) +- [\_getLiquidityWithdrawalStandardPoolParams](DefaultAMMAPI.md#_getliquiditywithdrawalstandardpoolparams) +- [\_getPoolRewardAmountsYearly](DefaultAMMAPI.md#_getpoolrewardamountsyearly) +- [\_getStableBasePooledCurrenciesAdjustedToLpTokenAmount](DefaultAMMAPI.md#_getstablebasepooledcurrenciesadjustedtolptokenamount) +- [\_getStableLiquidityPool](DefaultAMMAPI.md#_getstableliquiditypool) +- [\_getStableLiquidityPoolData](DefaultAMMAPI.md#_getstableliquiditypooldata) +- [\_getStableLpTokens](DefaultAMMAPI.md#_getstablelptokens) +- [\_getStableMetaPoolBasePool](DefaultAMMAPI.md#_getstablemetapoolbasepool) +- [\_getStablePoolAmplificationCoefficient](DefaultAMMAPI.md#_getstablepoolamplificationcoefficient) +- [\_getStablePoolPooledCurrencies](DefaultAMMAPI.md#_getstablepoolpooledcurrencies) +- [\_getStandardLiquidityPool](DefaultAMMAPI.md#_getstandardliquiditypool) +- [\_getStandardLpTokens](DefaultAMMAPI.md#_getstandardlptokens) +- [\_getStandardPoolReserveBalances](DefaultAMMAPI.md#_getstandardpoolreservebalances) +- [\_poolHasZeroLiquidity](DefaultAMMAPI.md#_poolhaszeroliquidity) +- [\_swapThroughStandardAndStablePools](DefaultAMMAPI.md#_swapthroughstandardandstablepools) +- [\_swapThroughStandardPoolsOnly](DefaultAMMAPI.md#_swapthroughstandardpoolsonly) +- [addLiquidity](DefaultAMMAPI.md#addliquidity) +- [claimFarmingRewards](DefaultAMMAPI.md#claimfarmingrewards) +- [getClaimableFarmingRewards](DefaultAMMAPI.md#getclaimablefarmingrewards) +- [getLiquidityPools](DefaultAMMAPI.md#getliquiditypools) +- [getLiquidityProvidedByAccount](DefaultAMMAPI.md#getliquidityprovidedbyaccount) +- [getLpTokens](DefaultAMMAPI.md#getlptokens) +- [getOptimalTrade](DefaultAMMAPI.md#getoptimaltrade) +- [getStableLiquidityPools](DefaultAMMAPI.md#getstableliquiditypools) +- [getStandardLiquidityPools](DefaultAMMAPI.md#getstandardliquiditypools) +- [removeLiquidity](DefaultAMMAPI.md#removeliquidity) +- [swap](DefaultAMMAPI.md#swap) +- [getStableLpTokenFromPoolData](DefaultAMMAPI.md#getstablelptokenfrompooldata) +- [getStablePoolInfo](DefaultAMMAPI.md#getstablepoolinfo) + +## Constructors + +### constructor + +• **new DefaultAMMAPI**(`api`, `tokensAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `tokensAPI` | [`TokensAPI`](../interfaces/TokensAPI.md) | + +#### Defined in + +[src/parachain/amm.ts:197](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L197) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/amm.ts:197](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L197) + +___ + +### tokensAPI + +• `Private` **tokensAPI**: [`TokensAPI`](../interfaces/TokensAPI.md) + +#### Defined in + +[src/parachain/amm.ts:197](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L197) + +## Methods + +### \_getClaimableFarmingRewardsByPool + +▸ `Private` **_getClaimableFarmingRewardsByPool**(`accountId`, `lpToken`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `lpToken` | [`LpCurrency`](../modules.md#lpcurrency) | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> + +#### Defined in + +[src/parachain/amm.ts:607](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L607) + +___ + +### \_getFarmingRewardCurrencyIds + +▸ `Private` **_getFarmingRewardCurrencyIds**(`lpTokenCurrencyId`): `Promise`<[`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `lpTokenCurrencyId` | [`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md) | + +#### Returns + +`Promise`<[`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md)[]\> + +#### Defined in + +[src/parachain/amm.ts:597](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L597) + +___ + +### \_getLiquidityDepositStablePoolParams + +▸ `Private` **_getLiquidityDepositStablePoolParams**(`amounts`, `pool`, `maxSlippageComplement`, `deadline`, `recipient`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amounts` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `pool` | [`StableLiquidityPool`](StableLiquidityPool.md) | +| `maxSlippageComplement` | `number` | +| `deadline` | `number` | +| `recipient` | `AddressOrPair` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Defined in + +[src/parachain/amm.ts:706](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L706) + +___ + +### \_getLiquidityDepositStandardPoolParams + +▸ `Private` **_getLiquidityDepositStandardPoolParams**(`amounts`, `pool`, `maxSlippageComplement`, `deadline`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amounts` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `pool` | [`StandardLiquidityPool`](StandardLiquidityPool.md) | +| `maxSlippageComplement` | `number` | +| `deadline` | `number` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Defined in + +[src/parachain/amm.ts:670](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L670) + +___ + +### \_getLiquidityWithdrawalStablePoolParams + +▸ `Private` **_getLiquidityWithdrawalStablePoolParams**(`amount`, `pool`, `maxSlippageComplement`, `recipient`, `deadline`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | +| `pool` | [`StableLiquidityPool`](StableLiquidityPool.md) | +| `maxSlippageComplement` | `number` | +| `recipient` | `AddressOrPair` | +| `deadline` | `number` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Defined in + +[src/parachain/amm.ts:830](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L830) + +___ + +### \_getLiquidityWithdrawalStandardPoolParams + +▸ `Private` **_getLiquidityWithdrawalStandardPoolParams**(`amount`, `pool`, `maxSlippageComplement`, `recipient`, `deadline`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`StandardLpToken`](../modules.md#standardlptoken)\> | +| `pool` | [`StandardLiquidityPool`](StandardLiquidityPool.md) | +| `maxSlippageComplement` | `number` | +| `recipient` | `AddressOrPair` | +| `deadline` | `number` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Defined in + +[src/parachain/amm.ts:806](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L806) + +___ + +### \_getPoolRewardAmountsYearly + +▸ `Private` **_getPoolRewardAmountsYearly**(`lpTokenCurrencyId`, `blockTimeMs`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `lpTokenCurrencyId` | [`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md) | +| `blockTimeMs` | `number` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> + +#### Defined in + +[src/parachain/amm.ts:276](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L276) + +___ + +### \_getStableBasePooledCurrenciesAdjustedToLpTokenAmount + +▸ `Private` **_getStableBasePooledCurrenciesAdjustedToLpTokenAmount**(`basePooledCurrencies`, `lpTokenTotalSupply`, `metaPoolLpTokenAmount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `basePooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `lpTokenTotalSupply` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | +| `metaPoolLpTokenAmount` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +#### Defined in + +[src/parachain/amm.ts:395](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L395) + +___ + +### \_getStableLiquidityPool + +▸ `Private` **_getStableLiquidityPool**(`poolId`, `poolData`, `blockTimeMs`, `metaPoolLpTokenAmount?`): `Promise`<``null`` \| [`StableLiquidityPool`](StableLiquidityPool.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `poolId` | `number` | +| `poolData` | `DexStablePrimitivesPool` | +| `blockTimeMs` | `number` | +| `metaPoolLpTokenAmount?` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | + +#### Returns + +`Promise`<``null`` \| [`StableLiquidityPool`](StableLiquidityPool.md)\> + +#### Defined in + +[src/parachain/amm.ts:472](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L472) + +___ + +### \_getStableLiquidityPoolData + +▸ `Private` **_getStableLiquidityPoolData**(`poolId`, `poolData`, `blockTimeMs`, `metaPoolLpTokenAmount?`): `Promise`<``null`` \| { `actuallyPooledCurrencies`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] ; `amplificationCoefficient`: `Big` ; `lpToken`: [`StableLpToken`](../modules.md#stablelptoken) ; `totalSupply`: `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> ; `tradingFee`: `Big` ; `yearlyRewards`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `poolId` | `number` | +| `poolData` | `DexStablePrimitivesPool` | +| `blockTimeMs` | `number` | +| `metaPoolLpTokenAmount?` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | + +#### Returns + +`Promise`<``null`` \| { `actuallyPooledCurrencies`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] ; `amplificationCoefficient`: `Big` ; `lpToken`: [`StableLpToken`](../modules.md#stablelptoken) ; `totalSupply`: `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> ; `tradingFee`: `Big` ; `yearlyRewards`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] }\> + +#### Defined in + +[src/parachain/amm.ts:404](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L404) + +___ + +### \_getStableLpTokens + +▸ `Private` **_getStableLpTokens**(): `Promise`<[`StableLpToken`](../modules.md#stablelptoken)[]\> + +#### Returns + +`Promise`<[`StableLpToken`](../modules.md#stablelptoken)[]\> + +#### Defined in + +[src/parachain/amm.ts:233](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L233) + +___ + +### \_getStableMetaPoolBasePool + +▸ `Private` **_getStableMetaPoolBasePool**(`poolData`, `pooledCurrencies`, `blockTimeMs`): `Promise`<[`StableLiquidityPool`](StableLiquidityPool.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `poolData` | `DexStablePrimitivesMetaPool` | +| `pooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `blockTimeMs` | `number` | + +#### Returns + +`Promise`<[`StableLiquidityPool`](StableLiquidityPool.md)\> + +#### Defined in + +[src/parachain/amm.ts:442](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L442) + +___ + +### \_getStablePoolAmplificationCoefficient + +▸ `Private` **_getStablePoolAmplificationCoefficient**(`poolId`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `poolId` | `number` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/amm.ts:380](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L380) + +___ + +### \_getStablePoolPooledCurrencies + +▸ `Private` **_getStablePoolPooledCurrencies**(`currencyIds`, `balances`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyIds` | [`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md)[] | +| `balances` | `u128`[] | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> + +#### Defined in + +[src/parachain/amm.ts:365](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L365) + +___ + +### \_getStandardLiquidityPool + +▸ `Private` **_getStandardLiquidityPool**(`pairCurrencies`, `lpTokenCurrencyId`, `pairStatus`, `blockTimeMs`): `Promise`<``null`` \| [`StandardLiquidityPool`](StandardLiquidityPool.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pairCurrencies` | [[`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md), [`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md)] | +| `lpTokenCurrencyId` | [`InterbtcPrimitivesCurrencyId`](../interfaces/InterbtcPrimitivesCurrencyId.md) | +| `pairStatus` | `DexGeneralPrimitivesPairStatus` | +| `blockTimeMs` | `number` | + +#### Returns + +`Promise`<``null`` \| [`StandardLiquidityPool`](StandardLiquidityPool.md)\> + +#### Defined in + +[src/parachain/amm.ts:293](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L293) + +___ + +### \_getStandardLpTokens + +▸ `Private` **_getStandardLpTokens**(): `Promise`<[`StandardLpToken`](../modules.md#standardlptoken)[]\> + +#### Returns + +`Promise`<[`StandardLpToken`](../modules.md#standardlptoken)[]\> + +#### Defined in + +[src/parachain/amm.ts:222](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L222) + +___ + +### \_getStandardPoolReserveBalances + +▸ `Private` **_getStandardPoolReserveBalances**(`token0`, `token1`, `pairAccount`): `Promise`<[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `token0` | [`CurrencyExt`](../modules.md#currencyext) | +| `token1` | [`CurrencyExt`](../modules.md#currencyext) | +| `pairAccount` | `AccountId` | + +#### Returns + +`Promise`<[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>]\> + +#### Defined in + +[src/parachain/amm.ts:261](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L261) + +___ + +### \_poolHasZeroLiquidity + +▸ `Private` **_poolHasZeroLiquidity**(`pooledCurrencies`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | + +#### Returns + +`boolean` + +#### Defined in + +[src/parachain/amm.ts:257](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L257) + +___ + +### \_swapThroughStandardAndStablePools + +▸ `Private` **_swapThroughStandardAndStablePools**(`trade`, `minimumAmountOut`, `recipient`, `deadline`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `trade` | [`Trade`](Trade.md) | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | +| `recipient` | `AddressOrPair` | +| `deadline` | `string` \| `number` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Defined in + +[src/parachain/amm.ts:575](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L575) + +___ + +### \_swapThroughStandardPoolsOnly + +▸ `Private` **_swapThroughStandardPoolsOnly**(`trade`, `minimumAmountOut`, `recipient`, `deadline`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `trade` | [`Trade`](Trade.md) | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | +| `recipient` | `AddressOrPair` | +| `deadline` | `string` \| `number` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Defined in + +[src/parachain/amm.ts:552](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L552) + +___ + +### addLiquidity + +▸ **addLiquidity**(`amounts`, `pool`, `maxSlippage`, `deadline`, `recipient`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Adds liquidity to liquidity pool + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amounts` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | Array of monetary amounts of pooled currencies sorted in the same order as in the pool. | +| `pool` | [`LiquidityPool`](../modules.md#liquiditypool) | Type of liquidity pool. | +| `maxSlippage` | `number` | Maximum allowed slippage. | +| `deadline` | `number` | Deadline block number. | +| `recipient` | `AddressOrPair` | Recipient of the liquidity pool token. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[addLiquidity](../interfaces/AMMAPI.md#addliquidity) + +#### Defined in + +[src/parachain/amm.ts:770](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L770) + +___ + +### claimFarmingRewards + +▸ **claimFarmingRewards**(`claimableRewards`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Claim all pending farming rewards. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `claimableRewards` | `Map`<[`LpCurrency`](../modules.md#lpcurrency), `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> | Map of LpToken -> Array of reward monetary amounts -> supposed to be output of `getClaimableFarmingRewards` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[claimFarmingRewards](../interfaces/AMMAPI.md#claimfarmingrewards) + +#### Defined in + +[src/parachain/amm.ts:930](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L930) + +___ + +### getClaimableFarmingRewards + +▸ **getClaimableFarmingRewards**(`accountId`, `accountLiquidity`, `pools`): `Promise`<`Map`<[`LpCurrency`](../modules.md#lpcurrency), `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\>\> + +Get claimable farming reward amounts for all farmed liquidity provided by account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account id for which to get claimable rewards. | +| `accountLiquidity` | `MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\>[] | Amount of liquidity the account has provided. | +| `pools` | [`LiquidityPool`](../modules.md#liquiditypool)[] | All liquidity pools. | + +#### Returns + +`Promise`<`Map`<[`LpCurrency`](../modules.md#lpcurrency), `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\>\> + +Map of LpCurrency -> Array of reward monetary amounts. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[getClaimableFarmingRewards](../interfaces/AMMAPI.md#getclaimablefarmingrewards) + +#### Defined in + +[src/parachain/amm.ts:631](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L631) + +___ + +### getLiquidityPools + +▸ **getLiquidityPools**(): `Promise`<[`LiquidityPool`](../modules.md#liquiditypool)[]\> + +Get all liquidity pools. + +#### Returns + +`Promise`<[`LiquidityPool`](../modules.md#liquiditypool)[]\> + +All liquidity pools. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[getLiquidityPools](../interfaces/AMMAPI.md#getliquiditypools) + +#### Defined in + +[src/parachain/amm.ts:542](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L542) + +___ + +### getLiquidityProvidedByAccount + +▸ **getLiquidityProvidedByAccount**(`accountId`): `Promise`<`MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\>[]\> + +Get liquidity provided by account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account to get provided liquidity information about. | + +#### Returns + +`Promise`<`MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\>[]\> + +Array of LP token amounts that represent + account's positions in respective liquidity pools. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[getLiquidityProvidedByAccount](../interfaces/AMMAPI.md#getliquidityprovidedbyaccount) + +#### Defined in + +[src/parachain/amm.ts:213](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L213) + +___ + +### getLpTokens + +▸ **getLpTokens**(): `Promise`<[`LpCurrency`](../modules.md#lpcurrency)[]\> + +Get all LP tokens. + +#### Returns + +`Promise`<[`LpCurrency`](../modules.md#lpcurrency)[]\> + +Array of all standard and stable LP tokens. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[getLpTokens](../interfaces/AMMAPI.md#getlptokens) + +#### Defined in + +[src/parachain/amm.ts:248](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L248) + +___ + +### getOptimalTrade + +▸ **getOptimalTrade**(`inputAmount`, `outputCurrency`, `pools`): ``null`` \| [`Trade`](Trade.md) + +Get optimal trade for provided trade type and amount. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount to be exchanged. | +| `outputCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to purchase. | +| `pools` | [`LiquidityPool`](../modules.md#liquiditypool)[] | Array of all liquidity pools. | + +#### Returns + +``null`` \| [`Trade`](Trade.md) + +Optimal trade information or null if the trade is not possible. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[getOptimalTrade](../interfaces/AMMAPI.md#getoptimaltrade) + +#### Defined in + +[src/parachain/amm.ts:199](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L199) + +___ + +### getStableLiquidityPools + +▸ **getStableLiquidityPools**(`blockTimeMs`): `Promise`<[`StableLiquidityPool`](StableLiquidityPool.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `blockTimeMs` | `number` | + +#### Returns + +`Promise`<[`StableLiquidityPool`](StableLiquidityPool.md)[]\> + +#### Defined in + +[src/parachain/amm.ts:530](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L530) + +___ + +### getStandardLiquidityPools + +▸ **getStandardLiquidityPools**(`blockTimeMs`): `Promise`<[`StandardLiquidityPool`](StandardLiquidityPool.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `blockTimeMs` | `number` | + +#### Returns + +`Promise`<[`StandardLiquidityPool`](StandardLiquidityPool.md)[]\> + +#### Defined in + +[src/parachain/amm.ts:345](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L345) + +___ + +### removeLiquidity + +▸ **removeLiquidity**(`amount`, `pool`, `maxSlippage`, `deadline`, `recipient`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Removes liquidity from pool. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\> | Amount of LP token to be removed | +| `pool` | [`LiquidityPool`](../modules.md#liquiditypool) | Liquidity pool to remove from. | +| `maxSlippage` | `number` | Maximum allowed slippage. | +| `deadline` | `number` | Deadline block number. | +| `recipient` | `AddressOrPair` | Recipient of the pooled currencies. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Note`** + +Removes `amount` of liquidity in LP token, breaks it down and transfers to account. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[removeLiquidity](../interfaces/AMMAPI.md#removeliquidity) + +#### Defined in + +[src/parachain/amm.ts:882](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L882) + +___ + +### swap + +▸ **swap**(`trade`, `minimumAmountOut`, `recipient`, `deadline`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Swap assets. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `trade` | [`Trade`](Trade.md) | Trade object containing information about the trade. | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Minimum output amount to be received. | +| `recipient` | `AddressOrPair` | Recipient address. | +| `deadline` | `string` \| `number` | Deadline block for the swap transaction. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[AMMAPI](../interfaces/AMMAPI.md).[swap](../interfaces/AMMAPI.md#swap) + +#### Defined in + +[src/parachain/amm.ts:656](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L656) + +___ + +### getStableLpTokenFromPoolData + +▸ `Static` **getStableLpTokenFromPoolData**(`poolId`, `basePoolData`): [`StableLpToken`](../modules.md#stablelptoken) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `poolId` | `number` | +| `basePoolData` | `DexStablePrimitivesBasePool` | + +#### Returns + +[`StableLpToken`](../modules.md#stablelptoken) + +#### Defined in + +[src/parachain/amm.ts:182](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L182) + +___ + +### getStablePoolInfo + +▸ `Static` **getStablePoolInfo**(`poolData`): ``null`` \| `DexStablePrimitivesBasePool` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `poolData` | `DexStablePrimitivesPool` | + +#### Returns + +``null`` \| `DexStablePrimitivesBasePool` + +#### Defined in + +[src/parachain/amm.ts:172](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L172) diff --git a/classes/DefaultAssetRegistryAPI.md b/classes/DefaultAssetRegistryAPI.md new file mode 100644 index 000000000..5c11ada90 --- /dev/null +++ b/classes/DefaultAssetRegistryAPI.md @@ -0,0 +1,239 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultAssetRegistryAPI + +# Class: DefaultAssetRegistryAPI + +## Implements + +- [`AssetRegistryAPI`](../interfaces/AssetRegistryAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultAssetRegistryAPI.md#constructor) + +### Properties + +- [api](DefaultAssetRegistryAPI.md#api) + +### Methods + +- [extractCollateralCeilingEntryKeys](DefaultAssetRegistryAPI.md#extractcollateralceilingentrykeys) +- [getAssetRegistryEntries](DefaultAssetRegistryAPI.md#getassetregistryentries) +- [getCollateralForeignAssets](DefaultAssetRegistryAPI.md#getcollateralforeignassets) +- [getForeignAsset](DefaultAssetRegistryAPI.md#getforeignasset) +- [getForeignAssets](DefaultAssetRegistryAPI.md#getforeignassets) +- [getSystemCollateralCeilingEntries](DefaultAssetRegistryAPI.md#getsystemcollateralceilingentries) +- [metadataToCurrency](DefaultAssetRegistryAPI.md#metadatatocurrency) +- [metadataTupleToForeignAsset](DefaultAssetRegistryAPI.md#metadatatupletoforeignasset) +- [unwrapMetadataFromEntries](DefaultAssetRegistryAPI.md#unwrapmetadatafromentries) + +## Constructors + +### constructor + +• **new DefaultAssetRegistryAPI**(`api`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Defined in + +[src/parachain/asset-registry.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L43) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/asset-registry.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L43) + +## Methods + +### extractCollateralCeilingEntryKeys + +▸ **extractCollateralCeilingEntryKeys**(`entries`): `InterbtcPrimitivesVaultCurrencyPair`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `entries` | `SystemCollateralCeilingTuple`[] | + +#### Returns + +`InterbtcPrimitivesVaultCurrencyPair`[] + +#### Defined in + +[src/parachain/asset-registry.ts:104](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L104) + +___ + +### getAssetRegistryEntries + +▸ **getAssetRegistryEntries**(): `Promise`<`AssetRegistryMetadataTuple`[]\> + +#### Returns + +`Promise`<`AssetRegistryMetadataTuple`[]\> + +#### Defined in + +[src/parachain/asset-registry.ts:71](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L71) + +___ + +### getCollateralForeignAssets + +▸ **getCollateralForeignAssets**(): `Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +Get all foreign assets which have a registered collateral ceiling, meaning they can be used as collateral currency. + +#### Returns + +`Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +All foreign assets that have been registered as collateral currency + +#### Implementation of + +[AssetRegistryAPI](../interfaces/AssetRegistryAPI.md).[getCollateralForeignAssets](../interfaces/AssetRegistryAPI.md#getcollateralforeignassets) + +#### Defined in + +[src/parachain/asset-registry.ts:110](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L110) + +___ + +### getForeignAsset + +▸ **getForeignAsset**(`id`): `Promise`<[`ForeignAsset`](../modules.md#foreignasset)\> + +Get foreign asset by its id. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `id` | `number` \| `u32` | The id of the foreign asset. | + +#### Returns + +`Promise`<[`ForeignAsset`](../modules.md#foreignasset)\> + +The foreign asset. + +#### Implementation of + +[AssetRegistryAPI](../interfaces/AssetRegistryAPI.md).[getForeignAsset](../interfaces/AssetRegistryAPI.md#getforeignasset) + +#### Defined in + +[src/parachain/asset-registry.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L94) + +___ + +### getForeignAssets + +▸ **getForeignAssets**(): `Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +Get all currencies (foreign assets) in the asset registry. + +#### Returns + +`Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +A list of currencies. + +#### Implementation of + +[AssetRegistryAPI](../interfaces/AssetRegistryAPI.md).[getForeignAssets](../interfaces/AssetRegistryAPI.md#getforeignassets) + +#### Defined in + +[src/parachain/asset-registry.ts:86](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L86) + +___ + +### getSystemCollateralCeilingEntries + +▸ **getSystemCollateralCeilingEntries**(): `Promise`<`SystemCollateralCeilingTuple`[]\> + +#### Returns + +`Promise`<`SystemCollateralCeilingTuple`[]\> + +#### Defined in + +[src/parachain/asset-registry.ts:99](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L99) + +___ + +### metadataToCurrency + +▸ `Static` **metadataToCurrency**(`metadata`): `Currency` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `metadata` | `OrmlTraitsAssetRegistryAssetMetadata` | + +#### Returns + +`Currency` + +#### Defined in + +[src/parachain/asset-registry.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L45) + +___ + +### metadataTupleToForeignAsset + +▸ `Static` **metadataTupleToForeignAsset**(`«destructured»`): [`ForeignAsset`](../modules.md#foreignasset) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `«destructured»` | `UnwrappedAssetRegistryMetadataTuple` | + +#### Returns + +[`ForeignAsset`](../modules.md#foreignasset) + +#### Defined in + +[src/parachain/asset-registry.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L56) + +___ + +### unwrapMetadataFromEntries + +▸ `Static` **unwrapMetadataFromEntries**(`entries`): `UnwrappedAssetRegistryMetadataTuple`[] + +Static method to filter out metadata that can be unwrapped.ie. `Option.isSome !== true`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `entries` | `AssetRegistryMetadataTuple`[] | The entries from the asset registry. | + +#### Returns + +`UnwrappedAssetRegistryMetadataTuple`[] + +A list of all entries containing metadata. + +#### Defined in + +[src/parachain/asset-registry.ts:80](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L80) diff --git a/classes/DefaultBTCRelayAPI.md b/classes/DefaultBTCRelayAPI.md new file mode 100644 index 000000000..7368ae821 --- /dev/null +++ b/classes/DefaultBTCRelayAPI.md @@ -0,0 +1,159 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultBTCRelayAPI + +# Class: DefaultBTCRelayAPI + +## Implements + +- [`BTCRelayAPI`](../interfaces/BTCRelayAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultBTCRelayAPI.md#constructor) + +### Properties + +- [api](DefaultBTCRelayAPI.md#api) + +### Methods + +- [getLatestBlock](DefaultBTCRelayAPI.md#getlatestblock) +- [getLatestBlockHeight](DefaultBTCRelayAPI.md#getlatestblockheight) +- [getStableBitcoinConfirmations](DefaultBTCRelayAPI.md#getstablebitcoinconfirmations) +- [getStableParachainConfirmations](DefaultBTCRelayAPI.md#getstableparachainconfirmations) +- [isBlockInRelay](DefaultBTCRelayAPI.md#isblockinrelay) + +## Constructors + +### constructor + +• **new DefaultBTCRelayAPI**(`api`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Defined in + +[src/parachain/btc-relay.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L37) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/btc-relay.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L37) + +## Methods + +### getLatestBlock + +▸ **getLatestBlock**(): `Promise`<`BitcoinH256Le`\> + +#### Returns + +`Promise`<`BitcoinH256Le`\> + +The raw transaction data, represented as a Buffer object + +#### Implementation of + +[BTCRelayAPI](../interfaces/BTCRelayAPI.md).[getLatestBlock](../interfaces/BTCRelayAPI.md#getlatestblock) + +#### Defined in + +[src/parachain/btc-relay.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L47) + +___ + +### getLatestBlockHeight + +▸ **getLatestBlockHeight**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The height of the latest Bitcoin block that was rekayed by the BTC-Relay + +#### Implementation of + +[BTCRelayAPI](../interfaces/BTCRelayAPI.md).[getLatestBlockHeight](../interfaces/BTCRelayAPI.md#getlatestblockheight) + +#### Defined in + +[src/parachain/btc-relay.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L51) + +___ + +### getStableBitcoinConfirmations + +▸ **getStableBitcoinConfirmations**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +A global security parameter: the required block confirmations +for a transaction to be considered stable on Bitcoin + +#### Implementation of + +[BTCRelayAPI](../interfaces/BTCRelayAPI.md).[getStableBitcoinConfirmations](../interfaces/BTCRelayAPI.md#getstablebitcoinconfirmations) + +#### Defined in + +[src/parachain/btc-relay.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L39) + +___ + +### getStableParachainConfirmations + +▸ **getStableParachainConfirmations**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +A global security parameter: the required block confirmations +for a transaction to be considered stable on the parachain + +#### Implementation of + +[BTCRelayAPI](../interfaces/BTCRelayAPI.md).[getStableParachainConfirmations](../interfaces/BTCRelayAPI.md#getstableparachainconfirmations) + +#### Defined in + +[src/parachain/btc-relay.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L43) + +___ + +### isBlockInRelay + +▸ **isBlockInRelay**(`blockHash`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `blockHash` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +True if the block is in the relay, false otherwise. + +#### Implementation of + +[BTCRelayAPI](../interfaces/BTCRelayAPI.md).[isBlockInRelay](../interfaces/BTCRelayAPI.md#isblockinrelay) + +#### Defined in + +[src/parachain/btc-relay.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L55) diff --git a/classes/DefaultConstantsAPI.md b/classes/DefaultConstantsAPI.md new file mode 100644 index 000000000..9084c6d3f --- /dev/null +++ b/classes/DefaultConstantsAPI.md @@ -0,0 +1,112 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultConstantsAPI + +# Class: DefaultConstantsAPI + +## Implements + +- [`ConstantsAPI`](../interfaces/ConstantsAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultConstantsAPI.md#constructor) + +### Properties + +- [api](DefaultConstantsAPI.md#api) + +### Methods + +- [getSystemBlockHashCount](DefaultConstantsAPI.md#getsystemblockhashcount) +- [getSystemDbWeight](DefaultConstantsAPI.md#getsystemdbweight) +- [getTimestampMinimumPeriod](DefaultConstantsAPI.md#gettimestampminimumperiod) + +## Constructors + +### constructor + +• **new DefaultConstantsAPI**(`api`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Defined in + +[src/parachain/constants.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L29) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/constants.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L29) + +## Methods + +### getSystemBlockHashCount + +▸ **getSystemBlockHashCount**(): `BlockNumber` + +#### Returns + +`BlockNumber` + +Maximum number of block number to block hash mappings to keep (oldest pruned first). + +#### Implementation of + +[ConstantsAPI](../interfaces/ConstantsAPI.md).[getSystemBlockHashCount](../interfaces/ConstantsAPI.md#getsystemblockhashcount) + +#### Defined in + +[src/parachain/constants.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L31) + +___ + +### getSystemDbWeight + +▸ **getSystemDbWeight**(): `SpWeightsRuntimeDbWeight` + +#### Returns + +`SpWeightsRuntimeDbWeight` + +The weight of database operations that the runtime can invoke. + +#### Implementation of + +[ConstantsAPI](../interfaces/ConstantsAPI.md).[getSystemDbWeight](../interfaces/ConstantsAPI.md#getsystemdbweight) + +#### Defined in + +[src/parachain/constants.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L35) + +___ + +### getTimestampMinimumPeriod + +▸ **getTimestampMinimumPeriod**(): `Moment` + +#### Returns + +`Moment` + +The minimum period between blocks. Beware that this is different to the *expected* period +that the block production apparatus provides. Your chosen consensus system will generally +work with this to determine a sensible block time. e.g. For Aura, it will be double this +period on default settings. + +#### Implementation of + +[ConstantsAPI](../interfaces/ConstantsAPI.md).[getTimestampMinimumPeriod](../interfaces/ConstantsAPI.md#gettimestampminimumperiod) + +#### Defined in + +[src/parachain/constants.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L39) diff --git a/classes/DefaultElectrsAPI.md b/classes/DefaultElectrsAPI.md new file mode 100644 index 000000000..f00905db1 --- /dev/null +++ b/classes/DefaultElectrsAPI.md @@ -0,0 +1,670 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultElectrsAPI + +# Class: DefaultElectrsAPI + +Bitcoin Core API + +## Implements + +- [`ElectrsAPI`](../interfaces/ElectrsAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultElectrsAPI.md#constructor) + +### Properties + +- [addressApi](DefaultElectrsAPI.md#addressapi) +- [blockApi](DefaultElectrsAPI.md#blockapi) +- [scripthashApi](DefaultElectrsAPI.md#scripthashapi) +- [txApi](DefaultElectrsAPI.md#txapi) + +### Methods + +- [broadcastRawTransaction](DefaultElectrsAPI.md#broadcastrawtransaction) +- [getCoinbaseTxId](DefaultElectrsAPI.md#getcoinbasetxid) +- [getData](DefaultElectrsAPI.md#getdata) +- [getEarliestPaymentToRecipientAddressTxId](DefaultElectrsAPI.md#getearliestpaymenttorecipientaddresstxid) +- [getLargestPaymentToRecipientAddressTxId](DefaultElectrsAPI.md#getlargestpaymenttorecipientaddresstxid) +- [getLatestBlock](DefaultElectrsAPI.md#getlatestblock) +- [getLatestBlockHeight](DefaultElectrsAPI.md#getlatestblockheight) +- [getMerkleProof](DefaultElectrsAPI.md#getmerkleproof) +- [getParsedExecutionParameters](DefaultElectrsAPI.md#getparsedexecutionparameters) +- [getRawTransaction](DefaultElectrsAPI.md#getrawtransaction) +- [getTransactionBlockHeight](DefaultElectrsAPI.md#gettransactionblockheight) +- [getTransactionStatus](DefaultElectrsAPI.md#gettransactionstatus) +- [getTx](DefaultElectrsAPI.md#gettx) +- [getTxIdByOpReturn](DefaultElectrsAPI.md#gettxidbyopreturn) +- [getTxStatus](DefaultElectrsAPI.md#gettxstatus) +- [getUtxoAmount](DefaultElectrsAPI.md#getutxoamount) +- [txOutputHasRecipientAndAmount](DefaultElectrsAPI.md#txoutputhasrecipientandamount) +- [txoHasAtLeastAmount](DefaultElectrsAPI.md#txohasatleastamount) +- [waitForOpreturn](DefaultElectrsAPI.md#waitforopreturn) +- [waitForTxInclusion](DefaultElectrsAPI.md#waitfortxinclusion) + +## Constructors + +### constructor + +• **new DefaultElectrsAPI**(`network?`) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `network` | `string` | `"mainnet"` | + +#### Defined in + +[src/external/electrs.ts:167](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L167) + +## Properties + +### addressApi + +• `Private` **addressApi**: `AddressApi` + +#### Defined in + +[src/external/electrs.ts:165](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L165) + +___ + +### blockApi + +• `Private` **blockApi**: `BlockApi` + +#### Defined in + +[src/external/electrs.ts:162](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L162) + +___ + +### scripthashApi + +• `Private` **scripthashApi**: `ScripthashApi` + +#### Defined in + +[src/external/electrs.ts:164](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L164) + +___ + +### txApi + +• `Private` **txApi**: `TxApi` + +#### Defined in + +[src/external/electrs.ts:163](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L163) + +## Methods + +### broadcastRawTransaction + +▸ **broadcastRawTransaction**(`hex`): `Promise`<`AxiosResponse`<`string`\>\> + +Broadcasts a transaction to the Bitcoin network configured in the constructor + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `hex` | `string` | A hex-encoded raw transaction to be broadcast to the Bitcoin blockchain | + +#### Returns + +`Promise`<`AxiosResponse`<`string`\>\> + +The txid of the transaction + +#### Defined in + +[src/external/electrs.ts:390](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L390) + +___ + +### getCoinbaseTxId + +▸ **getCoinbaseTxId**(`userTxId`): `Promise`<`undefined` \| `string`\> + +Returns tx id of the coinbase tx of block in which `userTxId` was included. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userTxId` | `string` | User tx ID which block's txId will be returned. | + +#### Returns + +`Promise`<`undefined` \| `string`\> + +Tx ID of coinbase transaction or undefined if block was not found. + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getCoinbaseTxId](../interfaces/ElectrsAPI.md#getcoinbasetxid) + +#### Defined in + +[src/external/electrs.ts:432](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L432) + +___ + +### getData + +▸ **getData**<`T`\>(`response`): `Promise`<`T`\> + +Parse an AxiosResponse Promise + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `response` | `Promise`<`AxiosResponse`<`T`\>\> | A generic AxiosResponse Promise | + +#### Returns + +`Promise`<`T`\> + +The data in the response + +#### Defined in + +[src/external/electrs.ts:456](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L456) + +___ + +### getEarliestPaymentToRecipientAddressTxId + +▸ **getEarliestPaymentToRecipientAddressTxId**(`recipientAddress`, `amount?`): `Promise`<`string`\> + +Fetch the earliest/oldest bitcoin transaction ID based on the recipient address and amount. +Throw an error if no such transaction is found. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `recipientAddress` | `string` | Match the receiving address of a transaction output | +| `amount?` | `BitcoinAmount` | Match the amount (in BTC) of a transaction output that contains said recipientAddress. | + +#### Returns + +`Promise`<`string`\> + +A Bitcoin transaction ID + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +**`Deprecated`** + +For most cases where this is used today, [getLargestPaymentToRecipientAddressTxId](../interfaces/ElectrsAPI.md#getlargestpaymenttorecipientaddresstxid) is better suited. + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getEarliestPaymentToRecipientAddressTxId](../interfaces/ElectrsAPI.md#getearliestpaymenttorecipientaddresstxid) + +#### Defined in + +[src/external/electrs.ts:252](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L252) + +___ + +### getLargestPaymentToRecipientAddressTxId + +▸ **getLargestPaymentToRecipientAddressTxId**(`recipientAddress`): `Promise`<`string`\> + +Fetch the bitcoin transaction ID with the largest payment based on the recipient address. +Throw an error if no transactions are found. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `recipientAddress` | `string` | Match the receiving address of a transaction output | + +#### Returns + +`Promise`<`string`\> + +A Bitcoin transaction ID + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getLargestPaymentToRecipientAddressTxId](../interfaces/ElectrsAPI.md#getlargestpaymenttorecipientaddresstxid) + +#### Defined in + +[src/external/electrs.ts:222](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L222) + +___ + +### getLatestBlock + +▸ **getLatestBlock**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +The block hash of the latest Bitcoin block + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getLatestBlock](../interfaces/ElectrsAPI.md#getlatestblock) + +#### Defined in + +[src/external/electrs.ts:189](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L189) + +___ + +### getLatestBlockHeight + +▸ **getLatestBlockHeight**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The height of the latest Bitcoin block + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getLatestBlockHeight](../interfaces/ElectrsAPI.md#getlatestblockheight) + +#### Defined in + +[src/external/electrs.ts:193](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L193) + +___ + +### getMerkleProof + +▸ **getMerkleProof**(`txid`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`string`\> + +The merkle inclusion proof for the transaction using bitcoind's merkleblock format. + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getMerkleProof](../interfaces/ElectrsAPI.md#getmerkleproof) + +#### Defined in + +[src/external/electrs.ts:197](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L197) + +___ + +### getParsedExecutionParameters + +▸ **getParsedExecutionParameters**(`txid`): `Promise`<[[`BitcoinMerkleProof`](BitcoinMerkleProof.md), `Transaction`]\> + +Get the parsed (as Bytes) merkle proof and raw transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | A Bitcoin transaction ID | + +#### Returns + +`Promise`<[[`BitcoinMerkleProof`](BitcoinMerkleProof.md), `Transaction`]\> + +A tuple representing [merkleProof, transaction] + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getParsedExecutionParameters](../interfaces/ElectrsAPI.md#getparsedexecutionparameters) + +#### Defined in + +[src/external/electrs.ts:422](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L422) + +___ + +### getRawTransaction + +▸ **getRawTransaction**(`txid`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`string`\> + +The raw transaction data, represented as a hex string + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getRawTransaction](../interfaces/ElectrsAPI.md#getrawtransaction) + +#### Defined in + +[src/external/electrs.ts:428](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L428) + +___ + +### getTransactionBlockHeight + +▸ **getTransactionBlockHeight**(`txid`): `Promise`<`undefined` \| `number`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`undefined` \| `number`\> + +The height of the block the transaction was included in. If the block has not been confirmed, returns undefined. + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getTransactionBlockHeight](../interfaces/ElectrsAPI.md#gettransactionblockheight) + +#### Defined in + +[src/external/electrs.ts:418](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L418) + +___ + +### getTransactionStatus + +▸ **getTransactionStatus**(`txid`): `Promise`<[`TxStatus`](../modules.md#txstatus)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<[`TxStatus`](../modules.md#txstatus)\> + +A TxStatus object, containing the confirmation status and number of confirmations, plus block height if +the tx is included in the blockchain + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getTransactionStatus](../interfaces/ElectrsAPI.md#gettransactionstatus) + +#### Defined in + +[src/external/electrs.ts:394](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L394) + +___ + +### getTx + +▸ **getTx**(`txid`): `Promise`<`Transaction`\> + +Fetch the Bitcoin transaction that matches the given TxId + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | A Bitcoin transaction ID | + +#### Returns + +`Promise`<`Transaction`\> + +A Bitcoin Transaction object + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getTx](../interfaces/ElectrsAPI.md#gettx) + +#### Defined in + +[src/external/electrs.ts:201](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L201) + +___ + +### getTxIdByOpReturn + +▸ **getTxIdByOpReturn**(`opReturn`, `recipientAddress?`, `amount?`): `Promise`<`string`\> + +Fetch the first bitcoin transaction ID based on the OP_RETURN field, recipient and amount. +Throw an error unless there is exactly one transaction with the given opcode. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `opReturn` | `string` | Data string used for matching the OP_CODE of Bitcoin transactions | +| `recipientAddress?` | `string` | Match the receiving address of a transaction that contains said op_return | +| `amount?` | `BitcoinAmount` | Match the amount (in BTC) of a transaction that contains said op_return and recipientAddress. This parameter is only considered if `recipientAddress` is defined. | + +#### Returns + +`Promise`<`string`\> + +A Bitcoin transaction ID + +**`Remarks`** + +Performs the lookup using an external service, Esplora. Requires the input string to be a hex + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getTxIdByOpReturn](../interfaces/ElectrsAPI.md#gettxidbyopreturn) + +#### Defined in + +[src/external/electrs.ts:297](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L297) + +___ + +### getTxStatus + +▸ `Private` **getTxStatus**(`txid`): `Promise`<`Status`\> + +Use the TxAPI to get the confirmationation + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`Status`\> + +A Status object, containing transaction settlement information + +#### Defined in + +[src/external/electrs.ts:447](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L447) + +___ + +### getUtxoAmount + +▸ **getUtxoAmount**(`txid`, `recipient`): `Promise`<`number`\> + +Fetch the Bitcoin UTXO amount that matches the given TxId and recipient + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | A Bitcoin transaction ID | +| `recipient` | `string` | A Bitcoin scriptpubkey address | + +#### Returns + +`Promise`<`number`\> + +A UTXO amount if found, 0 otherwise + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[getUtxoAmount](../interfaces/ElectrsAPI.md#getutxoamount) + +#### Defined in + +[src/external/electrs.ts:205](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L205) + +___ + +### txOutputHasRecipientAndAmount + +▸ `Private` **txOutputHasRecipientAndAmount**(`vout`, `recipientAddress?`, `amount?`): `boolean` + +Check if a given UTXO sends at least `amountAsBTC` to a certain `recipientAddress` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vout` | `VOut` | UTXO object | +| `recipientAddress?` | `string` | (Optional) Address of recipient | +| `amount?` | `BitcoinAmount` | - | + +#### Returns + +`boolean` + +Boolean value + +#### Defined in + +[src/external/electrs.ts:375](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L375) + +___ + +### txoHasAtLeastAmount + +▸ `Private` **txoHasAtLeastAmount**(`txo`, `amount?`): `boolean` + +Check if a given UTXO has at least `amountAsBTC` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `txo` | `VOut` \| `UTXO` | +| `amount?` | `BitcoinAmount` | + +#### Returns + +`boolean` + +Boolean value + +#### Defined in + +[src/external/electrs.ts:284](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L284) + +___ + +### waitForOpreturn + +▸ **waitForOpreturn**(`data`, `timeoutMs`, `retryIntervalMs`): `Promise`<`string`\> + +Return a promise that either resolves to the first txid with the given opreturn `data`, +or rejects if the `timeout` has elapsed. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `string` | The opReturn of the bitcoin transaction | +| `timeoutMs` | `number` | The duration until the Promise times out (in milliseconds) | +| `retryIntervalMs` | `number` | The time to wait (in milliseconds) between retries | + +#### Returns + +`Promise`<`string`\> + +The Bitcoin txid + +**`Remarks`** + +Every 5 seconds, performs the lookup using an external service, Esplora + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[waitForOpreturn](../interfaces/ElectrsAPI.md#waitforopreturn) + +#### Defined in + +[src/external/electrs.ts:326](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L326) + +___ + +### waitForTxInclusion + +▸ **waitForTxInclusion**(`txid`, `timeoutMs`, `retryIntervalMs`): `Promise`<[`TxStatus`](../modules.md#txstatus)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | +| `timeoutMs` | `number` | - | +| `retryIntervalMs` | `number` | - | + +#### Returns + +`Promise`<[`TxStatus`](../modules.md#txstatus)\> + +A TxStatus object, containing the confirmation status and number of confirmations, plus block height if +the tx is included in the blockchain + +#### Implementation of + +[ElectrsAPI](../interfaces/ElectrsAPI.md).[waitForTxInclusion](../interfaces/ElectrsAPI.md#waitfortxinclusion) + +#### Defined in + +[src/external/electrs.ts:345](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L345) diff --git a/classes/DefaultEscrowAPI.md b/classes/DefaultEscrowAPI.md new file mode 100644 index 000000000..07e749010 --- /dev/null +++ b/classes/DefaultEscrowAPI.md @@ -0,0 +1,516 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultEscrowAPI + +# Class: DefaultEscrowAPI + +## Implements + +- [`EscrowAPI`](../interfaces/EscrowAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultEscrowAPI.md#constructor) + +### Properties + +- [api](DefaultEscrowAPI.md#api) +- [governanceCurrency](DefaultEscrowAPI.md#governancecurrency) +- [systemApi](DefaultEscrowAPI.md#systemapi) + +### Methods + +- [createLock](DefaultEscrowAPI.md#createlock) +- [getEscrowStake](DefaultEscrowAPI.md#getescrowstake) +- [getEscrowTotalStake](DefaultEscrowAPI.md#getescrowtotalstake) +- [getMaxPeriod](DefaultEscrowAPI.md#getmaxperiod) +- [getRewardEstimate](DefaultEscrowAPI.md#getrewardestimate) +- [getRewardPerBlock](DefaultEscrowAPI.md#getrewardperblock) +- [getRewardPerToken](DefaultEscrowAPI.md#getrewardpertoken) +- [getRewardTally](DefaultEscrowAPI.md#getrewardtally) +- [getRewards](DefaultEscrowAPI.md#getrewards) +- [getSpan](DefaultEscrowAPI.md#getspan) +- [getStakedBalance](DefaultEscrowAPI.md#getstakedbalance) +- [getTotalStakedBalance](DefaultEscrowAPI.md#gettotalstakedbalance) +- [increaseAmount](DefaultEscrowAPI.md#increaseamount) +- [increaseUnlockHeight](DefaultEscrowAPI.md#increaseunlockheight) +- [totalVotingSupply](DefaultEscrowAPI.md#totalvotingsupply) +- [votingBalance](DefaultEscrowAPI.md#votingbalance) +- [withdraw](DefaultEscrowAPI.md#withdraw) +- [withdrawRewards](DefaultEscrowAPI.md#withdrawrewards) + +## Constructors + +### constructor + +• **new DefaultEscrowAPI**(`api`, `governanceCurrency`, `systemApi`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `governanceCurrency` | `Currency` | +| `systemApi` | [`SystemAPI`](../interfaces/SystemAPI.md) | + +#### Defined in + +[src/parachain/escrow.ts:108](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L108) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/escrow.ts:109](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L109) + +___ + +### governanceCurrency + +• `Private` **governanceCurrency**: `Currency` + +#### Defined in + +[src/parachain/escrow.ts:110](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L110) + +___ + +### systemApi + +• `Private` **systemApi**: [`SystemAPI`](../interfaces/SystemAPI.md) + +#### Defined in + +[src/parachain/escrow.ts:111](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L111) + +## Methods + +### createLock + +▸ **createLock**(`amount`, `unlockHeight`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Governance token amount to lock (e.g. KINT or INTR) | +| `unlockHeight` | `number` | Block number to lock until | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +The amount can't be less than the max period (`getMaxPeriod` getter) to prevent rounding errors + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[createLock](../interfaces/EscrowAPI.md#createlock) + +#### Defined in + +[src/parachain/escrow.ts:114](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L114) + +___ + +### getEscrowStake + +▸ **getEscrowStake**(`accountId`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/escrow.ts:206](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L206) + +___ + +### getEscrowTotalStake + +▸ **getEscrowTotalStake**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/escrow.ts:211](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L211) + +___ + +### getMaxPeriod + +▸ **getMaxPeriod**(): `Promise`<`BN`\> + +#### Returns + +`Promise`<`BN`\> + +The maximum time for locks. + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[getMaxPeriod](../interfaces/EscrowAPI.md#getmaxperiod) + +#### Defined in + +[src/parachain/escrow.ts:265](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L265) + +___ + +### getRewardEstimate + +▸ **getRewardEstimate**(`accountId`, `amountToLock?`, `newLockEndHeight?`): `Promise`<{ `amount`: `MonetaryAmount`<`Currency`\> ; `apy`: `Big` }\> + +Estimate the annualized rewards for an account's staked amounts while applying an optional amount to increase +the locked stake by, and an optional lock time extension. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | User account ID | +| `amountToLock?` | `MonetaryAmount`<`Currency`\> | (optional) New amount to add to the current stake. Zero, null, or undefined are interpreted as no changes to the current stake for the estimation. | +| `newLockEndHeight?` | `number` | (optional) At which block number the stake lock should end. Zero, null, or undefined are interpreted as no lock extension used for the estimate. | + +#### Returns + +`Promise`<{ `amount`: `MonetaryAmount`<`Currency`\> ; `apy`: `Big` }\> + +The estimated total reward amount and annualized reward percentage (APY). + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[getRewardEstimate](../interfaces/EscrowAPI.md#getrewardestimate) + +#### Defined in + +[src/parachain/escrow.ts:147](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L147) + +___ + +### getRewardPerBlock + +▸ **getRewardPerBlock**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Defined in + +[src/parachain/escrow.ts:228](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L228) + +___ + +### getRewardPerToken + +▸ **getRewardPerToken**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/escrow.ts:222](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L222) + +___ + +### getRewardTally + +▸ **getRewardTally**(`accountId`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/escrow.ts:216](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L216) + +___ + +### getRewards + +▸ **getRewards**(`accountId`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | User account ID | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The rewards that can be withdrawn by the account + +**`Remarks`** + +Implements https://spec.interlay.io/spec/reward.html#computereward + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[getRewards](../interfaces/EscrowAPI.md#getrewards) + +#### Defined in + +[src/parachain/escrow.ts:139](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L139) + +___ + +### getSpan + +▸ **getSpan**(): `Promise`<`BN`\> + +#### Returns + +`Promise`<`BN`\> + +All future times are rounded by this. + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[getSpan](../interfaces/EscrowAPI.md#getspan) + +#### Defined in + +[src/parachain/escrow.ts:261](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L261) + +___ + +### getStakedBalance + +▸ **getStakedBalance**(`accountId`): `Promise`<[`StakedBalance`](../modules.md#stakedbalance)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | ID of the user whose stake to fetch | + +#### Returns + +`Promise`<[`StakedBalance`](../modules.md#stakedbalance)\> + +The staked amount and end block + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[getStakedBalance](../interfaces/EscrowAPI.md#getstakedbalance) + +#### Defined in + +[src/parachain/escrow.ts:233](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L233) + +___ + +### getTotalStakedBalance + +▸ **getTotalStakedBalance**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total amount of locked governance tokens + +**`Remarks`** + +- Expect poor performance from this function as more blocks are appended to the parachain. +It is not recommended to call this directly, but rather to query through interbtc-squid once implemented. + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[getTotalStakedBalance](../interfaces/EscrowAPI.md#gettotalstakedbalance) + +#### Defined in + +[src/parachain/escrow.ts:238](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L238) + +___ + +### increaseAmount + +▸ **increaseAmount**(`amount`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Governance token amount to lock (e.g. KINT or INTR) | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[increaseAmount](../interfaces/EscrowAPI.md#increaseamount) + +#### Defined in + +[src/parachain/escrow.ts:129](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L129) + +___ + +### increaseUnlockHeight + +▸ **increaseUnlockHeight**(`unlockHeight`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `unlockHeight` | `number` | The unlock height to increase by. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[increaseUnlockHeight](../interfaces/EscrowAPI.md#increaseunlockheight) + +#### Defined in + +[src/parachain/escrow.ts:134](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L134) + +___ + +### totalVotingSupply + +▸ **totalVotingSupply**(`blockNumber?`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blockNumber?` | `number` | The number of block to query state at | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The voting balance + +**`Remarks`** + +- Expect poor performance from this function as more blocks are appended to the parachain. +It is not recommended to call this directly, but rather to query through the indexer (currently `interbtc-index`). +- Logic is duplicated from Escrow pallet in the parachain + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[totalVotingSupply](../interfaces/EscrowAPI.md#totalvotingsupply) + +#### Defined in + +[src/parachain/escrow.ts:255](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L255) + +___ + +### votingBalance + +▸ **votingBalance**(`accountId`, `blockNumber?`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account whose voting balance to fetch | +| `blockNumber?` | `number` | The number of block to query state at | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The voting balance + +**`Remarks`** + +Logic is duplicated from Escrow pallet in the parachain + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[votingBalance](../interfaces/EscrowAPI.md#votingbalance) + +#### Defined in + +[src/parachain/escrow.ts:249](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L249) + +___ + +### withdraw + +▸ **withdraw**(): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Withdraws all locked governance currency + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[withdraw](../interfaces/EscrowAPI.md#withdraw) + +#### Defined in + +[src/parachain/escrow.ts:119](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L119) + +___ + +### withdrawRewards + +▸ **withdrawRewards**(): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Withdraws stake-to-vote rewards + +#### Implementation of + +[EscrowAPI](../interfaces/EscrowAPI.md).[withdrawRewards](../interfaces/EscrowAPI.md#withdrawrewards) + +#### Defined in + +[src/parachain/escrow.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L124) diff --git a/classes/DefaultFeeAPI.md b/classes/DefaultFeeAPI.md new file mode 100644 index 000000000..999c5b7b8 --- /dev/null +++ b/classes/DefaultFeeAPI.md @@ -0,0 +1,178 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultFeeAPI + +# Class: DefaultFeeAPI + +## Implements + +- [`FeeAPI`](../interfaces/FeeAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultFeeAPI.md#constructor) + +### Properties + +- [api](DefaultFeeAPI.md#api) +- [oracleAPI](DefaultFeeAPI.md#oracleapi) + +### Methods + +- [calculateAPY](DefaultFeeAPI.md#calculateapy) +- [getGriefingCollateral](DefaultFeeAPI.md#getgriefingcollateral) +- [getIssueFee](DefaultFeeAPI.md#getissuefee) +- [getIssueGriefingCollateralRate](DefaultFeeAPI.md#getissuegriefingcollateralrate) +- [getReplaceGriefingCollateralRate](DefaultFeeAPI.md#getreplacegriefingcollateralrate) + +## Constructors + +### constructor + +• **new DefaultFeeAPI**(`api`, `oracleAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `oracleAPI` | [`OracleAPI`](../interfaces/OracleAPI.md) | + +#### Defined in + +[src/parachain/fee.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L56) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/fee.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L56) + +___ + +### oracleAPI + +• `Private` **oracleAPI**: [`OracleAPI`](../interfaces/OracleAPI.md) + +#### Defined in + +[src/parachain/fee.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L56) + +## Methods + +### calculateAPY + +▸ **calculateAPY**(`feesWrapped`, `lockedCollateral`, `exchangeRate?`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `feesWrapped` | `MonetaryAmount`<`Currency`\> | Wrapped token fees accrued, in wrapped token (e.g. BTC) | +| `lockedCollateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Collateral value representing the value locked to gain yield. | +| `exchangeRate?` | `ExchangeRate`<`Currency`, [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | (Optional) Conversion rate, as a `Monetary.js` object | + +#### Returns + +`Promise`<`Big`\> + +The APY, given the parameters + +#### Implementation of + +[FeeAPI](../interfaces/FeeAPI.md).[calculateAPY](../interfaces/FeeAPI.md#calculateapy) + +#### Defined in + +[src/parachain/fee.ts:100](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L100) + +___ + +### getGriefingCollateral + +▸ **getGriefingCollateral**(`amount`, `type`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount, in BTC, for which to compute the required griefing collateral | +| `type` | `GriefingCollateralType` | Type of griefing collateral to compute (e.g. for issuing, replacing) | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +The griefing collateral + +#### Implementation of + +[FeeAPI](../interfaces/FeeAPI.md).[getGriefingCollateral](../interfaces/FeeAPI.md#getgriefingcollateral) + +#### Defined in + +[src/parachain/fee.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L58) + +___ + +### getIssueFee + +▸ **getIssueFee**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The percentage of issued token that is received by the vault as reward + +#### Implementation of + +[FeeAPI](../interfaces/FeeAPI.md).[getIssueFee](../interfaces/FeeAPI.md#getissuefee) + +#### Defined in + +[src/parachain/fee.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L95) + +___ + +### getIssueGriefingCollateralRate + +▸ **getIssueGriefingCollateralRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The griefing collateral rate for issuing InterBTC + +#### Implementation of + +[FeeAPI](../interfaces/FeeAPI.md).[getIssueGriefingCollateralRate](../interfaces/FeeAPI.md#getissuegriefingcollateralrate) + +#### Defined in + +[src/parachain/fee.ts:85](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L85) + +___ + +### getReplaceGriefingCollateralRate + +▸ **getReplaceGriefingCollateralRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The griefing collateral rate for the Vault replace request + +#### Implementation of + +[FeeAPI](../interfaces/FeeAPI.md).[getReplaceGriefingCollateralRate](../interfaces/FeeAPI.md#getreplacegriefingcollateralrate) + +#### Defined in + +[src/parachain/fee.ts:90](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L90) diff --git a/classes/DefaultInterBtcApi.md b/classes/DefaultInterBtcApi.md new file mode 100644 index 000000000..83a3f7b31 --- /dev/null +++ b/classes/DefaultInterBtcApi.md @@ -0,0 +1,466 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultInterBtcApi + +# Class: DefaultInterBtcApi + +## Implements + +- [`InterBtcApi`](../interfaces/InterBtcApi.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultInterBtcApi.md#constructor) + +### Properties + +- [amm](DefaultInterBtcApi.md#amm) +- [api](DefaultInterBtcApi.md#api) +- [assetRegistry](DefaultInterBtcApi.md#assetregistry) +- [btcRelay](DefaultInterBtcApi.md#btcrelay) +- [electrsAPI](DefaultInterBtcApi.md#electrsapi) +- [escrow](DefaultInterBtcApi.md#escrow) +- [faucet](DefaultInterBtcApi.md#faucet) +- [fee](DefaultInterBtcApi.md#fee) +- [issue](DefaultInterBtcApi.md#issue) +- [loans](DefaultInterBtcApi.md#loans) +- [nomination](DefaultInterBtcApi.md#nomination) +- [oracle](DefaultInterBtcApi.md#oracle) +- [redeem](DefaultInterBtcApi.md#redeem) +- [replace](DefaultInterBtcApi.md#replace) +- [rewards](DefaultInterBtcApi.md#rewards) +- [system](DefaultInterBtcApi.md#system) +- [tokens](DefaultInterBtcApi.md#tokens) +- [transaction](DefaultInterBtcApi.md#transaction) +- [vaults](DefaultInterBtcApi.md#vaults) + +### Accessors + +- [account](DefaultInterBtcApi.md#account) + +### Methods + +- [disconnect](DefaultInterBtcApi.md#disconnect) +- [getGovernanceCurrency](DefaultInterBtcApi.md#getgovernancecurrency) +- [getRelayChainCurrency](DefaultInterBtcApi.md#getrelaychaincurrency) +- [getWrappedCurrency](DefaultInterBtcApi.md#getwrappedcurrency) +- [removeAccount](DefaultInterBtcApi.md#removeaccount) +- [setAccount](DefaultInterBtcApi.md#setaccount) + +## Constructors + +### constructor + +• **new DefaultInterBtcApi**(`api`, `bitcoinNetwork?`, `_account?`, `esploraNetwork?`) + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | `undefined` | +| `bitcoinNetwork` | [`BitcoinNetwork`](../modules.md#bitcoinnetwork) | `"mainnet"` | +| `_account?` | `AddressOrPair` | `undefined` | +| `esploraNetwork?` | `string` | `undefined` | + +#### Defined in + +[src/interbtc-api.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L95) + +## Properties + +### amm + +• `Readonly` **amm**: [`AMMAPI`](../interfaces/AMMAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[amm](../interfaces/InterBtcApi.md#amm) + +#### Defined in + +[src/interbtc-api.ts:92](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L92) + +___ + +### api + +• `Readonly` **api**: `ApiPromise` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[api](../interfaces/InterBtcApi.md#api) + +#### Defined in + +[src/interbtc-api.ts:96](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L96) + +___ + +### assetRegistry + +• `Readonly` **assetRegistry**: [`AssetRegistryAPI`](../interfaces/AssetRegistryAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[assetRegistry](../interfaces/InterBtcApi.md#assetregistry) + +#### Defined in + +[src/interbtc-api.ts:90](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L90) + +___ + +### btcRelay + +• `Readonly` **btcRelay**: [`BTCRelayAPI`](../interfaces/BTCRelayAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[btcRelay](../interfaces/InterBtcApi.md#btcrelay) + +#### Defined in + +[src/interbtc-api.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L82) + +___ + +### electrsAPI + +• `Readonly` **electrsAPI**: [`ElectrsAPI`](../interfaces/ElectrsAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[electrsAPI](../interfaces/InterBtcApi.md#electrsapi) + +#### Defined in + +[src/interbtc-api.ts:81](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L81) + +___ + +### escrow + +• `Readonly` **escrow**: [`EscrowAPI`](../interfaces/EscrowAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[escrow](../interfaces/InterBtcApi.md#escrow) + +#### Defined in + +[src/interbtc-api.ts:89](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L89) + +___ + +### faucet + +• `Readonly` **faucet**: [`FaucetClient`](FaucetClient.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[faucet](../interfaces/InterBtcApi.md#faucet) + +#### Defined in + +[src/interbtc-api.ts:79](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L79) + +___ + +### fee + +• `Readonly` **fee**: [`FeeAPI`](../interfaces/FeeAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[fee](../interfaces/InterBtcApi.md#fee) + +#### Defined in + +[src/interbtc-api.ts:86](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L86) + +___ + +### issue + +• `Readonly` **issue**: [`IssueAPI`](../interfaces/IssueAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[issue](../interfaces/InterBtcApi.md#issue) + +#### Defined in + +[src/interbtc-api.ts:77](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L77) + +___ + +### loans + +• `Readonly` **loans**: [`LoansAPI`](../interfaces/LoansAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[loans](../interfaces/InterBtcApi.md#loans) + +#### Defined in + +[src/interbtc-api.ts:91](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L91) + +___ + +### nomination + +• `Readonly` **nomination**: [`NominationAPI`](../interfaces/NominationAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[nomination](../interfaces/InterBtcApi.md#nomination) + +#### Defined in + +[src/interbtc-api.ts:87](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L87) + +___ + +### oracle + +• `Readonly` **oracle**: [`OracleAPI`](../interfaces/OracleAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[oracle](../interfaces/InterBtcApi.md#oracle) + +#### Defined in + +[src/interbtc-api.ts:80](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L80) + +___ + +### redeem + +• `Readonly` **redeem**: [`RedeemAPI`](../interfaces/RedeemAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[redeem](../interfaces/InterBtcApi.md#redeem) + +#### Defined in + +[src/interbtc-api.ts:78](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L78) + +___ + +### replace + +• `Readonly` **replace**: [`ReplaceAPI`](../interfaces/ReplaceAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[replace](../interfaces/InterBtcApi.md#replace) + +#### Defined in + +[src/interbtc-api.ts:85](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L85) + +___ + +### rewards + +• `Readonly` **rewards**: [`RewardsAPI`](../interfaces/RewardsAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[rewards](../interfaces/InterBtcApi.md#rewards) + +#### Defined in + +[src/interbtc-api.ts:88](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L88) + +___ + +### system + +• `Readonly` **system**: [`SystemAPI`](../interfaces/SystemAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[system](../interfaces/InterBtcApi.md#system) + +#### Defined in + +[src/interbtc-api.ts:84](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L84) + +___ + +### tokens + +• `Readonly` **tokens**: [`TokensAPI`](../interfaces/TokensAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[tokens](../interfaces/InterBtcApi.md#tokens) + +#### Defined in + +[src/interbtc-api.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L83) + +___ + +### transaction + +• `Readonly` **transaction**: [`TransactionAPI`](../interfaces/TransactionAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[transaction](../interfaces/InterBtcApi.md#transaction) + +#### Defined in + +[src/interbtc-api.ts:93](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L93) + +___ + +### vaults + +• `Readonly` **vaults**: [`VaultsAPI`](../interfaces/VaultsAPI.md) + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[vaults](../interfaces/InterBtcApi.md#vaults) + +#### Defined in + +[src/interbtc-api.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L76) + +## Accessors + +### account + +• `get` **account**(): `undefined` \| `AddressOrPair` + +#### Returns + +`undefined` \| `AddressOrPair` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[account](../interfaces/InterBtcApi.md#account) + +#### Defined in + +[src/interbtc-api.ts:169](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L169) + +## Methods + +### disconnect + +▸ **disconnect**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[disconnect](../interfaces/InterBtcApi.md#disconnect) + +#### Defined in + +[src/interbtc-api.ts:191](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L191) + +___ + +### getGovernanceCurrency + +▸ **getGovernanceCurrency**(): `Currency` + +#### Returns + +`Currency` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[getGovernanceCurrency](../interfaces/InterBtcApi.md#getgovernancecurrency) + +#### Defined in + +[src/interbtc-api.ts:173](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L173) + +___ + +### getRelayChainCurrency + +▸ **getRelayChainCurrency**(): `Currency` + +#### Returns + +`Currency` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[getRelayChainCurrency](../interfaces/InterBtcApi.md#getrelaychaincurrency) + +#### Defined in + +[src/interbtc-api.ts:185](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L185) + +___ + +### getWrappedCurrency + +▸ **getWrappedCurrency**(): `Currency` + +#### Returns + +`Currency` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[getWrappedCurrency](../interfaces/InterBtcApi.md#getwrappedcurrency) + +#### Defined in + +[src/interbtc-api.ts:179](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L179) + +___ + +### removeAccount + +▸ **removeAccount**(): `void` + +#### Returns + +`void` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[removeAccount](../interfaces/InterBtcApi.md#removeaccount) + +#### Defined in + +[src/interbtc-api.ts:165](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L165) + +___ + +### setAccount + +▸ **setAccount**(`account`, `signer?`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `AddressOrPair` | +| `signer?` | `Signer` | + +#### Returns + +`void` + +#### Implementation of + +[InterBtcApi](../interfaces/InterBtcApi.md).[setAccount](../interfaces/InterBtcApi.md#setaccount) + +#### Defined in + +[src/interbtc-api.ts:155](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L155) diff --git a/classes/DefaultIssueAPI.md b/classes/DefaultIssueAPI.md new file mode 100644 index 000000000..a7bdb8b1f --- /dev/null +++ b/classes/DefaultIssueAPI.md @@ -0,0 +1,583 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultIssueAPI + +# Class: DefaultIssueAPI + +## Implements + +- [`IssueAPI`](../interfaces/IssueAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultIssueAPI.md#constructor) + +### Properties + +- [api](DefaultIssueAPI.md#api) +- [btcNetwork](DefaultIssueAPI.md#btcnetwork) +- [electrsAPI](DefaultIssueAPI.md#electrsapi) +- [transactionAPI](DefaultIssueAPI.md#transactionapi) +- [vaultsAPI](DefaultIssueAPI.md#vaultsapi) +- [wrappedCurrency](DefaultIssueAPI.md#wrappedcurrency) + +### Methods + +- [buildCancelIssueExtrinsic](DefaultIssueAPI.md#buildcancelissueextrinsic) +- [buildExecuteIssueExtrinsic](DefaultIssueAPI.md#buildexecuteissueextrinsic) +- [buildRequestIssueExtrinsic](DefaultIssueAPI.md#buildrequestissueextrinsic) +- [cancel](DefaultIssueAPI.md#cancel) +- [execute](DefaultIssueAPI.md#execute) +- [getDustValue](DefaultIssueAPI.md#getdustvalue) +- [getFeeRate](DefaultIssueAPI.md#getfeerate) +- [getFeesToPay](DefaultIssueAPI.md#getfeestopay) +- [getIssuePeriod](DefaultIssueAPI.md#getissueperiod) +- [getRequestById](DefaultIssueAPI.md#getrequestbyid) +- [getRequestLimits](DefaultIssueAPI.md#getrequestlimits) +- [getRequestsByIds](DefaultIssueAPI.md#getrequestsbyids) +- [getVaultIssuableAmount](DefaultIssueAPI.md#getvaultissuableamount) +- [list](DefaultIssueAPI.md#list) +- [request](DefaultIssueAPI.md#request) +- [requestAdvanced](DefaultIssueAPI.md#requestadvanced) +- [setIssuePeriod](DefaultIssueAPI.md#setissueperiod) + +## Constructors + +### constructor + +• **new DefaultIssueAPI**(`api`, `btcNetwork`, `electrsAPI`, `wrappedCurrency`, `vaultsAPI`, `transactionAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `btcNetwork` | `Network` | +| `electrsAPI` | [`ElectrsAPI`](../interfaces/ElectrsAPI.md) | +| `wrappedCurrency` | `Currency` | +| `vaultsAPI` | [`VaultsAPI`](../interfaces/VaultsAPI.md) | +| `transactionAPI` | [`TransactionAPI`](../interfaces/TransactionAPI.md) | + +#### Defined in + +[src/parachain/issue.ts:188](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L188) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/issue.ts:189](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L189) + +___ + +### btcNetwork + +• `Private` **btcNetwork**: `Network` + +#### Defined in + +[src/parachain/issue.ts:190](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L190) + +___ + +### electrsAPI + +• `Private` **electrsAPI**: [`ElectrsAPI`](../interfaces/ElectrsAPI.md) + +#### Defined in + +[src/parachain/issue.ts:191](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L191) + +___ + +### transactionAPI + +• `Private` **transactionAPI**: [`TransactionAPI`](../interfaces/TransactionAPI.md) + +#### Defined in + +[src/parachain/issue.ts:194](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L194) + +___ + +### vaultsAPI + +• `Private` **vaultsAPI**: [`VaultsAPI`](../interfaces/VaultsAPI.md) + +#### Defined in + +[src/parachain/issue.ts:193](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L193) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/issue.ts:192](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L192) + +## Methods + +### buildCancelIssueExtrinsic + +▸ **buildCancelIssueExtrinsic**(`requestId`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a cancel issue extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID returned by the issue request transaction | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A cancel issue submittable extrinsic. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[buildCancelIssueExtrinsic](../interfaces/IssueAPI.md#buildcancelissueextrinsic) + +#### Defined in + +[src/parachain/issue.ts:295](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L295) + +___ + +### buildExecuteIssueExtrinsic + +▸ **buildExecuteIssueExtrinsic**(`requestId`, `btcTxId`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build an issue execution extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID returned by the issue request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +An execute issue submittable extrinsic. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[buildExecuteIssueExtrinsic](../interfaces/IssueAPI.md#buildexecuteissueextrinsic) + +#### Defined in + +[src/parachain/issue.ts:281](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L281) + +___ + +### buildRequestIssueExtrinsic + +▸ **buildRequestIssueExtrinsic**(`vaultId`, `amount`, `griefingCollateralCurrency?`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build an issue request extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | The vault ID of the vault to issue with. | +| `amount` | `MonetaryAmount`<`Currency`\> | wrapped token amount to issue. | +| `griefingCollateralCurrency?` | [`CurrencyExt`](../modules.md#currencyext) | (optional) Currency in which griefing collateral will be locked. | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +An execute issue submittable extrinsic. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[buildRequestIssueExtrinsic](../interfaces/IssueAPI.md#buildrequestissueextrinsic) + +#### Defined in + +[src/parachain/issue.ts:256](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L256) + +___ + +### cancel + +▸ **cancel**(`requestId`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Create an issue cancellation transaction. After the issue period has elapsed, +the issuance request can be cancelled. As a result, the griefing collateral +of the requester will be slashed and sent to the vault that had prepared to issue. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID returned by the issue request transaction | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[cancel](../interfaces/IssueAPI.md#cancel) + +#### Defined in + +[src/parachain/issue.ts:300](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L300) + +___ + +### execute + +▸ **execute**(`requestId`, `btcTxId`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Create an issue execution transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | - | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +If `txId` is not set, the `merkleProof` and `rawTx` must both be set. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[execute](../interfaces/IssueAPI.md#execute) + +#### Defined in + +[src/parachain/issue.ts:290](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L290) + +___ + +### getDustValue + +▸ **getDustValue**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The minimum amount of wrapped tokens that is accepted for issue requests; any lower values would +risk the bitcoin client to reject the payment + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getDustValue](../interfaces/IssueAPI.md#getdustvalue) + +#### Defined in + +[src/parachain/issue.ts:333](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L333) + +___ + +### getFeeRate + +▸ **getFeeRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The fee charged for issuing. For instance, "0.005" stands for 0.5% + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getFeeRate](../interfaces/IssueAPI.md#getfeerate) + +#### Defined in + +[src/parachain/issue.ts:338](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L338) + +___ + +### getFeesToPay + +▸ **getFeesToPay**(`amount`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount, in BTC, for which to compute the issue fees | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The fees, in BTC + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getFeesToPay](../interfaces/IssueAPI.md#getfeestopay) + +#### Defined in + +[src/parachain/issue.ts:328](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L328) + +___ + +### getIssuePeriod + +▸ **getIssuePeriod**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The time difference in number of blocks between an issue request is created +and required completion time by a user. The issue period has an upper limit +to prevent griefing of vault collateral. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getIssuePeriod](../interfaces/IssueAPI.md#getissueperiod) + +#### Defined in + +[src/parachain/issue.ts:311](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L311) + +___ + +### getRequestById + +▸ **getRequestById**(`issueId`): `Promise`<[`Issue`](../interfaces/Issue.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `issueId` | `string` \| `H256` | The ID of the issue request to fetch | + +#### Returns + +`Promise`<[`Issue`](../interfaces/Issue.md)\> + +An issue request object + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getRequestById](../interfaces/IssueAPI.md#getrequestbyid) + +#### Defined in + +[src/parachain/issue.ts:343](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L343) + +___ + +### getRequestLimits + +▸ **getRequestLimits**(`vaults?`): `Promise`<`IssueLimits`\> + +Gets the threshold for issuing with a single vault, and the maximum total +issue request size. Additionally passes the list of vaults for caching. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaults?` | `Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | (optional) A list of the vaults available to issue from. If not provided, will fetch from the parachain (incurring an extra request). | + +#### Returns + +`Promise`<`IssueLimits`\> + +An object of type {singleVault, maxTotal, vaultsCache} + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getRequestLimits](../interfaces/IssueAPI.md#getrequestlimits) + +#### Defined in + +[src/parachain/issue.ts:197](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L197) + +___ + +### getRequestsByIds + +▸ **getRequestsByIds**(`issueIds`): `Promise`<[`Issue`](../interfaces/Issue.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `issueIds` | (`string` \| `H256`)[] | + +#### Returns + +`Promise`<[`Issue`](../interfaces/Issue.md)[]\> + +The issue request objects + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getRequestsByIds](../interfaces/IssueAPI.md#getrequestsbyids) + +#### Defined in + +[src/parachain/issue.ts:347](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L347) + +___ + +### getVaultIssuableAmount + +▸ **getVaultIssuableAmount**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The amount of wrapped tokens issuable by this vault + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[getVaultIssuableAmount](../interfaces/IssueAPI.md#getvaultissuableamount) + +#### Defined in + +[src/parachain/issue.ts:371](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L371) + +___ + +### list + +▸ **list**(): `Promise`<[`Issue`](../interfaces/Issue.md)[]\> + +#### Returns + +`Promise`<[`Issue`](../interfaces/Issue.md)[]\> + +An array containing the issue requests + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[list](../interfaces/IssueAPI.md#list) + +#### Defined in + +[src/parachain/issue.ts:316](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L316) + +___ + +### request + +▸ **request**(`amount`, `vaultAccountId?`, `collateralCurrency?`, `atomic?`, `cachedVaults?`, `griefingCollateralCurrency?`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Request issuing wrapped tokens (e.g. interBTC, kBTC). + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | `undefined` | wrapped token amount to issue. | +| `vaultAccountId?` | `AccountId` | `undefined` | - | +| `collateralCurrency?` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | `undefined` | (optional) Collateral currency for backing wrapped tokens | +| `atomic` | `boolean` | `true` | (optional) Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. Defaults to false. | +| `cachedVaults?` | `Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | `undefined` | (optional) A list of all vaults usable for issue. If not provided, will fetch from the parachain. | +| `griefingCollateralCurrency?` | [`CurrencyExt`](../modules.md#currencyext) | `undefined` | (optional) Currency in which griefing collateral will be locked. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +An extrinsic with event. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[request](../interfaces/IssueAPI.md#request) + +#### Defined in + +[src/parachain/issue.ts:219](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L219) + +___ + +### requestAdvanced + +▸ **requestAdvanced**(`amountsPerVault`, `atomic`, `griefingCollateralCurrency?`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Create a batch of aggregated issue transactions (to one or more vaults). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amountsPerVault` | `Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | A mapping of vaults to issue from, and wrapped token amounts to issue using each vault | +| `atomic` | `boolean` | Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. | +| `griefingCollateralCurrency?` | [`CurrencyExt`](../modules.md#currencyext) | (optional) Currency in which griefing collateral will be locked. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[requestAdvanced](../interfaces/IssueAPI.md#requestadvanced) + +#### Defined in + +[src/parachain/issue.ts:269](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L269) + +___ + +### setIssuePeriod + +▸ **setIssuePeriod**(`blocks`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blocks` | `number` | The time difference in number of blocks between an issue request is created and required completion time by a user. The issue period has an upper limit to prevent griefing of vault collateral. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Testnet utility function + +#### Implementation of + +[IssueAPI](../interfaces/IssueAPI.md).[setIssuePeriod](../interfaces/IssueAPI.md#setissueperiod) + +#### Defined in + +[src/parachain/issue.ts:305](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L305) diff --git a/classes/DefaultLoansAPI.md b/classes/DefaultLoansAPI.md new file mode 100644 index 000000000..2b44573e3 --- /dev/null +++ b/classes/DefaultLoansAPI.md @@ -0,0 +1,1215 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultLoansAPI + +# Class: DefaultLoansAPI + +## Implements + +- [`LoansAPI`](../interfaces/LoansAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultLoansAPI.md#constructor) + +### Properties + +- [api](DefaultLoansAPI.md#api) +- [oracleAPI](DefaultLoansAPI.md#oracleapi) +- [wrappedCurrency](DefaultLoansAPI.md#wrappedcurrency) + +### Methods + +- [\_calculateAccumulatedDebt](DefaultLoansAPI.md#_calculateaccumulateddebt) +- [\_calculateLiquidityAndCapacityAmounts](DefaultLoansAPI.md#_calculateliquidityandcapacityamounts) +- [\_checkLoanAssetDataAvailability](DefaultLoansAPI.md#_checkloanassetdataavailability) +- [\_checkMarketState](DefaultLoansAPI.md#_checkmarketstate) +- [\_getAccruedBorrowReward](DefaultLoansAPI.md#_getaccruedborrowreward) +- [\_getAccruedSupplyReward](DefaultLoansAPI.md#_getaccruedsupplyreward) +- [\_getBorrowApy](DefaultLoansAPI.md#_getborrowapy) +- [\_getBorrowPosition](DefaultLoansAPI.md#_getborrowposition) +- [\_getLatestBorrowIndex](DefaultLoansAPI.md#_getlatestborrowindex) +- [\_getLatestSupplyIndex](DefaultLoansAPI.md#_getlatestsupplyindex) +- [\_getLendAndBorrowYearlyRewardAmount](DefaultLoansAPI.md#_getlendandborrowyearlyrewardamount) +- [\_getLendApy](DefaultLoansAPI.md#_getlendapy) +- [\_getLendPosition](DefaultLoansAPI.md#_getlendposition) +- [\_getLoanAsset](DefaultLoansAPI.md#_getloanasset) +- [\_getPositionsOfAccount](DefaultLoansAPI.md#_getpositionsofaccount) +- [\_getRewardCurrency](DefaultLoansAPI.md#_getrewardcurrency) +- [\_getSubsidyReward](DefaultLoansAPI.md#_getsubsidyreward) +- [\_getTotalLiquidityCapacityAndBorrows](DefaultLoansAPI.md#_gettotalliquiditycapacityandborrows) +- [borrow](DefaultLoansAPI.md#borrow) +- [claimAllSubsidyRewards](DefaultLoansAPI.md#claimallsubsidyrewards) +- [convertLendTokenToUnderlyingCurrency](DefaultLoansAPI.md#convertlendtokentounderlyingcurrency) +- [disableAsCollateral](DefaultLoansAPI.md#disableascollateral) +- [enableAsCollateral](DefaultLoansAPI.md#enableascollateral) +- [getAccruedRewardsOfAccount](DefaultLoansAPI.md#getaccruedrewardsofaccount) +- [getBorrowPositionsOfAccount](DefaultLoansAPI.md#getborrowpositionsofaccount) +- [getBorrowerAccountIds](DefaultLoansAPI.md#getborroweraccountids) +- [getLendPositionAmounts](DefaultLoansAPI.md#getlendpositionamounts) +- [getLendPositionsOfAccount](DefaultLoansAPI.md#getlendpositionsofaccount) +- [getLendTokenExchangeRates](DefaultLoansAPI.md#getlendtokenexchangerates) +- [getLendTokenIdFromUnderlyingCurrency](DefaultLoansAPI.md#getlendtokenidfromunderlyingcurrency) +- [getLendTokens](DefaultLoansAPI.md#getlendtokens) +- [getLendingStats](DefaultLoansAPI.md#getlendingstats) +- [getLiquidationThresholdLiquidity](DefaultLoansAPI.md#getliquidationthresholdliquidity) +- [getLoanAssets](DefaultLoansAPI.md#getloanassets) +- [getLoansMarkets](DefaultLoansAPI.md#getloansmarkets) +- [getUndercollateralizedBorrowers](DefaultLoansAPI.md#getundercollateralizedborrowers) +- [lend](DefaultLoansAPI.md#lend) +- [liquidateBorrowPosition](DefaultLoansAPI.md#liquidateborrowposition) +- [repay](DefaultLoansAPI.md#repay) +- [repayAll](DefaultLoansAPI.md#repayall) +- [withdraw](DefaultLoansAPI.md#withdraw) +- [withdrawAll](DefaultLoansAPI.md#withdrawall) +- [getLendTokenFromUnderlyingCurrency](DefaultLoansAPI.md#getlendtokenfromunderlyingcurrency) + +## Constructors + +### constructor + +• **new DefaultLoansAPI**(`api`, `wrappedCurrency`, `oracleAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `wrappedCurrency` | `Currency` | +| `oracleAPI` | [`OracleAPI`](../interfaces/OracleAPI.md) | + +#### Defined in + +[src/parachain/loans.ts:241](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L241) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/loans.ts:241](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L241) + +___ + +### oracleAPI + +• `Private` **oracleAPI**: [`OracleAPI`](../interfaces/OracleAPI.md) + +#### Defined in + +[src/parachain/loans.ts:241](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L241) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/loans.ts:241](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L241) + +## Methods + +### \_calculateAccumulatedDebt + +▸ **_calculateAccumulatedDebt**(`borrowedAmount`, `snapshotBorrowIndex`, `currentBorrowIndex`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `borrowedAmount` | `Big` | +| `snapshotBorrowIndex` | `Big` | +| `currentBorrowIndex` | `Big` | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/loans.ts:402](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L402) + +___ + +### \_calculateLiquidityAndCapacityAmounts + +▸ **_calculateLiquidityAndCapacityAmounts**(`underlyingCurrency`, `lendTokenTotalIssuance`, `totalBorrows`, `exchangeRate`): [`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | +| `lendTokenTotalIssuance` | `Big` | +| `totalBorrows` | `Big` | +| `exchangeRate` | `Big` | + +#### Returns + +[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>] + +#### Defined in + +[src/parachain/loans.ts:583](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L583) + +___ + +### \_checkLoanAssetDataAvailability + +▸ `Private` **_checkLoanAssetDataAvailability**(`positions`, `loanAssets`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `positions` | [`LoanPosition`](../interfaces/LoanPosition.md)[] | +| `loanAssets` | [`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](../interfaces/LoanAsset.md)\> | + +#### Returns + +`void` + +#### Defined in + +[src/parachain/loans.ts:459](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L459) + +___ + +### \_checkMarketState + +▸ **_checkMarketState**(`currency`, `action`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | +| `action` | `string` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/parachain/loans.ts:843](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L843) + +___ + +### \_getAccruedBorrowReward + +▸ **_getAccruedBorrowReward**(`accountId`, `underlyingCurrencyId`, `rewardCurrency`, `currentBlock`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `underlyingCurrencyId` | [`CurrencyId`](../interfaces/CurrencyId.md) | +| `rewardCurrency` | [`CurrencyExt`](../modules.md#currencyext) | +| `currentBlock` | `number` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Defined in + +[src/parachain/loans.ts:784](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L784) + +___ + +### \_getAccruedSupplyReward + +▸ **_getAccruedSupplyReward**(`accountId`, `underlyingCurrencyId`, `lendTokenId`, `rewardCurrency`, `currentBlock`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `underlyingCurrencyId` | [`CurrencyId`](../interfaces/CurrencyId.md) | +| `lendTokenId` | [`CurrencyId`](../interfaces/CurrencyId.md) | +| `rewardCurrency` | [`CurrencyExt`](../modules.md#currencyext) | +| `currentBlock` | `number` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Defined in + +[src/parachain/loans.ts:740](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L740) + +___ + +### \_getBorrowApy + +▸ **_getBorrowApy**(`underlyingCurrencyId`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/loans.ts:553](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L553) + +___ + +### \_getBorrowPosition + +▸ **_getBorrowPosition**(`accountId`, `underlyingCurrency`): `Promise`<``null`` \| [`BorrowPosition`](../interfaces/BorrowPosition.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`Promise`<``null`` \| [`BorrowPosition`](../interfaces/BorrowPosition.md)\> + +#### Defined in + +[src/parachain/loans.ts:412](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L412) + +___ + +### \_getLatestBorrowIndex + +▸ **_getLatestBorrowIndex**(`underlyingCurrencyId`, `currentBlockNumber`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrencyId` | [`CurrencyId`](../interfaces/CurrencyId.md) | +| `currentBlockNumber` | `number` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/loans.ts:761](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L761) + +___ + +### \_getLatestSupplyIndex + +▸ **_getLatestSupplyIndex**(`underlyingCurrencyId`, `lendTokenId`, `currentBlockNumber`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrencyId` | [`CurrencyId`](../interfaces/CurrencyId.md) | +| `lendTokenId` | [`CurrencyId`](../interfaces/CurrencyId.md) | +| `currentBlockNumber` | `number` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/loans.ts:713](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L713) + +___ + +### \_getLendAndBorrowYearlyRewardAmount + +▸ **_getLendAndBorrowYearlyRewardAmount**(`underlyingCurrencyId`, `totalLiquidity`, `totalBorrows`): `Promise`<[`Big`, `Big`]\> + +Get the lend and borrow annual rewards for 1 UNIT of a given underlying currency id. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | currency id to get reward amounts for. | +| `totalLiquidity` | `Big` | - | +| `totalBorrows` | `Big` | - | + +#### Returns + +`Promise`<[`Big`, `Big`]\> + +Annualized lend and borrow rewards for 1 unit of the given underlying currency. + +#### Defined in + +[src/parachain/loans.ts:605](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L605) + +___ + +### \_getLendApy + +▸ **_getLendApy**(`underlyingCurrencyId`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/loans.ts:546](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L546) + +___ + +### \_getLendPosition + +▸ **_getLendPosition**(`accountId`, `underlyingCurrency`, `lendTokenId`): `Promise`<``null`` \| [`CollateralPosition`](../interfaces/CollateralPosition.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | +| `lendTokenId` | `InterbtcPrimitivesCurrencyId` | + +#### Returns + +`Promise`<``null`` \| [`CollateralPosition`](../interfaces/CollateralPosition.md)\> + +#### Defined in + +[src/parachain/loans.ts:373](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L373) + +___ + +### \_getLoanAsset + +▸ **_getLoanAsset**(`underlyingCurrencyId`, `marketData`): `Promise`<[[`CurrencyExt`](../modules.md#currencyext), [`LoanAsset`](../interfaces/LoanAsset.md)]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | +| `marketData` | [`LoansMarket`](../interfaces/LoansMarket.md) | + +#### Returns + +`Promise`<[[`CurrencyExt`](../modules.md#currencyext), [`LoanAsset`](../interfaces/LoanAsset.md)]\> + +#### Defined in + +[src/parachain/loans.ts:647](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L647) + +___ + +### \_getPositionsOfAccount + +▸ **_getPositionsOfAccount**<`Position`\>(`accountId`, `getSinglePosition`): `Promise`<`Position`[]\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `Position` | extends [`LoanPosition`](../interfaces/LoanPosition.md) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `getSinglePosition` | (`accountId`: `AccountId`, `underlyingCurrency`: [`CurrencyExt`](../modules.md#currencyext), `lendTokenId`: `InterbtcPrimitivesCurrencyId`) => `Promise`<``null`` \| `Position`\> | + +#### Returns + +`Promise`<`Position`[]\> + +#### Defined in + +[src/parachain/loans.ts:433](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L433) + +___ + +### \_getRewardCurrency + +▸ **_getRewardCurrency**(): `Promise`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Returns + +`Promise`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/loans.ts:632](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L632) + +___ + +### \_getSubsidyReward + +▸ **_getSubsidyReward**(`amount`, `rewardCurrency`): ``null`` \| `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `Big` | +| `rewardCurrency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +``null`` \| `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/loans.ts:638](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L638) + +___ + +### \_getTotalLiquidityCapacityAndBorrows + +▸ **_getTotalLiquidityCapacityAndBorrows**(`underlyingCurrency`, `underlyingCurrencyId`): `Promise`<[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | + +#### Returns + +`Promise`<[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>]\> + +#### Defined in + +[src/parachain/loans.ts:560](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L560) + +___ + +### borrow + +▸ **borrow**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Borrow currency from the protocol. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to borrow. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to borrow. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no active market for `underlyingCurrency`. + +**`Throws`** + +If there is not enough collateral provided by account for +`amount` of `underlyingCurrency`. + +**`Throws`** + +If `amount` is higher than available amount of `underlyingCurrency` +in the protocol. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[borrow](../interfaces/LoansAPI.md#borrow) + +#### Defined in + +[src/parachain/loans.ts:906](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L906) + +___ + +### claimAllSubsidyRewards + +▸ **claimAllSubsidyRewards**(): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Claim subsidy rewards for all markets available for account. + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[claimAllSubsidyRewards](../interfaces/LoansAPI.md#claimallsubsidyrewards) + +#### Defined in + +[src/parachain/loans.ts:900](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L900) + +___ + +### convertLendTokenToUnderlyingCurrency + +▸ **convertLendTokenToUnderlyingCurrency**(`amount`, `underlyingCurrencyId`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `Big` | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/loans.ts:275](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L275) + +___ + +### disableAsCollateral + +▸ **disableAsCollateral**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Enable lend position of account as collateral for borrowing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to enable as collateral. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no existing lend position for `currency`. + +**`Throws`** + +If disabling lend position of `currency` would bring +account under collateral threshold. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[disableAsCollateral](../interfaces/LoansAPI.md#disableascollateral) + +#### Defined in + +[src/parachain/loans.ts:891](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L891) + +___ + +### enableAsCollateral + +▸ **enableAsCollateral**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Enable lend position of account as collateral for borrowing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to enable as collateral. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no existing lend position for `currency`. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[enableAsCollateral](../interfaces/LoansAPI.md#enableascollateral) + +#### Defined in + +[src/parachain/loans.ts:882](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L882) + +___ + +### getAccruedRewardsOfAccount + +▸ **getAccruedRewardsOfAccount**(`accountId`): `Promise`<[`AccruedRewards`](../interfaces/AccruedRewards.md)\> + +Get accrued subsidy rewards amounts for the account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account to get rewards for | + +#### Returns + +`Promise`<[`AccruedRewards`](../interfaces/AccruedRewards.md)\> + +Total amount how much rewards the account can claim and rewards per market. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getAccruedRewardsOfAccount](../interfaces/LoansAPI.md#getaccruedrewardsofaccount) + +#### Defined in + +[src/parachain/loans.ts:803](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L803) + +___ + +### getBorrowPositionsOfAccount + +▸ **getBorrowPositionsOfAccount**(`accountId`): `Promise`<[`BorrowPosition`](../interfaces/BorrowPosition.md)[]\> + +Get the borrow positions for given account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | the account Id for which to get borrow positions | + +#### Returns + +`Promise`<[`BorrowPosition`](../interfaces/BorrowPosition.md)[]\> + +Array of borrow positions of account. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getBorrowPositionsOfAccount](../interfaces/LoansAPI.md#getborrowpositionsofaccount) + +#### Defined in + +[src/parachain/loans.ts:455](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L455) + +___ + +### getBorrowerAccountIds + +▸ **getBorrowerAccountIds**(): `Promise`<`AccountId`[]\> + +#### Returns + +`Promise`<`AccountId`[]\> + +An array of `AccountId`s which historically borrowed from the lending protocol. +This includes accounts with zero outstanding debt. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getBorrowerAccountIds](../interfaces/LoansAPI.md#getborroweraccountids) + +#### Defined in + +[src/parachain/loans.ts:337](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L337) + +___ + +### getLendPositionAmounts + +▸ **getLendPositionAmounts**(`accountId`, `lendTokenId`, `underlyingCurrencyId`): `Promise`<[`Big`, `Big`]\> + +Get lend position amounts in both underlying and lend currencies. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | AccountId to get position information about | +| `lendTokenId` | `InterbtcPrimitivesCurrencyId` | LendToken CurrencyId of the position | +| `underlyingCurrencyId` | `InterbtcPrimitivesCurrencyId` | Underlying CurrencyId of the position | + +#### Returns + +`Promise`<[`Big`, `Big`]\> + +Lend position amounts in underlying currency and lend token + +#### Defined in + +[src/parachain/loans.ts:293](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L293) + +___ + +### getLendPositionsOfAccount + +▸ **getLendPositionsOfAccount**(`accountId`): `Promise`<[`CollateralPosition`](../interfaces/CollateralPosition.md)[]\> + +Get the lend positions for given account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | the account Id for which to get supply positions | + +#### Returns + +`Promise`<[`CollateralPosition`](../interfaces/CollateralPosition.md)[]\> + +Array of lend positions of account. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLendPositionsOfAccount](../interfaces/LoansAPI.md#getlendpositionsofaccount) + +#### Defined in + +[src/parachain/loans.ts:451](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L451) + +___ + +### getLendTokenExchangeRates + +▸ **getLendTokenExchangeRates**(): `Promise`<[`TickerToData`](../modules.md#tickertodata)<`Big`\>\> + +#### Returns + +`Promise`<[`TickerToData`](../modules.md#tickertodata)<`Big`\>\> + +Exchange rates for underlying currency -> lend token. +Representing amount of lend token equal to 1 of underlying currency. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLendTokenExchangeRates](../interfaces/LoansAPI.md#getlendtokenexchangerates) + +#### Defined in + +[src/parachain/loans.ts:322](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L322) + +___ + +### getLendTokenIdFromUnderlyingCurrency + +▸ **getLendTokenIdFromUnderlyingCurrency**(`currency`): `Promise`<`InterbtcPrimitivesCurrencyId`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`Promise`<`InterbtcPrimitivesCurrencyId`\> + +#### Defined in + +[src/parachain/loans.ts:269](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L269) + +___ + +### getLendTokens + +▸ **getLendTokens**(): `Promise`<[`LendToken`](../modules.md#lendtoken)[]\> + +Get all lend token currencies. + +#### Returns + +`Promise`<[`LendToken`](../modules.md#lendtoken)[]\> + +Array of all LendToken currencies. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLendTokens](../interfaces/LoansAPI.md#getlendtokens) + +#### Defined in + +[src/parachain/loans.ts:315](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L315) + +___ + +### getLendingStats + +▸ **getLendingStats**(`lendPositions`, `borrowPositions`, `loanAssets`): [`LendingStats`](../interfaces/LendingStats.md) + +Get collateralization information about account's loans. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `lendPositions` | [`CollateralPosition`](../interfaces/CollateralPosition.md)[] | Lend positions of account. | +| `borrowPositions` | [`BorrowPosition`](../interfaces/BorrowPosition.md)[] | Borrow positions of account. | +| `loanAssets` | [`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](../interfaces/LoanAsset.md)\> | All loan assets data in TickerToData structure. | + +#### Returns + +[`LendingStats`](../interfaces/LendingStats.md) + +Collateral information about account based on passed positions. + +**`Throws`** + +When `loanAssets` does not contain all of the loan positions currencies. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLendingStats](../interfaces/LoansAPI.md#getlendingstats) + +#### Defined in + +[src/parachain/loans.ts:467](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L467) + +___ + +### getLiquidationThresholdLiquidity + +▸ **getLiquidationThresholdLiquidity**(`accountId`): `Promise`<[`AccountLiquidity`](../modules.md#accountliquidity)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | The account whose liquidity to query from the chain | + +#### Returns + +`Promise`<[`AccountLiquidity`](../modules.md#accountliquidity)\> + +An `AccountLiquidity` object, which is valid even for accounts that didn't use the loans pallet at all + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLiquidationThresholdLiquidity](../interfaces/LoansAPI.md#getliquidationthresholdliquidity) + +#### Defined in + +[src/parachain/loans.ts:365](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L365) + +___ + +### getLoanAssets + +▸ **getLoanAssets**(): `Promise`<[`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](../interfaces/LoanAsset.md)\>\> + +Get all loan assets. + +#### Returns + +`Promise`<[`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](../interfaces/LoanAsset.md)\>\> + +Array of all assets that can be lent and borrowed. + +**`Remarks`** + +Method could be refactored to compute APR in lib if we can get underlyingCurrency/rewardCurrency exchange rate, +but is it safe to assume that exchange rate for btc/underlyingCurrency will be +always fed to the oracle and available? + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLoanAssets](../interfaces/LoansAPI.md#getloanassets) + +#### Defined in + +[src/parachain/loans.ts:697](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L697) + +___ + +### getLoansMarkets + +▸ **getLoansMarkets**(): `Promise`<[[`CurrencyExt`](../modules.md#currencyext), [`LoansMarket`](../interfaces/LoansMarket.md)][]\> + +#### Returns + +`Promise`<[[`CurrencyExt`](../modules.md#currencyext), [`LoansMarket`](../interfaces/LoansMarket.md)][]\> + +An array of tuples denoting the underlying currency of a market, and the configuration of that market + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getLoansMarkets](../interfaces/LoansAPI.md#getloansmarkets) + +#### Defined in + +[src/parachain/loans.ts:243](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L243) + +___ + +### getUndercollateralizedBorrowers + +▸ **getUndercollateralizedBorrowers**(): `Promise`<[`UndercollateralizedPosition`](../modules.md#undercollateralizedposition)[]\> + +#### Returns + +`Promise`<[`UndercollateralizedPosition`](../modules.md#undercollateralizedposition)[]\> + +An array of `UndercollateralizedPosition`s, with all details needed to +liquidate them (accountId, shortfall - expressed in the wrapped currency, open borrow positions, collateral +deposits). + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[getUndercollateralizedBorrowers](../interfaces/LoansAPI.md#getundercollateralizedborrowers) + +#### Defined in + +[src/parachain/loans.ts:346](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L346) + +___ + +### lend + +▸ **lend**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Lend currency to protocol for borrowing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to lend. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to lend. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is not active market for `underlyingCurrency`. + +**`Throws`** + +If `amount` is exceeding available balance of account. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[lend](../interfaces/LoansAPI.md#lend) + +#### Defined in + +[src/parachain/loans.ts:855](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L855) + +___ + +### liquidateBorrowPosition + +▸ **liquidateBorrowPosition**(`borrower`, `liquidationCurrency`, `repayAmount`, `collateralCurrency`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Liquidates borrow position for exchange of collateral. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `borrower` | `AccountId` | AccountId of borrower whose position will be liquidated. | +| `liquidationCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency of position that will be liquidated. | +| `repayAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount to be repaid. | +| `collateralCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Collateral currency which will be claimed by liquidator. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[liquidateBorrowPosition](../interfaces/LoansAPI.md#liquidateborrowposition) + +#### Defined in + +[src/parachain/loans.ts:933](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L933) + +___ + +### repay + +▸ **repay**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Repay borrowed loan. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to repay. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to repay. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no active market for `underlyingCurrency`. + +**`Throws`** + +If `amount` is higher than available balance of account. + +**`Throws`** + +If `amount` is higher than outstanding loan. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[repay](../interfaces/LoansAPI.md#repay) + +#### Defined in + +[src/parachain/loans.ts:915](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L915) + +___ + +### repayAll + +▸ **repayAll**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Same as `repay`, but repays full loan. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to repay. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[repayAll](../interfaces/LoansAPI.md#repayall) + +#### Defined in + +[src/parachain/loans.ts:924](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L924) + +___ + +### withdraw + +▸ **withdraw**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Withdraw previously lent currency from protocol. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to witdhraw. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to withdraw. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is not active market for `underlyingCurrency`. + +**`Throws`** + +If `amount` is exceeding lent amount of account. + +**`Throws`** + +If `underlyingCurrency` is used as collateral and withdrawal of +`amount` would bring account under collateral threshold. + +**`Throws`** + +If there is not enough of underlying currency currently +available in the protocol. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[withdraw](../interfaces/LoansAPI.md#withdraw) + +#### Defined in + +[src/parachain/loans.ts:864](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L864) + +___ + +### withdrawAll + +▸ **withdrawAll**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Same as `withdraw`, but exits full position. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to fully withdraw. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[LoansAPI](../interfaces/LoansAPI.md).[withdrawAll](../interfaces/LoansAPI.md#withdrawall) + +#### Defined in + +[src/parachain/loans.ts:873](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L873) + +___ + +### getLendTokenFromUnderlyingCurrency + +▸ `Static` **getLendTokenFromUnderlyingCurrency**(`currency`, `lendTokenId`): [`LendToken`](../modules.md#lendtoken) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | +| `lendTokenId` | `InterbtcPrimitivesCurrencyId` | + +#### Returns + +[`LendToken`](../modules.md#lendtoken) + +#### Defined in + +[src/parachain/loans.ts:255](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L255) diff --git a/classes/DefaultNominationAPI.md b/classes/DefaultNominationAPI.md new file mode 100644 index 000000000..f4b1563bf --- /dev/null +++ b/classes/DefaultNominationAPI.md @@ -0,0 +1,573 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultNominationAPI + +# Class: DefaultNominationAPI + +## Implements + +- [`NominationAPI`](../interfaces/NominationAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultNominationAPI.md#constructor) + +### Properties + +- [api](DefaultNominationAPI.md#api) +- [rewardsAPI](DefaultNominationAPI.md#rewardsapi) +- [vaultsAPI](DefaultNominationAPI.md#vaultsapi) +- [wrappedCurrency](DefaultNominationAPI.md#wrappedcurrency) + +### Methods + +- [depositCollateral](DefaultNominationAPI.md#depositcollateral) +- [getActiveNominatorRewards](DefaultNominationAPI.md#getactivenominatorrewards) +- [getFilteredNominations](DefaultNominationAPI.md#getfilterednominations) +- [getNominationStatus](DefaultNominationAPI.md#getnominationstatus) +- [getNominatorReward](DefaultNominationAPI.md#getnominatorreward) +- [getNonces](DefaultNominationAPI.md#getnonces) +- [getTotalNomination](DefaultNominationAPI.md#gettotalnomination) +- [isNominationEnabled](DefaultNominationAPI.md#isnominationenabled) +- [isVaultOptedIn](DefaultNominationAPI.md#isvaultoptedin) +- [list](DefaultNominationAPI.md#list) +- [listAllNominations](DefaultNominationAPI.md#listallnominations) +- [listNominatorRewards](DefaultNominationAPI.md#listnominatorrewards) +- [listVaults](DefaultNominationAPI.md#listvaults) +- [optIn](DefaultNominationAPI.md#optin) +- [optOut](DefaultNominationAPI.md#optout) +- [setNominationEnabled](DefaultNominationAPI.md#setnominationenabled) +- [withdrawCollateral](DefaultNominationAPI.md#withdrawcollateral) +- [buildDepositCollateralExtrinsic](DefaultNominationAPI.md#builddepositcollateralextrinsic) +- [buildWithdrawCollateralExtrinsic](DefaultNominationAPI.md#buildwithdrawcollateralextrinsic) + +## Constructors + +### constructor + +• **new DefaultNominationAPI**(`api`, `wrappedCurrency`, `vaultsAPI`, `rewardsAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `wrappedCurrency` | `Currency` | +| `vaultsAPI` | [`VaultsAPI`](../interfaces/VaultsAPI.md) | +| `rewardsAPI` | [`RewardsAPI`](../interfaces/RewardsAPI.md) | + +#### Defined in + +[src/parachain/nomination.ts:145](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L145) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/nomination.ts:146](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L146) + +___ + +### rewardsAPI + +• `Private` **rewardsAPI**: [`RewardsAPI`](../interfaces/RewardsAPI.md) + +#### Defined in + +[src/parachain/nomination.ts:149](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L149) + +___ + +### vaultsAPI + +• `Private` **vaultsAPI**: [`VaultsAPI`](../interfaces/VaultsAPI.md) + +#### Defined in + +[src/parachain/nomination.ts:148](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L148) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/nomination.ts:147](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L147) + +## Methods + +### depositCollateral + +▸ **depositCollateral**(`vaultAccountId`, `amount`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | Vault to nominate collateral to | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Amount to deposit, as a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[depositCollateral](../interfaces/NominationAPI.md#depositcollateral) + +#### Defined in + +[src/parachain/nomination.ts:163](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L163) + +___ + +### getActiveNominatorRewards + +▸ **getActiveNominatorRewards**(`nominatorId`): `Promise`<`NominationData`[]\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nominatorId` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`NominationData`[]\> + +The rewards a currently active nominator has accumulated + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[getActiveNominatorRewards](../interfaces/NominationAPI.md#getactivenominatorrewards) + +#### Defined in + +[src/parachain/nomination.ts:290](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L290) + +___ + +### getFilteredNominations + +▸ **getFilteredNominations**(`vaultId?`, `collateralCurrency?`, `nominatorId?`): `Promise`<`Nomination`[]\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId?` | `AccountId` | Id of vault who is opted in to nomination | +| `collateralCurrency?` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | - | +| `nominatorId?` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`Nomination`[]\> + +**`Remarks`** + +At least one of the parameters must be specified + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[getFilteredNominations](../interfaces/NominationAPI.md#getfilterednominations) + +#### Defined in + +[src/parachain/nomination.ts:309](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L309) + +___ + +### getNominationStatus + +▸ **getNominationStatus**(`vaultId`, `collateralCurrency`, `nominatorId`): `Promise`<[`NominationStatus`](../enums/NominationStatus.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultId` | `AccountId` | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | +| `nominatorId` | `AccountId` | + +#### Returns + +`Promise`<[`NominationStatus`](../enums/NominationStatus.md)\> + +#### Defined in + +[src/parachain/nomination.ts:352](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L352) + +___ + +### getNominatorReward + +▸ **getNominatorReward**(`vaultId`, `collateralCurrency`, `rewardCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | `AccountId` | - | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency towards whose issuance the nomination was made | +| `rewardCurrency` | `Currency` | The reward currency, e.g. kBTC, KINT, interBTC, INTR | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The rewards a (possibly inactive) nominator has accumulated + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[getNominatorReward](../interfaces/NominationAPI.md#getnominatorreward) + +#### Defined in + +[src/parachain/nomination.ts:297](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L297) + +___ + +### getNonces + +▸ **getNonces**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `number`\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `number`\>\> + +A map (vaultId => nonce), representing the nonces for each reward pool with the given currency + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[getNonces](../interfaces/NominationAPI.md#getnonces) + +#### Defined in + +[src/parachain/nomination.ts:226](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L226) + +___ + +### getTotalNomination + +▸ **getTotalNomination**(`vaultId?`, `collateralCurrency?`, `nominatorId?`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId?` | `AccountId` | Id of vault who is opted in to nomination | +| `collateralCurrency?` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The collateral currency of the nominations | +| `nominatorId?` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The total nominated amount, filtered using the given parameters + +**`Remarks`** + +At least one of the parameters must be specified + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[getTotalNomination](../interfaces/NominationAPI.md#gettotalnomination) + +#### Defined in + +[src/parachain/nomination.ts:370](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L370) + +___ + +### isNominationEnabled + +▸ **isNominationEnabled**(): `Promise`<`boolean`\> + +#### Returns + +`Promise`<`boolean`\> + +A boolean value representing whether the vault nomination feature is enabled + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[isNominationEnabled](../interfaces/NominationAPI.md#isnominationenabled) + +#### Defined in + +[src/parachain/nomination.ts:221](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L221) + +___ + +### isVaultOptedIn + +▸ **isVaultOptedIn**(`accountId`, `collateralCurrency`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`boolean`\> + +A boolean value + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[isVaultOptedIn](../interfaces/NominationAPI.md#isvaultoptedin) + +#### Defined in + +[src/parachain/nomination.ts:411](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L411) + +___ + +### list + +▸ **list**(): `Promise`<`Nomination`[]\> + +#### Returns + +`Promise`<`Nomination`[]\> + +All nominations for the wrapped currency set in the API + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[list](../interfaces/NominationAPI.md#list) + +#### Defined in + +[src/parachain/nomination.ts:305](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L305) + +___ + +### listAllNominations + +▸ **listAllNominations**(): `Promise`<`RawNomination`[]\> + +#### Returns + +`Promise`<`RawNomination`[]\> + +#### Defined in + +[src/parachain/nomination.ts:239](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L239) + +___ + +### listNominatorRewards + +▸ **listNominatorRewards**(): `Promise`<`NominationData`[]\> + +#### Returns + +`Promise`<`NominationData`[]\> + +The rewards a nominator has accumulated, in wrapped token (e.g. interBTC, kBTC) + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[listNominatorRewards](../interfaces/NominationAPI.md#listnominatorrewards) + +#### Defined in + +[src/parachain/nomination.ts:271](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L271) + +___ + +### listVaults + +▸ **listVaults**(): `Promise`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md)[]\> + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md)[]\> + +A list of all vaults that opted in to the nomination feature. + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[listVaults](../interfaces/NominationAPI.md#listvaults) + +#### Defined in + +[src/parachain/nomination.ts:406](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L406) + +___ + +### optIn + +▸ **optIn**(`collateralCurrency`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Currency to accept as nomination | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Function callable by vaults to opt in to the nomination feature + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[optIn](../interfaces/NominationAPI.md#optin) + +#### Defined in + +[src/parachain/nomination.ts:204](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L204) + +___ + +### optOut + +▸ **optOut**(`collateralCurrency`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Currency to stop accepting as nomination | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Function callable by vaults to opt out of the nomination feature + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[optOut](../interfaces/NominationAPI.md#optout) + +#### Defined in + +[src/parachain/nomination.ts:210](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L210) + +___ + +### setNominationEnabled + +▸ **setNominationEnabled**(`enabled`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `enabled` | `boolean` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Testnet utility function + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[setNominationEnabled](../interfaces/NominationAPI.md#setnominationenabled) + +#### Defined in + +[src/parachain/nomination.ts:216](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L216) + +___ + +### withdrawCollateral + +▸ **withdrawCollateral**(`vaultAccountId`, `amount`, `nonce?`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | Vault that collateral was nominated to | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Amount to withdraw, as a `Monetary.js` object or `ForeignAsset` | +| `nonce?` | `number` | - | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[NominationAPI](../interfaces/NominationAPI.md).[withdrawCollateral](../interfaces/NominationAPI.md#withdrawcollateral) + +#### Defined in + +[src/parachain/nomination.ts:188](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L188) + +___ + +### buildDepositCollateralExtrinsic + +▸ `Static` **buildDepositCollateralExtrinsic**(`api`, `vaultAccountId`, `amount`, `wrappedCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultAccountId` | `AccountId` | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | +| `wrappedCurrency` | `Currency` | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +#### Defined in + +[src/parachain/nomination.ts:152](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L152) + +___ + +### buildWithdrawCollateralExtrinsic + +▸ `Static` **buildWithdrawCollateralExtrinsic**(`api`, `rewardsAPI`, `vaultAccountId`, `amount`, `wrappedCurrency`, `nonce?`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `rewardsAPI` | [`RewardsAPI`](../interfaces/RewardsAPI.md) | +| `vaultAccountId` | `AccountId` | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | +| `wrappedCurrency` | `Currency` | +| `nonce?` | `number` | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +#### Defined in + +[src/parachain/nomination.ts:173](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L173) diff --git a/classes/DefaultOracleAPI.md b/classes/DefaultOracleAPI.md new file mode 100644 index 000000000..8a239e2b1 --- /dev/null +++ b/classes/DefaultOracleAPI.md @@ -0,0 +1,345 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultOracleAPI + +# Class: DefaultOracleAPI + +## Implements + +- [`OracleAPI`](../interfaces/OracleAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultOracleAPI.md#constructor) + +### Properties + +- [api](DefaultOracleAPI.md#api) +- [wrappedCurrency](DefaultOracleAPI.md#wrappedcurrency) + +### Methods + +- [convertCollateralToWrapped](DefaultOracleAPI.md#convertcollateraltowrapped) +- [convertWrappedToCurrency](DefaultOracleAPI.md#convertwrappedtocurrency) +- [getBitcoinFees](DefaultOracleAPI.md#getbitcoinfees) +- [getExchangeRate](DefaultOracleAPI.md#getexchangerate) +- [getOnlineTimeout](DefaultOracleAPI.md#getonlinetimeout) +- [getRawValuesUpdated](DefaultOracleAPI.md#getrawvaluesupdated) +- [getSourcesById](DefaultOracleAPI.md#getsourcesbyid) +- [getValidUntil](DefaultOracleAPI.md#getvaliduntil) +- [isOnline](DefaultOracleAPI.md#isonline) +- [setBitcoinFees](DefaultOracleAPI.md#setbitcoinfees) +- [setExchangeRate](DefaultOracleAPI.md#setexchangerate) + +## Constructors + +### constructor + +• **new DefaultOracleAPI**(`api`, `wrappedCurrency`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `wrappedCurrency` | `Currency` | + +#### Defined in + +[src/parachain/oracle.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L95) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/oracle.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L95) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/oracle.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L95) + +## Methods + +### convertCollateralToWrapped + +▸ **convertCollateralToWrapped**(`amount`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of collateral tokens to convert | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +Converted value + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[convertCollateralToWrapped](../interfaces/OracleAPI.md#convertcollateraltowrapped) + +#### Defined in + +[src/parachain/oracle.ts:152](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L152) + +___ + +### convertWrappedToCurrency + +▸ **convertWrappedToCurrency**(`amount`, `currency`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to convert | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | A `Monetary.js` object | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +Converted value + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[convertWrappedToCurrency](../interfaces/OracleAPI.md#convertwrappedtocurrency) + +#### Defined in + +[src/parachain/oracle.ts:144](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L144) + +___ + +### getBitcoinFees + +▸ **getBitcoinFees**(): `Promise`<`Big`\> + +Obtains the current fees for BTC transactions, in satoshi/byte. + +#### Returns + +`Promise`<`Big`\> + +Big value for the current inclusion fees. + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[getBitcoinFees](../interfaces/OracleAPI.md#getbitcoinfees) + +#### Defined in + +[src/parachain/oracle.ts:171](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L171) + +___ + +### getExchangeRate + +▸ **getExchangeRate**(`currency`): `Promise`<`ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`Promise`<`ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\>\> + +The exchange rate between Bitcoin and the provided collateral currency + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[getExchangeRate](../interfaces/OracleAPI.md#getexchangerate) + +#### Defined in + +[src/parachain/oracle.ts:97](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L97) + +___ + +### getOnlineTimeout + +▸ **getOnlineTimeout**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The period of time (in milliseconds) after an oracle's last submission +during which it is considered online + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[getOnlineTimeout](../interfaces/OracleAPI.md#getonlinetimeout) + +#### Defined in + +[src/parachain/oracle.ts:159](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L159) + +___ + +### getRawValuesUpdated + +▸ **getRawValuesUpdated**(`key`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `InterbtcPrimitivesOracleKey` | A key defining an exchange rate or a BTC network fee estimate | + +#### Returns + +`Promise`<`boolean`\> + +Whether the oracle entr for the given key has been updated + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[getRawValuesUpdated](../interfaces/OracleAPI.md#getrawvaluesupdated) + +#### Defined in + +[src/parachain/oracle.ts:220](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L220) + +___ + +### getSourcesById + +▸ **getSourcesById**(): `Promise`<`Map`<`string`, `string`\>\> + +#### Returns + +`Promise`<`Map`<`string`, `string`\>\> + +A map from the oracle's account id to its name + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[getSourcesById](../interfaces/OracleAPI.md#getsourcesbyid) + +#### Defined in + +[src/parachain/oracle.ts:199](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L199) + +___ + +### getValidUntil + +▸ **getValidUntil**(`counterCurrency`): `Promise`<`Date`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `counterCurrency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`Promise`<`Date`\> + +Last exchange rate time + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[getValidUntil](../interfaces/OracleAPI.md#getvaliduntil) + +#### Defined in + +[src/parachain/oracle.ts:206](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L206) + +___ + +### isOnline + +▸ **isOnline**(`currency`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | Currency for which we check status of oracle. | + +#### Returns + +`Promise`<`boolean`\> + +Boolean value indicating whether the oracle is online for currency + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[isOnline](../interfaces/OracleAPI.md#isonline) + +#### Defined in + +[src/parachain/oracle.ts:212](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L212) + +___ + +### setBitcoinFees + +▸ **setBitcoinFees**(`fees`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Create a transaction to set the current fee estimate for BTC transactions + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `fees` | `Big` | Estimated Satoshis per bytes to get a transaction included | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[setBitcoinFees](../interfaces/OracleAPI.md#setbitcoinfees) + +#### Defined in + +[src/parachain/oracle.ts:186](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L186) + +___ + +### setExchangeRate + +▸ **setExchangeRate**(`exchangeRate`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Create a transaction to set the exchange rate between Bitcoin and a collateral currency + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeRate` | `ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\> | The rate to set | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[OracleAPI](../interfaces/OracleAPI.md).[setExchangeRate](../interfaces/OracleAPI.md#setexchangerate) + +#### Defined in + +[src/parachain/oracle.ts:164](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L164) diff --git a/classes/DefaultRedeemAPI.md b/classes/DefaultRedeemAPI.md new file mode 100644 index 000000000..8fc7d37a1 --- /dev/null +++ b/classes/DefaultRedeemAPI.md @@ -0,0 +1,713 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultRedeemAPI + +# Class: DefaultRedeemAPI + +## Implements + +- [`RedeemAPI`](../interfaces/RedeemAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultRedeemAPI.md#constructor) + +### Properties + +- [api](DefaultRedeemAPI.md#api) +- [btcNetwork](DefaultRedeemAPI.md#btcnetwork) +- [electrsAPI](DefaultRedeemAPI.md#electrsapi) +- [oracleAPI](DefaultRedeemAPI.md#oracleapi) +- [systemAPI](DefaultRedeemAPI.md#systemapi) +- [transactionAPI](DefaultRedeemAPI.md#transactionapi) +- [vaultsAPI](DefaultRedeemAPI.md#vaultsapi) +- [wrappedCurrency](DefaultRedeemAPI.md#wrappedcurrency) + +### Methods + +- [buildCancelRedeemExtrinsic](DefaultRedeemAPI.md#buildcancelredeemextrinsic) +- [buildExecuteRedeemExtrinsic](DefaultRedeemAPI.md#buildexecuteredeemextrinsic) +- [buildLiquidationRedeemExtrinsic](DefaultRedeemAPI.md#buildliquidationredeemextrinsic) +- [buildRequestRedeemExtrinsic](DefaultRedeemAPI.md#buildrequestredeemextrinsic) +- [burn](DefaultRedeemAPI.md#burn) +- [cancel](DefaultRedeemAPI.md#cancel) +- [execute](DefaultRedeemAPI.md#execute) +- [getBurnExchangeRate](DefaultRedeemAPI.md#getburnexchangerate) +- [getCurrentInclusionFee](DefaultRedeemAPI.md#getcurrentinclusionfee) +- [getDustValue](DefaultRedeemAPI.md#getdustvalue) +- [getFeeRate](DefaultRedeemAPI.md#getfeerate) +- [getFeesToPay](DefaultRedeemAPI.md#getfeestopay) +- [getMaxBurnableTokens](DefaultRedeemAPI.md#getmaxburnabletokens) +- [getPremiumRedeemFeeRate](DefaultRedeemAPI.md#getpremiumredeemfeerate) +- [getRedeemPeriod](DefaultRedeemAPI.md#getredeemperiod) +- [getRequestById](DefaultRedeemAPI.md#getrequestbyid) +- [getRequestsByIds](DefaultRedeemAPI.md#getrequestsbyids) +- [list](DefaultRedeemAPI.md#list) +- [request](DefaultRedeemAPI.md#request) +- [requestAdvanced](DefaultRedeemAPI.md#requestadvanced) +- [setRedeemPeriod](DefaultRedeemAPI.md#setredeemperiod) + +## Constructors + +### constructor + +• **new DefaultRedeemAPI**(`api`, `btcNetwork`, `electrsAPI`, `wrappedCurrency`, `vaultsAPI`, `oracleAPI`, `transactionAPI`, `systemAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `btcNetwork` | `Network` | +| `electrsAPI` | [`ElectrsAPI`](../interfaces/ElectrsAPI.md) | +| `wrappedCurrency` | `Currency` | +| `vaultsAPI` | [`VaultsAPI`](../interfaces/VaultsAPI.md) | +| `oracleAPI` | [`OracleAPI`](../interfaces/OracleAPI.md) | +| `transactionAPI` | [`TransactionAPI`](../interfaces/TransactionAPI.md) | +| `systemAPI` | [`SystemAPI`](../interfaces/SystemAPI.md) | + +#### Defined in + +[src/parachain/redeem.ts:218](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L218) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/redeem.ts:219](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L219) + +___ + +### btcNetwork + +• `Private` **btcNetwork**: `Network` + +#### Defined in + +[src/parachain/redeem.ts:220](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L220) + +___ + +### electrsAPI + +• `Private` **electrsAPI**: [`ElectrsAPI`](../interfaces/ElectrsAPI.md) + +#### Defined in + +[src/parachain/redeem.ts:221](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L221) + +___ + +### oracleAPI + +• `Private` **oracleAPI**: [`OracleAPI`](../interfaces/OracleAPI.md) + +#### Defined in + +[src/parachain/redeem.ts:224](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L224) + +___ + +### systemAPI + +• `Private` **systemAPI**: [`SystemAPI`](../interfaces/SystemAPI.md) + +#### Defined in + +[src/parachain/redeem.ts:226](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L226) + +___ + +### transactionAPI + +• `Private` **transactionAPI**: [`TransactionAPI`](../interfaces/TransactionAPI.md) + +#### Defined in + +[src/parachain/redeem.ts:225](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L225) + +___ + +### vaultsAPI + +• `Private` **vaultsAPI**: [`VaultsAPI`](../interfaces/VaultsAPI.md) + +#### Defined in + +[src/parachain/redeem.ts:223](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L223) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/redeem.ts:222](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L222) + +## Methods + +### buildCancelRedeemExtrinsic + +▸ **buildCancelRedeemExtrinsic**(`redeemId`, `reimburse`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a cancel redeem extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` | The ID returned by the redeem request transaction | +| `reimburse` | `boolean` | In case of redeem failure: - `false` = retry redeeming, with a different Vault - `true` = accept reimbursement in wrapped token | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A cancel redeem submittable extrinsic. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[buildCancelRedeemExtrinsic](../interfaces/RedeemAPI.md#buildcancelredeemextrinsic) + +#### Defined in + +[src/parachain/redeem.ts:292](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L292) + +___ + +### buildExecuteRedeemExtrinsic + +▸ **buildExecuteRedeemExtrinsic**(`redeemId`, `btcTxId`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build a redeem execution extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` | The ID returned by the issue request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +An execute redeem submittable extrinsic. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[buildExecuteRedeemExtrinsic](../interfaces/RedeemAPI.md#buildexecuteredeemextrinsic) + +#### Defined in + +[src/parachain/redeem.ts:278](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L278) + +___ + +### buildLiquidationRedeemExtrinsic + +▸ **buildLiquidationRedeemExtrinsic**(`amount`, `collateralCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build liquidation redeem extrinsic (without sending it) to burn wrapped tokens for a premium + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to burn | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Liquidated collateral currency to use when burning wrapped tokens | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A liquidation redeem submittable extrinsic. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[buildLiquidationRedeemExtrinsic](../interfaces/RedeemAPI.md#buildliquidationredeemextrinsic) + +#### Defined in + +[src/parachain/redeem.ts:305](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L305) + +___ + +### buildRequestRedeemExtrinsic + +▸ **buildRequestRedeemExtrinsic**(`vaultId`, `amount`, `btcAddressEnc`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a request redeem extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | ID of the vault to redeem with. | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped token amount to redeem | +| `btcAddressEnc` | `string` | Bitcoin transaction ID | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A request redeem submittable extrinsic. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[buildRequestRedeemExtrinsic](../interfaces/RedeemAPI.md#buildrequestredeemextrinsic) + +#### Defined in + +[src/parachain/redeem.ts:253](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L253) + +___ + +### burn + +▸ **burn**(`amount`, `collateralCurrency`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Burn wrapped tokens for a premium + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to burn | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Liquidated collateral currency to use when burning wrapped tokens | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[burn](../interfaces/RedeemAPI.md#burn) + +#### Defined in + +[src/parachain/redeem.ts:314](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L314) + +___ + +### cancel + +▸ **cancel**(`requestId`, `reimburse?`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Send a redeem cancellation transaction. After the redeem period has elapsed, +the redeemal request can be cancelled. As a result, the griefing collateral +of the vault will be slashed and sent to the redeemer + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `requestId` | `string` | `undefined` | The ID returned by the redeem request transaction | +| `reimburse` | `boolean` | `false` | (Optional) In case of redeem failure: - (Default) `false` = retry redeeming, with a different Vault - `true` = accept reimbursement in wrapped token | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[cancel](../interfaces/RedeemAPI.md#cancel) + +#### Defined in + +[src/parachain/redeem.ts:300](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L300) + +___ + +### execute + +▸ **execute**(`requestId`, `btcTxId`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Send a redeem execution transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | - | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +If `txId` is not set, the `merkleProof` and `rawTx` must both be set. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[execute](../interfaces/RedeemAPI.md#execute) + +#### Defined in + +[src/parachain/redeem.ts:287](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L287) + +___ + +### getBurnExchangeRate + +▸ **getBurnExchangeRate**(`collateralCurrency`): `Promise`<`ExchangeRate`<`Currency`, [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Currency whose exchange rate with BTC to fetch | + +#### Returns + +`Promise`<`ExchangeRate`<`Currency`, [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The exchange rate (collateral currency to wrapped token currency) +used when burning tokens + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getBurnExchangeRate](../interfaces/RedeemAPI.md#getburnexchangerate) + +#### Defined in + +[src/parachain/redeem.ts:350](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L350) + +___ + +### getCurrentInclusionFee + +▸ **getCurrentInclusionFee**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The current inclusion fee based on the expected number of bytes +in the transaction, and the inclusion fee rate reported by the oracle + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getCurrentInclusionFee](../interfaces/RedeemAPI.md#getcurrentinclusionfee) + +#### Defined in + +[src/parachain/redeem.ts:365](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L365) + +___ + +### getDustValue + +▸ **getDustValue**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The minimum amount of wrapped tokens that is accepted for redeem requests; any lower values would +risk the bitcoin client to reject the payment + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getDustValue](../interfaces/RedeemAPI.md#getdustvalue) + +#### Defined in + +[src/parachain/redeem.ts:412](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L412) + +___ + +### getFeeRate + +▸ **getFeeRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The fee charged for redeeming. For instance, "0.005" stands for 0.5% + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getFeeRate](../interfaces/RedeemAPI.md#getfeerate) + +#### Defined in + +[src/parachain/redeem.ts:407](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L407) + +___ + +### getFeesToPay + +▸ **getFeesToPay**(`amount`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens for which to compute the redeem fees | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The fees + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getFeesToPay](../interfaces/RedeemAPI.md#getfeestopay) + +#### Defined in + +[src/parachain/redeem.ts:402](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L402) + +___ + +### getMaxBurnableTokens + +▸ **getMaxBurnableTokens**(`collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Liquidated collateral currency to use when burning wrapped tokens | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The maximum amount of tokens that can be burned through a liquidation redeem + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getMaxBurnableTokens](../interfaces/RedeemAPI.md#getmaxburnabletokens) + +#### Defined in + +[src/parachain/redeem.ts:330](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L330) + +___ + +### getPremiumRedeemFeeRate + +▸ **getPremiumRedeemFeeRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +If users execute a redeem with a Vault flagged for premium redeem, +they can earn a premium, slashed from the Vault's collateral. +This value is a percentage of the redeemed amount. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getPremiumRedeemFeeRate](../interfaces/RedeemAPI.md#getpremiumredeemfeerate) + +#### Defined in + +[src/parachain/redeem.ts:417](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L417) + +___ + +### getRedeemPeriod + +▸ **getRedeemPeriod**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The time difference in number of blocks between a redeem request +is created and required completion time by a vault. +The redeem period has an upper limit to ensure the user gets their BTC in time +and to potentially punish a vault for inactivity or stealing BTC. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getRedeemPeriod](../interfaces/RedeemAPI.md#getredeemperiod) + +#### Defined in + +[src/parachain/redeem.ts:325](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L325) + +___ + +### getRequestById + +▸ **getRequestById**(`redeemId`): `Promise`<[`Redeem`](../interfaces/Redeem.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` \| `H256` | The ID of the redeem request to fetch | + +#### Returns + +`Promise`<[`Redeem`](../interfaces/Redeem.md)\> + +A redeem request object + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getRequestById](../interfaces/RedeemAPI.md#getrequestbyid) + +#### Defined in + +[src/parachain/redeem.ts:422](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L422) + +___ + +### getRequestsByIds + +▸ **getRequestsByIds**(`redeemIds`): `Promise`<[`Redeem`](../interfaces/Redeem.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `redeemIds` | (`string` \| `H256`)[] | + +#### Returns + +`Promise`<[`Redeem`](../interfaces/Redeem.md)[]\> + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[getRequestsByIds](../interfaces/RedeemAPI.md#getrequestsbyids) + +#### Defined in + +[src/parachain/redeem.ts:427](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L427) + +___ + +### list + +▸ **list**(): `Promise`<[`Redeem`](../interfaces/Redeem.md)[]\> + +#### Returns + +`Promise`<[`Redeem`](../interfaces/Redeem.md)[]\> + +An array containing the redeem requests + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[list](../interfaces/RedeemAPI.md#list) + +#### Defined in + +[src/parachain/redeem.ts:374](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L374) + +___ + +### request + +▸ **request**(`amount`, `btcAddressEnc`, `vaultId?`, `atomic?`, `cachedVaults?`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Create a redeem request transaction + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | `undefined` | Wrapped token amount to redeem | +| `btcAddressEnc` | `string` | `undefined` | Bitcoin address where the redeemed BTC should be sent | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | (optional) ID of the vault to redeem with. | +| `atomic` | `boolean` | `true` | (optional) Whether the request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. Defaults to false. | +| `cachedVaults?` | `Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | `undefined` | (optional) A list of all vaults usable for redeem. If not provided, will fetch from the parachain. | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[request](../interfaces/RedeemAPI.md#request) + +#### Defined in + +[src/parachain/redeem.ts:229](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L229) + +___ + +### requestAdvanced + +▸ **requestAdvanced**(`amountsPerVault`, `btcAddressEnc`, `atomic`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Create a batch of aggregated redeem transactions (to one or more vaults) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amountsPerVault` | `Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | A mapping of vaults to redeem from, and wrapped token amounts to redeem using each vault | +| `btcAddressEnc` | `string` | Bitcoin address where the redeemed BTC should be sent | +| `atomic` | `boolean` | Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +Rejects the promise if none of the requests succeeded (or if at least one failed, when atomic=true). + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[requestAdvanced](../interfaces/RedeemAPI.md#requestadvanced) + +#### Defined in + +[src/parachain/redeem.ts:266](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L266) + +___ + +### setRedeemPeriod + +▸ **setRedeemPeriod**(`blocks`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blocks` | `number` | The time difference in number of blocks between a redeem request is created and required completion time by a vault. The redeem period has an upper limit to ensure the user gets their BTC in time and to potentially punish a vault for inactivity or stealing BTC. | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Testnet utility function + +#### Implementation of + +[RedeemAPI](../interfaces/RedeemAPI.md).[setRedeemPeriod](../interfaces/RedeemAPI.md#setredeemperiod) + +#### Defined in + +[src/parachain/redeem.ts:319](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L319) diff --git a/classes/DefaultReplaceAPI.md b/classes/DefaultReplaceAPI.md new file mode 100644 index 000000000..cde4a211f --- /dev/null +++ b/classes/DefaultReplaceAPI.md @@ -0,0 +1,536 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultReplaceAPI + +# Class: DefaultReplaceAPI + +## Implements + +- [`ReplaceAPI`](../interfaces/ReplaceAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultReplaceAPI.md#constructor) + +### Properties + +- [api](DefaultReplaceAPI.md#api) +- [btcNetwork](DefaultReplaceAPI.md#btcnetwork) +- [electrsAPI](DefaultReplaceAPI.md#electrsapi) +- [wrappedCurrency](DefaultReplaceAPI.md#wrappedcurrency) + +### Methods + +- [accept](DefaultReplaceAPI.md#accept) +- [buildAcceptReplaceExtrinsic](DefaultReplaceAPI.md#buildacceptreplaceextrinsic) +- [buildExecuteReplaceExtrinsic](DefaultReplaceAPI.md#buildexecutereplaceextrinsic) +- [buildRequestReplaceExtrinsic](DefaultReplaceAPI.md#buildrequestreplaceextrinsic) +- [buildWithdrawReplaceExtrinsic](DefaultReplaceAPI.md#buildwithdrawreplaceextrinsic) +- [execute](DefaultReplaceAPI.md#execute) +- [getDustValue](DefaultReplaceAPI.md#getdustvalue) +- [getNewVaultReplaceRequests](DefaultReplaceAPI.md#getnewvaultreplacerequests) +- [getOldVaultReplaceRequests](DefaultReplaceAPI.md#getoldvaultreplacerequests) +- [getReplacePeriod](DefaultReplaceAPI.md#getreplaceperiod) +- [getRequestById](DefaultReplaceAPI.md#getrequestbyid) +- [list](DefaultReplaceAPI.md#list) +- [map](DefaultReplaceAPI.md#map) +- [mapReplaceRequests](DefaultReplaceAPI.md#mapreplacerequests) +- [parseRequestsAsync](DefaultReplaceAPI.md#parserequestsasync) +- [request](DefaultReplaceAPI.md#request) +- [withdraw](DefaultReplaceAPI.md#withdraw) + +## Constructors + +### constructor + +• **new DefaultReplaceAPI**(`api`, `btcNetwork`, `electrsAPI`, `wrappedCurrency`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `btcNetwork` | `Network` | +| `electrsAPI` | [`ElectrsAPI`](../interfaces/ElectrsAPI.md) | +| `wrappedCurrency` | `Currency` | + +#### Defined in + +[src/parachain/replace.ts:154](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L154) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/replace.ts:155](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L155) + +___ + +### btcNetwork + +• `Private` **btcNetwork**: `Network` + +#### Defined in + +[src/parachain/replace.ts:156](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L156) + +___ + +### electrsAPI + +• `Private` **electrsAPI**: [`ElectrsAPI`](../interfaces/ElectrsAPI.md) + +#### Defined in + +[src/parachain/replace.ts:157](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L157) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/replace.ts:158](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L158) + +## Methods + +### accept + +▸ **accept**(`oldVault`, `amount`, `collateral`, `btcAddress`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Accept a replace request + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `oldVault` | `AccountId` | ID of the old vault that to be (possibly partially) replaced | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount of issued tokens to be replaced | +| `collateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral for replacement | +| `btcAddress` | `string` | The address that old-vault should transfer the btc to | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[accept](../interfaces/ReplaceAPI.md#accept) + +#### Defined in + +[src/parachain/replace.ts:209](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L209) + +___ + +### buildAcceptReplaceExtrinsic + +▸ **buildAcceptReplaceExtrinsic**(`oldVault`, `amount`, `collateral`, `btcAddress`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build an accept replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `oldVault` | `AccountId` | account ID of the old vault that to be (possibly partially) replaced | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount of issued tokens to be replaced | +| `collateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral for replacement | +| `btcAddress` | `string` | The address that old-vault should transfer the btc to | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +An accept replace submittable extrinsic. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[buildAcceptReplaceExtrinsic](../interfaces/ReplaceAPI.md#buildacceptreplaceextrinsic) + +#### Defined in + +[src/parachain/replace.ts:190](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L190) + +___ + +### buildExecuteReplaceExtrinsic + +▸ **buildExecuteReplaceExtrinsic**(`requestId`, `btcTxId`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build an execute replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID generated by the replace request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +An execute replace submittable extrinsic. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[buildExecuteReplaceExtrinsic](../interfaces/ReplaceAPI.md#buildexecutereplaceextrinsic) + +#### Defined in + +[src/parachain/replace.ts:219](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L219) + +___ + +### buildRequestReplaceExtrinsic + +▸ **buildRequestReplaceExtrinsic**(`amount`, `collateralCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a request replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped token amount to replace. | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency to have replaced | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A request replace submittable extrinsic. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[buildRequestReplaceExtrinsic](../interfaces/ReplaceAPI.md#buildrequestreplaceextrinsic) + +#### Defined in + +[src/parachain/replace.ts:161](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L161) + +___ + +### buildWithdrawReplaceExtrinsic + +▸ **buildWithdrawReplaceExtrinsic**(`amount`, `collateralCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a withdraw replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to withdraw from the amount requested to have replaced. | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency to have replaced | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A withdraw replace submittable extrinsic. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[buildWithdrawReplaceExtrinsic](../interfaces/ReplaceAPI.md#buildwithdrawreplaceextrinsic) + +#### Defined in + +[src/parachain/replace.ts:176](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L176) + +___ + +### execute + +▸ **execute**(`requestId`, `btcTxId`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Execute a replace request + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID generated by the replace request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +If `txId` is not set, the `merkleProof` and `rawTx` must both be set. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[execute](../interfaces/ReplaceAPI.md#execute) + +#### Defined in + +[src/parachain/replace.ts:228](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L228) + +___ + +### getDustValue + +▸ **getDustValue**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The minimum amount of btc that is accepted for replace requests; any lower values would +risk the bitcoin client to reject the payment + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[getDustValue](../interfaces/ReplaceAPI.md#getdustvalue) + +#### Defined in + +[src/parachain/replace.ts:233](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L233) + +___ + +### getNewVaultReplaceRequests + +▸ **getNewVaultReplaceRequests**(`vaultAccountId`): `Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultAccountId` | `AccountId` | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +#### Defined in + +[src/parachain/replace.ts:326](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L326) + +___ + +### getOldVaultReplaceRequests + +▸ **getOldVaultReplaceRequests**(`vaultAccountId`): `Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultAccountId` | `AccountId` | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +#### Defined in + +[src/parachain/replace.ts:320](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L320) + +___ + +### getReplacePeriod + +▸ **getReplacePeriod**(): `Promise`<`BlockNumber`\> + +#### Returns + +`Promise`<`BlockNumber`\> + +The time difference in number of blocks between when a replace request is created +and required completion time by a vault. The replace period has an upper limit +to prevent griefing of vault collateral. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[getReplacePeriod](../interfaces/ReplaceAPI.md#getreplaceperiod) + +#### Defined in + +[src/parachain/replace.ts:238](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L238) + +___ + +### getRequestById + +▸ **getRequestById**(`replaceId`, `atBlock?`): `Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `replaceId` | `string` \| `H256` | The ID of the replace request to fetch | +| `atBlock?` | `BlockHash` | - | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)\> + +A replace request object + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[getRequestById](../interfaces/ReplaceAPI.md#getrequestbyid) + +#### Defined in + +[src/parachain/replace.ts:291](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L291) + +___ + +### list + +▸ **list**(): `Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +#### Returns + +`Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +An array containing the replace requests + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[list](../interfaces/ReplaceAPI.md#list) + +#### Defined in + +[src/parachain/replace.ts:242](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L242) + +___ + +### map + +▸ **map**(): `Promise`<`Map`<`H256`, [`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)\>\> + +#### Returns + +`Promise`<`Map`<`H256`, [`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)\>\> + +A mapping from the replace request ID to the replace request object + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[map](../interfaces/ReplaceAPI.md#map) + +#### Defined in + +[src/parachain/replace.ts:262](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L262) + +___ + +### mapReplaceRequests + +▸ **mapReplaceRequests**(`vaultAccountId`): `Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +Fetch the replace requests associated with a vault. In the returned requests, +the vault is either the replaced or the replacing one. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The AccountId of the vault used to filter replace requests | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)[]\> + +An array with replace requests involving said vault + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[mapReplaceRequests](../interfaces/ReplaceAPI.md#mapreplacerequests) + +#### Defined in + +[src/parachain/replace.ts:308](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L308) + +___ + +### parseRequestsAsync + +▸ **parseRequestsAsync**(`requestPairs`): `Promise`<[`H256`, [`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)][]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `requestPairs` | [`H256`, `InterbtcPrimitivesReplaceReplaceRequest`][] | + +#### Returns + +`Promise`<[`H256`, [`ReplaceRequestExt`](../interfaces/ReplaceRequestExt.md)][]\> + +#### Defined in + +[src/parachain/replace.ts:332](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L332) + +___ + +### request + +▸ **request**(`amount`, `collateralCurrency`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount issued, denoted in Bitcoin, to have replaced by another vault | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency to have replaced | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[request](../interfaces/ReplaceAPI.md#request) + +#### Defined in + +[src/parachain/replace.ts:171](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L171) + +___ + +### withdraw + +▸ **withdraw**(`amount`, `collateralCurrency`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Wihdraw a replace request + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to withdraw from the amount requested to have replaced. | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency of the request | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[ReplaceAPI](../interfaces/ReplaceAPI.md).[withdraw](../interfaces/ReplaceAPI.md#withdraw) + +#### Defined in + +[src/parachain/replace.ts:185](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L185) diff --git a/classes/DefaultRewardsAPI.md b/classes/DefaultRewardsAPI.md new file mode 100644 index 000000000..df1c310c9 --- /dev/null +++ b/classes/DefaultRewardsAPI.md @@ -0,0 +1,146 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultRewardsAPI + +# Class: DefaultRewardsAPI + +## Implements + +- [`RewardsAPI`](../interfaces/RewardsAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultRewardsAPI.md#constructor) + +### Properties + +- [api](DefaultRewardsAPI.md#api) +- [wrappedCurrency](DefaultRewardsAPI.md#wrappedcurrency) + +### Methods + +- [computeCollateralInStakingPool](DefaultRewardsAPI.md#computecollateralinstakingpool) +- [getStakingPoolNonce](DefaultRewardsAPI.md#getstakingpoolnonce) +- [withdrawRewards](DefaultRewardsAPI.md#withdrawrewards) + +## Constructors + +### constructor + +• **new DefaultRewardsAPI**(`api`, `wrappedCurrency`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `wrappedCurrency` | `Currency` | + +#### Defined in + +[src/parachain/rewards.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L42) + +## Properties + +### api + +• **api**: `ApiPromise` + +#### Defined in + +[src/parachain/rewards.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L42) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/rewards.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L42) + +## Methods + +### computeCollateralInStakingPool + +▸ **computeCollateralInStakingPool**(`vaultId`, `nominatorId`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | The account ID of the staking pool nominee | +| `nominatorId` | `AccountId` | The account ID of the staking pool nominator | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +A Monetary.js amount object, representing the collateral in the given currency + +#### Implementation of + +[RewardsAPI](../interfaces/RewardsAPI.md).[computeCollateralInStakingPool](../interfaces/RewardsAPI.md#computecollateralinstakingpool) + +#### Defined in + +[src/parachain/rewards.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L50) + +___ + +### getStakingPoolNonce + +▸ **getStakingPoolNonce**(`collateralCurrency`, `vaultAccountId`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The staked currency | +| `vaultAccountId` | `AccountId` | The account ID of the staking pool nominee | + +#### Returns + +`Promise`<`number`\> + +The current nonce of the staking pool + +#### Implementation of + +[RewardsAPI](../interfaces/RewardsAPI.md).[getStakingPoolNonce](../interfaces/RewardsAPI.md#getstakingpoolnonce) + +#### Defined in + +[src/parachain/rewards.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L44) + +___ + +### withdrawRewards + +▸ **withdrawRewards**(`vaultId`, `nonce?`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | VaultId object | +| `nonce?` | `number` | Staking pool nonce | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Withdraw all rewards from the current account in the `vaultId` staking pool. + +#### Implementation of + +[RewardsAPI](../interfaces/RewardsAPI.md).[withdrawRewards](../interfaces/RewardsAPI.md#withdrawrewards) + +#### Defined in + +[src/parachain/rewards.ts:70](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L70) diff --git a/classes/DefaultSystemAPI.md b/classes/DefaultSystemAPI.md new file mode 100644 index 000000000..7402d20a6 --- /dev/null +++ b/classes/DefaultSystemAPI.md @@ -0,0 +1,239 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultSystemAPI + +# Class: DefaultSystemAPI + +## Implements + +- [`SystemAPI`](../interfaces/SystemAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultSystemAPI.md#constructor) + +### Properties + +- [api](DefaultSystemAPI.md#api) + +### Methods + +- [getBlockHash](DefaultSystemAPI.md#getblockhash) +- [getCurrentActiveBlockNumber](DefaultSystemAPI.md#getcurrentactiveblocknumber) +- [getCurrentBlockNumber](DefaultSystemAPI.md#getcurrentblocknumber) +- [getFutureBlockNumber](DefaultSystemAPI.md#getfutureblocknumber) +- [setCode](DefaultSystemAPI.md#setcode) +- [subscribeToCurrentBlockHeads](DefaultSystemAPI.md#subscribetocurrentblockheads) +- [subscribeToFinalizedBlockHeads](DefaultSystemAPI.md#subscribetofinalizedblockheads) + +## Constructors + +### constructor + +• **new DefaultSystemAPI**(`api`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Defined in + +[src/parachain/system.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L57) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/system.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L57) + +## Methods + +### getBlockHash + +▸ **getBlockHash**(`blockNumber`): `Promise`<`BlockHash`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blockNumber` | `number` | The block number to get the hash for | + +#### Returns + +`Promise`<`BlockHash`\> + +The block hash for the given block number + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[getBlockHash](../interfaces/SystemAPI.md#getblockhash) + +#### Defined in + +[src/parachain/system.ts:88](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L88) + +___ + +### getCurrentActiveBlockNumber + +▸ **getCurrentActiveBlockNumber**(`atBlock?`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `atBlock?` | `BlockHash` | + +#### Returns + +`Promise`<`number`\> + +The current active block number being processed. + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[getCurrentActiveBlockNumber](../interfaces/SystemAPI.md#getcurrentactiveblocknumber) + +#### Defined in + +[src/parachain/system.ts:63](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L63) + +___ + +### getCurrentBlockNumber + +▸ **getCurrentBlockNumber**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The current block number being processed. + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[getCurrentBlockNumber](../interfaces/SystemAPI.md#getcurrentblocknumber) + +#### Defined in + +[src/parachain/system.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L59) + +___ + +### getFutureBlockNumber + +▸ **getFutureBlockNumber**(`secondsFromNow`): `Promise`<`number`\> + +Get number of block that will added in amount of seconds from now. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `secondsFromNow` | `number` | Amount of seconds in the future. | + +#### Returns + +`Promise`<`number`\> + +Number of block added in future. + +**`Note`** + +Based on approximate block time of 12 seconds. + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[getFutureBlockNumber](../interfaces/SystemAPI.md#getfutureblocknumber) + +#### Defined in + +[src/parachain/system.ts:92](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L92) + +___ + +### setCode + +▸ **setCode**(`code`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `code` | `string` | Hex-encoded wasm blob | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Upgrades runtime using `sudoUncheckedWeight` + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[setCode](../interfaces/SystemAPI.md#setcode) + +#### Defined in + +[src/parachain/system.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L83) + +___ + +### subscribeToCurrentBlockHeads + +▸ **subscribeToCurrentBlockHeads**(`callback`): `Promise`<() => `void`\> + +On every new parachain block, call the callback function with the new block header + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callback` | (`blockHeader`: `Header`) => `void` | Function to be called with every new unfinalized block header | + +#### Returns + +`Promise`<() => `void`\> + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[subscribeToCurrentBlockHeads](../interfaces/SystemAPI.md#subscribetocurrentblockheads) + +#### Defined in + +[src/parachain/system.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L76) + +___ + +### subscribeToFinalizedBlockHeads + +▸ **subscribeToFinalizedBlockHeads**(`callback`): `Promise`<() => `void`\> + +On every new parachain block, call the callback function with the new block header + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callback` | (`blockHeader`: `Header`) => `void` | Function to be called with every new block header | + +#### Returns + +`Promise`<() => `void`\> + +#### Implementation of + +[SystemAPI](../interfaces/SystemAPI.md).[subscribeToFinalizedBlockHeads](../interfaces/SystemAPI.md#subscribetofinalizedblockheads) + +#### Defined in + +[src/parachain/system.ts:69](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L69) diff --git a/classes/DefaultTokensAPI.md b/classes/DefaultTokensAPI.md new file mode 100644 index 000000000..95bf9905f --- /dev/null +++ b/classes/DefaultTokensAPI.md @@ -0,0 +1,249 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultTokensAPI + +# Class: DefaultTokensAPI + +## Implements + +- [`TokensAPI`](../interfaces/TokensAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultTokensAPI.md#constructor) + +### Properties + +- [api](DefaultTokensAPI.md#api) + +### Methods + +- [balance](DefaultTokensAPI.md#balance) +- [buildTransferExtrinsic](DefaultTokensAPI.md#buildtransferextrinsic) +- [getAccountData](DefaultTokensAPI.md#getaccountdata) +- [setBalance](DefaultTokensAPI.md#setbalance) +- [subscribeToBalance](DefaultTokensAPI.md#subscribetobalance) +- [total](DefaultTokensAPI.md#total) +- [transfer](DefaultTokensAPI.md#transfer) + +## Constructors + +### constructor + +• **new DefaultTokensAPI**(`api`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Defined in + +[src/parachain/tokens.ts:70](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L70) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/tokens.ts:70](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L70) + +## Methods + +### balance + +▸ **balance**(`currency`, `id`): `Promise`<[`ChainBalance`](ChainBalance.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | The currency specification, `Monetary.js` object or `ForeignAsset` | +| `id` | `AccountId` | The AccountId of a user | + +#### Returns + +`Promise`<[`ChainBalance`](ChainBalance.md)\> + +The user's balance + +#### Implementation of + +[TokensAPI](../interfaces/TokensAPI.md).[balance](../interfaces/TokensAPI.md#balance) + +#### Defined in + +[src/parachain/tokens.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L82) + +___ + +### buildTransferExtrinsic + +▸ **buildTransferExtrinsic**(`destination`, `amount`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a transfer extrinsic without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `destination` | `string` | The address of a user | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | The amount to transfer, as `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A transfer submittable extrinsic. + +#### Implementation of + +[TokensAPI](../interfaces/TokensAPI.md).[buildTransferExtrinsic](../interfaces/TokensAPI.md#buildtransferextrinsic) + +#### Defined in + +[src/parachain/tokens.ts:111](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L111) + +___ + +### getAccountData + +▸ **getAccountData**(`currency`, `id`): `Promise`<`OrmlTokensAccountData`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | +| `id` | `AccountId` | + +#### Returns + +`Promise`<`OrmlTokensAccountData`\> + +#### Defined in + +[src/parachain/tokens.ts:78](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L78) + +___ + +### setBalance + +▸ **setBalance**(`accountId`, `freeBalance`, `lockedBalance?`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account whose balance to set | +| `freeBalance` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Free balance to set, as a Monetary.js object | +| `lockedBalance?` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Locked balance to set, as a Monetary.js object | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +This extrinsic is only valid if submitted by a sudo account + +#### Implementation of + +[TokensAPI](../interfaces/TokensAPI.md).[setBalance](../interfaces/TokensAPI.md#setbalance) + +#### Defined in + +[src/parachain/tokens.ts:129](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L129) + +___ + +### subscribeToBalance + +▸ **subscribeToBalance**(`currency`, `account`, `callback`): `Promise`<() => `void`\> + +Subscribe to balance updates + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | The currency specification, `Monetary.js` object or `ForeignAsset` | +| `account` | `string` | AccountId string | +| `callback` | (`account`: `string`, `accountData`: [`ChainBalance`](ChainBalance.md)) => `void` | Function to be called whenever the balance of an account is updated. Its parameters are (accountIdString, freeBalance) | + +#### Returns + +`Promise`<() => `void`\> + +#### Implementation of + +[TokensAPI](../interfaces/TokensAPI.md).[subscribeToBalance](../interfaces/TokensAPI.md#subscribetobalance) + +#### Defined in + +[src/parachain/tokens.ts:87](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L87) + +___ + +### total + +▸ **total**<`CurrencyT`\>(`currency`): `Promise`<`MonetaryAmount`<`CurrencyT`\>\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `CurrencyT` | extends [`CurrencyExt`](../modules.md#currencyext) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | `CurrencyT` | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<`CurrencyT`\>\> + +The total amount in the system + +#### Implementation of + +[TokensAPI](../interfaces/TokensAPI.md).[total](../interfaces/TokensAPI.md#total) + +#### Defined in + +[src/parachain/tokens.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L72) + +___ + +### transfer + +▸ **transfer**(`destination`, `amount`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `destination` | `string` | The address of a user | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | The amount to transfer, as `Monetary.js` object or `ForeignAsset` | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[TokensAPI](../interfaces/TokensAPI.md).[transfer](../interfaces/TokensAPI.md#transfer) + +#### Defined in + +[src/parachain/tokens.ts:119](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L119) diff --git a/classes/DefaultTransactionAPI.md b/classes/DefaultTransactionAPI.md new file mode 100644 index 000000000..0698b3615 --- /dev/null +++ b/classes/DefaultTransactionAPI.md @@ -0,0 +1,380 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultTransactionAPI + +# Class: DefaultTransactionAPI + +## Implements + +- [`TransactionAPI`](../interfaces/TransactionAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultTransactionAPI.md#constructor) + +### Properties + +- [account](DefaultTransactionAPI.md#account) +- [api](DefaultTransactionAPI.md#api) + +### Methods + +- [buildBatchExtrinsic](DefaultTransactionAPI.md#buildbatchextrinsic) +- [dryRun](DefaultTransactionAPI.md#dryrun) +- [getAccount](DefaultTransactionAPI.md#getaccount) +- [getFeeEstimate](DefaultTransactionAPI.md#getfeeestimate) +- [removeAccount](DefaultTransactionAPI.md#removeaccount) +- [sendLogged](DefaultTransactionAPI.md#sendlogged) +- [setAccount](DefaultTransactionAPI.md#setaccount) +- [buildBatchExtrinsic](DefaultTransactionAPI.md#buildbatchextrinsic-1) +- [doesArrayContainEvent](DefaultTransactionAPI.md#doesarraycontainevent) +- [isDispatchError](DefaultTransactionAPI.md#isdispatcherror) +- [printEvents](DefaultTransactionAPI.md#printevents) +- [sendLogged](DefaultTransactionAPI.md#sendlogged-1) + +## Constructors + +### constructor + +• **new DefaultTransactionAPI**(`api`, `account?`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `account?` | `AddressOrPair` | + +#### Defined in + +[src/parachain/transaction.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L58) + +## Properties + +### account + +• `Private` `Optional` **account**: `AddressOrPair` + +#### Defined in + +[src/parachain/transaction.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L58) + +___ + +### api + +• **api**: `ApiPromise` + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[api](../interfaces/TransactionAPI.md#api) + +#### Defined in + +[src/parachain/transaction.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L58) + +## Methods + +### buildBatchExtrinsic + +▸ **buildBatchExtrinsic**(`extrinsics`, `atomic?`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Builds a submittable extrinsic to send other extrinsic in batch. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `extrinsics` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>[] | `undefined` | An array of extrinsics to be submitted as batch. | +| `atomic` | `boolean` | `true` | Whether the given extrinsics should be handled atomically or not. When true (default) all extrinsics will rollback if one fails (batchAll), otherwise allows partial successes (batch). | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A batch/batchAll submittable extrinsic. + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[buildBatchExtrinsic](../interfaces/TransactionAPI.md#buildbatchextrinsic) + +#### Defined in + +[src/parachain/transaction.ts:107](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L107) + +___ + +### dryRun + +▸ **dryRun**(`extrinsic`): `Promise`<[`DryRunResult`](../interfaces/DryRunResult.md)\> + +Tests extrinsic execution against runtime. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `extrinsic` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | Extrinsic to dry run. | + +#### Returns + +`Promise`<[`DryRunResult`](../interfaces/DryRunResult.md)\> + +Object consisting of `success` boolean that is true if extrinsic +was successfully executed, false otherwise. If execution fails, caught error is exposed. + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[dryRun](../interfaces/TransactionAPI.md#dryrun) + +#### Defined in + +[src/parachain/transaction.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L95) + +___ + +### getAccount + +▸ **getAccount**(): `undefined` \| `AddressOrPair` + +#### Returns + +`undefined` \| `AddressOrPair` + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[getAccount](../interfaces/TransactionAPI.md#getaccount) + +#### Defined in + +[src/parachain/transaction.ts:68](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L68) + +___ + +### getFeeEstimate + +▸ **getFeeEstimate**(`extrinsic`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +Getter for fee estimate of the extrinsic. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `extrinsic` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | Extrinsic to get fee estimation about. | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +amount of native currency that will be paid as transaction fee. + +**`Note`** + +This fee estimation does not include tip. + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[getFeeEstimate](../interfaces/TransactionAPI.md#getfeeestimate) + +#### Defined in + +[src/parachain/transaction.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L83) + +___ + +### removeAccount + +▸ **removeAccount**(): `void` + +#### Returns + +`void` + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[removeAccount](../interfaces/TransactionAPI.md#removeaccount) + +#### Defined in + +[src/parachain/transaction.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L64) + +___ + +### sendLogged + +▸ **sendLogged**<`T`\>(`transaction`, `successEventType?`, `extrinsicStatus?`): `Promise`<`ISubmittableResult`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `Codec`[] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `transaction` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | +| `successEventType?` | `AugmentedEvent`<`ApiTypes`, `T`\> | +| `extrinsicStatus?` | `ExtrinsicStatus` | + +#### Returns + +`Promise`<`ISubmittableResult`\> + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[sendLogged](../interfaces/TransactionAPI.md#sendlogged) + +#### Defined in + +[src/parachain/transaction.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L72) + +___ + +### setAccount + +▸ **setAccount**(`account`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `AddressOrPair` | + +#### Returns + +`void` + +#### Implementation of + +[TransactionAPI](../interfaces/TransactionAPI.md).[setAccount](../interfaces/TransactionAPI.md#setaccount) + +#### Defined in + +[src/parachain/transaction.ts:60](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L60) + +___ + +### buildBatchExtrinsic + +▸ `Static` **buildBatchExtrinsic**(`api`, `extrinsics`, `atomic?`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Builds a submittable extrinsic to send other extrinsic in batch. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `api` | `ApiPromise` | `undefined` | The ApiPromis instance to construct the batch extrinsic with. | +| `extrinsics` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>[] | `undefined` | An array of extrinsics to be submitted as batch. | +| `atomic` | `boolean` | `true` | Whether the given extrinsics should be handled atomically or not. When true (default) all extrinsics will rollback if one fails (batchAll), otherwise allows partial successes (batch). | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A batch/batchAll submittable extrinsic. + +#### Defined in + +[src/parachain/transaction.ts:123](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L123) + +___ + +### doesArrayContainEvent + +▸ `Static` **doesArrayContainEvent**<`T`\>(`events`, `eventType`): `boolean` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `Codec`[] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `events` | `EventRecord`[] | +| `eventType` | `AugmentedEvent`<`ApiTypes`, `T`\> | + +#### Returns + +`boolean` + +#### Defined in + +[src/parachain/transaction.ts:238](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L238) + +___ + +### isDispatchError + +▸ `Static` **isDispatchError**(`eventData`): eventData is DispatchError + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `eventData` | `unknown` | + +#### Returns + +eventData is DispatchError + +#### Defined in + +[src/parachain/transaction.ts:234](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L234) + +___ + +### printEvents + +▸ `Static` **printEvents**(`api`, `events`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `events` | `EventRecord`[] | + +#### Returns + +`void` + +#### Defined in + +[src/parachain/transaction.ts:204](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L204) + +___ + +### sendLogged + +▸ `Static` **sendLogged**<`T`\>(`api`, `account`, `transaction`, `successEventType?`, `extrinsicStatus?`): `Promise`<`ISubmittableResult`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `Codec`[] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `account` | `AddressOrPair` | +| `transaction` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | +| `successEventType?` | `AugmentedEvent`<`ApiTypes`, `T`\> | +| `extrinsicStatus?` | `ExtrinsicStatus` | + +#### Returns + +`Promise`<`ISubmittableResult`\> + +#### Defined in + +[src/parachain/transaction.ts:132](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L132) diff --git a/classes/DefaultVaultsAPI.md b/classes/DefaultVaultsAPI.md new file mode 100644 index 000000000..109c657bc --- /dev/null +++ b/classes/DefaultVaultsAPI.md @@ -0,0 +1,1582 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DefaultVaultsAPI + +# Class: DefaultVaultsAPI + +## Implements + +- [`VaultsAPI`](../interfaces/VaultsAPI.md) + +## Table of contents + +### Constructors + +- [constructor](DefaultVaultsAPI.md#constructor) + +### Properties + +- [api](DefaultVaultsAPI.md#api) +- [electrsAPI](DefaultVaultsAPI.md#electrsapi) +- [feeAPI](DefaultVaultsAPI.md#feeapi) +- [governanceCurrency](DefaultVaultsAPI.md#governancecurrency) +- [oracleAPI](DefaultVaultsAPI.md#oracleapi) +- [rewardsAPI](DefaultVaultsAPI.md#rewardsapi) +- [systemAPI](DefaultVaultsAPI.md#systemapi) +- [tokensAPI](DefaultVaultsAPI.md#tokensapi) +- [transactionAPI](DefaultVaultsAPI.md#transactionapi) +- [wrappedCurrency](DefaultVaultsAPI.md#wrappedcurrency) + +### Methods + +- [backingCollateralProportion](DefaultVaultsAPI.md#backingcollateralproportion) +- [buildAcceptNewIssuesExtrinsic](DefaultVaultsAPI.md#buildacceptnewissuesextrinsic) +- [buildDepositCollateralExtrinsic](DefaultVaultsAPI.md#builddepositcollateralextrinsic) +- [buildRegisterPublicKeyExtrinsic](DefaultVaultsAPI.md#buildregisterpublickeyextrinsic) +- [buildRegisterVaultExtrinsic](DefaultVaultsAPI.md#buildregistervaultextrinsic) +- [buildWithdrawCollateralExtrinsic](DefaultVaultsAPI.md#buildwithdrawcollateralextrinsic) +- [calculateCapacity](DefaultVaultsAPI.md#calculatecapacity) +- [computeBackingCollateral](DefaultVaultsAPI.md#computebackingcollateral) +- [computeReward](DefaultVaultsAPI.md#computereward) +- [depositCollateral](DefaultVaultsAPI.md#depositcollateral) +- [get](DefaultVaultsAPI.md#get) +- [getAPY](DefaultVaultsAPI.md#getapy) +- [getBlockRewardAPY](DefaultVaultsAPI.md#getblockrewardapy) +- [getCollateral](DefaultVaultsAPI.md#getcollateral) +- [getCollateralizationFromVault](DefaultVaultsAPI.md#getcollateralizationfromvault) +- [getCollateralizationFromVaultAndCollateral](DefaultVaultsAPI.md#getcollateralizationfromvaultandcollateral) +- [getExchangeRateForLiquidation](DefaultVaultsAPI.md#getexchangerateforliquidation) +- [getGovernanceReward](DefaultVaultsAPI.md#getgovernancereward) +- [getIssuableTokensFromVault](DefaultVaultsAPI.md#getissuabletokensfromvault) +- [getIssuedAmount](DefaultVaultsAPI.md#getissuedamount) +- [getLiquidationCollateralThreshold](DefaultVaultsAPI.md#getliquidationcollateralthreshold) +- [getLiquidationVault](DefaultVaultsAPI.md#getliquidationvault) +- [getMaxNominationRatio](DefaultVaultsAPI.md#getmaxnominationratio) +- [getMinimumCollateral](DefaultVaultsAPI.md#getminimumcollateral) +- [getOrNull](DefaultVaultsAPI.md#getornull) +- [getPremiumRedeemThreshold](DefaultVaultsAPI.md#getpremiumredeemthreshold) +- [getPremiumRedeemVaults](DefaultVaultsAPI.md#getpremiumredeemvaults) +- [getPunishmentFee](DefaultVaultsAPI.md#getpunishmentfee) +- [getRegisterVaultEvent](DefaultVaultsAPI.md#getregistervaultevent) +- [getRequiredCollateralForVault](DefaultVaultsAPI.md#getrequiredcollateralforvault) +- [getRequiredCollateralForWrapped](DefaultVaultsAPI.md#getrequiredcollateralforwrapped) +- [getSecureCollateralThreshold](DefaultVaultsAPI.md#getsecurecollateralthreshold) +- [getStakingCapacity](DefaultVaultsAPI.md#getstakingcapacity) +- [getSystemCollateralization](DefaultVaultsAPI.md#getsystemcollateralization) +- [getTotalIssuableAmount](DefaultVaultsAPI.md#gettotalissuableamount) +- [getTotalIssuedAmount](DefaultVaultsAPI.md#gettotalissuedamount) +- [getVaultCollateralization](DefaultVaultsAPI.md#getvaultcollateralization) +- [getVaultsEligibleForRedeeming](DefaultVaultsAPI.md#getvaultseligibleforredeeming) +- [getVaultsWithIssuableTokens](DefaultVaultsAPI.md#getvaultswithissuabletokens) +- [getVaultsWithRedeemableTokens](DefaultVaultsAPI.md#getvaultswithredeemabletokens) +- [getWrappedCurrency](DefaultVaultsAPI.md#getwrappedcurrency) +- [getWrappedReward](DefaultVaultsAPI.md#getwrappedreward) +- [isBelowPremiumThreshold](DefaultVaultsAPI.md#isbelowpremiumthreshold) +- [isNoTokensIssuedError](DefaultVaultsAPI.md#isnotokensissuederror) +- [isVaultEligibleForRedeem](DefaultVaultsAPI.md#isvaulteligibleforredeem) +- [isVaultFlaggedForTheft](DefaultVaultsAPI.md#isvaultflaggedfortheft) +- [list](DefaultVaultsAPI.md#list) +- [parseVault](DefaultVaultsAPI.md#parsevault) +- [parseVaultStatus](DefaultVaultsAPI.md#parsevaultstatus) +- [registerNewCollateralVault](DefaultVaultsAPI.md#registernewcollateralvault) +- [selectRandomVaultIssue](DefaultVaultsAPI.md#selectrandomvaultissue) +- [selectRandomVaultRedeem](DefaultVaultsAPI.md#selectrandomvaultredeem) +- [toggleIssueRequests](DefaultVaultsAPI.md#toggleissuerequests) +- [withdrawCollateral](DefaultVaultsAPI.md#withdrawcollateral) + +## Constructors + +### constructor + +• **new DefaultVaultsAPI**(`api`, `electrsAPI`, `wrappedCurrency`, `governanceCurrency`, `tokensAPI`, `oracleAPI`, `feeAPI`, `rewardsAPI`, `systemAPI`, `transactionAPI`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `electrsAPI` | [`ElectrsAPI`](../interfaces/ElectrsAPI.md) | +| `wrappedCurrency` | `Currency` | +| `governanceCurrency` | `Currency` | +| `tokensAPI` | [`TokensAPI`](../interfaces/TokensAPI.md) | +| `oracleAPI` | [`OracleAPI`](../interfaces/OracleAPI.md) | +| `feeAPI` | [`FeeAPI`](../interfaces/FeeAPI.md) | +| `rewardsAPI` | [`RewardsAPI`](../interfaces/RewardsAPI.md) | +| `systemAPI` | [`SystemAPI`](../interfaces/SystemAPI.md) | +| `transactionAPI` | [`TransactionAPI`](../interfaces/TransactionAPI.md) | + +#### Defined in + +[src/parachain/vaults.ts:405](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L405) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/parachain/vaults.ts:406](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L406) + +___ + +### electrsAPI + +• `Private` **electrsAPI**: [`ElectrsAPI`](../interfaces/ElectrsAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:407](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L407) + +___ + +### feeAPI + +• `Private` **feeAPI**: [`FeeAPI`](../interfaces/FeeAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:412](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L412) + +___ + +### governanceCurrency + +• `Private` **governanceCurrency**: `Currency` + +#### Defined in + +[src/parachain/vaults.ts:409](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L409) + +___ + +### oracleAPI + +• `Private` **oracleAPI**: [`OracleAPI`](../interfaces/OracleAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:411](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L411) + +___ + +### rewardsAPI + +• `Private` **rewardsAPI**: [`RewardsAPI`](../interfaces/RewardsAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:413](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L413) + +___ + +### systemAPI + +• `Private` **systemAPI**: [`SystemAPI`](../interfaces/SystemAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:414](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L414) + +___ + +### tokensAPI + +• `Private` **tokensAPI**: [`TokensAPI`](../interfaces/TokensAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:410](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L410) + +___ + +### transactionAPI + +• `Private` **transactionAPI**: [`TransactionAPI`](../interfaces/TransactionAPI.md) + +#### Defined in + +[src/parachain/vaults.ts:415](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L415) + +___ + +### wrappedCurrency + +• `Private` **wrappedCurrency**: `Currency` + +#### Defined in + +[src/parachain/vaults.ts:408](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L408) + +## Methods + +### backingCollateralProportion + +▸ **backingCollateralProportion**(`vaultAccountId`, `nominatorId`, `collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultAccountId` | `AccountId` | +| `nominatorId` | `AccountId` | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/vaults.ts:567](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L567) + +___ + +### buildAcceptNewIssuesExtrinsic + +▸ **buildAcceptNewIssuesExtrinsic**(`collateralCurrency`, `acceptNewIssues`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build accept new issues extrinsic without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | the collateral currency for which to change the accepting status, | +| `acceptNewIssues` | `boolean` | Boolean denoting whether issuing should be enabled or not | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +An accept new issues submittable extrinsic. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[buildAcceptNewIssuesExtrinsic](../interfaces/VaultsAPI.md#buildacceptnewissuesextrinsic) + +#### Defined in + +[src/parachain/vaults.ts:970](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L970) + +___ + +### buildDepositCollateralExtrinsic + +▸ **buildDepositCollateralExtrinsic**(`amount`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build deposit collateral extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of extra collateral to lock | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A deposit collateral submittable extrinsic. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[buildDepositCollateralExtrinsic](../interfaces/VaultsAPI.md#builddepositcollateralextrinsic) + +#### Defined in + +[src/parachain/vaults.ts:474](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L474) + +___ + +### buildRegisterPublicKeyExtrinsic + +▸ **buildRegisterPublicKeyExtrinsic**(`publicKey`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build extrinsic to register a public key. + +This extrinsic can be used together with a register vault extrinsic (see: [buildRegisterVaultExtrinsic](../interfaces/VaultsAPI.md#buildregistervaultextrinsic)) +to register the first vault for the logged in account id. + +Registering the public key should only be done once per account id when it is not associated with a running vault, yet. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `publicKey` | `string` | The BTC public key of the vault to derive deposit keys with the [On-Chain Key Derivation Scheme](https://spec.interlay.io/security_performance/xclaim-security.html#okd). | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A register vault submittable extrinsic. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[buildRegisterPublicKeyExtrinsic](../interfaces/VaultsAPI.md#buildregisterpublickeyextrinsic) + +#### Defined in + +[src/parachain/vaults.ts:447](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L447) + +___ + +### buildRegisterVaultExtrinsic + +▸ **buildRegisterVaultExtrinsic**(`collateralAmount`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build extrinsic to register a new vault. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral amount to register the vault with - in the new collateral currency. | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A register vault submittable extrinsic. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[buildRegisterVaultExtrinsic](../interfaces/VaultsAPI.md#buildregistervaultextrinsic) + +#### Defined in + +[src/parachain/vaults.ts:439](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L439) + +___ + +### buildWithdrawCollateralExtrinsic + +▸ **buildWithdrawCollateralExtrinsic**(`amount`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build withdraw collateral extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of collateral to withdraw | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +A withdraw collateral submittable extrinsic as promise. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[buildWithdrawCollateralExtrinsic](../interfaces/VaultsAPI.md#buildwithdrawcollateralextrinsic) + +#### Defined in + +[src/parachain/vaults.ts:451](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L451) + +___ + +### calculateCapacity + +▸ **calculateCapacity**(`collateral`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Amount of collateral to calculate issuable capacity for | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +Issuable amount by the vault, given the collateral amount + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[calculateCapacity](../interfaces/VaultsAPI.md#calculatecapacity) + +#### Defined in + +[src/parachain/vaults.ts:773](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L773) + +___ + +### computeBackingCollateral + +▸ **computeBackingCollateral**(`vaultId`, `nonce?`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | Vault ID object | +| `nonce?` | `number` | Nonce of the staking pool | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The entire collateral backing a vault's issued tokens. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[computeBackingCollateral](../interfaces/VaultsAPI.md#computebackingcollateral) + +#### Defined in + +[src/parachain/vaults.ts:554](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L554) + +___ + +### computeReward + +▸ **computeReward**(`vaultAccountId`, `collateralCurrency`, `rewardCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +Compute the total reward, including the staking (local) pool and the rewards (global) pool + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault ID whose reward pool to check | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | - | +| `rewardCurrency` | `Currency` | The reward currency, e.g. kBTC, KINT, interBTC, INTR | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +A Monetary.js amount object, representing the total reward in the given currency + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[computeReward](../interfaces/VaultsAPI.md#computereward) + +#### Defined in + +[src/parachain/vaults.ts:606](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L606) + +___ + +### depositCollateral + +▸ **depositCollateral**(`amount`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of extra collateral to lock | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[depositCollateral](../interfaces/VaultsAPI.md#depositcollateral) + +#### Defined in + +[src/parachain/vaults.ts:491](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L491) + +___ + +### get + +▸ **get**(`vaultAccountId`, `collateralCurrency`): `Promise`<[`VaultExt`](VaultExt.md)\> + +Get a vault by account ID and collateral currency. Rejects if no vault exists. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The ID of the vault to fetch | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by vault | + +#### Returns + +`Promise`<[`VaultExt`](VaultExt.md)\> + +A vault object, rejects if no vault with the given ID and currency pair exists + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[get](../interfaces/VaultsAPI.md#get) + +#### Defined in + +[src/parachain/vaults.ts:516](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L516) + +___ + +### getAPY + +▸ **getAPY**(`vaultAccountId`, `collateralCurrency`): `Promise`<`Big`\> + +Get the total APY for a vault based on the income in wrapped and collateral tokens +divided by the locked collateral. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`Big`\> + +the APY as a percentage string + +**`Note`** + +this does not account for interest compounding + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getAPY](../interfaces/VaultsAPI.md#getapy) + +#### Defined in + +[src/parachain/vaults.ts:918](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L918) + +___ + +### getBlockRewardAPY + +▸ **getBlockRewardAPY**(`vaultAccountId`, `collateralCurrency`): `Promise`<`Big`\> + +Gets the estimated APY for just the block rewards (in governance tokens). + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultAccountId` | `AccountId` | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +the APY as a percentage + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getBlockRewardAPY](../interfaces/VaultsAPI.md#getblockrewardapy) + +#### Defined in + +[src/parachain/vaults.ts:593](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L593) + +___ + +### getCollateral + +▸ **getCollateral**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | - | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The collateral of a vault, taking slashes into account. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getCollateral](../interfaces/VaultsAPI.md#getcollateral) + +#### Defined in + +[src/parachain/vaults.ts:527](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L527) + +___ + +### getCollateralizationFromVault + +▸ **getCollateralizationFromVault**(`vaultId`, `onlyIssued?`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `onlyIssued` | `boolean` | `false` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/vaults.ts:704](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L704) + +___ + +### getCollateralizationFromVaultAndCollateral + +▸ **getCollateralizationFromVaultAndCollateral**(`vaultId`, `newCollateral`, `onlyIssued`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | +| `newCollateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | +| `onlyIssued` | `boolean` | + +#### Returns + +`Promise`<`Big`\> + +#### Defined in + +[src/parachain/vaults.ts:709](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L709) + +___ + +### getExchangeRateForLiquidation + +▸ **getExchangeRateForLiquidation**(`vaultAccountId`, `collateralCurrency`): `Promise`<`undefined` \| `Big`\> + +Get the target exchange rate at which a vault will be forced to liquidate, given its +current locked collateral and issued as well as to be issued tokens. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault's account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The collateral currency for the vault with the account id above | + +#### Returns + +`Promise`<`undefined` \| `Big`\> + +The theoretical collateral per wrapped currency rate below which the vault would be liquidated. + Returns undefined if a value cannot be calculated, eg. if the vault has no issued tokens. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getExchangeRateForLiquidation](../interfaces/VaultsAPI.md#getexchangerateforliquidation) + +#### Defined in + +[src/parachain/vaults.ts:984](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L984) + +___ + +### getGovernanceReward + +▸ **getGovernanceReward**(`vaultAccountId`, `vaultCollateral`, `governanceCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault ID whose reward pool to check | +| `vaultCollateral` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by the vault | +| `governanceCurrency` | `Currency` | The fee reward currency | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total reward collected by the vault + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getGovernanceReward](../interfaces/VaultsAPI.md#getgovernancereward) + +#### Defined in + +[src/parachain/vaults.ts:627](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L627) + +___ + +### getIssuableTokensFromVault + +▸ **getIssuableTokensFromVault**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +Returns issuable amount for a given vault + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The issuable amount of a vault + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getIssuableTokensFromVault](../interfaces/VaultsAPI.md#getissuabletokensfromvault) + +#### Defined in + +[src/parachain/vaults.ts:788](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L788) + +___ + +### getIssuedAmount + +▸ **getIssuedAmount**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The amount of wrapped tokens issued by the given vault + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getIssuedAmount](../interfaces/VaultsAPI.md#getissuedamount) + +#### Defined in + +[src/parachain/vaults.ts:749](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L749) + +___ + +### getLiquidationCollateralThreshold + +▸ **getLiquidationCollateralThreshold**(`collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +The lower bound for vault collateralization. +If a Vault’s collateral rate +drops below this, automatic liquidation (forced Redeem) is triggered. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getLiquidationCollateralThreshold](../interfaces/VaultsAPI.md#getliquidationcollateralthreshold) + +#### Defined in + +[src/parachain/vaults.ts:894](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L894) + +___ + +### getLiquidationVault + +▸ **getLiquidationVault**(`collateralCurrency`): `Promise`<[`SystemVaultExt`](../interfaces/SystemVaultExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<[`SystemVaultExt`](../interfaces/SystemVaultExt.md)\> + +A vault object representing the liquidation vault + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getLiquidationVault](../interfaces/VaultsAPI.md#getliquidationvault) + +#### Defined in + +[src/parachain/vaults.ts:647](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L647) + +___ + +### getMaxNominationRatio + +▸ **getMaxNominationRatio**(`collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The collateral currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`Big`\> + +The maximum collateral a vault can accept as nomination, as a ratio of its own collateral + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getMaxNominationRatio](../interfaces/VaultsAPI.md#getmaxnominationratio) + +#### Defined in + +[src/parachain/vaults.ts:546](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L546) + +___ + +### getMinimumCollateral + +▸ **getMinimumCollateral**(`collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +Get the minimum secured collateral amount required to activate a vault + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +the minimum collateral to register a vault + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getMinimumCollateral](../interfaces/VaultsAPI.md#getminimumcollateral) + +#### Defined in + +[src/parachain/vaults.ts:537](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L537) + +___ + +### getOrNull + +▸ **getOrNull**(`vaultAccountId`, `collateralCurrency`): `Promise`<``null`` \| [`VaultExt`](VaultExt.md)\> + +Get a vault by account ID and collateral currency. +Does not reject if the vault does not exist, but returns null instead. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The ID of the vault to fetch | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by vault | + +#### Returns + +`Promise`<``null`` \| [`VaultExt`](VaultExt.md)\> + +A vault object, or null if no vault with the given ID and currency pair exists + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getOrNull](../interfaces/VaultsAPI.md#getornull) + +#### Defined in + +[src/parachain/vaults.ts:503](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L503) + +___ + +### getPremiumRedeemThreshold + +▸ **getPremiumRedeemThreshold**(`collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +The collateral rate at which users receive +a premium allocated from the Vault’s collateral, when performing a redeem with this Vault. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getPremiumRedeemThreshold](../interfaces/VaultsAPI.md#getpremiumredeemthreshold) + +#### Defined in + +[src/parachain/vaults.ts:903](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L903) + +___ + +### getPremiumRedeemVaults + +▸ **getPremiumRedeemVaults**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +Vaults below the premium redeem threshold, sorted in descending order of their redeemable tokens + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getPremiumRedeemVaults](../interfaces/VaultsAPI.md#getpremiumredeemvaults) + +#### Defined in + +[src/parachain/vaults.ts:824](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L824) + +___ + +### getPunishmentFee + +▸ **getPunishmentFee**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +Fee that a Vault has to pay, as a percentage, if it fails to execute +redeem or replace requests (for redeem, on top of the slashed wrapped-token-to-collateral +value of the request). The fee is paid in collateral currency based on the wrapped token +amount at the current exchange rate. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getPunishmentFee](../interfaces/VaultsAPI.md#getpunishmentfee) + +#### Defined in + +[src/parachain/vaults.ts:927](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L927) + +___ + +### getRegisterVaultEvent + +▸ **getRegisterVaultEvent**(): `AugmentedEvent`<`ApiTypes`, `AnyTuple`\> + +#### Returns + +`AugmentedEvent`<`ApiTypes`, `AnyTuple`\> + +#### Defined in + +[src/parachain/vaults.ts:435](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L435) + +___ + +### getRequiredCollateralForVault + +▸ **getRequiredCollateralForVault**(`vaultAccountId`, `currency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +Get the amount of collateral required for the given vault to be at the +current SecureCollateralThreshold with the current exchange rate + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `currency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The required collateral the vault needs to deposit to stay +above the threshold limit + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getRequiredCollateralForVault](../interfaces/VaultsAPI.md#getrequiredcollateralforvault) + +#### Defined in + +[src/parachain/vaults.ts:731](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L731) + +___ + +### getRequiredCollateralForWrapped + +▸ **getRequiredCollateralForWrapped**(`wrappedAmount`, `currency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `wrappedAmount` | `MonetaryAmount`<`Currency`\> | +| `currency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Defined in + +[src/parachain/vaults.ts:740](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L740) + +___ + +### getSecureCollateralThreshold + +▸ **getSecureCollateralThreshold**(`collateralCurrency`): `Promise`<`Big`\> + +Get the global secure collateral threshold. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +The global over-collateralization rate for collateral locked +by Vaults, necessary for issuing wrapped tokens + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getSecureCollateralThreshold](../interfaces/VaultsAPI.md#getsecurecollateralthreshold) + +#### Defined in + +[src/parachain/vaults.ts:912](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L912) + +___ + +### getStakingCapacity + +▸ **getStakingCapacity**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +Staking capacity, as a collateral currency (e.g. DOT) + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getStakingCapacity](../interfaces/VaultsAPI.md#getstakingcapacity) + +#### Defined in + +[src/parachain/vaults.ts:635](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L635) + +___ + +### getSystemCollateralization + +▸ **getSystemCollateralization**(): `Promise`<`undefined` \| `Big`\> + +#### Returns + +`Promise`<`undefined` \| `Big`\> + +#### Defined in + +[src/parachain/vaults.ts:726](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L726) + +___ + +### getTotalIssuableAmount + +▸ **getTotalIssuableAmount**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total amount of wrapped tokens that can be issued, considering the collateral +locked by the vaults + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getTotalIssuableAmount](../interfaces/VaultsAPI.md#gettotalissuableamount) + +#### Defined in + +[src/parachain/vaults.ts:762](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L762) + +___ + +### getTotalIssuedAmount + +▸ **getTotalIssuedAmount**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total amount of wrapped tokens issued by the vaults + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getTotalIssuedAmount](../interfaces/VaultsAPI.md#gettotalissuedamount) + +#### Defined in + +[src/parachain/vaults.ts:757](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L757) + +___ + +### getVaultCollateralization + +▸ **getVaultCollateralization**(`vaultAccountId`, `collateralCurrency`, `newCollateral?`, `onlyIssued?`): `Promise`<`undefined` \| `Big`\> + +Get the collateralization of a single vault measured by dividing the value of issued (wrapped) tokens +by the value of total locked collateral. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | `undefined` | the vault account id | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | `undefined` | Collateral used by vault | +| `newCollateral?` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | `undefined` | use this instead of the vault's actual collateral | +| `onlyIssued` | `boolean` | `false` | optional, defaults to `false`. Specifies whether the collateralization should only include the issued tokens, leaving out unsettled ("to-be-issued") tokens | + +#### Returns + +`Promise`<`undefined` \| `Big`\> + +the vault collateralization + +**`Remarks`** + +Undefined collateralization is handled as infinite collateralization in the UI. +If no tokens have been issued, the `collateralFunds / issuedFunds` ratio divides by zero, +which means collateralization is infinite. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getVaultCollateralization](../interfaces/VaultsAPI.md#getvaultcollateralization) + +#### Defined in + +[src/parachain/vaults.ts:674](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L674) + +___ + +### getVaultsEligibleForRedeeming + +▸ `Private` **getVaultsEligibleForRedeeming**(): `Promise`<[`VaultExt`](VaultExt.md)[]\> + +#### Returns + +`Promise`<[`VaultExt`](VaultExt.md)[]\> + +#### Defined in + +[src/parachain/vaults.ts:859](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L859) + +___ + +### getVaultsWithIssuableTokens + +▸ **getVaultsWithIssuableTokens**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +Vaults with issuable tokens, not sorted in any particular order. + +**`Remarks`** + +The result is not sorted as an attempt to randomize the assignment of requests to vaults. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getVaultsWithIssuableTokens](../interfaces/VaultsAPI.md#getvaultswithissuabletokens) + +#### Defined in + +[src/parachain/vaults.ts:837](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L837) + +___ + +### getVaultsWithRedeemableTokens + +▸ **getVaultsWithRedeemableTokens**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +Vaults with redeemable tokens, sorted in descending order. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getVaultsWithRedeemableTokens](../interfaces/VaultsAPI.md#getvaultswithredeemabletokens) + +#### Defined in + +[src/parachain/vaults.ts:873](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L873) + +___ + +### getWrappedCurrency + +▸ **getWrappedCurrency**(): `Currency` + +#### Returns + +`Currency` + +The wrapped currency issued by the vaults + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getWrappedCurrency](../interfaces/VaultsAPI.md#getwrappedcurrency) + +#### Defined in + +[src/parachain/vaults.ts:418](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L418) + +___ + +### getWrappedReward + +▸ **getWrappedReward**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault ID whose reward pool to check | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by the vault | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total reward collected by the vault + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[getWrappedReward](../interfaces/VaultsAPI.md#getwrappedreward) + +#### Defined in + +[src/parachain/vaults.ts:620](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L620) + +___ + +### isBelowPremiumThreshold + +▸ **isBelowPremiumThreshold**(`vaultId`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/parachain/vaults.ts:666](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L666) + +___ + +### isNoTokensIssuedError + +▸ `Private` **isNoTokensIssuedError**(`e`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `e` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[src/parachain/vaults.ts:662](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L662) + +___ + +### isVaultEligibleForRedeem + +▸ `Private` **isVaultEligibleForRedeem**(`vault`, `activeBlockNumber`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vault` | [`VaultExt`](VaultExt.md) | +| `activeBlockNumber` | `number` | + +#### Returns + +`boolean` + +#### Defined in + +[src/parachain/vaults.ts:850](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L850) + +___ + +### isVaultFlaggedForTheft + +▸ **isVaultFlaggedForTheft**(`vaultId`, `btcTxId`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | The vault ID | +| `btcTxId` | `string` | ID of the Bitcoin transaction to check | + +#### Returns + +`Promise`<`boolean`\> + +A bollean value + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[isVaultFlaggedForTheft](../interfaces/VaultsAPI.md#isvaultflaggedfortheft) + +#### Defined in + +[src/parachain/vaults.ts:887](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L887) + +___ + +### list + +▸ **list**(`atBlock?`): `Promise`<[`VaultExt`](VaultExt.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `atBlock?` | `BlockHash` | + +#### Returns + +`Promise`<[`VaultExt`](VaultExt.md)[]\> + +An array containing the vaults with non-zero backing collateral + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[list](../interfaces/VaultsAPI.md#list) + +#### Defined in + +[src/parachain/vaults.ts:496](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L496) + +___ + +### parseVault + +▸ **parseVault**(`vault`): `Promise`<[`VaultExt`](VaultExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vault` | [`VaultRegistryVault`](../interfaces/VaultRegistryVault.md) | + +#### Returns + +`Promise`<[`VaultExt`](VaultExt.md)\> + +#### Defined in + +[src/parachain/vaults.ts:942](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L942) + +___ + +### parseVaultStatus + +▸ `Private` **parseVaultStatus**(`status`): [`VaultStatusExt`](../enums/VaultStatusExt.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `status` | `VaultRegistryVaultStatus` | + +#### Returns + +[`VaultStatusExt`](../enums/VaultStatusExt.md) + +#### Defined in + +[src/parachain/vaults.ts:932](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L932) + +___ + +### registerNewCollateralVault + +▸ **registerNewCollateralVault**(`collateralAmount`): [`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +Registers a new vault for the current account ID with a new collateral amount. +Only applicable if the connected account ID already has a running vault with a different collateral currency. + +Rejects with an Error if unable to register. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral amount to register the vault with - in the new collateral currency | + +#### Returns + +[`ExtrinsicData`](../interfaces/ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[registerNewCollateralVault](../interfaces/VaultsAPI.md#registernewcollateralvault) + +#### Defined in + +[src/parachain/vaults.ts:422](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L422) + +___ + +### selectRandomVaultIssue + +▸ **selectRandomVaultIssue**(`amount`): `Promise`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped tokens amount to issue | + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md)\> + +A vault that has sufficient collateral to issue the given amount + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[selectRandomVaultIssue](../interfaces/VaultsAPI.md#selectrandomvaultissue) + +#### Defined in + +[src/parachain/vaults.ts:803](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L803) + +___ + +### selectRandomVaultRedeem + +▸ **selectRandomVaultRedeem**(`amount`): `Promise`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped tokens amount to redeem | + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md)\> + +A vault that has issued sufficient wrapped tokens to redeem the given amount + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[selectRandomVaultRedeem](../interfaces/VaultsAPI.md#selectrandomvaultredeem) + +#### Defined in + +[src/parachain/vaults.ts:813](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L813) + +___ + +### toggleIssueRequests + +▸ **toggleIssueRequests**(`vaultId`, `acceptNewIssues`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +Enables or disables issue requests for given vault + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | The vault ID whose issuing will be toggled | +| `acceptNewIssues` | `boolean` | Boolean denoting whether issuing should be enabled or not | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[toggleIssueRequests](../interfaces/VaultsAPI.md#toggleissuerequests) + +#### Defined in + +[src/parachain/vaults.ts:978](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L978) + +___ + +### withdrawCollateral + +▸ **withdrawCollateral**(`amount`): `Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of collateral to withdraw | + +#### Returns + +`Promise`<[`ExtrinsicData`](../interfaces/ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Implementation of + +[VaultsAPI](../interfaces/VaultsAPI.md).[withdrawCollateral](../interfaces/VaultsAPI.md#withdrawcollateral) + +#### Defined in + +[src/parachain/vaults.ts:469](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L469) diff --git a/classes/FaucetClient.md b/classes/FaucetClient.md new file mode 100644 index 000000000..55ae32261 --- /dev/null +++ b/classes/FaucetClient.md @@ -0,0 +1,144 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / FaucetClient + +# Class: FaucetClient + +## Hierarchy + +- `JsonRpcClient`<`void`\> + + ↳ **`FaucetClient`** + +## Table of contents + +### Constructors + +- [constructor](FaucetClient.md#constructor) + +### Properties + +- [api](FaucetClient.md#api) +- [constr](FaucetClient.md#constr) +- [registry](FaucetClient.md#registry) +- [url](FaucetClient.md#url) + +### Methods + +- [fundAccount](FaucetClient.md#fundaccount) +- [post](FaucetClient.md#post) + +## Constructors + +### constructor + +• **new FaucetClient**(`api`, `url`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `url` | `string` | + +#### Overrides + +JsonRpcClient<void\>.constructor + +#### Defined in + +[src/clients/faucet.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/faucet.ts#L21) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/clients/faucet.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/faucet.ts#L21) + +___ + +### constr + +• **constr**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `FundAccountJsonRpcRequest` | `CodecClass`<[`FundAccountJsonRpcRequest`](../interfaces/FundAccountJsonRpcRequest.md)\> | + +#### Defined in + +[src/clients/faucet.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/faucet.ts#L17) + +___ + +### registry + +• **registry**: `TypeRegistry` + +#### Defined in + +[src/clients/faucet.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/faucet.ts#L15) + +___ + +### url + +• **url**: `string` + +#### Inherited from + +JsonRpcClient.url + +#### Defined in + +[src/clients/client.ts:27](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/client.ts#L27) + +## Methods + +### fundAccount + +▸ **fundAccount**(`account`, `currency`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `AccountId` | +| `currency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/clients/faucet.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/faucet.ts#L31) + +___ + +### post + +▸ **post**(`method`, `params?`): `Promise`<`JsonRpcResponse`<`void`\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `method` | `string` | +| `params?` | `RequestParams` | + +#### Returns + +`Promise`<`JsonRpcResponse`<`void`\>\> + +#### Inherited from + +JsonRpcClient.post + +#### Defined in + +[src/clients/client.ts:33](https://github.com/interlay/interbtc-api/blob/6262ea7/src/clients/client.ts#L33) diff --git a/classes/StableLiquidityMetaPool.md b/classes/StableLiquidityMetaPool.md new file mode 100644 index 000000000..082f8d1a2 --- /dev/null +++ b/classes/StableLiquidityMetaPool.md @@ -0,0 +1,493 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / StableLiquidityMetaPool + +# Class: StableLiquidityMetaPool + +## Hierarchy + +- [`StableLiquidityPool`](StableLiquidityPool.md) + + ↳ **`StableLiquidityMetaPool`** + +## Table of contents + +### Constructors + +- [constructor](StableLiquidityMetaPool.md#constructor) + +### Properties + +- [actuallyPooledCurrencies](StableLiquidityMetaPool.md#actuallypooledcurrencies) +- [amplificationCoefficient](StableLiquidityMetaPool.md#amplificationcoefficient) +- [basePool](StableLiquidityMetaPool.md#basepool) +- [isEmpty](StableLiquidityMetaPool.md#isempty) +- [lpToken](StableLiquidityMetaPool.md#lptoken) +- [poolId](StableLiquidityMetaPool.md#poolid) +- [pooledCurrencies](StableLiquidityMetaPool.md#pooledcurrencies) +- [rewardAmountsYearly](StableLiquidityMetaPool.md#rewardamountsyearly) +- [totalSupply](StableLiquidityMetaPool.md#totalsupply) +- [tradingFee](StableLiquidityMetaPool.md#tradingfee) +- [type](StableLiquidityMetaPool.md#type) + +### Accessors + +- [\_feePerToken](StableLiquidityMetaPool.md#_feepertoken) +- [xp](StableLiquidityMetaPool.md#xp) + +### Methods + +- [calculateRemoveLiquidityOneToken](StableLiquidityMetaPool.md#calculateremoveliquidityonetoken) +- [calculateSwap](StableLiquidityMetaPool.md#calculateswap) +- [calculateTokenAmount](StableLiquidityMetaPool.md#calculatetokenamount) +- [getLiquidityDepositInputAmounts](StableLiquidityMetaPool.md#getliquiditydepositinputamounts) +- [getLiquidityDepositLpTokenAmount](StableLiquidityMetaPool.md#getliquiditydepositlptokenamount) +- [getLiquidityWithdrawalPooledCurrencyAmounts](StableLiquidityMetaPool.md#getliquiditywithdrawalpooledcurrencyamounts) +- [getTokenIndex](StableLiquidityMetaPool.md#gettokenindex) +- [involvesToken](StableLiquidityMetaPool.md#involvestoken) + +## Constructors + +### constructor + +• **new StableLiquidityMetaPool**(`lpToken`, `metaPooledCurrencies`, `pooledCurrencies`, `rewardAmountsYearly`, `tradingFee`, `poolId`, `amplificationCoefficient`, `totalSupply`, `isEmpty`, `basePool`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `lpToken` | [`StableLpToken`](../modules.md#stablelptoken) | +| `metaPooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `pooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `rewardAmountsYearly` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] | +| `tradingFee` | `Big` | +| `poolId` | `number` | +| `amplificationCoefficient` | `Big` | +| `totalSupply` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | +| `isEmpty` | `boolean` | +| `basePool` | [`StableLiquidityPool`](StableLiquidityPool.md) | + +#### Overrides + +[StableLiquidityPool](StableLiquidityPool.md).[constructor](StableLiquidityPool.md#constructor) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable-meta.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable-meta.ts#L8) + +## Properties + +### actuallyPooledCurrencies + +• **actuallyPooledCurrencies**: [`PooledCurrencies`](../modules.md#pooledcurrencies) + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[actuallyPooledCurrencies](StableLiquidityPool.md#actuallypooledcurrencies) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L14) + +___ + +### amplificationCoefficient + +• **amplificationCoefficient**: `Big` + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[amplificationCoefficient](StableLiquidityPool.md#amplificationcoefficient) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L20) + +___ + +### basePool + +• **basePool**: [`StableLiquidityPool`](StableLiquidityPool.md) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable-meta.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable-meta.ts#L18) + +___ + +### isEmpty + +• **isEmpty**: `boolean` + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[isEmpty](StableLiquidityPool.md#isempty) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L22) + +___ + +### lpToken + +• **lpToken**: [`StableLpToken`](../modules.md#stablelptoken) + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[lpToken](StableLiquidityPool.md#lptoken) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L12) + +___ + +### poolId + +• **poolId**: `number` + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[poolId](StableLiquidityPool.md#poolid) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L19) + +___ + +### pooledCurrencies + +• **pooledCurrencies**: [`PooledCurrencies`](../modules.md#pooledcurrencies) + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[pooledCurrencies](StableLiquidityPool.md#pooledcurrencies) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L16) + +___ + +### rewardAmountsYearly + +• **rewardAmountsYearly**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[rewardAmountsYearly](StableLiquidityPool.md#rewardamountsyearly) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L17) + +___ + +### totalSupply + +• **totalSupply**: `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[totalSupply](StableLiquidityPool.md#totalsupply) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L21) + +___ + +### tradingFee + +• **tradingFee**: `Big` + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[tradingFee](StableLiquidityPool.md#tradingfee) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L18) + +___ + +### type + +• **type**: [`STABLE_PLAIN`](../enums/PoolType.md#stable_plain) \| [`STABLE_META`](../enums/PoolType.md#stable_meta) + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[type](StableLiquidityPool.md#type) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L11) + +## Accessors + +### \_feePerToken + +• `Private` `get` **_feePerToken**(): `Big` + +#### Returns + +`Big` + +#### Inherited from + +StableLiquidityPool.\_feePerToken + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L35) + +___ + +### xp + +• `get` **xp**(): `Big`[] + +#### Returns + +`Big`[] + +#### Inherited from + +StableLiquidityPool.xp + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:194](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L194) + +## Methods + +### calculateRemoveLiquidityOneToken + +▸ **calculateRemoveLiquidityOneToken**(`tokenLPAmount`, `outputCurrencyIndex`): [`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `tokenLPAmount` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | +| `outputCurrencyIndex` | `number` | + +#### Returns + +[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>] + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[calculateRemoveLiquidityOneToken](StableLiquidityPool.md#calculateremoveliquidityonetoken) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:223](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L223) + +___ + +### calculateSwap + +▸ **calculateSwap**(`inputIndex`, `outputIndex`, `inputAmount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inputIndex` | `number` | +| `outputIndex` | `number` | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[calculateSwap](StableLiquidityPool.md#calculateswap) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:263](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L263) + +___ + +### calculateTokenAmount + +▸ **calculateTokenAmount**(`amounts`, `deposit`): `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amounts` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | Array of monetary amount for each pooled currency of this pool. | +| `deposit` | `boolean` | True for deposit, false for withdrawal | + +#### Returns + +`MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +LP token amount that will be minted/burned after operation. + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[calculateTokenAmount](StableLiquidityPool.md#calculatetokenamount) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:204](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L204) + +___ + +### getLiquidityDepositInputAmounts + +▸ **getLiquidityDepositInputAmounts**(`amount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Calculates how much of pooled currencies needs to be deposited +into pool with current ratio of currencies. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of one of the pooled currencies. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Monetary amounts of all pooled currencies in balanced proportion. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[getLiquidityDepositInputAmounts](StableLiquidityPool.md#getliquiditydepositinputamounts) + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L29) + +___ + +### getLiquidityDepositLpTokenAmount + +▸ **getLiquidityDepositLpTokenAmount**(`amount`): `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +Calculates expected amount of LP token account will get after depositing +`amount` of pooled currency into pool. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of one of the pooled currencies. | + +#### Returns + +`MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +Expected amount of lp token that will be received after `amount` is added to pool. + +**`Note`** + +This method assumes all pooled currencies will be added in balance. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[getLiquidityDepositLpTokenAmount](StableLiquidityPool.md#getliquiditydepositlptokenamount) + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L47) + +___ + +### getLiquidityWithdrawalPooledCurrencyAmounts + +▸ **getLiquidityWithdrawalPooledCurrencyAmounts**(`amount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Calculates expected amount of pooled currencies account will get +after withdrawing `amount` of LP token. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | Amount of liquidity in LP token to be withdrawn. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Amounts of pooled currencies to be returned to account. + +**`Note`** + +This method assumes all pooled currencies will be withdrawn in balance. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[getLiquidityWithdrawalPooledCurrencyAmounts](StableLiquidityPool.md#getliquiditywithdrawalpooledcurrencyamounts) + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L64) + +___ + +### getTokenIndex + +▸ **getTokenIndex**(`currency`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`number` + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[getTokenIndex](StableLiquidityPool.md#gettokenindex) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:188](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L188) + +___ + +### involvesToken + +▸ **involvesToken**(`currency`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`boolean` + +#### Inherited from + +[StableLiquidityPool](StableLiquidityPool.md).[involvesToken](StableLiquidityPool.md#involvestoken) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:182](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L182) diff --git a/classes/StableLiquidityPool.md b/classes/StableLiquidityPool.md new file mode 100644 index 000000000..c7e86357f --- /dev/null +++ b/classes/StableLiquidityPool.md @@ -0,0 +1,598 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / StableLiquidityPool + +# Class: StableLiquidityPool + +## Hierarchy + +- `LiquidityPoolCalculator`<[`StableLpToken`](../modules.md#stablelptoken)\> + + ↳ **`StableLiquidityPool`** + + ↳↳ [`StableLiquidityMetaPool`](StableLiquidityMetaPool.md) + +## Implements + +- [`LiquidityPoolBase`](../interfaces/LiquidityPoolBase.md) + +## Table of contents + +### Constructors + +- [constructor](StableLiquidityPool.md#constructor) + +### Properties + +- [actuallyPooledCurrencies](StableLiquidityPool.md#actuallypooledcurrencies) +- [amplificationCoefficient](StableLiquidityPool.md#amplificationcoefficient) +- [isEmpty](StableLiquidityPool.md#isempty) +- [lpToken](StableLiquidityPool.md#lptoken) +- [poolId](StableLiquidityPool.md#poolid) +- [pooledCurrencies](StableLiquidityPool.md#pooledcurrencies) +- [rewardAmountsYearly](StableLiquidityPool.md#rewardamountsyearly) +- [totalSupply](StableLiquidityPool.md#totalsupply) +- [tradingFee](StableLiquidityPool.md#tradingfee) +- [type](StableLiquidityPool.md#type) + +### Accessors + +- [\_feePerToken](StableLiquidityPool.md#_feepertoken) +- [xp](StableLiquidityPool.md#xp) + +### Methods + +- [\_distance](StableLiquidityPool.md#_distance) +- [\_getD](StableLiquidityPool.md#_getd) +- [\_getY](StableLiquidityPool.md#_gety) +- [\_getYD](StableLiquidityPool.md#_getyd) +- [\_sortAmounts](StableLiquidityPool.md#_sortamounts) +- [\_xp](StableLiquidityPool.md#_xp) +- [calculateRemoveLiquidityOneToken](StableLiquidityPool.md#calculateremoveliquidityonetoken) +- [calculateSwap](StableLiquidityPool.md#calculateswap) +- [calculateTokenAmount](StableLiquidityPool.md#calculatetokenamount) +- [getLiquidityDepositInputAmounts](StableLiquidityPool.md#getliquiditydepositinputamounts) +- [getLiquidityDepositLpTokenAmount](StableLiquidityPool.md#getliquiditydepositlptokenamount) +- [getLiquidityWithdrawalPooledCurrencyAmounts](StableLiquidityPool.md#getliquiditywithdrawalpooledcurrencyamounts) +- [getTokenIndex](StableLiquidityPool.md#gettokenindex) +- [involvesToken](StableLiquidityPool.md#involvestoken) + +## Constructors + +### constructor + +• **new StableLiquidityPool**(`type`, `lpToken`, `actuallyPooledCurrencies`, `pooledCurrencies`, `rewardAmountsYearly`, `tradingFee`, `poolId`, `amplificationCoefficient`, `totalSupply`, `isEmpty`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `type` | [`STABLE_PLAIN`](../enums/PoolType.md#stable_plain) \| [`STABLE_META`](../enums/PoolType.md#stable_meta) | +| `lpToken` | [`StableLpToken`](../modules.md#stablelptoken) | +| `actuallyPooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `pooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `rewardAmountsYearly` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] | +| `tradingFee` | `Big` | +| `poolId` | `number` | +| `amplificationCoefficient` | `Big` | +| `totalSupply` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | +| `isEmpty` | `boolean` | + +#### Overrides + +LiquidityPoolCalculator<StableLpToken\>.constructor + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L10) + +## Properties + +### actuallyPooledCurrencies + +• **actuallyPooledCurrencies**: [`PooledCurrencies`](../modules.md#pooledcurrencies) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L14) + +___ + +### amplificationCoefficient + +• **amplificationCoefficient**: `Big` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L20) + +___ + +### isEmpty + +• **isEmpty**: `boolean` + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[isEmpty](../interfaces/LiquidityPoolBase.md#isempty) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L22) + +___ + +### lpToken + +• **lpToken**: [`StableLpToken`](../modules.md#stablelptoken) + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[lpToken](../interfaces/LiquidityPoolBase.md#lptoken) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L12) + +___ + +### poolId + +• **poolId**: `number` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L19) + +___ + +### pooledCurrencies + +• **pooledCurrencies**: [`PooledCurrencies`](../modules.md#pooledcurrencies) + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[pooledCurrencies](../interfaces/LiquidityPoolBase.md#pooledcurrencies) + +#### Inherited from + +LiquidityPoolCalculator.pooledCurrencies + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L16) + +___ + +### rewardAmountsYearly + +• **rewardAmountsYearly**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[rewardAmountsYearly](../interfaces/LiquidityPoolBase.md#rewardamountsyearly) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L17) + +___ + +### totalSupply + +• **totalSupply**: `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[totalSupply](../interfaces/LiquidityPoolBase.md#totalsupply) + +#### Inherited from + +LiquidityPoolCalculator.totalSupply + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L21) + +___ + +### tradingFee + +• **tradingFee**: `Big` + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[tradingFee](../interfaces/LiquidityPoolBase.md#tradingfee) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L18) + +___ + +### type + +• **type**: [`STABLE_PLAIN`](../enums/PoolType.md#stable_plain) \| [`STABLE_META`](../enums/PoolType.md#stable_meta) + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[type](../interfaces/LiquidityPoolBase.md#type) + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L11) + +## Accessors + +### \_feePerToken + +• `Private` `get` **_feePerToken**(): `Big` + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L35) + +___ + +### xp + +• `get` **xp**(): `Big`[] + +#### Returns + +`Big`[] + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:194](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L194) + +## Methods + +### \_distance + +▸ `Private` **_distance**(`x`, `y`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `x` | `Big` | +| `y` | `Big` | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L31) + +___ + +### \_getD + +▸ `Private` **_getD**(`amountsInBaseDenomination`, `amp`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amountsInBaseDenomination` | `Big`[] | +| `amp` | `Big` | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:41](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L41) + +___ + +### \_getY + +▸ `Private` **_getY**(`inIndex`, `outIndex`, `inBalance`, `normalizedBalances`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inIndex` | `number` | +| `outIndex` | `number` | +| `inBalance` | `Big` | +| `normalizedBalances` | `Big`[] | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:74](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L74) + +___ + +### \_getYD + +▸ `Private` **_getYD**(`A`, `index`, `xp`, `D`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `A` | `Big` | +| `index` | `number` | +| `xp` | `Big`[] | +| `D` | `Big` | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:115](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L115) + +___ + +### \_sortAmounts + +▸ `Private` **_sortAmounts**(`amounts`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Sort amounts in same order as `actuallyPooledCurrencies`. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amounts` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] | Array of monetary | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Amounts containing currency amounts at the same index as `this.actuallyPooledCurrencies` + +**`Throws`** + +When currencies of `amounts` differ from `actuallyPooledCurrencies` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:156](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L156) + +___ + +### \_xp + +▸ `Private` **_xp**(`amounts`): `Big`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amounts` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] | + +#### Returns + +`Big`[] + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:27](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L27) + +___ + +### calculateRemoveLiquidityOneToken + +▸ **calculateRemoveLiquidityOneToken**(`tokenLPAmount`, `outputCurrencyIndex`): [`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `tokenLPAmount` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | +| `outputCurrencyIndex` | `number` | + +#### Returns + +[`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>, `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>] + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:223](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L223) + +___ + +### calculateSwap + +▸ **calculateSwap**(`inputIndex`, `outputIndex`, `inputAmount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inputIndex` | `number` | +| `outputIndex` | `number` | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:263](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L263) + +___ + +### calculateTokenAmount + +▸ **calculateTokenAmount**(`amounts`, `deposit`): `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amounts` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | Array of monetary amount for each pooled currency of this pool. | +| `deposit` | `boolean` | True for deposit, false for withdrawal | + +#### Returns + +`MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +LP token amount that will be minted/burned after operation. + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:204](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L204) + +___ + +### getLiquidityDepositInputAmounts + +▸ **getLiquidityDepositInputAmounts**(`amount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Calculates how much of pooled currencies needs to be deposited +into pool with current ratio of currencies. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of one of the pooled currencies. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Monetary amounts of all pooled currencies in balanced proportion. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +LiquidityPoolCalculator.getLiquidityDepositInputAmounts + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L29) + +___ + +### getLiquidityDepositLpTokenAmount + +▸ **getLiquidityDepositLpTokenAmount**(`amount`): `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +Calculates expected amount of LP token account will get after depositing +`amount` of pooled currency into pool. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of one of the pooled currencies. | + +#### Returns + +`MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> + +Expected amount of lp token that will be received after `amount` is added to pool. + +**`Note`** + +This method assumes all pooled currencies will be added in balance. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +LiquidityPoolCalculator.getLiquidityDepositLpTokenAmount + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L47) + +___ + +### getLiquidityWithdrawalPooledCurrencyAmounts + +▸ **getLiquidityWithdrawalPooledCurrencyAmounts**(`amount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Calculates expected amount of pooled currencies account will get +after withdrawing `amount` of LP token. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`StableLpToken`](../modules.md#stablelptoken)\> | Amount of liquidity in LP token to be withdrawn. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Amounts of pooled currencies to be returned to account. + +**`Note`** + +This method assumes all pooled currencies will be withdrawn in balance. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +LiquidityPoolCalculator.getLiquidityWithdrawalPooledCurrencyAmounts + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L64) + +___ + +### getTokenIndex + +▸ **getTokenIndex**(`currency`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`number` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:188](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L188) + +___ + +### involvesToken + +▸ **involvesToken**(`currency`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`boolean` + +#### Defined in + +[src/parachain/amm/liquidity-pool/stable.ts:182](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/stable.ts#L182) diff --git a/classes/StandardLiquidityPool.md b/classes/StandardLiquidityPool.md new file mode 100644 index 000000000..2f7de0eb7 --- /dev/null +++ b/classes/StandardLiquidityPool.md @@ -0,0 +1,375 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / StandardLiquidityPool + +# Class: StandardLiquidityPool + +## Hierarchy + +- `LiquidityPoolCalculator`<[`StandardLpToken`](../modules.md#standardlptoken)\> + + ↳ **`StandardLiquidityPool`** + +## Implements + +- [`LiquidityPoolBase`](../interfaces/LiquidityPoolBase.md) + +## Table of contents + +### Constructors + +- [constructor](StandardLiquidityPool.md#constructor) + +### Properties + +- [isEmpty](StandardLiquidityPool.md#isempty) +- [isTradingActive](StandardLiquidityPool.md#istradingactive) +- [lpToken](StandardLiquidityPool.md#lptoken) +- [pooledCurrencies](StandardLiquidityPool.md#pooledcurrencies) +- [reserve0](StandardLiquidityPool.md#reserve0) +- [reserve1](StandardLiquidityPool.md#reserve1) +- [rewardAmountsYearly](StandardLiquidityPool.md#rewardamountsyearly) +- [token0](StandardLiquidityPool.md#token0) +- [token1](StandardLiquidityPool.md#token1) +- [totalSupply](StandardLiquidityPool.md#totalsupply) +- [tradingFee](StandardLiquidityPool.md#tradingfee) +- [type](StandardLiquidityPool.md#type) + +### Methods + +- [getLiquidityDepositInputAmounts](StandardLiquidityPool.md#getliquiditydepositinputamounts) +- [getLiquidityDepositLpTokenAmount](StandardLiquidityPool.md#getliquiditydepositlptokenamount) +- [getLiquidityWithdrawalPooledCurrencyAmounts](StandardLiquidityPool.md#getliquiditywithdrawalpooledcurrencyamounts) +- [getOutputAmount](StandardLiquidityPool.md#getoutputamount) +- [pathOf](StandardLiquidityPool.md#pathof) + +## Constructors + +### constructor + +• **new StandardLiquidityPool**(`lpToken`, `pooledCurrencies`, `rewardAmountsYearly`, `tradingFee`, `isTradingActive`, `totalSupply`, `isEmpty`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `lpToken` | [`StandardLpToken`](../modules.md#standardlptoken) | +| `pooledCurrencies` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | +| `rewardAmountsYearly` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] | +| `tradingFee` | `Big` | +| `isTradingActive` | `boolean` | +| `totalSupply` | `MonetaryAmount`<[`StandardLpToken`](../modules.md#standardlptoken)\> | +| `isEmpty` | `boolean` | + +#### Overrides + +LiquidityPoolCalculator<StandardLpToken\>.constructor + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L15) + +## Properties + +### isEmpty + +• **isEmpty**: `boolean` + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[isEmpty](../interfaces/LiquidityPoolBase.md#isempty) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L22) + +___ + +### isTradingActive + +• **isTradingActive**: `boolean` + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L20) + +___ + +### lpToken + +• **lpToken**: [`StandardLpToken`](../modules.md#standardlptoken) + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[lpToken](../interfaces/LiquidityPoolBase.md#lptoken) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L16) + +___ + +### pooledCurrencies + +• **pooledCurrencies**: [`PooledCurrencies`](../modules.md#pooledcurrencies) + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[pooledCurrencies](../interfaces/LiquidityPoolBase.md#pooledcurrencies) + +#### Inherited from + +LiquidityPoolCalculator.pooledCurrencies + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L17) + +___ + +### reserve0 + +• **reserve0**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L13) + +___ + +### reserve1 + +• **reserve1**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L14) + +___ + +### rewardAmountsYearly + +• **rewardAmountsYearly**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[rewardAmountsYearly](../interfaces/LiquidityPoolBase.md#rewardamountsyearly) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L18) + +___ + +### token0 + +• **token0**: [`CurrencyExt`](../modules.md#currencyext) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L11) + +___ + +### token1 + +• **token1**: [`CurrencyExt`](../modules.md#currencyext) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L12) + +___ + +### totalSupply + +• **totalSupply**: `MonetaryAmount`<[`StandardLpToken`](../modules.md#standardlptoken)\> + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[totalSupply](../interfaces/LiquidityPoolBase.md#totalsupply) + +#### Inherited from + +LiquidityPoolCalculator.totalSupply + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L21) + +___ + +### tradingFee + +• **tradingFee**: `Big` + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[tradingFee](../interfaces/LiquidityPoolBase.md#tradingfee) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L19) + +___ + +### type + +• **type**: [`PoolType`](../enums/PoolType.md) = `PoolType.STANDARD` + +#### Implementation of + +[LiquidityPoolBase](../interfaces/LiquidityPoolBase.md).[type](../interfaces/LiquidityPoolBase.md#type) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L10) + +## Methods + +### getLiquidityDepositInputAmounts + +▸ **getLiquidityDepositInputAmounts**(`amount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Calculates how much of pooled currencies needs to be deposited +into pool with current ratio of currencies. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of one of the pooled currencies. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Monetary amounts of all pooled currencies in balanced proportion. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +LiquidityPoolCalculator.getLiquidityDepositInputAmounts + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L29) + +___ + +### getLiquidityDepositLpTokenAmount + +▸ **getLiquidityDepositLpTokenAmount**(`amount`): `MonetaryAmount`<[`StandardLpToken`](../modules.md#standardlptoken)\> + +Calculates expected amount of LP token account will get after depositing +`amount` of pooled currency into pool. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of one of the pooled currencies. | + +#### Returns + +`MonetaryAmount`<[`StandardLpToken`](../modules.md#standardlptoken)\> + +Expected amount of lp token that will be received after `amount` is added to pool. + +**`Note`** + +This method assumes all pooled currencies will be added in balance. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +LiquidityPoolCalculator.getLiquidityDepositLpTokenAmount + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L47) + +___ + +### getLiquidityWithdrawalPooledCurrencyAmounts + +▸ **getLiquidityWithdrawalPooledCurrencyAmounts**(`amount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Calculates expected amount of pooled currencies account will get +after withdrawing `amount` of LP token. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`StandardLpToken`](../modules.md#standardlptoken)\> | Amount of liquidity in LP token to be withdrawn. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +Amounts of pooled currencies to be returned to account. + +**`Note`** + +This method assumes all pooled currencies will be withdrawn in balance. + +**`Throws`** + +If pool is empty. Note: handle by checking `isEmpty` property of pool. + +#### Inherited from + +LiquidityPoolCalculator.getLiquidityWithdrawalPooledCurrencyAmounts + +#### Defined in + +[src/parachain/amm/liquidity-pool/calculator.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/calculator.ts#L64) + +___ + +### getOutputAmount + +▸ **getOutputAmount**(`inputAmount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +Get output amount of pool after swap of `inputAmount` is made. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Input amount of currency to swap. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +Output amount after swap of `inputAmount` is made. + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L51) + +___ + +### pathOf + +▸ **pathOf**(`inputCurrency`): [`MultiPathElementStandard`](../interfaces/MultiPathElementStandard.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inputCurrency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +[`MultiPathElementStandard`](../interfaces/MultiPathElementStandard.md) + +#### Defined in + +[src/parachain/amm/liquidity-pool/standard.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/standard.ts#L35) diff --git a/classes/Trade.md b/classes/Trade.md new file mode 100644 index 000000000..f094080f6 --- /dev/null +++ b/classes/Trade.md @@ -0,0 +1,142 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Trade + +# Class: Trade + +## Table of contents + +### Constructors + +- [constructor](Trade.md#constructor) + +### Properties + +- [executionPrice](Trade.md#executionprice) +- [inputAmount](Trade.md#inputamount) +- [outputAmount](Trade.md#outputamount) +- [path](Trade.md#path) +- [priceImpact](Trade.md#priceimpact) + +### Methods + +- [getMinimumOutputAmount](Trade.md#getminimumoutputamount) +- [isBetter](Trade.md#isbetter) + +## Constructors + +### constructor + +• **new Trade**(`path`, `inputAmount`, `outputAmount`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `path` | [`MultiPath`](../modules.md#multipath) | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | +| `outputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | + +#### Defined in + +[src/parachain/amm/trade/trade.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L11) + +## Properties + +### executionPrice + +• **executionPrice**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/trade/trade.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L9) + +___ + +### inputAmount + +• **inputAmount**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/trade/trade.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L13) + +___ + +### outputAmount + +• **outputAmount**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/trade/trade.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L14) + +___ + +### path + +• **path**: [`MultiPath`](../modules.md#multipath) + +#### Defined in + +[src/parachain/amm/trade/trade.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L12) + +___ + +### priceImpact + +• **priceImpact**: `Big` + +#### Defined in + +[src/parachain/amm/trade/trade.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L10) + +## Methods + +### getMinimumOutputAmount + +▸ **getMinimumOutputAmount**(`maxSlippage`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +Get minimum output amount for trade with provided maximum allowed slippage. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `maxSlippage` | `number` | Maximum slippage in percentage. | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +Minimum output amount of trade allowed with provided slippage. + +#### Defined in + +[src/parachain/amm/trade/trade.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L52) + +___ + +### isBetter + +▸ **isBetter**(`anotherTrade`): `boolean` + +Comparator for 2 trades with same input and output. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `anotherTrade` | ``null`` \| [`Trade`](Trade.md) | Trade to compare. | + +#### Returns + +`boolean` + +true if `this` trade is better, false if `anotherTrade` is better. + +**`Throws`** + +When provided trade has different input or output currency. + +#### Defined in + +[src/parachain/amm/trade/trade.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/trade.ts#L28) diff --git a/classes/VaultExt.md b/classes/VaultExt.md new file mode 100644 index 000000000..7c35ced63 --- /dev/null +++ b/classes/VaultExt.md @@ -0,0 +1,339 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / VaultExt + +# Class: VaultExt + +## Table of contents + +### Constructors + +- [constructor](VaultExt.md#constructor) + +### Properties + +- [api](VaultExt.md#api) +- [backingCollateral](VaultExt.md#backingcollateral) +- [bannedUntil](VaultExt.md#banneduntil) +- [id](VaultExt.md#id) +- [issuedTokens](VaultExt.md#issuedtokens) +- [liquidatedCollateral](VaultExt.md#liquidatedcollateral) +- [oracleAPI](VaultExt.md#oracleapi) +- [replaceCollateral](VaultExt.md#replacecollateral) +- [secureCollateralThreshold](VaultExt.md#securecollateralthreshold) +- [status](VaultExt.md#status) +- [systemAPI](VaultExt.md#systemapi) +- [toBeIssuedTokens](VaultExt.md#tobeissuedtokens) +- [toBeRedeemedTokens](VaultExt.md#toberedeemedtokens) +- [toBeReplacedTokens](VaultExt.md#tobereplacedtokens) + +### Methods + +- [computeBackingCollateral](VaultExt.md#computebackingcollateral) +- [getBackedTokens](VaultExt.md#getbackedtokens) +- [getFreeCollateral](VaultExt.md#getfreecollateral) +- [getIssuableTokens](VaultExt.md#getissuabletokens) +- [getRedeemableTokens](VaultExt.md#getredeemabletokens) +- [getSecureCollateralThreshold](VaultExt.md#getsecurecollateralthreshold) +- [getStakingPoolNonce](VaultExt.md#getstakingpoolnonce) +- [getUsedCollateral](VaultExt.md#getusedcollateral) +- [isBanned](VaultExt.md#isbanned) + +## Constructors + +### constructor + +• **new VaultExt**(`api`, `oracleAPI`, `systemAPI`, `backingCollateral`, `id`, `status`, `bannedUntil`, `toBeIssuedTokens`, `issuedTokens`, `toBeRedeemedTokens`, `toBeReplacedTokens`, `replaceCollateral`, `liquidatedCollateral`, `secureCollateralThreshold`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `oracleAPI` | [`OracleAPI`](../interfaces/OracleAPI.md) | +| `systemAPI` | [`SystemAPI`](../interfaces/SystemAPI.md) | +| `backingCollateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | +| `id` | [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) | +| `status` | [`VaultStatusExt`](../enums/VaultStatusExt.md) | +| `bannedUntil` | `undefined` \| `number` | +| `toBeIssuedTokens` | `MonetaryAmount`<`Currency`\> | +| `issuedTokens` | `MonetaryAmount`<`Currency`\> | +| `toBeRedeemedTokens` | `MonetaryAmount`<`Currency`\> | +| `toBeReplacedTokens` | `MonetaryAmount`<`Currency`\> | +| `replaceCollateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | +| `liquidatedCollateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | +| `secureCollateralThreshold` | `Big` | + +#### Defined in + +[src/types/vault.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L29) + +## Properties + +### api + +• `Private` **api**: `ApiPromise` + +#### Defined in + +[src/types/vault.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L30) + +___ + +### backingCollateral + +• **backingCollateral**: `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> + +#### Defined in + +[src/types/vault.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L17) + +___ + +### bannedUntil + +• **bannedUntil**: `undefined` \| `number` + +#### Defined in + +[src/types/vault.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L20) + +___ + +### id + +• **id**: [`InterbtcPrimitivesVaultId`](../interfaces/InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/types/vault.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L18) + +___ + +### issuedTokens + +• **issuedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L22) + +___ + +### liquidatedCollateral + +• **liquidatedCollateral**: `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> + +#### Defined in + +[src/types/vault.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L26) + +___ + +### oracleAPI + +• `Private` **oracleAPI**: [`OracleAPI`](../interfaces/OracleAPI.md) + +#### Defined in + +[src/types/vault.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L31) + +___ + +### replaceCollateral + +• **replaceCollateral**: `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> + +#### Defined in + +[src/types/vault.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L25) + +___ + +### secureCollateralThreshold + +• **secureCollateralThreshold**: `Big` + +#### Defined in + +[src/types/vault.ts:27](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L27) + +___ + +### status + +• **status**: [`VaultStatusExt`](../enums/VaultStatusExt.md) + +#### Defined in + +[src/types/vault.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L19) + +___ + +### systemAPI + +• `Private` **systemAPI**: [`SystemAPI`](../interfaces/SystemAPI.md) + +#### Defined in + +[src/types/vault.ts:32](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L32) + +___ + +### toBeIssuedTokens + +• **toBeIssuedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L21) + +___ + +### toBeRedeemedTokens + +• **toBeRedeemedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:23](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L23) + +___ + +### toBeReplacedTokens + +• **toBeReplacedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L24) + +## Methods + +### computeBackingCollateral + +▸ **computeBackingCollateral**(`nonce?`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `nonce?` | `number` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Defined in + +[src/types/vault.ts:108](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L108) + +___ + +### getBackedTokens + +▸ **getBackedTokens**(): `MonetaryAmount`<`Currency`\> + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:79](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L79) + +___ + +### getFreeCollateral + +▸ **getFreeCollateral**(): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Defined in + +[src/types/vault.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L83) + +___ + +### getIssuableTokens + +▸ **getIssuableTokens**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Defined in + +[src/types/vault.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L62) + +___ + +### getRedeemableTokens + +▸ **getRedeemableTokens**(): `MonetaryAmount`<`Currency`\> + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L58) + +___ + +### getSecureCollateralThreshold + +▸ **getSecureCollateralThreshold**(): `Big` + +#### Returns + +`Big` + +#### Defined in + +[src/types/vault.ts:102](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L102) + +___ + +### getStakingPoolNonce + +▸ **getStakingPoolNonce**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +#### Defined in + +[src/types/vault.ts:117](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L117) + +___ + +### getUsedCollateral + +▸ **getUsedCollateral**(): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Defined in + +[src/types/vault.ts:89](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L89) + +___ + +### isBanned + +▸ **isBanned**(): `Promise`<`boolean`\> + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[src/types/vault.ts:71](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L71) diff --git a/enums/CurrencyIdLiteral.md b/enums/CurrencyIdLiteral.md new file mode 100644 index 000000000..3c3192163 --- /dev/null +++ b/enums/CurrencyIdLiteral.md @@ -0,0 +1,74 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / CurrencyIdLiteral + +# Enumeration: CurrencyIdLiteral + +## Table of contents + +### Enumeration Members + +- [DOT](CurrencyIdLiteral.md#dot) +- [INTERBTC](CurrencyIdLiteral.md#interbtc) +- [INTR](CurrencyIdLiteral.md#intr) +- [KBTC](CurrencyIdLiteral.md#kbtc) +- [KINT](CurrencyIdLiteral.md#kint) +- [KSM](CurrencyIdLiteral.md#ksm) + +## Enumeration Members + +### DOT + +• **DOT** = ``"DOT"`` + +#### Defined in + +[src/types/currency.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L20) + +___ + +### INTERBTC + +• **INTERBTC** = ``"IBTC"`` + +#### Defined in + +[src/types/currency.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L21) + +___ + +### INTR + +• **INTR** = ``"INTR"`` + +#### Defined in + +[src/types/currency.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L22) + +___ + +### KBTC + +• **KBTC** = ``"KBTC"`` + +#### Defined in + +[src/types/currency.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L24) + +___ + +### KINT + +• **KINT** = ``"KINT"`` + +#### Defined in + +[src/types/currency.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L25) + +___ + +### KSM + +• **KSM** = ``"KSM"`` + +#### Defined in + +[src/types/currency.ts:23](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L23) diff --git a/enums/ExecuteRedeem.md b/enums/ExecuteRedeem.md new file mode 100644 index 000000000..653daeb98 --- /dev/null +++ b/enums/ExecuteRedeem.md @@ -0,0 +1,41 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ExecuteRedeem + +# Enumeration: ExecuteRedeem + +## Table of contents + +### Enumeration Members + +- [Auto](ExecuteRedeem.md#auto) +- [False](ExecuteRedeem.md#false) +- [Manually](ExecuteRedeem.md#manually) + +## Enumeration Members + +### Auto + +• **Auto** = ``2`` + +#### Defined in + +[src/utils/issueRedeem.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L28) + +___ + +### False + +• **False** = ``0`` + +#### Defined in + +[src/utils/issueRedeem.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L26) + +___ + +### Manually + +• **Manually** = ``1`` + +#### Defined in + +[src/utils/issueRedeem.ts:27](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L27) diff --git a/enums/IssueStatus.md b/enums/IssueStatus.md new file mode 100644 index 000000000..f11c6c2dd --- /dev/null +++ b/enums/IssueStatus.md @@ -0,0 +1,96 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / IssueStatus + +# Enumeration: IssueStatus + +## Table of contents + +### Enumeration Members + +- [Cancelled](IssueStatus.md#cancelled) +- [Completed](IssueStatus.md#completed) +- [Expired](IssueStatus.md#expired) +- [PendingWithBtcTxNotFound](IssueStatus.md#pendingwithbtctxnotfound) +- [PendingWithBtcTxNotIncluded](IssueStatus.md#pendingwithbtctxnotincluded) +- [PendingWithEnoughConfirmations](IssueStatus.md#pendingwithenoughconfirmations) +- [PendingWithTooFewConfirmations](IssueStatus.md#pendingwithtoofewconfirmations) +- [RequestedRefund](IssueStatus.md#requestedrefund) + +## Enumeration Members + +### Cancelled + +• **Cancelled** = ``1`` + +#### Defined in + +[src/types/requestTypes.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L31) + +___ + +### Completed + +• **Completed** = ``0`` + +#### Defined in + +[src/types/requestTypes.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L30) + +___ + +### Expired + +• **Expired** = ``3`` + +#### Defined in + +[src/types/requestTypes.ts:33](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L33) + +___ + +### PendingWithBtcTxNotFound + +• **PendingWithBtcTxNotFound** = ``4`` + +#### Defined in + +[src/types/requestTypes.ts:34](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L34) + +___ + +### PendingWithBtcTxNotIncluded + +• **PendingWithBtcTxNotIncluded** = ``5`` + +#### Defined in + +[src/types/requestTypes.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L35) + +___ + +### PendingWithEnoughConfirmations + +• **PendingWithEnoughConfirmations** = ``7`` + +#### Defined in + +[src/types/requestTypes.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L37) + +___ + +### PendingWithTooFewConfirmations + +• **PendingWithTooFewConfirmations** = ``6`` + +#### Defined in + +[src/types/requestTypes.ts:36](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L36) + +___ + +### RequestedRefund + +• **RequestedRefund** = ``2`` + +#### Defined in + +[src/types/requestTypes.ts:32](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L32) diff --git a/enums/MultiPathElementType.md b/enums/MultiPathElementType.md new file mode 100644 index 000000000..d9aac3d95 --- /dev/null +++ b/enums/MultiPathElementType.md @@ -0,0 +1,41 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / MultiPathElementType + +# Enumeration: MultiPathElementType + +## Table of contents + +### Enumeration Members + +- [STABLE\_META](MultiPathElementType.md#stable_meta) +- [STABLE\_PLAIN](MultiPathElementType.md#stable_plain) +- [STANDARD](MultiPathElementType.md#standard) + +## Enumeration Members + +### STABLE\_META + +• **STABLE\_META** = ``"STABLE_META"`` + +#### Defined in + +[src/parachain/amm/trade/types.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L24) + +___ + +### STABLE\_PLAIN + +• **STABLE\_PLAIN** = ``"STABLE_PLAIN"`` + +#### Defined in + +[src/parachain/amm/trade/types.ts:23](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L23) + +___ + +### STANDARD + +• **STANDARD** = ``"STANDARD"`` + +#### Defined in + +[src/parachain/amm/trade/types.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L22) diff --git a/enums/NominationStatus.md b/enums/NominationStatus.md new file mode 100644 index 000000000..092ca2bfd --- /dev/null +++ b/enums/NominationStatus.md @@ -0,0 +1,41 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / NominationStatus + +# Enumeration: NominationStatus + +## Table of contents + +### Enumeration Members + +- [Refunded](NominationStatus.md#refunded) +- [Staked](NominationStatus.md#staked) +- [Unstaked](NominationStatus.md#unstaked) + +## Enumeration Members + +### Refunded + +• **Refunded** = ``2`` + +#### Defined in + +[src/types/requestTypes.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L43) + +___ + +### Staked + +• **Staked** = ``0`` + +#### Defined in + +[src/types/requestTypes.ts:41](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L41) + +___ + +### Unstaked + +• **Unstaked** = ``1`` + +#### Defined in + +[src/types/requestTypes.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L42) diff --git a/enums/PoolType.md b/enums/PoolType.md new file mode 100644 index 000000000..d3b16cefd --- /dev/null +++ b/enums/PoolType.md @@ -0,0 +1,41 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / PoolType + +# Enumeration: PoolType + +## Table of contents + +### Enumeration Members + +- [STABLE\_META](PoolType.md#stable_meta) +- [STABLE\_PLAIN](PoolType.md#stable_plain) +- [STANDARD](PoolType.md#standard) + +## Enumeration Members + +### STABLE\_META + +• **STABLE\_META** = ``"STABLE_META"`` + +#### Defined in + +[src/parachain/amm/types.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L21) + +___ + +### STABLE\_PLAIN + +• **STABLE\_PLAIN** = ``"STABLE_PLAIN"`` + +#### Defined in + +[src/parachain/amm/types.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L20) + +___ + +### STANDARD + +• **STANDARD** = ``"STANDARD"`` + +#### Defined in + +[src/parachain/amm/types.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L19) diff --git a/enums/RedeemStatus.md b/enums/RedeemStatus.md new file mode 100644 index 000000000..45d4d1a91 --- /dev/null +++ b/enums/RedeemStatus.md @@ -0,0 +1,96 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / RedeemStatus + +# Enumeration: RedeemStatus + +## Table of contents + +### Enumeration Members + +- [Completed](RedeemStatus.md#completed) +- [Expired](RedeemStatus.md#expired) +- [PendingWithBtcTxNotFound](RedeemStatus.md#pendingwithbtctxnotfound) +- [PendingWithBtcTxNotIncluded](RedeemStatus.md#pendingwithbtctxnotincluded) +- [PendingWithEnoughConfirmations](RedeemStatus.md#pendingwithenoughconfirmations) +- [PendingWithTooFewConfirmations](RedeemStatus.md#pendingwithtoofewconfirmations) +- [Reimbursed](RedeemStatus.md#reimbursed) +- [Retried](RedeemStatus.md#retried) + +## Enumeration Members + +### Completed + +• **Completed** = ``0`` + +#### Defined in + +[src/types/requestTypes.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L65) + +___ + +### Expired + +• **Expired** = ``1`` + +#### Defined in + +[src/types/requestTypes.ts:66](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L66) + +___ + +### PendingWithBtcTxNotFound + +• **PendingWithBtcTxNotFound** = ``4`` + +#### Defined in + +[src/types/requestTypes.ts:69](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L69) + +___ + +### PendingWithBtcTxNotIncluded + +• **PendingWithBtcTxNotIncluded** = ``5`` + +#### Defined in + +[src/types/requestTypes.ts:70](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L70) + +___ + +### PendingWithEnoughConfirmations + +• **PendingWithEnoughConfirmations** = ``7`` + +#### Defined in + +[src/types/requestTypes.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L72) + +___ + +### PendingWithTooFewConfirmations + +• **PendingWithTooFewConfirmations** = ``6`` + +#### Defined in + +[src/types/requestTypes.ts:71](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L71) + +___ + +### Reimbursed + +• **Reimbursed** = ``2`` + +#### Defined in + +[src/types/requestTypes.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L67) + +___ + +### Retried + +• **Retried** = ``3`` + +#### Defined in + +[src/types/requestTypes.ts:68](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L68) diff --git a/enums/VaultStatusExt.md b/enums/VaultStatusExt.md new file mode 100644 index 000000000..7ce9e1813 --- /dev/null +++ b/enums/VaultStatusExt.md @@ -0,0 +1,41 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / VaultStatusExt + +# Enumeration: VaultStatusExt + +## Table of contents + +### Enumeration Members + +- [Active](VaultStatusExt.md#active) +- [Inactive](VaultStatusExt.md#inactive) +- [Liquidated](VaultStatusExt.md#liquidated) + +## Enumeration Members + +### Active + +• **Active** = ``0`` + +#### Defined in + +[src/types/vault.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L11) + +___ + +### Inactive + +• **Inactive** = ``1`` + +#### Defined in + +[src/types/vault.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L12) + +___ + +### Liquidated + +• **Liquidated** = ``2`` + +#### Defined in + +[src/types/vault.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L13) diff --git a/interfaces/AMMAPI.md b/interfaces/AMMAPI.md new file mode 100644 index 000000000..10a1b17b3 --- /dev/null +++ b/interfaces/AMMAPI.md @@ -0,0 +1,245 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / AMMAPI + +# Interface: AMMAPI + +## Implemented by + +- [`DefaultAMMAPI`](../classes/DefaultAMMAPI.md) + +## Table of contents + +### Methods + +- [addLiquidity](AMMAPI.md#addliquidity) +- [claimFarmingRewards](AMMAPI.md#claimfarmingrewards) +- [getClaimableFarmingRewards](AMMAPI.md#getclaimablefarmingrewards) +- [getLiquidityPools](AMMAPI.md#getliquiditypools) +- [getLiquidityProvidedByAccount](AMMAPI.md#getliquidityprovidedbyaccount) +- [getLpTokens](AMMAPI.md#getlptokens) +- [getOptimalTrade](AMMAPI.md#getoptimaltrade) +- [removeLiquidity](AMMAPI.md#removeliquidity) +- [swap](AMMAPI.md#swap) + +## Methods + +### addLiquidity + +▸ **addLiquidity**(`amounts`, `pool`, `maxSlippage`, `deadline`, `recipient`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Adds liquidity to liquidity pool + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amounts` | [`PooledCurrencies`](../modules.md#pooledcurrencies) | Array of monetary amounts of pooled currencies sorted in the same order as in the pool. | +| `pool` | [`LiquidityPool`](../modules.md#liquiditypool) | Type of liquidity pool. | +| `maxSlippage` | `number` | Maximum allowed slippage. | +| `deadline` | `number` | Deadline block number. | +| `recipient` | `AddressOrPair` | Recipient of the liquidity pool token. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/amm.ts:134](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L134) + +___ + +### claimFarmingRewards + +▸ **claimFarmingRewards**(`claimableRewards`): [`ExtrinsicData`](ExtrinsicData.md) + +Claim all pending farming rewards. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `claimableRewards` | `Map`<[`LpCurrency`](../modules.md#lpcurrency), `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\> | Map of LpToken -> Array of reward monetary amounts -> supposed to be output of `getClaimableFarmingRewards` | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/amm.ts:168](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L168) + +___ + +### getClaimableFarmingRewards + +▸ **getClaimableFarmingRewards**(`accountId`, `accountLiquidity`, `pools`): `Promise`<`Map`<[`LpCurrency`](../modules.md#lpcurrency), `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\>\> + +Get claimable farming reward amounts for all farmed liquidity provided by account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account id for which to get claimable rewards. | +| `accountLiquidity` | `MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\>[] | Amount of liquidity the account has provided. | +| `pools` | [`LiquidityPool`](../modules.md#liquiditypool)[] | All liquidity pools. | + +#### Returns + +`Promise`<`Map`<[`LpCurrency`](../modules.md#lpcurrency), `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[]\>\> + +Map of LpCurrency -> Array of reward monetary amounts. + +#### Defined in + +[src/parachain/amm.ts:101](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L101) + +___ + +### getLiquidityPools + +▸ **getLiquidityPools**(): `Promise`<[`LiquidityPool`](../modules.md#liquiditypool)[]\> + +Get all liquidity pools. + +#### Returns + +`Promise`<[`LiquidityPool`](../modules.md#liquiditypool)[]\> + +All liquidity pools. + +#### Defined in + +[src/parachain/amm.ts:91](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L91) + +___ + +### getLiquidityProvidedByAccount + +▸ **getLiquidityProvidedByAccount**(`accountId`): `Promise`<`MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\>[]\> + +Get liquidity provided by account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account to get provided liquidity information about. | + +#### Returns + +`Promise`<`MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\>[]\> + +Array of LP token amounts that represent + account's positions in respective liquidity pools. + +#### Defined in + +[src/parachain/amm.ts:84](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L84) + +___ + +### getLpTokens + +▸ **getLpTokens**(): `Promise`<[`LpCurrency`](../modules.md#lpcurrency)[]\> + +Get all LP tokens. + +#### Returns + +`Promise`<[`LpCurrency`](../modules.md#lpcurrency)[]\> + +Array of all standard and stable LP tokens. + +#### Defined in + +[src/parachain/amm.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L61) + +___ + +### getOptimalTrade + +▸ **getOptimalTrade**(`inputAmount`, `outputCurrency`, `pools`): ``null`` \| [`Trade`](../classes/Trade.md) + +Get optimal trade for provided trade type and amount. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount to be exchanged. | +| `outputCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to purchase. | +| `pools` | [`LiquidityPool`](../modules.md#liquiditypool)[] | Array of all liquidity pools. | + +#### Returns + +``null`` \| [`Trade`](../classes/Trade.md) + +Optimal trade information or null if the trade is not possible. + +#### Defined in + +[src/parachain/amm.ts:71](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L71) + +___ + +### removeLiquidity + +▸ **removeLiquidity**(`amount`, `pool`, `maxSlippage`, `deadline`, `recipient`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Removes liquidity from pool. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\> | Amount of LP token to be removed | +| `pool` | [`LiquidityPool`](../modules.md#liquiditypool) | Liquidity pool to remove from. | +| `maxSlippage` | `number` | Maximum allowed slippage. | +| `deadline` | `number` | Deadline block number. | +| `recipient` | `AddressOrPair` | Recipient of the pooled currencies. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Note`** + +Removes `amount` of liquidity in LP token, breaks it down and transfers to account. + +#### Defined in + +[src/parachain/amm.ts:153](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L153) + +___ + +### swap + +▸ **swap**(`trade`, `minimumAmountOut`, `recipient`, `deadline`): [`ExtrinsicData`](ExtrinsicData.md) + +Swap assets. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `trade` | [`Trade`](../classes/Trade.md) | Trade object containing information about the trade. | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Minimum output amount to be received. | +| `recipient` | `AddressOrPair` | Recipient address. | +| `deadline` | `string` \| `number` | Deadline block for the swap transaction. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/amm.ts:116](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm.ts#L116) diff --git a/interfaces/AccruedRewards.md b/interfaces/AccruedRewards.md new file mode 100644 index 000000000..d17b09bfb --- /dev/null +++ b/interfaces/AccruedRewards.md @@ -0,0 +1,30 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / AccruedRewards + +# Interface: AccruedRewards + +## Table of contents + +### Properties + +- [perMarket](AccruedRewards.md#permarket) +- [total](AccruedRewards.md#total) + +## Properties + +### perMarket + +• **perMarket**: [`TickerToData`](../modules.md#tickertodata)<{ `borrow`: ``null`` \| `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> ; `lend`: ``null`` \| `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> }\> + +#### Defined in + +[src/types/loans.ts:84](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L84) + +___ + +### total + +• **total**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L83) diff --git a/interfaces/AssetRegistryAPI.md b/interfaces/AssetRegistryAPI.md new file mode 100644 index 000000000..4f881e3b7 --- /dev/null +++ b/interfaces/AssetRegistryAPI.md @@ -0,0 +1,75 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / AssetRegistryAPI + +# Interface: AssetRegistryAPI + +## Implemented by + +- [`DefaultAssetRegistryAPI`](../classes/DefaultAssetRegistryAPI.md) + +## Table of contents + +### Methods + +- [getCollateralForeignAssets](AssetRegistryAPI.md#getcollateralforeignassets) +- [getForeignAsset](AssetRegistryAPI.md#getforeignasset) +- [getForeignAssets](AssetRegistryAPI.md#getforeignassets) + +## Methods + +### getCollateralForeignAssets + +▸ **getCollateralForeignAssets**(): `Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +Get all foreign assets which have a registered collateral ceiling, meaning they can be used as collateral currency. + +#### Returns + +`Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +All foreign assets that have been registered as collateral currency + +#### Defined in + +[src/parachain/asset-registry.ts:32](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L32) + +___ + +### getForeignAsset + +▸ **getForeignAsset**(`id`): `Promise`<[`ForeignAsset`](../modules.md#foreignasset)\> + +Get foreign asset by its id. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `id` | `number` \| `u32` | The id of the foreign asset. | + +#### Returns + +`Promise`<[`ForeignAsset`](../modules.md#foreignasset)\> + +The foreign asset. + +#### Defined in + +[src/parachain/asset-registry.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L25) + +___ + +### getForeignAssets + +▸ **getForeignAssets**(): `Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +Get all currencies (foreign assets) in the asset registry. + +#### Returns + +`Promise`<[`ForeignAsset`](../modules.md#foreignasset)[]\> + +A list of currencies. + +#### Defined in + +[src/parachain/asset-registry.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/asset-registry.ts#L18) diff --git a/interfaces/BTCRelayAPI.md b/interfaces/BTCRelayAPI.md new file mode 100644 index 000000000..b517fe593 --- /dev/null +++ b/interfaces/BTCRelayAPI.md @@ -0,0 +1,105 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / BTCRelayAPI + +# Interface: BTCRelayAPI + +## Implemented by + +- [`DefaultBTCRelayAPI`](../classes/DefaultBTCRelayAPI.md) + +## Table of contents + +### Methods + +- [getLatestBlock](BTCRelayAPI.md#getlatestblock) +- [getLatestBlockHeight](BTCRelayAPI.md#getlatestblockheight) +- [getStableBitcoinConfirmations](BTCRelayAPI.md#getstablebitcoinconfirmations) +- [getStableParachainConfirmations](BTCRelayAPI.md#getstableparachainconfirmations) +- [isBlockInRelay](BTCRelayAPI.md#isblockinrelay) + +## Methods + +### getLatestBlock + +▸ **getLatestBlock**(): `Promise`<`BitcoinH256Le`\> + +#### Returns + +`Promise`<`BitcoinH256Le`\> + +The raw transaction data, represented as a Buffer object + +#### Defined in + +[src/parachain/btc-relay.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L25) + +___ + +### getLatestBlockHeight + +▸ **getLatestBlockHeight**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The height of the latest Bitcoin block that was rekayed by the BTC-Relay + +#### Defined in + +[src/parachain/btc-relay.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L29) + +___ + +### getStableBitcoinConfirmations + +▸ **getStableBitcoinConfirmations**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +A global security parameter: the required block confirmations +for a transaction to be considered stable on Bitcoin + +#### Defined in + +[src/parachain/btc-relay.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L16) + +___ + +### getStableParachainConfirmations + +▸ **getStableParachainConfirmations**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +A global security parameter: the required block confirmations +for a transaction to be considered stable on the parachain + +#### Defined in + +[src/parachain/btc-relay.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L21) + +___ + +### isBlockInRelay + +▸ **isBlockInRelay**(`blockHash`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `blockHash` | `string` | + +#### Returns + +`Promise`<`boolean`\> + +True if the block is in the relay, false otherwise. + +#### Defined in + +[src/parachain/btc-relay.ts:33](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/btc-relay.ts#L33) diff --git a/interfaces/BalanceWrapper.md b/interfaces/BalanceWrapper.md new file mode 100644 index 000000000..281a2e9ad --- /dev/null +++ b/interfaces/BalanceWrapper.md @@ -0,0 +1,815 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / BalanceWrapper + +# Interface: BalanceWrapper + +**`Name`** + +BalanceWrapper + +## Hierarchy + +- `Struct` + + ↳ **`BalanceWrapper`** + +## Table of contents + +### Properties + +- [#private](BalanceWrapper.md##private) +- [[toStringTag]](BalanceWrapper.md#[tostringtag]) +- [amount](BalanceWrapper.md#amount) +- [createdAtHash](BalanceWrapper.md#createdathash) +- [initialU8aLength](BalanceWrapper.md#initialu8alength) +- [isStorageFallback](BalanceWrapper.md#isstoragefallback) +- [registry](BalanceWrapper.md#registry) +- [size](BalanceWrapper.md#size) + +### Accessors + +- [Type](BalanceWrapper.md#type) +- [defKeys](BalanceWrapper.md#defkeys) +- [encodedLength](BalanceWrapper.md#encodedlength) +- [hash](BalanceWrapper.md#hash) +- [isEmpty](BalanceWrapper.md#isempty) + +### Methods + +- [[iterator]](BalanceWrapper.md#[iterator]) +- [clear](BalanceWrapper.md#clear) +- [delete](BalanceWrapper.md#delete) +- [entries](BalanceWrapper.md#entries) +- [eq](BalanceWrapper.md#eq) +- [forEach](BalanceWrapper.md#foreach) +- [get](BalanceWrapper.md#get) +- [getAtIndex](BalanceWrapper.md#getatindex) +- [getT](BalanceWrapper.md#gett) +- [has](BalanceWrapper.md#has) +- [inspect](BalanceWrapper.md#inspect) +- [keys](BalanceWrapper.md#keys) +- [set](BalanceWrapper.md#set) +- [toArray](BalanceWrapper.md#toarray) +- [toHex](BalanceWrapper.md#tohex) +- [toHuman](BalanceWrapper.md#tohuman) +- [toJSON](BalanceWrapper.md#tojson) +- [toPrimitive](BalanceWrapper.md#toprimitive) +- [toRawType](BalanceWrapper.md#torawtype) +- [toString](BalanceWrapper.md#tostring) +- [toU8a](BalanceWrapper.md#tou8a) +- [values](BalanceWrapper.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### amount + +• `Readonly` **amount**: `Text` + +#### Defined in + +src/interfaces/default/types.ts:10 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`BalanceWrapper`](BalanceWrapper.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`BalanceWrapper`](BalanceWrapper.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/BorrowPosition.md b/interfaces/BorrowPosition.md new file mode 100644 index 000000000..b5e600b37 --- /dev/null +++ b/interfaces/BorrowPosition.md @@ -0,0 +1,40 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / BorrowPosition + +# Interface: BorrowPosition + +## Hierarchy + +- [`LoanPosition`](LoanPosition.md) + + ↳ **`BorrowPosition`** + +## Table of contents + +### Properties + +- [accumulatedDebt](BorrowPosition.md#accumulateddebt) +- [amount](BorrowPosition.md#amount) + +## Properties + +### accumulatedDebt + +• **accumulatedDebt**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L16) + +___ + +### amount + +• **amount**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Inherited from + +[LoanPosition](LoanPosition.md).[amount](LoanPosition.md#amount) + +#### Defined in + +[src/types/loans.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L7) diff --git a/interfaces/CollateralPosition.md b/interfaces/CollateralPosition.md new file mode 100644 index 000000000..350c5ab01 --- /dev/null +++ b/interfaces/CollateralPosition.md @@ -0,0 +1,51 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / CollateralPosition + +# Interface: CollateralPosition + +## Hierarchy + +- [`LoanPosition`](LoanPosition.md) + + ↳ **`CollateralPosition`** + +## Table of contents + +### Properties + +- [amount](CollateralPosition.md#amount) +- [isCollateral](CollateralPosition.md#iscollateral) +- [vaultCollateralAmount](CollateralPosition.md#vaultcollateralamount) + +## Properties + +### amount + +• **amount**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Inherited from + +[LoanPosition](LoanPosition.md).[amount](LoanPosition.md#amount) + +#### Defined in + +[src/types/loans.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L7) + +___ + +### isCollateral + +• **isCollateral**: `boolean` + +#### Defined in + +[src/types/loans.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L11) + +___ + +### vaultCollateralAmount + +• **vaultCollateralAmount**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L12) diff --git a/interfaces/ConstantsAPI.md b/interfaces/ConstantsAPI.md new file mode 100644 index 000000000..b4451db1e --- /dev/null +++ b/interfaces/ConstantsAPI.md @@ -0,0 +1,66 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ConstantsAPI + +# Interface: ConstantsAPI + +## Implemented by + +- [`DefaultConstantsAPI`](../classes/DefaultConstantsAPI.md) + +## Table of contents + +### Methods + +- [getSystemBlockHashCount](ConstantsAPI.md#getsystemblockhashcount) +- [getSystemDbWeight](ConstantsAPI.md#getsystemdbweight) +- [getTimestampMinimumPeriod](ConstantsAPI.md#gettimestampminimumperiod) + +## Methods + +### getSystemBlockHashCount + +▸ **getSystemBlockHashCount**(): `BlockNumber` + +#### Returns + +`BlockNumber` + +Maximum number of block number to block hash mappings to keep (oldest pruned first). + +#### Defined in + +[src/parachain/constants.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L14) + +___ + +### getSystemDbWeight + +▸ **getSystemDbWeight**(): `SpWeightsRuntimeDbWeight` + +#### Returns + +`SpWeightsRuntimeDbWeight` + +The weight of database operations that the runtime can invoke. + +#### Defined in + +[src/parachain/constants.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L18) + +___ + +### getTimestampMinimumPeriod + +▸ **getTimestampMinimumPeriod**(): `Moment` + +#### Returns + +`Moment` + +The minimum period between blocks. Beware that this is different to the *expected* period +that the block production apparatus provides. Your chosen consensus system will generally +work with this to determine a sensible block time. e.g. For Aura, it will be double this +period on default settings. + +#### Defined in + +[src/parachain/constants.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/constants.ts#L25) diff --git a/interfaces/CurrencyId.md b/interfaces/CurrencyId.md new file mode 100644 index 000000000..dad1c7b98 --- /dev/null +++ b/interfaces/CurrencyId.md @@ -0,0 +1,725 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / CurrencyId + +# Interface: CurrencyId + +**`Name`** + +CurrencyId + +## Hierarchy + +- `Enum` + + ↳ **`CurrencyId`** + +## Table of contents + +### Properties + +- [#private](CurrencyId.md##private) +- [asForeignAsset](CurrencyId.md#asforeignasset) +- [asLendToken](CurrencyId.md#aslendtoken) +- [asLpToken](CurrencyId.md#aslptoken) +- [asStableLpToken](CurrencyId.md#asstablelptoken) +- [asToken](CurrencyId.md#astoken) +- [createdAtHash](CurrencyId.md#createdathash) +- [initialU8aLength](CurrencyId.md#initialu8alength) +- [isForeignAsset](CurrencyId.md#isforeignasset) +- [isLendToken](CurrencyId.md#islendtoken) +- [isLpToken](CurrencyId.md#islptoken) +- [isStableLpToken](CurrencyId.md#isstablelptoken) +- [isStorageFallback](CurrencyId.md#isstoragefallback) +- [isToken](CurrencyId.md#istoken) +- [registry](CurrencyId.md#registry) +- [type](CurrencyId.md#type) + +### Accessors + +- [defIndexes](CurrencyId.md#defindexes) +- [defKeys](CurrencyId.md#defkeys) +- [encodedLength](CurrencyId.md#encodedlength) +- [hash](CurrencyId.md#hash) +- [index](CurrencyId.md#index) +- [inner](CurrencyId.md#inner) +- [isBasic](CurrencyId.md#isbasic) +- [isEmpty](CurrencyId.md#isempty) +- [isNone](CurrencyId.md#isnone) +- [value](CurrencyId.md#value) + +### Methods + +- [\_toRawStruct](CurrencyId.md#_torawstruct) +- [eq](CurrencyId.md#eq) +- [inspect](CurrencyId.md#inspect) +- [toHex](CurrencyId.md#tohex) +- [toHuman](CurrencyId.md#tohuman) +- [toJSON](CurrencyId.md#tojson) +- [toNumber](CurrencyId.md#tonumber) +- [toPrimitive](CurrencyId.md#toprimitive) +- [toRawType](CurrencyId.md#torawtype) +- [toString](CurrencyId.md#tostring) +- [toU8a](CurrencyId.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### asForeignAsset + +• `Readonly` **asForeignAsset**: [`ForeignAssetId`](ForeignAssetId.md) + +#### Defined in + +src/interfaces/default/types.ts:18 + +___ + +### asLendToken + +• `Readonly` **asLendToken**: [`LendTokenId`](LendTokenId.md) + +#### Defined in + +src/interfaces/default/types.ts:20 + +___ + +### asLpToken + +• `Readonly` **asLpToken**: `ITuple`<[[`LpToken`](LpToken.md), [`LpToken`](LpToken.md)]\> + +#### Defined in + +src/interfaces/default/types.ts:22 + +___ + +### asStableLpToken + +• `Readonly` **asStableLpToken**: [`StablePoolId`](StablePoolId.md) + +#### Defined in + +src/interfaces/default/types.ts:24 + +___ + +### asToken + +• `Readonly` **asToken**: [`TokenSymbol`](TokenSymbol.md) + +#### Defined in + +src/interfaces/default/types.ts:16 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isForeignAsset + +• `Readonly` **isForeignAsset**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:17 + +___ + +### isLendToken + +• `Readonly` **isLendToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:19 + +___ + +### isLpToken + +• `Readonly` **isLpToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:21 + +___ + +### isStableLpToken + +• `Readonly` **isStableLpToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:23 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### isToken + +• `Readonly` **isToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Token"`` \| ``"ForeignAsset"`` \| ``"LendToken"`` \| ``"LpToken"`` \| ``"StableLpToken"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:25 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/DecodedRequest.md b/interfaces/DecodedRequest.md new file mode 100644 index 000000000..9c9d99031 --- /dev/null +++ b/interfaces/DecodedRequest.md @@ -0,0 +1,811 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DecodedRequest + +# Interface: DecodedRequest + +## Hierarchy + +- `Struct` + + ↳ **`DecodedRequest`** + +## Table of contents + +### Properties + +- [#private](DecodedRequest.md##private) +- [[toStringTag]](DecodedRequest.md#[tostringtag]) +- [btc\_address](DecodedRequest.md#btc_address) +- [createdAtHash](DecodedRequest.md#createdathash) +- [initialU8aLength](DecodedRequest.md#initialu8alength) +- [isStorageFallback](DecodedRequest.md#isstoragefallback) +- [registry](DecodedRequest.md#registry) +- [size](DecodedRequest.md#size) + +### Accessors + +- [Type](DecodedRequest.md#type) +- [defKeys](DecodedRequest.md#defkeys) +- [encodedLength](DecodedRequest.md#encodedlength) +- [hash](DecodedRequest.md#hash) +- [isEmpty](DecodedRequest.md#isempty) + +### Methods + +- [[iterator]](DecodedRequest.md#[iterator]) +- [clear](DecodedRequest.md#clear) +- [delete](DecodedRequest.md#delete) +- [entries](DecodedRequest.md#entries) +- [eq](DecodedRequest.md#eq) +- [forEach](DecodedRequest.md#foreach) +- [get](DecodedRequest.md#get) +- [getAtIndex](DecodedRequest.md#getatindex) +- [getT](DecodedRequest.md#gett) +- [has](DecodedRequest.md#has) +- [inspect](DecodedRequest.md#inspect) +- [keys](DecodedRequest.md#keys) +- [set](DecodedRequest.md#set) +- [toArray](DecodedRequest.md#toarray) +- [toHex](DecodedRequest.md#tohex) +- [toHuman](DecodedRequest.md#tohuman) +- [toJSON](DecodedRequest.md#tojson) +- [toPrimitive](DecodedRequest.md#toprimitive) +- [toRawType](DecodedRequest.md#torawtype) +- [toString](DecodedRequest.md#tostring) +- [toU8a](DecodedRequest.md#tou8a) +- [values](DecodedRequest.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### btc\_address + +• `Readonly` **btc\_address**: `BitcoinAddress` + +#### Defined in + +[src/utils/encoding.ts:150](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L150) + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`DecodedRequest`](DecodedRequest.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`DecodedRequest`](DecodedRequest.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/DecodedRequestExt.md b/interfaces/DecodedRequestExt.md new file mode 100644 index 000000000..ff0729df5 --- /dev/null +++ b/interfaces/DecodedRequestExt.md @@ -0,0 +1,753 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DecodedRequestExt + +# Interface: DecodedRequestExt + +## Hierarchy + +- `Omit`<[`DecodedRequest`](DecodedRequest.md), ``"btc_address"``\> + + ↳ **`DecodedRequestExt`** + +## Table of contents + +### Properties + +- [Type](DecodedRequestExt.md#type) +- [[toStringTag]](DecodedRequestExt.md#[tostringtag]) +- [btc\_address](DecodedRequestExt.md#btc_address) +- [createdAtHash](DecodedRequestExt.md#createdathash) +- [defKeys](DecodedRequestExt.md#defkeys) +- [encodedLength](DecodedRequestExt.md#encodedlength) +- [hash](DecodedRequestExt.md#hash) +- [initialU8aLength](DecodedRequestExt.md#initialu8alength) +- [isEmpty](DecodedRequestExt.md#isempty) +- [isStorageFallback](DecodedRequestExt.md#isstoragefallback) +- [registry](DecodedRequestExt.md#registry) +- [size](DecodedRequestExt.md#size) + +### Methods + +- [[iterator]](DecodedRequestExt.md#[iterator]) +- [clear](DecodedRequestExt.md#clear) +- [delete](DecodedRequestExt.md#delete) +- [entries](DecodedRequestExt.md#entries) +- [eq](DecodedRequestExt.md#eq) +- [forEach](DecodedRequestExt.md#foreach) +- [get](DecodedRequestExt.md#get) +- [getAtIndex](DecodedRequestExt.md#getatindex) +- [getT](DecodedRequestExt.md#gett) +- [has](DecodedRequestExt.md#has) +- [inspect](DecodedRequestExt.md#inspect) +- [keys](DecodedRequestExt.md#keys) +- [set](DecodedRequestExt.md#set) +- [toArray](DecodedRequestExt.md#toarray) +- [toHex](DecodedRequestExt.md#tohex) +- [toHuman](DecodedRequestExt.md#tohuman) +- [toJSON](DecodedRequestExt.md#tojson) +- [toPrimitive](DecodedRequestExt.md#toprimitive) +- [toRawType](DecodedRequestExt.md#torawtype) +- [toString](DecodedRequestExt.md#tostring) +- [toU8a](DecodedRequestExt.md#tou8a) +- [values](DecodedRequestExt.md#values) + +## Properties + +### Type + +• **Type**: `Object` + +#### Inherited from + +Omit.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Omit.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### btc\_address + +• **btc\_address**: `string` + +#### Defined in + +[src/utils/encoding.ts:155](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L155) + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Omit.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### defKeys + +• **defKeys**: `string`[] + +#### Inherited from + +Omit.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• **encodedLength**: `number` + +#### Inherited from + +Omit.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• **hash**: `IU8a` + +#### Inherited from + +Omit.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Omit.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isEmpty + +• **isEmpty**: `boolean` + +#### Inherited from + +Omit.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Omit.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Omit.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Omit.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Omit.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Omit.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Omit.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Omit.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Omit.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Omit.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Omit.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Omit.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Omit.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Omit.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Omit.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Omit.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`DecodedRequest`](DecodedRequest.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`DecodedRequest`](DecodedRequest.md) + +#### Inherited from + +Omit.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Omit.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Omit.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Omit.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Omit.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Omit.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Omit.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Omit.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Omit.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Omit.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/DryRunResult.md b/interfaces/DryRunResult.md new file mode 100644 index 000000000..e80b5e24d --- /dev/null +++ b/interfaces/DryRunResult.md @@ -0,0 +1,30 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / DryRunResult + +# Interface: DryRunResult + +## Table of contents + +### Properties + +- [error](DryRunResult.md#error) +- [success](DryRunResult.md#success) + +## Properties + +### error + +• `Optional` **error**: `unknown` + +#### Defined in + +[src/types/extrinsic.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/extrinsic.ts#L10) + +___ + +### success + +• **success**: `boolean` + +#### Defined in + +[src/types/extrinsic.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/extrinsic.ts#L9) diff --git a/interfaces/ElectrsAPI.md b/interfaces/ElectrsAPI.md new file mode 100644 index 000000000..c1ed22377 --- /dev/null +++ b/interfaces/ElectrsAPI.md @@ -0,0 +1,409 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ElectrsAPI + +# Interface: ElectrsAPI + +Bitcoin Core API + +## Implemented by + +- [`DefaultElectrsAPI`](../classes/DefaultElectrsAPI.md) + +## Table of contents + +### Methods + +- [getCoinbaseTxId](ElectrsAPI.md#getcoinbasetxid) +- [getEarliestPaymentToRecipientAddressTxId](ElectrsAPI.md#getearliestpaymenttorecipientaddresstxid) +- [getLargestPaymentToRecipientAddressTxId](ElectrsAPI.md#getlargestpaymenttorecipientaddresstxid) +- [getLatestBlock](ElectrsAPI.md#getlatestblock) +- [getLatestBlockHeight](ElectrsAPI.md#getlatestblockheight) +- [getMerkleProof](ElectrsAPI.md#getmerkleproof) +- [getParsedExecutionParameters](ElectrsAPI.md#getparsedexecutionparameters) +- [getRawTransaction](ElectrsAPI.md#getrawtransaction) +- [getTransactionBlockHeight](ElectrsAPI.md#gettransactionblockheight) +- [getTransactionStatus](ElectrsAPI.md#gettransactionstatus) +- [getTx](ElectrsAPI.md#gettx) +- [getTxIdByOpReturn](ElectrsAPI.md#gettxidbyopreturn) +- [getUtxoAmount](ElectrsAPI.md#getutxoamount) +- [waitForOpreturn](ElectrsAPI.md#waitforopreturn) +- [waitForTxInclusion](ElectrsAPI.md#waitfortxinclusion) + +## Methods + +### getCoinbaseTxId + +▸ **getCoinbaseTxId**(`userTxId`): `Promise`<`undefined` \| `string`\> + +Returns tx id of the coinbase tx of block in which `userTxId` was included. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `userTxId` | `string` | User tx ID which block's txId will be returned. | + +#### Returns + +`Promise`<`undefined` \| `string`\> + +Tx ID of coinbase transaction or undefined if block was not found. + +#### Defined in + +[src/external/electrs.ts:138](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L138) + +___ + +### getEarliestPaymentToRecipientAddressTxId + +▸ **getEarliestPaymentToRecipientAddressTxId**(`recipientAddress`, `amount?`): `Promise`<`string`\> + +Fetch the earliest/oldest bitcoin transaction ID based on the recipient address and amount. +Throw an error if no such transaction is found. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `recipientAddress` | `string` | Match the receiving address of a transaction output | +| `amount?` | `BitcoinAmount` | Match the amount (in BTC) of a transaction output that contains said recipientAddress. | + +#### Returns + +`Promise`<`string`\> + +A Bitcoin transaction ID + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +**`Deprecated`** + +For most cases where this is used today, [getLargestPaymentToRecipientAddressTxId](ElectrsAPI.md#getlargestpaymenttorecipientaddresstxid) is better suited. + +#### Defined in + +[src/external/electrs.ts:97](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L97) + +___ + +### getLargestPaymentToRecipientAddressTxId + +▸ **getLargestPaymentToRecipientAddressTxId**(`recipientAddress`): `Promise`<`string`\> + +Fetch the bitcoin transaction ID with the largest payment based on the recipient address. +Throw an error if no transactions are found. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `recipientAddress` | `string` | Match the receiving address of a transaction output | + +#### Returns + +`Promise`<`string`\> + +A Bitcoin transaction ID + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Defined in + +[src/external/electrs.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L83) + +___ + +### getLatestBlock + +▸ **getLatestBlock**(): `Promise`<`string`\> + +#### Returns + +`Promise`<`string`\> + +The block hash of the latest Bitcoin block + +#### Defined in + +[src/external/electrs.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L31) + +___ + +### getLatestBlockHeight + +▸ **getLatestBlockHeight**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The height of the latest Bitcoin block + +#### Defined in + +[src/external/electrs.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L35) + +___ + +### getMerkleProof + +▸ **getMerkleProof**(`txid`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`string`\> + +The merkle inclusion proof for the transaction using bitcoind's merkleblock format. + +#### Defined in + +[src/external/electrs.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L40) + +___ + +### getParsedExecutionParameters + +▸ **getParsedExecutionParameters**(`txid`): `Promise`<[[`BitcoinMerkleProof`](../classes/BitcoinMerkleProof.md), `Transaction`]\> + +Get the parsed (as Bytes) merkle proof and raw transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | A Bitcoin transaction ID | + +#### Returns + +`Promise`<[[`BitcoinMerkleProof`](../classes/BitcoinMerkleProof.md), `Transaction`]\> + +A tuple representing [merkleProof, transaction] + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Defined in + +[src/external/electrs.ts:131](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L131) + +___ + +### getRawTransaction + +▸ **getRawTransaction**(`txid`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`string`\> + +The raw transaction data, represented as a hex string + +#### Defined in + +[src/external/electrs.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L56) + +___ + +### getTransactionBlockHeight + +▸ **getTransactionBlockHeight**(`txid`): `Promise`<`undefined` \| `number`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<`undefined` \| `number`\> + +The height of the block the transaction was included in. If the block has not been confirmed, returns undefined. + +#### Defined in + +[src/external/electrs.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L51) + +___ + +### getTransactionStatus + +▸ **getTransactionStatus**(`txid`): `Promise`<[`TxStatus`](../modules.md#txstatus)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | + +#### Returns + +`Promise`<[`TxStatus`](../modules.md#txstatus)\> + +A TxStatus object, containing the confirmation status and number of confirmations, plus block height if +the tx is included in the blockchain + +#### Defined in + +[src/external/electrs.ts:46](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L46) + +___ + +### getTx + +▸ **getTx**(`txid`): `Promise`<`Transaction`\> + +Fetch the Bitcoin transaction that matches the given TxId + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | A Bitcoin transaction ID | + +#### Returns + +`Promise`<`Transaction`\> + +A Bitcoin Transaction object + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Defined in + +[src/external/electrs.ts:108](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L108) + +___ + +### getTxIdByOpReturn + +▸ **getTxIdByOpReturn**(`opReturn`, `recipientAddress?`, `amount?`): `Promise`<`string`\> + +Fetch the first bitcoin transaction ID based on the OP_RETURN field, recipient and amount. +Throw an error unless there is exactly one transaction with the given opcode. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `opReturn` | `string` | Data string used for matching the OP_CODE of Bitcoin transactions | +| `recipientAddress?` | `string` | Match the receiving address of a transaction that contains said op_return | +| `amount?` | `BitcoinAmount` | Match the amount (in BTC) of a transaction that contains said op_return and recipientAddress. This parameter is only considered if `recipientAddress` is defined. | + +#### Returns + +`Promise`<`string`\> + +A Bitcoin transaction ID + +**`Remarks`** + +Performs the lookup using an external service, Esplora. Requires the input string to be a hex + +#### Defined in + +[src/external/electrs.ts:71](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L71) + +___ + +### getUtxoAmount + +▸ **getUtxoAmount**(`txid`, `recipient`): `Promise`<`number`\> + +Fetch the Bitcoin UTXO amount that matches the given TxId and recipient + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | A Bitcoin transaction ID | +| `recipient` | `string` | A Bitcoin scriptpubkey address | + +#### Returns + +`Promise`<`number`\> + +A UTXO amount if found, 0 otherwise + +**`Remarks`** + +Performs the lookup using an external service, Esplora + +#### Defined in + +[src/external/electrs.ts:120](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L120) + +___ + +### waitForOpreturn + +▸ **waitForOpreturn**(`data`, `timeoutMs`, `retryIntervalMs`): `Promise`<`string`\> + +Return a promise that either resolves to the first txid with the given opreturn `data`, +or rejects if the `timeout` has elapsed. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `data` | `string` | The opReturn of the bitcoin transaction | +| `timeoutMs` | `number` | The duration until the Promise times out (in milliseconds) | +| `retryIntervalMs` | `number` | The time to wait (in milliseconds) between retries | + +#### Returns + +`Promise`<`string`\> + +The Bitcoin txid + +**`Remarks`** + +Every 5 seconds, performs the lookup using an external service, Esplora + +#### Defined in + +[src/external/electrs.ts:152](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L152) + +___ + +### waitForTxInclusion + +▸ **waitForTxInclusion**(`txid`, `timeoutMs`, `retryIntervalMs`): `Promise`<[`TxStatus`](../modules.md#txstatus)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `txid` | `string` | The ID of a Bitcoin transaction | +| `timeoutMs` | `number` | - | +| `retryIntervalMs` | `number` | - | + +#### Returns + +`Promise`<[`TxStatus`](../modules.md#txstatus)\> + +A TxStatus object, containing the confirmation status and number of confirmations, plus block height if +the tx is included in the blockchain + +#### Defined in + +[src/external/electrs.ts:158](https://github.com/interlay/interbtc-api/blob/6262ea7/src/external/electrs.ts#L158) diff --git a/interfaces/EscrowAPI.md b/interfaces/EscrowAPI.md new file mode 100644 index 000000000..27c7290c9 --- /dev/null +++ b/interfaces/EscrowAPI.md @@ -0,0 +1,319 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / EscrowAPI + +# Interface: EscrowAPI + +## Implemented by + +- [`DefaultEscrowAPI`](../classes/DefaultEscrowAPI.md) + +## Table of contents + +### Methods + +- [createLock](EscrowAPI.md#createlock) +- [getMaxPeriod](EscrowAPI.md#getmaxperiod) +- [getRewardEstimate](EscrowAPI.md#getrewardestimate) +- [getRewards](EscrowAPI.md#getrewards) +- [getSpan](EscrowAPI.md#getspan) +- [getStakedBalance](EscrowAPI.md#getstakedbalance) +- [getTotalStakedBalance](EscrowAPI.md#gettotalstakedbalance) +- [increaseAmount](EscrowAPI.md#increaseamount) +- [increaseUnlockHeight](EscrowAPI.md#increaseunlockheight) +- [totalVotingSupply](EscrowAPI.md#totalvotingsupply) +- [votingBalance](EscrowAPI.md#votingbalance) +- [withdraw](EscrowAPI.md#withdraw) +- [withdrawRewards](EscrowAPI.md#withdrawrewards) + +## Methods + +### createLock + +▸ **createLock**(`amount`, `unlockHeight`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Governance token amount to lock (e.g. KINT or INTR) | +| `unlockHeight` | `number` | Block number to lock until | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +The amount can't be less than the max period (`getMaxPeriod` getter) to prevent rounding errors + +#### Defined in + +[src/parachain/escrow.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L37) + +___ + +### getMaxPeriod + +▸ **getMaxPeriod**(): `Promise`<`BN`\> + +#### Returns + +`Promise`<`BN`\> + +The maximum time for locks. + +#### Defined in + +[src/parachain/escrow.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L62) + +___ + +### getRewardEstimate + +▸ **getRewardEstimate**(`accountId`, `amountToLock?`, `newLockEndHeight?`): `Promise`<{ `amount`: `MonetaryAmount`<`Currency`\> ; `apy`: `Big` }\> + +Estimate the annualized rewards for an account's staked amounts while applying an optional amount to increase +the locked stake by, and an optional lock time extension. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | User account ID | +| `amountToLock?` | `MonetaryAmount`<`Currency`\> | (optional) New amount to add to the current stake. Zero, null, or undefined are interpreted as no changes to the current stake for the estimation. | +| `newLockEndHeight?` | `number` | (optional) At which block number the stake lock should end. Zero, null, or undefined are interpreted as no lock extension used for the estimate. | + +#### Returns + +`Promise`<{ `amount`: `MonetaryAmount`<`Currency`\> ; `apy`: `Big` }\> + +The estimated total reward amount and annualized reward percentage (APY). + +#### Defined in + +[src/parachain/escrow.ts:97](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L97) + +___ + +### getRewards + +▸ **getRewards**(`accountId`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | User account ID | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The rewards that can be withdrawn by the account + +**`Remarks`** + +Implements https://spec.interlay.io/spec/reward.html#computereward + +#### Defined in + +[src/parachain/escrow.ts:84](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L84) + +___ + +### getSpan + +▸ **getSpan**(): `Promise`<`BN`\> + +#### Returns + +`Promise`<`BN`\> + +All future times are rounded by this. + +#### Defined in + +[src/parachain/escrow.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L58) + +___ + +### getStakedBalance + +▸ **getStakedBalance**(`accountId`): `Promise`<[`StakedBalance`](../modules.md#stakedbalance)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | ID of the user whose stake to fetch | + +#### Returns + +`Promise`<[`StakedBalance`](../modules.md#stakedbalance)\> + +The staked amount and end block + +#### Defined in + +[src/parachain/escrow.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L42) + +___ + +### getTotalStakedBalance + +▸ **getTotalStakedBalance**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total amount of locked governance tokens + +**`Remarks`** + +- Expect poor performance from this function as more blocks are appended to the parachain. +It is not recommended to call this directly, but rather to query through interbtc-squid once implemented. + +#### Defined in + +[src/parachain/escrow.ts:49](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L49) + +___ + +### increaseAmount + +▸ **increaseAmount**(`amount`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Governance token amount to lock (e.g. KINT or INTR) | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/escrow.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L72) + +___ + +### increaseUnlockHeight + +▸ **increaseUnlockHeight**(`unlockHeight`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `unlockHeight` | `number` | The unlock height to increase by. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/escrow.ts:78](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L78) + +___ + +### totalVotingSupply + +▸ **totalVotingSupply**(`blockNumber?`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blockNumber?` | `number` | The number of block to query state at | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The voting balance + +**`Remarks`** + +- Expect poor performance from this function as more blocks are appended to the parachain. +It is not recommended to call this directly, but rather to query through the indexer (currently `interbtc-index`). +- Logic is duplicated from Escrow pallet in the parachain + +#### Defined in + +[src/parachain/escrow.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L30) + +___ + +### votingBalance + +▸ **votingBalance**(`accountId`, `blockNumber?`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account whose voting balance to fetch | +| `blockNumber?` | `number` | The number of block to query state at | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The voting balance + +**`Remarks`** + +Logic is duplicated from Escrow pallet in the parachain + +#### Defined in + +[src/parachain/escrow.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L21) + +___ + +### withdraw + +▸ **withdraw**(): [`ExtrinsicData`](ExtrinsicData.md) + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Withdraws all locked governance currency + +#### Defined in + +[src/parachain/escrow.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L54) + +___ + +### withdrawRewards + +▸ **withdrawRewards**(): [`ExtrinsicData`](ExtrinsicData.md) + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Withdraws stake-to-vote rewards + +#### Defined in + +[src/parachain/escrow.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/escrow.ts#L67) diff --git a/interfaces/ExtrinsicData.md b/interfaces/ExtrinsicData.md new file mode 100644 index 000000000..77f274503 --- /dev/null +++ b/interfaces/ExtrinsicData.md @@ -0,0 +1,30 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ExtrinsicData + +# Interface: ExtrinsicData + +## Table of contents + +### Properties + +- [event](ExtrinsicData.md#event) +- [extrinsic](ExtrinsicData.md#extrinsic) + +## Properties + +### event + +• `Optional` **event**: `AugmentedEvent`<`ApiTypes`\> + +#### Defined in + +[src/types/extrinsic.ts:5](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/extrinsic.ts#L5) + +___ + +### extrinsic + +• **extrinsic**: `SubmittableExtrinsic`<`ApiTypes`, `ISubmittableResult`\> + +#### Defined in + +[src/types/extrinsic.ts:4](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/extrinsic.ts#L4) diff --git a/interfaces/FeeAPI.md b/interfaces/FeeAPI.md new file mode 100644 index 000000000..7a84abf9a --- /dev/null +++ b/interfaces/FeeAPI.md @@ -0,0 +1,112 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / FeeAPI + +# Interface: FeeAPI + +## Implemented by + +- [`DefaultFeeAPI`](../classes/DefaultFeeAPI.md) + +## Table of contents + +### Methods + +- [calculateAPY](FeeAPI.md#calculateapy) +- [getGriefingCollateral](FeeAPI.md#getgriefingcollateral) +- [getIssueFee](FeeAPI.md#getissuefee) +- [getIssueGriefingCollateralRate](FeeAPI.md#getissuegriefingcollateralrate) +- [getReplaceGriefingCollateralRate](FeeAPI.md#getreplacegriefingcollateralrate) + +## Methods + +### calculateAPY + +▸ **calculateAPY**(`feesWrapped`, `lockedCollateral`, `exchangeRate?`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `feesWrapped` | `MonetaryAmount`<`Currency`\> | Wrapped token fees accrued, in wrapped token (e.g. BTC) | +| `lockedCollateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Collateral value representing the value locked to gain yield. | +| `exchangeRate?` | `ExchangeRate`<`Currency`, [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | (Optional) Conversion rate, as a `Monetary.js` object | + +#### Returns + +`Promise`<`Big`\> + +The APY, given the parameters + +#### Defined in + +[src/parachain/fee.ts:36](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L36) + +___ + +### getGriefingCollateral + +▸ **getGriefingCollateral**(`amount`, `type`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount, in BTC, for which to compute the required griefing collateral | +| `type` | `GriefingCollateralType` | Type of griefing collateral to compute (e.g. for issuing, replacing) | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +The griefing collateral + +#### Defined in + +[src/parachain/fee.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L26) + +___ + +### getIssueFee + +▸ **getIssueFee**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The percentage of issued token that is received by the vault as reward + +#### Defined in + +[src/parachain/fee.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L52) + +___ + +### getIssueGriefingCollateralRate + +▸ **getIssueGriefingCollateralRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The griefing collateral rate for issuing InterBTC + +#### Defined in + +[src/parachain/fee.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L44) + +___ + +### getReplaceGriefingCollateralRate + +▸ **getReplaceGriefingCollateralRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The griefing collateral rate for the Vault replace request + +#### Defined in + +[src/parachain/fee.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/fee.ts#L48) diff --git a/interfaces/ForeignAssetId.md b/interfaces/ForeignAssetId.md new file mode 100644 index 000000000..fd92e29d1 --- /dev/null +++ b/interfaces/ForeignAssetId.md @@ -0,0 +1,2947 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ForeignAssetId + +# Interface: ForeignAssetId + +**`Name`** + +ForeignAssetId + +## Hierarchy + +- `u32` + + ↳ **`ForeignAssetId`** + +## Table of contents + +### Properties + +- [#private](ForeignAssetId.md##private) +- [\_\_UIntType](ForeignAssetId.md#__uinttype) +- [createdAtHash](ForeignAssetId.md#createdathash) +- [encodedLength](ForeignAssetId.md#encodedlength) +- [initialU8aLength](ForeignAssetId.md#initialu8alength) +- [isStorageFallback](ForeignAssetId.md#isstoragefallback) +- [isUnsigned](ForeignAssetId.md#isunsigned) +- [registry](ForeignAssetId.md#registry) + +### Accessors + +- [hash](ForeignAssetId.md#hash) +- [isEmpty](ForeignAssetId.md#isempty) + +### Methods + +- [abs](ForeignAssetId.md#abs) +- [add](ForeignAssetId.md#add) +- [addn](ForeignAssetId.md#addn) +- [and](ForeignAssetId.md#and) +- [andln](ForeignAssetId.md#andln) +- [bincn](ForeignAssetId.md#bincn) +- [bitLength](ForeignAssetId.md#bitlength) +- [byteLength](ForeignAssetId.md#bytelength) +- [clone](ForeignAssetId.md#clone) +- [cmp](ForeignAssetId.md#cmp) +- [cmpn](ForeignAssetId.md#cmpn) +- [div](ForeignAssetId.md#div) +- [divRound](ForeignAssetId.md#divround) +- [divmod](ForeignAssetId.md#divmod) +- [divn](ForeignAssetId.md#divn) +- [egcd](ForeignAssetId.md#egcd) +- [eq](ForeignAssetId.md#eq) +- [eqn](ForeignAssetId.md#eqn) +- [fromTwos](ForeignAssetId.md#fromtwos) +- [gcd](ForeignAssetId.md#gcd) +- [gt](ForeignAssetId.md#gt) +- [gte](ForeignAssetId.md#gte) +- [gten](ForeignAssetId.md#gten) +- [gtn](ForeignAssetId.md#gtn) +- [iabs](ForeignAssetId.md#iabs) +- [iadd](ForeignAssetId.md#iadd) +- [iaddn](ForeignAssetId.md#iaddn) +- [iand](ForeignAssetId.md#iand) +- [idivn](ForeignAssetId.md#idivn) +- [imaskn](ForeignAssetId.md#imaskn) +- [imul](ForeignAssetId.md#imul) +- [imuln](ForeignAssetId.md#imuln) +- [ineg](ForeignAssetId.md#ineg) +- [inotn](ForeignAssetId.md#inotn) +- [inspect](ForeignAssetId.md#inspect) +- [invm](ForeignAssetId.md#invm) +- [ior](ForeignAssetId.md#ior) +- [isEven](ForeignAssetId.md#iseven) +- [isMax](ForeignAssetId.md#ismax) +- [isNeg](ForeignAssetId.md#isneg) +- [isOdd](ForeignAssetId.md#isodd) +- [isZero](ForeignAssetId.md#iszero) +- [ishln](ForeignAssetId.md#ishln) +- [ishrn](ForeignAssetId.md#ishrn) +- [isqr](ForeignAssetId.md#isqr) +- [isub](ForeignAssetId.md#isub) +- [isubn](ForeignAssetId.md#isubn) +- [iuand](ForeignAssetId.md#iuand) +- [iuor](ForeignAssetId.md#iuor) +- [iushln](ForeignAssetId.md#iushln) +- [iushrn](ForeignAssetId.md#iushrn) +- [iuxor](ForeignAssetId.md#iuxor) +- [ixor](ForeignAssetId.md#ixor) +- [lt](ForeignAssetId.md#lt) +- [lte](ForeignAssetId.md#lte) +- [lten](ForeignAssetId.md#lten) +- [ltn](ForeignAssetId.md#ltn) +- [maskn](ForeignAssetId.md#maskn) +- [mod](ForeignAssetId.md#mod) +- [modn](ForeignAssetId.md#modn) +- [modrn](ForeignAssetId.md#modrn) +- [mul](ForeignAssetId.md#mul) +- [muln](ForeignAssetId.md#muln) +- [neg](ForeignAssetId.md#neg) +- [notn](ForeignAssetId.md#notn) +- [or](ForeignAssetId.md#or) +- [pow](ForeignAssetId.md#pow) +- [setn](ForeignAssetId.md#setn) +- [shln](ForeignAssetId.md#shln) +- [shrn](ForeignAssetId.md#shrn) +- [sqr](ForeignAssetId.md#sqr) +- [sub](ForeignAssetId.md#sub) +- [subn](ForeignAssetId.md#subn) +- [testn](ForeignAssetId.md#testn) +- [toArray](ForeignAssetId.md#toarray) +- [toArrayLike](ForeignAssetId.md#toarraylike) +- [toBigInt](ForeignAssetId.md#tobigint) +- [toBn](ForeignAssetId.md#tobn) +- [toBuffer](ForeignAssetId.md#tobuffer) +- [toHex](ForeignAssetId.md#tohex) +- [toHuman](ForeignAssetId.md#tohuman) +- [toJSON](ForeignAssetId.md#tojson) +- [toNumber](ForeignAssetId.md#tonumber) +- [toPrimitive](ForeignAssetId.md#toprimitive) +- [toRawType](ForeignAssetId.md#torawtype) +- [toRed](ForeignAssetId.md#tored) +- [toString](ForeignAssetId.md#tostring) +- [toTwos](ForeignAssetId.md#totwos) +- [toU8a](ForeignAssetId.md#tou8a) +- [uand](ForeignAssetId.md#uand) +- [ucmp](ForeignAssetId.md#ucmp) +- [umod](ForeignAssetId.md#umod) +- [uor](ForeignAssetId.md#uor) +- [ushln](ForeignAssetId.md#ushln) +- [ushrn](ForeignAssetId.md#ushrn) +- [uxor](ForeignAssetId.md#uxor) +- [xor](ForeignAssetId.md#xor) +- [zeroBits](ForeignAssetId.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +u32.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### \_\_UIntType + +• `Readonly` **\_\_UIntType**: ``"u32"`` + +#### Inherited from + +u32.\_\_UIntType + +#### Defined in + +node_modules/@polkadot/types-codec/primitive/U32.d.ts:9 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +u32.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +u32.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +u32.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +u32.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +u32.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +u32.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +u32.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +u32.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +u32.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +u32.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +u32.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +u32.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +u32.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +u32.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +u32.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +u32.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +u32.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +u32.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +u32.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +u32.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +u32.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +u32.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +u32.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +u32.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +u32.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +u32.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +u32.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +u32.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +u32.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +u32.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +u32.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +u32.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +u32.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +u32.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +u32.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +u32.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +u32.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +u32.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +u32.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +u32.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +u32.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +u32.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +u32.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +u32.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +u32.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +u32.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +u32.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +u32.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/FundAccountJsonRpcRequest.md b/interfaces/FundAccountJsonRpcRequest.md new file mode 100644 index 000000000..f6d507f2b --- /dev/null +++ b/interfaces/FundAccountJsonRpcRequest.md @@ -0,0 +1,826 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / FundAccountJsonRpcRequest + +# Interface: FundAccountJsonRpcRequest + +**`Name`** + +FundAccountJsonRpcRequest + +## Hierarchy + +- `Struct` + + ↳ **`FundAccountJsonRpcRequest`** + +## Table of contents + +### Properties + +- [#private](FundAccountJsonRpcRequest.md##private) +- [[toStringTag]](FundAccountJsonRpcRequest.md#[tostringtag]) +- [account\_id](FundAccountJsonRpcRequest.md#account_id) +- [createdAtHash](FundAccountJsonRpcRequest.md#createdathash) +- [currency\_id](FundAccountJsonRpcRequest.md#currency_id) +- [initialU8aLength](FundAccountJsonRpcRequest.md#initialu8alength) +- [isStorageFallback](FundAccountJsonRpcRequest.md#isstoragefallback) +- [registry](FundAccountJsonRpcRequest.md#registry) +- [size](FundAccountJsonRpcRequest.md#size) + +### Accessors + +- [Type](FundAccountJsonRpcRequest.md#type) +- [defKeys](FundAccountJsonRpcRequest.md#defkeys) +- [encodedLength](FundAccountJsonRpcRequest.md#encodedlength) +- [hash](FundAccountJsonRpcRequest.md#hash) +- [isEmpty](FundAccountJsonRpcRequest.md#isempty) + +### Methods + +- [[iterator]](FundAccountJsonRpcRequest.md#[iterator]) +- [clear](FundAccountJsonRpcRequest.md#clear) +- [delete](FundAccountJsonRpcRequest.md#delete) +- [entries](FundAccountJsonRpcRequest.md#entries) +- [eq](FundAccountJsonRpcRequest.md#eq) +- [forEach](FundAccountJsonRpcRequest.md#foreach) +- [get](FundAccountJsonRpcRequest.md#get) +- [getAtIndex](FundAccountJsonRpcRequest.md#getatindex) +- [getT](FundAccountJsonRpcRequest.md#gett) +- [has](FundAccountJsonRpcRequest.md#has) +- [inspect](FundAccountJsonRpcRequest.md#inspect) +- [keys](FundAccountJsonRpcRequest.md#keys) +- [set](FundAccountJsonRpcRequest.md#set) +- [toArray](FundAccountJsonRpcRequest.md#toarray) +- [toHex](FundAccountJsonRpcRequest.md#tohex) +- [toHuman](FundAccountJsonRpcRequest.md#tohuman) +- [toJSON](FundAccountJsonRpcRequest.md#tojson) +- [toPrimitive](FundAccountJsonRpcRequest.md#toprimitive) +- [toRawType](FundAccountJsonRpcRequest.md#torawtype) +- [toString](FundAccountJsonRpcRequest.md#tostring) +- [toU8a](FundAccountJsonRpcRequest.md#tou8a) +- [values](FundAccountJsonRpcRequest.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### account\_id + +• `Readonly` **account\_id**: `AccountId` + +#### Defined in + +src/interfaces/default/types.ts:33 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### currency\_id + +• `Readonly` **currency\_id**: [`InterbtcPrimitivesCurrencyId`](InterbtcPrimitivesCurrencyId.md) + +#### Defined in + +src/interfaces/default/types.ts:34 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`FundAccountJsonRpcRequest`](FundAccountJsonRpcRequest.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`FundAccountJsonRpcRequest`](FundAccountJsonRpcRequest.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/H256Le.md b/interfaces/H256Le.md new file mode 100644 index 000000000..ef65adcfa --- /dev/null +++ b/interfaces/H256Le.md @@ -0,0 +1,1381 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / H256Le + +# Interface: H256Le + +**`Name`** + +H256Le + +## Hierarchy + +- `H256` + + ↳ **`H256Le`** + +## Table of contents + +### Properties + +- [BYTES\_PER\_ELEMENT](H256Le.md#bytes_per_element) +- [[toStringTag]](H256Le.md#[tostringtag]) +- [buffer](H256Le.md#buffer) +- [byteLength](H256Le.md#bytelength) +- [byteOffset](H256Le.md#byteoffset) +- [createdAtHash](H256Le.md#createdathash) +- [initialU8aLength](H256Le.md#initialu8alength) +- [isStorageFallback](H256Le.md#isstoragefallback) +- [length](H256Le.md#length) +- [registry](H256Le.md#registry) + +### Accessors + +- [encodedLength](H256Le.md#encodedlength) +- [hash](H256Le.md#hash) +- [isAscii](H256Le.md#isascii) +- [isEmpty](H256Le.md#isempty) +- [isUtf8](H256Le.md#isutf8) + +### Methods + +- [[iterator]](H256Le.md#[iterator]) +- [at](H256Le.md#at) +- [bitLength](H256Le.md#bitlength) +- [copyWithin](H256Le.md#copywithin) +- [entries](H256Le.md#entries) +- [eq](H256Le.md#eq) +- [every](H256Le.md#every) +- [fill](H256Le.md#fill) +- [filter](H256Le.md#filter) +- [find](H256Le.md#find) +- [findIndex](H256Le.md#findindex) +- [forEach](H256Le.md#foreach) +- [includes](H256Le.md#includes) +- [indexOf](H256Le.md#indexof) +- [inspect](H256Le.md#inspect) +- [join](H256Le.md#join) +- [keys](H256Le.md#keys) +- [lastIndexOf](H256Le.md#lastindexof) +- [map](H256Le.md#map) +- [reduce](H256Le.md#reduce) +- [reduceRight](H256Le.md#reduceright) +- [reverse](H256Le.md#reverse) +- [set](H256Le.md#set) +- [slice](H256Le.md#slice) +- [some](H256Le.md#some) +- [sort](H256Le.md#sort) +- [subarray](H256Le.md#subarray) +- [toHex](H256Le.md#tohex) +- [toHuman](H256Le.md#tohuman) +- [toJSON](H256Le.md#tojson) +- [toLocaleString](H256Le.md#tolocalestring) +- [toPrimitive](H256Le.md#toprimitive) +- [toRawType](H256Le.md#torawtype) +- [toString](H256Le.md#tostring) +- [toU8a](H256Le.md#tou8a) +- [toUtf8](H256Le.md#toutf8) +- [valueOf](H256Le.md#valueof) +- [values](H256Le.md#values) + +## Properties + +### BYTES\_PER\_ELEMENT + +• `Readonly` **BYTES\_PER\_ELEMENT**: `number` + +The size in bytes of each element in the array. + +#### Inherited from + +H256.BYTES\_PER\_ELEMENT + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2129 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: ``"Uint8Array"`` + +#### Inherited from + +H256.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:284 + +___ + +### buffer + +• `Readonly` **buffer**: `ArrayBufferLike` + +The ArrayBuffer instance referenced by the array. + +#### Inherited from + +H256.buffer + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2134 + +___ + +### byteLength + +• `Readonly` **byteLength**: `number` + +The length in bytes of the array. + +#### Inherited from + +H256.byteLength + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2139 + +___ + +### byteOffset + +• `Readonly` **byteOffset**: `number` + +The offset in bytes of the array. + +#### Inherited from + +H256.byteOffset + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2144 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +H256.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +H256.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:15 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +H256.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:16 + +___ + +### length + +• `Readonly` **length**: `number` + +The length of the array. + +#### Inherited from + +H256.length + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2243 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +H256.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:13 + +## Accessors + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +H256.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:26 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +H256.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:30 + +___ + +### isAscii + +• `get` **isAscii**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Returns true if the wrapped value contains only ASCII printable characters + +#### Inherited from + +H256.isAscii + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:34 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Returns true if the type wraps an empty/default all-0 value + +#### Inherited from + +H256.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:38 + +___ + +### isUtf8 + +• `get` **isUtf8**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Returns true if the wrapped value contains only utf8 characters + +#### Inherited from + +H256.isUtf8 + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<`number`\> + +#### Returns + +`IterableIterator`<`number`\> + +#### Inherited from + +H256.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:270 + +___ + +### at + +▸ **at**(`index`): `undefined` \| `number` + +Takes an integer value and returns the item at that index, +allowing for positive and negative integers. +Negative integers count back from the last item in the array. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`undefined` \| `number` + +#### Inherited from + +H256.at + +#### Defined in + +node_modules/@types/node/globals.d.ts:94 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +H256.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:46 + +___ + +### copyWithin + +▸ **copyWithin**(`target`, `start`, `end?`): [`H256Le`](H256Le.md) + +Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `target` | `number` | If target is negative, it is treated as length+target where length is the length of the array. | +| `start` | `number` | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. | +| `end?` | `number` | If not specified, length of the this object is used as its default value. | + +#### Returns + +[`H256Le`](H256Le.md) + +#### Inherited from + +H256.copyWithin + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2155 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`number`, `number`]\> + +Returns an array of key, value pairs for every entry in the array + +#### Returns + +`IterableIterator`<[`number`, `number`]\> + +#### Inherited from + +H256.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:274 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +H256.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:50 + +___ + +### every + +▸ **every**(`predicate`, `thisArg?`): `boolean` + +Determines whether all the members of an array satisfy the specified test. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `unknown` | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`boolean` + +#### Inherited from + +H256.every + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2165 + +___ + +### fill + +▸ **fill**(`value`, `start?`, `end?`): [`H256Le`](H256Le.md) + +Changes all array elements from `start` to `end` index to a static `value` and returns the modified array + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `value` | `number` | value to fill array section with | +| `start?` | `number` | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. | +| `end?` | `number` | index to stop filling the array at. If end is negative, it is treated as length+end. | + +#### Returns + +[`H256Le`](H256Le.md) + +#### Inherited from + +H256.fill + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2175 + +___ + +### filter + +▸ **filter**(`predicate`, `thisArg?`): `Uint8Array` + +Returns the elements of an array that meet the condition specified in a callback function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `any` | A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`Uint8Array` + +#### Inherited from + +H256.filter + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2184 + +___ + +### find + +▸ **find**(`predicate`, `thisArg?`): `undefined` \| `number` + +Returns the value of the first element in the array where predicate is true, and undefined +otherwise. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: `number`, `index`: `number`, `obj`: `Uint8Array`) => `boolean` | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. | +| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +#### Returns + +`undefined` \| `number` + +#### Inherited from + +H256.find + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2195 + +___ + +### findIndex + +▸ **findIndex**(`predicate`, `thisArg?`): `number` + +Returns the index of the first element in the array where predicate is true, and -1 +otherwise. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: `number`, `index`: `number`, `obj`: `Uint8Array`) => `boolean` | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. | +| `thisArg?` | `any` | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +#### Returns + +`number` + +#### Inherited from + +H256.findIndex + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2206 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Performs the specified action for each element in an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `void` | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`void` + +#### Inherited from + +H256.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2215 + +___ + +### includes + +▸ **includes**(`searchElement`, `fromIndex?`): `boolean` + +Determines whether an array includes a certain element, returning true or false as appropriate. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `searchElement` | `number` | The element to search for. | +| `fromIndex?` | `number` | The position in this array at which to begin searching for searchElement. | + +#### Returns + +`boolean` + +#### Inherited from + +H256.includes + +#### Defined in + +node_modules/typescript/lib/lib.es2016.array.include.d.ts:52 + +___ + +### indexOf + +▸ **indexOf**(`searchElement`, `fromIndex?`): `number` + +Returns the index of the first occurrence of a value in an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `searchElement` | `number` | The value to locate in the array. | +| `fromIndex?` | `number` | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +#### Returns + +`number` + +#### Inherited from + +H256.indexOf + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2223 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +H256.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:54 + +___ + +### join + +▸ **join**(`separator?`): `string` + +Adds all the elements of an array separated by the specified separator string. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `separator?` | `string` | A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. | + +#### Returns + +`string` + +#### Inherited from + +H256.join + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2230 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`number`\> + +Returns an list of keys in the array + +#### Returns + +`IterableIterator`<`number`\> + +#### Inherited from + +H256.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:278 + +___ + +### lastIndexOf + +▸ **lastIndexOf**(`searchElement`, `fromIndex?`): `number` + +Returns the index of the last occurrence of a value in an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `searchElement` | `number` | The value to locate in the array. | +| `fromIndex?` | `number` | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +#### Returns + +`number` + +#### Inherited from + +H256.lastIndexOf + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2238 + +___ + +### map + +▸ **map**(`callbackfn`, `thisArg?`): `Uint8Array` + +Calls a defined callback function on each element of an array, and returns an array that +contains the results. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `number` | A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`Uint8Array` + +#### Inherited from + +H256.map + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2253 + +___ + +### reduce + +▸ **reduce**(`callbackfn`): `number` + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number` | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | + +#### Returns + +`number` + +#### Inherited from + +H256.reduce + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2265 + +▸ **reduce**(`callbackfn`, `initialValue`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number` | +| `initialValue` | `number` | + +#### Returns + +`number` + +#### Inherited from + +H256.reduce + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2266 + +▸ **reduce**<`U`\>(`callbackfn`, `initialValue`): `U` + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Type parameters + +| Name | +| :------ | +| `U` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: `U`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `U` | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | +| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +#### Returns + +`U` + +#### Inherited from + +H256.reduce + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2278 + +___ + +### reduceRight + +▸ **reduceRight**(`callbackfn`): `number` + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number` | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | + +#### Returns + +`number` + +#### Inherited from + +H256.reduceRight + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2290 + +▸ **reduceRight**(`callbackfn`, `initialValue`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`previousValue`: `number`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `number` | +| `initialValue` | `number` | + +#### Returns + +`number` + +#### Inherited from + +H256.reduceRight + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2291 + +▸ **reduceRight**<`U`\>(`callbackfn`, `initialValue`): `U` + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Type parameters + +| Name | +| :------ | +| `U` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callbackfn` | (`previousValue`: `U`, `currentValue`: `number`, `currentIndex`: `number`, `array`: `Uint8Array`) => `U` | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | +| `initialValue` | `U` | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +#### Returns + +`U` + +#### Inherited from + +H256.reduceRight + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2303 + +___ + +### reverse + +▸ **reverse**(): `Uint8Array` + +Reverses the elements in an Array. + +#### Returns + +`Uint8Array` + +#### Inherited from + +H256.reverse + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2308 + +___ + +### set + +▸ **set**(`array`, `offset?`): `void` + +Sets a value or an array of values. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `array` | `ArrayLike`<`number`\> | A typed or untyped array of values to set. | +| `offset?` | `number` | The index in the current array at which the values are to be written. | + +#### Returns + +`void` + +#### Inherited from + +H256.set + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2315 + +___ + +### slice + +▸ **slice**(`start?`, `end?`): `Uint8Array` + +Returns a section of an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `start?` | `number` | The beginning of the specified portion of the array. | +| `end?` | `number` | The end of the specified portion of the array. This is exclusive of the element at the index 'end'. | + +#### Returns + +`Uint8Array` + +#### Inherited from + +H256.slice + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2322 + +___ + +### some + +▸ **some**(`predicate`, `thisArg?`): `boolean` + +Determines whether the specified callback function returns true for any element of an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `predicate` | (`value`: `number`, `index`: `number`, `array`: `Uint8Array`) => `unknown` | A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. | +| `thisArg?` | `any` | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +#### Returns + +`boolean` + +#### Inherited from + +H256.some + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2332 + +___ + +### sort + +▸ **sort**(`compareFn?`): [`H256Le`](H256Le.md) + +Sorts an array. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `compareFn?` | (`a`: `number`, `b`: `number`) => `number` | Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` | + +#### Returns + +[`H256Le`](H256Le.md) + +#### Inherited from + +H256.sort + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2343 + +___ + +### subarray + +▸ **subarray**(`begin?`, `end?`): `Uint8Array` + +Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements +at begin, inclusive, up to end, exclusive. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `begin?` | `number` | The index of the beginning of the array. | +| `end?` | `number` | The index of the end of the array. | + +#### Returns + +`Uint8Array` + +#### Inherited from + +H256.subarray + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2351 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +H256.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:58 + +___ + +### toHuman + +▸ **toHuman**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +H256.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:62 + +___ + +### toJSON + +▸ **toJSON**(): `string` + +#### Returns + +`string` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +H256.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:66 + +___ + +### toLocaleString + +▸ **toLocaleString**(): `string` + +Converts a number to a string by using the current locale. + +#### Returns + +`string` + +#### Inherited from + +H256.toLocaleString + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2356 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +H256.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:70 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +H256.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/extended/U8aFixed.d.ts:15 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +H256.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:78 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +H256.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:83 + +___ + +### toUtf8 + +▸ **toUtf8**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the wrapped data as a UTF-8 string + +#### Inherited from + +H256.toUtf8 + +#### Defined in + +node_modules/@polkadot/types-codec/native/Raw.d.ts:87 + +___ + +### valueOf + +▸ **valueOf**(): `Uint8Array` + +Returns the primitive value of the specified object. + +#### Returns + +`Uint8Array` + +#### Inherited from + +H256.valueOf + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:2364 + +___ + +### values + +▸ **values**(): `IterableIterator`<`number`\> + +Returns an list of values in the array + +#### Returns + +`IterableIterator`<`number`\> + +#### Inherited from + +H256.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:282 diff --git a/interfaces/InterBtcApi.md b/interfaces/InterBtcApi.md new file mode 100644 index 000000000..323e2db8f --- /dev/null +++ b/interfaces/InterBtcApi.md @@ -0,0 +1,332 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterBtcApi + +# Interface: InterBtcApi + +## Implemented by + +- [`DefaultInterBtcApi`](../classes/DefaultInterBtcApi.md) + +## Table of contents + +### Properties + +- [account](InterBtcApi.md#account) +- [amm](InterBtcApi.md#amm) +- [api](InterBtcApi.md#api) +- [assetRegistry](InterBtcApi.md#assetregistry) +- [btcRelay](InterBtcApi.md#btcrelay) +- [electrsAPI](InterBtcApi.md#electrsapi) +- [escrow](InterBtcApi.md#escrow) +- [faucet](InterBtcApi.md#faucet) +- [fee](InterBtcApi.md#fee) +- [issue](InterBtcApi.md#issue) +- [loans](InterBtcApi.md#loans) +- [nomination](InterBtcApi.md#nomination) +- [oracle](InterBtcApi.md#oracle) +- [redeem](InterBtcApi.md#redeem) +- [replace](InterBtcApi.md#replace) +- [rewards](InterBtcApi.md#rewards) +- [system](InterBtcApi.md#system) +- [tokens](InterBtcApi.md#tokens) +- [transaction](InterBtcApi.md#transaction) +- [vaults](InterBtcApi.md#vaults) + +### Methods + +- [disconnect](InterBtcApi.md#disconnect) +- [getGovernanceCurrency](InterBtcApi.md#getgovernancecurrency) +- [getRelayChainCurrency](InterBtcApi.md#getrelaychaincurrency) +- [getWrappedCurrency](InterBtcApi.md#getwrappedcurrency) +- [removeAccount](InterBtcApi.md#removeaccount) +- [setAccount](InterBtcApi.md#setaccount) + +## Properties + +### account + +• `Readonly` **account**: `undefined` \| `AddressOrPair` + +#### Defined in + +[src/interbtc-api.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L65) + +___ + +### amm + +• `Readonly` **amm**: [`AMMAPI`](AMMAPI.md) + +#### Defined in + +[src/interbtc-api.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L61) + +___ + +### api + +• `Readonly` **api**: `ApiPromise` + +#### Defined in + +[src/interbtc-api.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L44) + +___ + +### assetRegistry + +• `Readonly` **assetRegistry**: [`AssetRegistryAPI`](AssetRegistryAPI.md) + +#### Defined in + +[src/interbtc-api.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L59) + +___ + +### btcRelay + +• `Readonly` **btcRelay**: [`BTCRelayAPI`](BTCRelayAPI.md) + +#### Defined in + +[src/interbtc-api.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L51) + +___ + +### electrsAPI + +• `Readonly` **electrsAPI**: [`ElectrsAPI`](ElectrsAPI.md) + +#### Defined in + +[src/interbtc-api.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L50) + +___ + +### escrow + +• `Readonly` **escrow**: [`EscrowAPI`](EscrowAPI.md) + +#### Defined in + +[src/interbtc-api.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L58) + +___ + +### faucet + +• `Readonly` **faucet**: [`FaucetClient`](../classes/FaucetClient.md) + +#### Defined in + +[src/interbtc-api.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L48) + +___ + +### fee + +• `Readonly` **fee**: [`FeeAPI`](FeeAPI.md) + +#### Defined in + +[src/interbtc-api.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L55) + +___ + +### issue + +• `Readonly` **issue**: [`IssueAPI`](IssueAPI.md) + +#### Defined in + +[src/interbtc-api.ts:46](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L46) + +___ + +### loans + +• `Readonly` **loans**: [`LoansAPI`](LoansAPI.md) + +#### Defined in + +[src/interbtc-api.ts:60](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L60) + +___ + +### nomination + +• `Readonly` **nomination**: [`NominationAPI`](NominationAPI.md) + +#### Defined in + +[src/interbtc-api.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L56) + +___ + +### oracle + +• `Readonly` **oracle**: [`OracleAPI`](OracleAPI.md) + +#### Defined in + +[src/interbtc-api.ts:49](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L49) + +___ + +### redeem + +• `Readonly` **redeem**: [`RedeemAPI`](RedeemAPI.md) + +#### Defined in + +[src/interbtc-api.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L47) + +___ + +### replace + +• `Readonly` **replace**: [`ReplaceAPI`](ReplaceAPI.md) + +#### Defined in + +[src/interbtc-api.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L54) + +___ + +### rewards + +• `Readonly` **rewards**: [`RewardsAPI`](RewardsAPI.md) + +#### Defined in + +[src/interbtc-api.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L57) + +___ + +### system + +• `Readonly` **system**: [`SystemAPI`](SystemAPI.md) + +#### Defined in + +[src/interbtc-api.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L53) + +___ + +### tokens + +• `Readonly` **tokens**: [`TokensAPI`](TokensAPI.md) + +#### Defined in + +[src/interbtc-api.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L52) + +___ + +### transaction + +• `Readonly` **transaction**: [`TransactionAPI`](TransactionAPI.md) + +#### Defined in + +[src/interbtc-api.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L62) + +___ + +### vaults + +• `Readonly` **vaults**: [`VaultsAPI`](VaultsAPI.md) + +#### Defined in + +[src/interbtc-api.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L45) + +## Methods + +### disconnect + +▸ **disconnect**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/interbtc-api.ts:69](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L69) + +___ + +### getGovernanceCurrency + +▸ **getGovernanceCurrency**(): `Currency` + +#### Returns + +`Currency` + +#### Defined in + +[src/interbtc-api.ts:66](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L66) + +___ + +### getRelayChainCurrency + +▸ **getRelayChainCurrency**(): `Currency` + +#### Returns + +`Currency` + +#### Defined in + +[src/interbtc-api.ts:68](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L68) + +___ + +### getWrappedCurrency + +▸ **getWrappedCurrency**(): `Currency` + +#### Returns + +`Currency` + +#### Defined in + +[src/interbtc-api.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L67) + +___ + +### removeAccount + +▸ **removeAccount**(): `void` + +#### Returns + +`void` + +#### Defined in + +[src/interbtc-api.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L64) + +___ + +### setAccount + +▸ **setAccount**(`account`, `signer?`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `AddressOrPair` | +| `signer?` | `Signer` | + +#### Returns + +`void` + +#### Defined in + +[src/interbtc-api.ts:63](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L63) diff --git a/interfaces/InterbtcForeignAssetId.md b/interfaces/InterbtcForeignAssetId.md new file mode 100644 index 000000000..345770dea --- /dev/null +++ b/interfaces/InterbtcForeignAssetId.md @@ -0,0 +1,2947 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcForeignAssetId + +# Interface: InterbtcForeignAssetId + +**`Name`** + +InterbtcForeignAssetId + +## Hierarchy + +- `u32` + + ↳ **`InterbtcForeignAssetId`** + +## Table of contents + +### Properties + +- [#private](InterbtcForeignAssetId.md##private) +- [\_\_UIntType](InterbtcForeignAssetId.md#__uinttype) +- [createdAtHash](InterbtcForeignAssetId.md#createdathash) +- [encodedLength](InterbtcForeignAssetId.md#encodedlength) +- [initialU8aLength](InterbtcForeignAssetId.md#initialu8alength) +- [isStorageFallback](InterbtcForeignAssetId.md#isstoragefallback) +- [isUnsigned](InterbtcForeignAssetId.md#isunsigned) +- [registry](InterbtcForeignAssetId.md#registry) + +### Accessors + +- [hash](InterbtcForeignAssetId.md#hash) +- [isEmpty](InterbtcForeignAssetId.md#isempty) + +### Methods + +- [abs](InterbtcForeignAssetId.md#abs) +- [add](InterbtcForeignAssetId.md#add) +- [addn](InterbtcForeignAssetId.md#addn) +- [and](InterbtcForeignAssetId.md#and) +- [andln](InterbtcForeignAssetId.md#andln) +- [bincn](InterbtcForeignAssetId.md#bincn) +- [bitLength](InterbtcForeignAssetId.md#bitlength) +- [byteLength](InterbtcForeignAssetId.md#bytelength) +- [clone](InterbtcForeignAssetId.md#clone) +- [cmp](InterbtcForeignAssetId.md#cmp) +- [cmpn](InterbtcForeignAssetId.md#cmpn) +- [div](InterbtcForeignAssetId.md#div) +- [divRound](InterbtcForeignAssetId.md#divround) +- [divmod](InterbtcForeignAssetId.md#divmod) +- [divn](InterbtcForeignAssetId.md#divn) +- [egcd](InterbtcForeignAssetId.md#egcd) +- [eq](InterbtcForeignAssetId.md#eq) +- [eqn](InterbtcForeignAssetId.md#eqn) +- [fromTwos](InterbtcForeignAssetId.md#fromtwos) +- [gcd](InterbtcForeignAssetId.md#gcd) +- [gt](InterbtcForeignAssetId.md#gt) +- [gte](InterbtcForeignAssetId.md#gte) +- [gten](InterbtcForeignAssetId.md#gten) +- [gtn](InterbtcForeignAssetId.md#gtn) +- [iabs](InterbtcForeignAssetId.md#iabs) +- [iadd](InterbtcForeignAssetId.md#iadd) +- [iaddn](InterbtcForeignAssetId.md#iaddn) +- [iand](InterbtcForeignAssetId.md#iand) +- [idivn](InterbtcForeignAssetId.md#idivn) +- [imaskn](InterbtcForeignAssetId.md#imaskn) +- [imul](InterbtcForeignAssetId.md#imul) +- [imuln](InterbtcForeignAssetId.md#imuln) +- [ineg](InterbtcForeignAssetId.md#ineg) +- [inotn](InterbtcForeignAssetId.md#inotn) +- [inspect](InterbtcForeignAssetId.md#inspect) +- [invm](InterbtcForeignAssetId.md#invm) +- [ior](InterbtcForeignAssetId.md#ior) +- [isEven](InterbtcForeignAssetId.md#iseven) +- [isMax](InterbtcForeignAssetId.md#ismax) +- [isNeg](InterbtcForeignAssetId.md#isneg) +- [isOdd](InterbtcForeignAssetId.md#isodd) +- [isZero](InterbtcForeignAssetId.md#iszero) +- [ishln](InterbtcForeignAssetId.md#ishln) +- [ishrn](InterbtcForeignAssetId.md#ishrn) +- [isqr](InterbtcForeignAssetId.md#isqr) +- [isub](InterbtcForeignAssetId.md#isub) +- [isubn](InterbtcForeignAssetId.md#isubn) +- [iuand](InterbtcForeignAssetId.md#iuand) +- [iuor](InterbtcForeignAssetId.md#iuor) +- [iushln](InterbtcForeignAssetId.md#iushln) +- [iushrn](InterbtcForeignAssetId.md#iushrn) +- [iuxor](InterbtcForeignAssetId.md#iuxor) +- [ixor](InterbtcForeignAssetId.md#ixor) +- [lt](InterbtcForeignAssetId.md#lt) +- [lte](InterbtcForeignAssetId.md#lte) +- [lten](InterbtcForeignAssetId.md#lten) +- [ltn](InterbtcForeignAssetId.md#ltn) +- [maskn](InterbtcForeignAssetId.md#maskn) +- [mod](InterbtcForeignAssetId.md#mod) +- [modn](InterbtcForeignAssetId.md#modn) +- [modrn](InterbtcForeignAssetId.md#modrn) +- [mul](InterbtcForeignAssetId.md#mul) +- [muln](InterbtcForeignAssetId.md#muln) +- [neg](InterbtcForeignAssetId.md#neg) +- [notn](InterbtcForeignAssetId.md#notn) +- [or](InterbtcForeignAssetId.md#or) +- [pow](InterbtcForeignAssetId.md#pow) +- [setn](InterbtcForeignAssetId.md#setn) +- [shln](InterbtcForeignAssetId.md#shln) +- [shrn](InterbtcForeignAssetId.md#shrn) +- [sqr](InterbtcForeignAssetId.md#sqr) +- [sub](InterbtcForeignAssetId.md#sub) +- [subn](InterbtcForeignAssetId.md#subn) +- [testn](InterbtcForeignAssetId.md#testn) +- [toArray](InterbtcForeignAssetId.md#toarray) +- [toArrayLike](InterbtcForeignAssetId.md#toarraylike) +- [toBigInt](InterbtcForeignAssetId.md#tobigint) +- [toBn](InterbtcForeignAssetId.md#tobn) +- [toBuffer](InterbtcForeignAssetId.md#tobuffer) +- [toHex](InterbtcForeignAssetId.md#tohex) +- [toHuman](InterbtcForeignAssetId.md#tohuman) +- [toJSON](InterbtcForeignAssetId.md#tojson) +- [toNumber](InterbtcForeignAssetId.md#tonumber) +- [toPrimitive](InterbtcForeignAssetId.md#toprimitive) +- [toRawType](InterbtcForeignAssetId.md#torawtype) +- [toRed](InterbtcForeignAssetId.md#tored) +- [toString](InterbtcForeignAssetId.md#tostring) +- [toTwos](InterbtcForeignAssetId.md#totwos) +- [toU8a](InterbtcForeignAssetId.md#tou8a) +- [uand](InterbtcForeignAssetId.md#uand) +- [ucmp](InterbtcForeignAssetId.md#ucmp) +- [umod](InterbtcForeignAssetId.md#umod) +- [uor](InterbtcForeignAssetId.md#uor) +- [ushln](InterbtcForeignAssetId.md#ushln) +- [ushrn](InterbtcForeignAssetId.md#ushrn) +- [uxor](InterbtcForeignAssetId.md#uxor) +- [xor](InterbtcForeignAssetId.md#xor) +- [zeroBits](InterbtcForeignAssetId.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +u32.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### \_\_UIntType + +• `Readonly` **\_\_UIntType**: ``"u32"`` + +#### Inherited from + +u32.\_\_UIntType + +#### Defined in + +node_modules/@polkadot/types-codec/primitive/U32.d.ts:9 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +u32.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +u32.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +u32.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +u32.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +u32.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +u32.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +u32.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +u32.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +u32.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +u32.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +u32.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +u32.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +u32.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +u32.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +u32.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +u32.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +u32.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +u32.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +u32.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +u32.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +u32.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +u32.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +u32.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +u32.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +u32.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +u32.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +u32.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +u32.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +u32.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +u32.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +u32.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +u32.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +u32.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +u32.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +u32.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +u32.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +u32.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +u32.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +u32.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +u32.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +u32.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +u32.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +u32.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +u32.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +u32.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +u32.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +u32.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +u32.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/InterbtcLendTokenId.md b/interfaces/InterbtcLendTokenId.md new file mode 100644 index 000000000..3980f5a5b --- /dev/null +++ b/interfaces/InterbtcLendTokenId.md @@ -0,0 +1,2947 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcLendTokenId + +# Interface: InterbtcLendTokenId + +**`Name`** + +InterbtcLendTokenId + +## Hierarchy + +- `u32` + + ↳ **`InterbtcLendTokenId`** + +## Table of contents + +### Properties + +- [#private](InterbtcLendTokenId.md##private) +- [\_\_UIntType](InterbtcLendTokenId.md#__uinttype) +- [createdAtHash](InterbtcLendTokenId.md#createdathash) +- [encodedLength](InterbtcLendTokenId.md#encodedlength) +- [initialU8aLength](InterbtcLendTokenId.md#initialu8alength) +- [isStorageFallback](InterbtcLendTokenId.md#isstoragefallback) +- [isUnsigned](InterbtcLendTokenId.md#isunsigned) +- [registry](InterbtcLendTokenId.md#registry) + +### Accessors + +- [hash](InterbtcLendTokenId.md#hash) +- [isEmpty](InterbtcLendTokenId.md#isempty) + +### Methods + +- [abs](InterbtcLendTokenId.md#abs) +- [add](InterbtcLendTokenId.md#add) +- [addn](InterbtcLendTokenId.md#addn) +- [and](InterbtcLendTokenId.md#and) +- [andln](InterbtcLendTokenId.md#andln) +- [bincn](InterbtcLendTokenId.md#bincn) +- [bitLength](InterbtcLendTokenId.md#bitlength) +- [byteLength](InterbtcLendTokenId.md#bytelength) +- [clone](InterbtcLendTokenId.md#clone) +- [cmp](InterbtcLendTokenId.md#cmp) +- [cmpn](InterbtcLendTokenId.md#cmpn) +- [div](InterbtcLendTokenId.md#div) +- [divRound](InterbtcLendTokenId.md#divround) +- [divmod](InterbtcLendTokenId.md#divmod) +- [divn](InterbtcLendTokenId.md#divn) +- [egcd](InterbtcLendTokenId.md#egcd) +- [eq](InterbtcLendTokenId.md#eq) +- [eqn](InterbtcLendTokenId.md#eqn) +- [fromTwos](InterbtcLendTokenId.md#fromtwos) +- [gcd](InterbtcLendTokenId.md#gcd) +- [gt](InterbtcLendTokenId.md#gt) +- [gte](InterbtcLendTokenId.md#gte) +- [gten](InterbtcLendTokenId.md#gten) +- [gtn](InterbtcLendTokenId.md#gtn) +- [iabs](InterbtcLendTokenId.md#iabs) +- [iadd](InterbtcLendTokenId.md#iadd) +- [iaddn](InterbtcLendTokenId.md#iaddn) +- [iand](InterbtcLendTokenId.md#iand) +- [idivn](InterbtcLendTokenId.md#idivn) +- [imaskn](InterbtcLendTokenId.md#imaskn) +- [imul](InterbtcLendTokenId.md#imul) +- [imuln](InterbtcLendTokenId.md#imuln) +- [ineg](InterbtcLendTokenId.md#ineg) +- [inotn](InterbtcLendTokenId.md#inotn) +- [inspect](InterbtcLendTokenId.md#inspect) +- [invm](InterbtcLendTokenId.md#invm) +- [ior](InterbtcLendTokenId.md#ior) +- [isEven](InterbtcLendTokenId.md#iseven) +- [isMax](InterbtcLendTokenId.md#ismax) +- [isNeg](InterbtcLendTokenId.md#isneg) +- [isOdd](InterbtcLendTokenId.md#isodd) +- [isZero](InterbtcLendTokenId.md#iszero) +- [ishln](InterbtcLendTokenId.md#ishln) +- [ishrn](InterbtcLendTokenId.md#ishrn) +- [isqr](InterbtcLendTokenId.md#isqr) +- [isub](InterbtcLendTokenId.md#isub) +- [isubn](InterbtcLendTokenId.md#isubn) +- [iuand](InterbtcLendTokenId.md#iuand) +- [iuor](InterbtcLendTokenId.md#iuor) +- [iushln](InterbtcLendTokenId.md#iushln) +- [iushrn](InterbtcLendTokenId.md#iushrn) +- [iuxor](InterbtcLendTokenId.md#iuxor) +- [ixor](InterbtcLendTokenId.md#ixor) +- [lt](InterbtcLendTokenId.md#lt) +- [lte](InterbtcLendTokenId.md#lte) +- [lten](InterbtcLendTokenId.md#lten) +- [ltn](InterbtcLendTokenId.md#ltn) +- [maskn](InterbtcLendTokenId.md#maskn) +- [mod](InterbtcLendTokenId.md#mod) +- [modn](InterbtcLendTokenId.md#modn) +- [modrn](InterbtcLendTokenId.md#modrn) +- [mul](InterbtcLendTokenId.md#mul) +- [muln](InterbtcLendTokenId.md#muln) +- [neg](InterbtcLendTokenId.md#neg) +- [notn](InterbtcLendTokenId.md#notn) +- [or](InterbtcLendTokenId.md#or) +- [pow](InterbtcLendTokenId.md#pow) +- [setn](InterbtcLendTokenId.md#setn) +- [shln](InterbtcLendTokenId.md#shln) +- [shrn](InterbtcLendTokenId.md#shrn) +- [sqr](InterbtcLendTokenId.md#sqr) +- [sub](InterbtcLendTokenId.md#sub) +- [subn](InterbtcLendTokenId.md#subn) +- [testn](InterbtcLendTokenId.md#testn) +- [toArray](InterbtcLendTokenId.md#toarray) +- [toArrayLike](InterbtcLendTokenId.md#toarraylike) +- [toBigInt](InterbtcLendTokenId.md#tobigint) +- [toBn](InterbtcLendTokenId.md#tobn) +- [toBuffer](InterbtcLendTokenId.md#tobuffer) +- [toHex](InterbtcLendTokenId.md#tohex) +- [toHuman](InterbtcLendTokenId.md#tohuman) +- [toJSON](InterbtcLendTokenId.md#tojson) +- [toNumber](InterbtcLendTokenId.md#tonumber) +- [toPrimitive](InterbtcLendTokenId.md#toprimitive) +- [toRawType](InterbtcLendTokenId.md#torawtype) +- [toRed](InterbtcLendTokenId.md#tored) +- [toString](InterbtcLendTokenId.md#tostring) +- [toTwos](InterbtcLendTokenId.md#totwos) +- [toU8a](InterbtcLendTokenId.md#tou8a) +- [uand](InterbtcLendTokenId.md#uand) +- [ucmp](InterbtcLendTokenId.md#ucmp) +- [umod](InterbtcLendTokenId.md#umod) +- [uor](InterbtcLendTokenId.md#uor) +- [ushln](InterbtcLendTokenId.md#ushln) +- [ushrn](InterbtcLendTokenId.md#ushrn) +- [uxor](InterbtcLendTokenId.md#uxor) +- [xor](InterbtcLendTokenId.md#xor) +- [zeroBits](InterbtcLendTokenId.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +u32.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### \_\_UIntType + +• `Readonly` **\_\_UIntType**: ``"u32"`` + +#### Inherited from + +u32.\_\_UIntType + +#### Defined in + +node_modules/@polkadot/types-codec/primitive/U32.d.ts:9 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +u32.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +u32.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +u32.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +u32.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +u32.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +u32.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +u32.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +u32.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +u32.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +u32.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +u32.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +u32.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +u32.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +u32.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +u32.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +u32.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +u32.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +u32.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +u32.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +u32.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +u32.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +u32.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +u32.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +u32.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +u32.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +u32.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +u32.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +u32.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +u32.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +u32.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +u32.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +u32.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +u32.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +u32.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +u32.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +u32.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +u32.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +u32.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +u32.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +u32.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +u32.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +u32.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +u32.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +u32.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +u32.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +u32.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +u32.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +u32.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/InterbtcLpToken.md b/interfaces/InterbtcLpToken.md new file mode 100644 index 000000000..457d7707a --- /dev/null +++ b/interfaces/InterbtcLpToken.md @@ -0,0 +1,681 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcLpToken + +# Interface: InterbtcLpToken + +**`Name`** + +InterbtcLpToken + +## Hierarchy + +- `Enum` + + ↳ **`InterbtcLpToken`** + +## Table of contents + +### Properties + +- [#private](InterbtcLpToken.md##private) +- [asForeignAsset](InterbtcLpToken.md#asforeignasset) +- [asStableLpToken](InterbtcLpToken.md#asstablelptoken) +- [asToken](InterbtcLpToken.md#astoken) +- [createdAtHash](InterbtcLpToken.md#createdathash) +- [initialU8aLength](InterbtcLpToken.md#initialu8alength) +- [isForeignAsset](InterbtcLpToken.md#isforeignasset) +- [isStableLpToken](InterbtcLpToken.md#isstablelptoken) +- [isStorageFallback](InterbtcLpToken.md#isstoragefallback) +- [isToken](InterbtcLpToken.md#istoken) +- [registry](InterbtcLpToken.md#registry) +- [type](InterbtcLpToken.md#type) + +### Accessors + +- [defIndexes](InterbtcLpToken.md#defindexes) +- [defKeys](InterbtcLpToken.md#defkeys) +- [encodedLength](InterbtcLpToken.md#encodedlength) +- [hash](InterbtcLpToken.md#hash) +- [index](InterbtcLpToken.md#index) +- [inner](InterbtcLpToken.md#inner) +- [isBasic](InterbtcLpToken.md#isbasic) +- [isEmpty](InterbtcLpToken.md#isempty) +- [isNone](InterbtcLpToken.md#isnone) +- [value](InterbtcLpToken.md#value) + +### Methods + +- [\_toRawStruct](InterbtcLpToken.md#_torawstruct) +- [eq](InterbtcLpToken.md#eq) +- [inspect](InterbtcLpToken.md#inspect) +- [toHex](InterbtcLpToken.md#tohex) +- [toHuman](InterbtcLpToken.md#tohuman) +- [toJSON](InterbtcLpToken.md#tojson) +- [toNumber](InterbtcLpToken.md#tonumber) +- [toPrimitive](InterbtcLpToken.md#toprimitive) +- [toRawType](InterbtcLpToken.md#torawtype) +- [toString](InterbtcLpToken.md#tostring) +- [toU8a](InterbtcLpToken.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### asForeignAsset + +• `Readonly` **asForeignAsset**: [`InterbtcForeignAssetId`](InterbtcForeignAssetId.md) + +#### Defined in + +src/interfaces/default/types.ts:51 + +___ + +### asStableLpToken + +• `Readonly` **asStableLpToken**: [`InterbtcStablePoolId`](InterbtcStablePoolId.md) + +#### Defined in + +src/interfaces/default/types.ts:53 + +___ + +### asToken + +• `Readonly` **asToken**: [`InterbtcPrimitivesTokenSymbol`](InterbtcPrimitivesTokenSymbol.md) + +#### Defined in + +src/interfaces/default/types.ts:49 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isForeignAsset + +• `Readonly` **isForeignAsset**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:50 + +___ + +### isStableLpToken + +• `Readonly` **isStableLpToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:52 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### isToken + +• `Readonly` **isToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:48 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Token"`` \| ``"ForeignAsset"`` \| ``"StableLpToken"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:54 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/InterbtcPrimitivesCurrencyId.md b/interfaces/InterbtcPrimitivesCurrencyId.md new file mode 100644 index 000000000..6d010cf38 --- /dev/null +++ b/interfaces/InterbtcPrimitivesCurrencyId.md @@ -0,0 +1,725 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcPrimitivesCurrencyId + +# Interface: InterbtcPrimitivesCurrencyId + +**`Name`** + +InterbtcPrimitivesCurrencyId + +## Hierarchy + +- `Enum` + + ↳ **`InterbtcPrimitivesCurrencyId`** + +## Table of contents + +### Properties + +- [#private](InterbtcPrimitivesCurrencyId.md##private) +- [asForeignAsset](InterbtcPrimitivesCurrencyId.md#asforeignasset) +- [asLendToken](InterbtcPrimitivesCurrencyId.md#aslendtoken) +- [asLpToken](InterbtcPrimitivesCurrencyId.md#aslptoken) +- [asStableLpToken](InterbtcPrimitivesCurrencyId.md#asstablelptoken) +- [asToken](InterbtcPrimitivesCurrencyId.md#astoken) +- [createdAtHash](InterbtcPrimitivesCurrencyId.md#createdathash) +- [initialU8aLength](InterbtcPrimitivesCurrencyId.md#initialu8alength) +- [isForeignAsset](InterbtcPrimitivesCurrencyId.md#isforeignasset) +- [isLendToken](InterbtcPrimitivesCurrencyId.md#islendtoken) +- [isLpToken](InterbtcPrimitivesCurrencyId.md#islptoken) +- [isStableLpToken](InterbtcPrimitivesCurrencyId.md#isstablelptoken) +- [isStorageFallback](InterbtcPrimitivesCurrencyId.md#isstoragefallback) +- [isToken](InterbtcPrimitivesCurrencyId.md#istoken) +- [registry](InterbtcPrimitivesCurrencyId.md#registry) +- [type](InterbtcPrimitivesCurrencyId.md#type) + +### Accessors + +- [defIndexes](InterbtcPrimitivesCurrencyId.md#defindexes) +- [defKeys](InterbtcPrimitivesCurrencyId.md#defkeys) +- [encodedLength](InterbtcPrimitivesCurrencyId.md#encodedlength) +- [hash](InterbtcPrimitivesCurrencyId.md#hash) +- [index](InterbtcPrimitivesCurrencyId.md#index) +- [inner](InterbtcPrimitivesCurrencyId.md#inner) +- [isBasic](InterbtcPrimitivesCurrencyId.md#isbasic) +- [isEmpty](InterbtcPrimitivesCurrencyId.md#isempty) +- [isNone](InterbtcPrimitivesCurrencyId.md#isnone) +- [value](InterbtcPrimitivesCurrencyId.md#value) + +### Methods + +- [\_toRawStruct](InterbtcPrimitivesCurrencyId.md#_torawstruct) +- [eq](InterbtcPrimitivesCurrencyId.md#eq) +- [inspect](InterbtcPrimitivesCurrencyId.md#inspect) +- [toHex](InterbtcPrimitivesCurrencyId.md#tohex) +- [toHuman](InterbtcPrimitivesCurrencyId.md#tohuman) +- [toJSON](InterbtcPrimitivesCurrencyId.md#tojson) +- [toNumber](InterbtcPrimitivesCurrencyId.md#tonumber) +- [toPrimitive](InterbtcPrimitivesCurrencyId.md#toprimitive) +- [toRawType](InterbtcPrimitivesCurrencyId.md#torawtype) +- [toString](InterbtcPrimitivesCurrencyId.md#tostring) +- [toU8a](InterbtcPrimitivesCurrencyId.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### asForeignAsset + +• `Readonly` **asForeignAsset**: [`InterbtcForeignAssetId`](InterbtcForeignAssetId.md) + +#### Defined in + +src/interfaces/default/types.ts:62 + +___ + +### asLendToken + +• `Readonly` **asLendToken**: [`InterbtcLendTokenId`](InterbtcLendTokenId.md) + +#### Defined in + +src/interfaces/default/types.ts:64 + +___ + +### asLpToken + +• `Readonly` **asLpToken**: `ITuple`<[[`InterbtcLpToken`](InterbtcLpToken.md), [`InterbtcLpToken`](InterbtcLpToken.md)]\> + +#### Defined in + +src/interfaces/default/types.ts:66 + +___ + +### asStableLpToken + +• `Readonly` **asStableLpToken**: [`InterbtcStablePoolId`](InterbtcStablePoolId.md) + +#### Defined in + +src/interfaces/default/types.ts:68 + +___ + +### asToken + +• `Readonly` **asToken**: [`InterbtcPrimitivesTokenSymbol`](InterbtcPrimitivesTokenSymbol.md) + +#### Defined in + +src/interfaces/default/types.ts:60 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isForeignAsset + +• `Readonly` **isForeignAsset**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:61 + +___ + +### isLendToken + +• `Readonly` **isLendToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:63 + +___ + +### isLpToken + +• `Readonly` **isLpToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:65 + +___ + +### isStableLpToken + +• `Readonly` **isStableLpToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:67 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### isToken + +• `Readonly` **isToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:59 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Token"`` \| ``"ForeignAsset"`` \| ``"LendToken"`` \| ``"LpToken"`` \| ``"StableLpToken"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:69 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/InterbtcPrimitivesTokenSymbol.md b/interfaces/InterbtcPrimitivesTokenSymbol.md new file mode 100644 index 000000000..c4279df07 --- /dev/null +++ b/interfaces/InterbtcPrimitivesTokenSymbol.md @@ -0,0 +1,681 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcPrimitivesTokenSymbol + +# Interface: InterbtcPrimitivesTokenSymbol + +**`Name`** + +InterbtcPrimitivesTokenSymbol + +## Hierarchy + +- `Enum` + + ↳ **`InterbtcPrimitivesTokenSymbol`** + +## Table of contents + +### Properties + +- [#private](InterbtcPrimitivesTokenSymbol.md##private) +- [createdAtHash](InterbtcPrimitivesTokenSymbol.md#createdathash) +- [initialU8aLength](InterbtcPrimitivesTokenSymbol.md#initialu8alength) +- [isDot](InterbtcPrimitivesTokenSymbol.md#isdot) +- [isIbtc](InterbtcPrimitivesTokenSymbol.md#isibtc) +- [isIntr](InterbtcPrimitivesTokenSymbol.md#isintr) +- [isKbtc](InterbtcPrimitivesTokenSymbol.md#iskbtc) +- [isKint](InterbtcPrimitivesTokenSymbol.md#iskint) +- [isKsm](InterbtcPrimitivesTokenSymbol.md#isksm) +- [isStorageFallback](InterbtcPrimitivesTokenSymbol.md#isstoragefallback) +- [registry](InterbtcPrimitivesTokenSymbol.md#registry) +- [type](InterbtcPrimitivesTokenSymbol.md#type) + +### Accessors + +- [defIndexes](InterbtcPrimitivesTokenSymbol.md#defindexes) +- [defKeys](InterbtcPrimitivesTokenSymbol.md#defkeys) +- [encodedLength](InterbtcPrimitivesTokenSymbol.md#encodedlength) +- [hash](InterbtcPrimitivesTokenSymbol.md#hash) +- [index](InterbtcPrimitivesTokenSymbol.md#index) +- [inner](InterbtcPrimitivesTokenSymbol.md#inner) +- [isBasic](InterbtcPrimitivesTokenSymbol.md#isbasic) +- [isEmpty](InterbtcPrimitivesTokenSymbol.md#isempty) +- [isNone](InterbtcPrimitivesTokenSymbol.md#isnone) +- [value](InterbtcPrimitivesTokenSymbol.md#value) + +### Methods + +- [\_toRawStruct](InterbtcPrimitivesTokenSymbol.md#_torawstruct) +- [eq](InterbtcPrimitivesTokenSymbol.md#eq) +- [inspect](InterbtcPrimitivesTokenSymbol.md#inspect) +- [toHex](InterbtcPrimitivesTokenSymbol.md#tohex) +- [toHuman](InterbtcPrimitivesTokenSymbol.md#tohuman) +- [toJSON](InterbtcPrimitivesTokenSymbol.md#tojson) +- [toNumber](InterbtcPrimitivesTokenSymbol.md#tonumber) +- [toPrimitive](InterbtcPrimitivesTokenSymbol.md#toprimitive) +- [toRawType](InterbtcPrimitivesTokenSymbol.md#torawtype) +- [toString](InterbtcPrimitivesTokenSymbol.md#tostring) +- [toU8a](InterbtcPrimitivesTokenSymbol.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isDot + +• `Readonly` **isDot**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:74 + +___ + +### isIbtc + +• `Readonly` **isIbtc**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:75 + +___ + +### isIntr + +• `Readonly` **isIntr**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:76 + +___ + +### isKbtc + +• `Readonly` **isKbtc**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:78 + +___ + +### isKint + +• `Readonly` **isKint**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:79 + +___ + +### isKsm + +• `Readonly` **isKsm**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:77 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Dot"`` \| ``"Ibtc"`` \| ``"Intr"`` \| ``"Ksm"`` \| ``"Kbtc"`` \| ``"Kint"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:80 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/InterbtcPrimitivesVaultId.md b/interfaces/InterbtcPrimitivesVaultId.md new file mode 100644 index 000000000..ac7019a1c --- /dev/null +++ b/interfaces/InterbtcPrimitivesVaultId.md @@ -0,0 +1,826 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcPrimitivesVaultId + +# Interface: InterbtcPrimitivesVaultId + +**`Name`** + +InterbtcPrimitivesVaultId (88) + +## Hierarchy + +- `Struct` + + ↳ **`InterbtcPrimitivesVaultId`** + +## Table of contents + +### Properties + +- [#private](InterbtcPrimitivesVaultId.md##private) +- [[toStringTag]](InterbtcPrimitivesVaultId.md#[tostringtag]) +- [accountId](InterbtcPrimitivesVaultId.md#accountid) +- [createdAtHash](InterbtcPrimitivesVaultId.md#createdathash) +- [currencies](InterbtcPrimitivesVaultId.md#currencies) +- [initialU8aLength](InterbtcPrimitivesVaultId.md#initialu8alength) +- [isStorageFallback](InterbtcPrimitivesVaultId.md#isstoragefallback) +- [registry](InterbtcPrimitivesVaultId.md#registry) +- [size](InterbtcPrimitivesVaultId.md#size) + +### Accessors + +- [Type](InterbtcPrimitivesVaultId.md#type) +- [defKeys](InterbtcPrimitivesVaultId.md#defkeys) +- [encodedLength](InterbtcPrimitivesVaultId.md#encodedlength) +- [hash](InterbtcPrimitivesVaultId.md#hash) +- [isEmpty](InterbtcPrimitivesVaultId.md#isempty) + +### Methods + +- [[iterator]](InterbtcPrimitivesVaultId.md#[iterator]) +- [clear](InterbtcPrimitivesVaultId.md#clear) +- [delete](InterbtcPrimitivesVaultId.md#delete) +- [entries](InterbtcPrimitivesVaultId.md#entries) +- [eq](InterbtcPrimitivesVaultId.md#eq) +- [forEach](InterbtcPrimitivesVaultId.md#foreach) +- [get](InterbtcPrimitivesVaultId.md#get) +- [getAtIndex](InterbtcPrimitivesVaultId.md#getatindex) +- [getT](InterbtcPrimitivesVaultId.md#gett) +- [has](InterbtcPrimitivesVaultId.md#has) +- [inspect](InterbtcPrimitivesVaultId.md#inspect) +- [keys](InterbtcPrimitivesVaultId.md#keys) +- [set](InterbtcPrimitivesVaultId.md#set) +- [toArray](InterbtcPrimitivesVaultId.md#toarray) +- [toHex](InterbtcPrimitivesVaultId.md#tohex) +- [toHuman](InterbtcPrimitivesVaultId.md#tohuman) +- [toJSON](InterbtcPrimitivesVaultId.md#tojson) +- [toPrimitive](InterbtcPrimitivesVaultId.md#toprimitive) +- [toRawType](InterbtcPrimitivesVaultId.md#torawtype) +- [toString](InterbtcPrimitivesVaultId.md#tostring) +- [toU8a](InterbtcPrimitivesVaultId.md#tou8a) +- [values](InterbtcPrimitivesVaultId.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### accountId + +• `Readonly` **accountId**: `AccountId32` + +#### Defined in + +src/interfaces/types-lookup.ts:951 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### currencies + +• `Readonly` **currencies**: `InterbtcPrimitivesVaultCurrencyPair` + +#### Defined in + +src/interfaces/types-lookup.ts:952 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/InterbtcStablePoolId.md b/interfaces/InterbtcStablePoolId.md new file mode 100644 index 000000000..2a327aff7 --- /dev/null +++ b/interfaces/InterbtcStablePoolId.md @@ -0,0 +1,2947 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / InterbtcStablePoolId + +# Interface: InterbtcStablePoolId + +**`Name`** + +InterbtcStablePoolId + +## Hierarchy + +- `u32` + + ↳ **`InterbtcStablePoolId`** + +## Table of contents + +### Properties + +- [#private](InterbtcStablePoolId.md##private) +- [\_\_UIntType](InterbtcStablePoolId.md#__uinttype) +- [createdAtHash](InterbtcStablePoolId.md#createdathash) +- [encodedLength](InterbtcStablePoolId.md#encodedlength) +- [initialU8aLength](InterbtcStablePoolId.md#initialu8alength) +- [isStorageFallback](InterbtcStablePoolId.md#isstoragefallback) +- [isUnsigned](InterbtcStablePoolId.md#isunsigned) +- [registry](InterbtcStablePoolId.md#registry) + +### Accessors + +- [hash](InterbtcStablePoolId.md#hash) +- [isEmpty](InterbtcStablePoolId.md#isempty) + +### Methods + +- [abs](InterbtcStablePoolId.md#abs) +- [add](InterbtcStablePoolId.md#add) +- [addn](InterbtcStablePoolId.md#addn) +- [and](InterbtcStablePoolId.md#and) +- [andln](InterbtcStablePoolId.md#andln) +- [bincn](InterbtcStablePoolId.md#bincn) +- [bitLength](InterbtcStablePoolId.md#bitlength) +- [byteLength](InterbtcStablePoolId.md#bytelength) +- [clone](InterbtcStablePoolId.md#clone) +- [cmp](InterbtcStablePoolId.md#cmp) +- [cmpn](InterbtcStablePoolId.md#cmpn) +- [div](InterbtcStablePoolId.md#div) +- [divRound](InterbtcStablePoolId.md#divround) +- [divmod](InterbtcStablePoolId.md#divmod) +- [divn](InterbtcStablePoolId.md#divn) +- [egcd](InterbtcStablePoolId.md#egcd) +- [eq](InterbtcStablePoolId.md#eq) +- [eqn](InterbtcStablePoolId.md#eqn) +- [fromTwos](InterbtcStablePoolId.md#fromtwos) +- [gcd](InterbtcStablePoolId.md#gcd) +- [gt](InterbtcStablePoolId.md#gt) +- [gte](InterbtcStablePoolId.md#gte) +- [gten](InterbtcStablePoolId.md#gten) +- [gtn](InterbtcStablePoolId.md#gtn) +- [iabs](InterbtcStablePoolId.md#iabs) +- [iadd](InterbtcStablePoolId.md#iadd) +- [iaddn](InterbtcStablePoolId.md#iaddn) +- [iand](InterbtcStablePoolId.md#iand) +- [idivn](InterbtcStablePoolId.md#idivn) +- [imaskn](InterbtcStablePoolId.md#imaskn) +- [imul](InterbtcStablePoolId.md#imul) +- [imuln](InterbtcStablePoolId.md#imuln) +- [ineg](InterbtcStablePoolId.md#ineg) +- [inotn](InterbtcStablePoolId.md#inotn) +- [inspect](InterbtcStablePoolId.md#inspect) +- [invm](InterbtcStablePoolId.md#invm) +- [ior](InterbtcStablePoolId.md#ior) +- [isEven](InterbtcStablePoolId.md#iseven) +- [isMax](InterbtcStablePoolId.md#ismax) +- [isNeg](InterbtcStablePoolId.md#isneg) +- [isOdd](InterbtcStablePoolId.md#isodd) +- [isZero](InterbtcStablePoolId.md#iszero) +- [ishln](InterbtcStablePoolId.md#ishln) +- [ishrn](InterbtcStablePoolId.md#ishrn) +- [isqr](InterbtcStablePoolId.md#isqr) +- [isub](InterbtcStablePoolId.md#isub) +- [isubn](InterbtcStablePoolId.md#isubn) +- [iuand](InterbtcStablePoolId.md#iuand) +- [iuor](InterbtcStablePoolId.md#iuor) +- [iushln](InterbtcStablePoolId.md#iushln) +- [iushrn](InterbtcStablePoolId.md#iushrn) +- [iuxor](InterbtcStablePoolId.md#iuxor) +- [ixor](InterbtcStablePoolId.md#ixor) +- [lt](InterbtcStablePoolId.md#lt) +- [lte](InterbtcStablePoolId.md#lte) +- [lten](InterbtcStablePoolId.md#lten) +- [ltn](InterbtcStablePoolId.md#ltn) +- [maskn](InterbtcStablePoolId.md#maskn) +- [mod](InterbtcStablePoolId.md#mod) +- [modn](InterbtcStablePoolId.md#modn) +- [modrn](InterbtcStablePoolId.md#modrn) +- [mul](InterbtcStablePoolId.md#mul) +- [muln](InterbtcStablePoolId.md#muln) +- [neg](InterbtcStablePoolId.md#neg) +- [notn](InterbtcStablePoolId.md#notn) +- [or](InterbtcStablePoolId.md#or) +- [pow](InterbtcStablePoolId.md#pow) +- [setn](InterbtcStablePoolId.md#setn) +- [shln](InterbtcStablePoolId.md#shln) +- [shrn](InterbtcStablePoolId.md#shrn) +- [sqr](InterbtcStablePoolId.md#sqr) +- [sub](InterbtcStablePoolId.md#sub) +- [subn](InterbtcStablePoolId.md#subn) +- [testn](InterbtcStablePoolId.md#testn) +- [toArray](InterbtcStablePoolId.md#toarray) +- [toArrayLike](InterbtcStablePoolId.md#toarraylike) +- [toBigInt](InterbtcStablePoolId.md#tobigint) +- [toBn](InterbtcStablePoolId.md#tobn) +- [toBuffer](InterbtcStablePoolId.md#tobuffer) +- [toHex](InterbtcStablePoolId.md#tohex) +- [toHuman](InterbtcStablePoolId.md#tohuman) +- [toJSON](InterbtcStablePoolId.md#tojson) +- [toNumber](InterbtcStablePoolId.md#tonumber) +- [toPrimitive](InterbtcStablePoolId.md#toprimitive) +- [toRawType](InterbtcStablePoolId.md#torawtype) +- [toRed](InterbtcStablePoolId.md#tored) +- [toString](InterbtcStablePoolId.md#tostring) +- [toTwos](InterbtcStablePoolId.md#totwos) +- [toU8a](InterbtcStablePoolId.md#tou8a) +- [uand](InterbtcStablePoolId.md#uand) +- [ucmp](InterbtcStablePoolId.md#ucmp) +- [umod](InterbtcStablePoolId.md#umod) +- [uor](InterbtcStablePoolId.md#uor) +- [ushln](InterbtcStablePoolId.md#ushln) +- [ushrn](InterbtcStablePoolId.md#ushrn) +- [uxor](InterbtcStablePoolId.md#uxor) +- [xor](InterbtcStablePoolId.md#xor) +- [zeroBits](InterbtcStablePoolId.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +u32.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### \_\_UIntType + +• `Readonly` **\_\_UIntType**: ``"u32"`` + +#### Inherited from + +u32.\_\_UIntType + +#### Defined in + +node_modules/@polkadot/types-codec/primitive/U32.d.ts:9 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +u32.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +u32.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +u32.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +u32.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +u32.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +u32.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +u32.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +u32.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +u32.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +u32.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +u32.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +u32.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +u32.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +u32.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +u32.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +u32.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +u32.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +u32.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +u32.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +u32.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +u32.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +u32.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +u32.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +u32.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +u32.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +u32.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +u32.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +u32.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +u32.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +u32.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +u32.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +u32.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +u32.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +u32.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +u32.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +u32.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +u32.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +u32.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +u32.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +u32.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +u32.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +u32.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +u32.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +u32.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +u32.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +u32.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +u32.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +u32.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/Issue.md b/interfaces/Issue.md new file mode 100644 index 000000000..2355304a8 --- /dev/null +++ b/interfaces/Issue.md @@ -0,0 +1,228 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Issue + +# Interface: Issue + +## Table of contents + +### Properties + +- [bridgeFee](Issue.md#bridgefee) +- [btcAmountSubmittedByUser](Issue.md#btcamountsubmittedbyuser) +- [btcBlockHeight](Issue.md#btcblockheight) +- [btcConfirmationActiveBlockHeight](Issue.md#btcconfirmationactiveblockheight) +- [btcTxId](Issue.md#btctxid) +- [confirmations](Issue.md#confirmations) +- [creationBlock](Issue.md#creationblock) +- [creationTimestamp](Issue.md#creationtimestamp) +- [executedAmountWrapped](Issue.md#executedamountwrapped) +- [griefingCollateral](Issue.md#griefingcollateral) +- [id](Issue.md#id) +- [period](Issue.md#period) +- [refundAmountWrapped](Issue.md#refundamountwrapped) +- [refundBtcAddress](Issue.md#refundbtcaddress) +- [status](Issue.md#status) +- [userParachainAddress](Issue.md#userparachainaddress) +- [vaultId](Issue.md#vaultid) +- [vaultWalletPubkey](Issue.md#vaultwalletpubkey) +- [vaultWrappedAddress](Issue.md#vaultwrappedaddress) +- [wrappedAmount](Issue.md#wrappedamount) + +## Properties + +### bridgeFee + +• **bridgeFee**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L10) + +___ + +### btcAmountSubmittedByUser + +• `Optional` **btcAmountSubmittedByUser**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L21) + +___ + +### btcBlockHeight + +• `Optional` **btcBlockHeight**: `number` + +#### Defined in + +[src/types/requestTypes.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L19) + +___ + +### btcConfirmationActiveBlockHeight + +• `Optional` **btcConfirmationActiveBlockHeight**: `number` + +#### Defined in + +[src/types/requestTypes.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L20) + +___ + +### btcTxId + +• `Optional` **btcTxId**: `string` + +#### Defined in + +[src/types/requestTypes.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L17) + +___ + +### confirmations + +• `Optional` **confirmations**: `number` + +#### Defined in + +[src/types/requestTypes.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L18) + +___ + +### creationBlock + +• **creationBlock**: `number` + +#### Defined in + +[src/types/requestTypes.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L13) + +___ + +### creationTimestamp + +• `Optional` **creationTimestamp**: `number` + +#### Defined in + +[src/types/requestTypes.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L14) + +___ + +### executedAmountWrapped + +• `Optional` **executedAmountWrapped**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L25) + +___ + +### griefingCollateral + +• **griefingCollateral**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L11) + +___ + +### id + +• **id**: `string` + +#### Defined in + +[src/types/requestTypes.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L7) + +___ + +### period + +• **period**: `number` + +#### Defined in + +[src/types/requestTypes.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L26) + +___ + +### refundAmountWrapped + +• `Optional` **refundAmountWrapped**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L24) + +___ + +### refundBtcAddress + +• `Optional` **refundBtcAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:23](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L23) + +___ + +### status + +• **status**: [`IssueStatus`](../enums/IssueStatus.md) + +#### Defined in + +[src/types/requestTypes.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L22) + +___ + +### userParachainAddress + +• **userParachainAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L9) + +___ + +### vaultId + +• **vaultId**: [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/types/requestTypes.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L16) + +___ + +### vaultWalletPubkey + +• **vaultWalletPubkey**: `string` + +#### Defined in + +[src/types/requestTypes.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L12) + +___ + +### vaultWrappedAddress + +• **vaultWrappedAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L15) + +___ + +### wrappedAmount + +• **wrappedAmount**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L8) diff --git a/interfaces/IssueAPI.md b/interfaces/IssueAPI.md new file mode 100644 index 000000000..0bd16ff8a --- /dev/null +++ b/interfaces/IssueAPI.md @@ -0,0 +1,421 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / IssueAPI + +# Interface: IssueAPI + +## Implemented by + +- [`DefaultIssueAPI`](../classes/DefaultIssueAPI.md) + +## Table of contents + +### Methods + +- [buildCancelIssueExtrinsic](IssueAPI.md#buildcancelissueextrinsic) +- [buildExecuteIssueExtrinsic](IssueAPI.md#buildexecuteissueextrinsic) +- [buildRequestIssueExtrinsic](IssueAPI.md#buildrequestissueextrinsic) +- [cancel](IssueAPI.md#cancel) +- [execute](IssueAPI.md#execute) +- [getDustValue](IssueAPI.md#getdustvalue) +- [getFeeRate](IssueAPI.md#getfeerate) +- [getFeesToPay](IssueAPI.md#getfeestopay) +- [getIssuePeriod](IssueAPI.md#getissueperiod) +- [getRequestById](IssueAPI.md#getrequestbyid) +- [getRequestLimits](IssueAPI.md#getrequestlimits) +- [getRequestsByIds](IssueAPI.md#getrequestsbyids) +- [getVaultIssuableAmount](IssueAPI.md#getvaultissuableamount) +- [list](IssueAPI.md#list) +- [request](IssueAPI.md#request) +- [requestAdvanced](IssueAPI.md#requestadvanced) +- [setIssuePeriod](IssueAPI.md#setissueperiod) + +## Methods + +### buildCancelIssueExtrinsic + +▸ **buildCancelIssueExtrinsic**(`issueId`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a cancel issue extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `issueId` | `string` | The ID returned by the issue request transaction | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A cancel issue submittable extrinsic. + +#### Defined in + +[src/parachain/issue.ts:123](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L123) + +___ + +### buildExecuteIssueExtrinsic + +▸ **buildExecuteIssueExtrinsic**(`issueId`, `btcTxId`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build an issue execution extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `issueId` | `string` | The ID returned by the issue request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +An execute issue submittable extrinsic. + +#### Defined in + +[src/parachain/issue.ts:102](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L102) + +___ + +### buildRequestIssueExtrinsic + +▸ **buildRequestIssueExtrinsic**(`vaultId`, `amount`, `griefingCollateralCurrency?`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build an issue request extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | The vault ID of the vault to issue with. | +| `amount` | `MonetaryAmount`<`Currency`\> | wrapped token amount to issue. | +| `griefingCollateralCurrency?` | [`CurrencyExt`](../modules.md#currencyext) | (optional) Currency in which griefing collateral will be locked. | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +An execute issue submittable extrinsic. + +#### Defined in + +[src/parachain/issue.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L55) + +___ + +### cancel + +▸ **cancel**(`issueId`): [`ExtrinsicData`](ExtrinsicData.md) + +Create an issue cancellation transaction. After the issue period has elapsed, +the issuance request can be cancelled. As a result, the griefing collateral +of the requester will be slashed and sent to the vault that had prepared to issue. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `issueId` | `string` | The ID returned by the issue request transaction | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/issue.ts:132](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L132) + +___ + +### execute + +▸ **execute**(`requestId`, `btcTxId`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Create an issue execution transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | - | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +If `txId` is not set, the `merkleProof` and `rawTx` must both be set. + +#### Defined in + +[src/parachain/issue.ts:115](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L115) + +___ + +### getDustValue + +▸ **getDustValue**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The minimum amount of wrapped tokens that is accepted for issue requests; any lower values would +risk the bitcoin client to reject the payment + +#### Defined in + +[src/parachain/issue.ts:166](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L166) + +___ + +### getFeeRate + +▸ **getFeeRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The fee charged for issuing. For instance, "0.005" stands for 0.5% + +#### Defined in + +[src/parachain/issue.ts:170](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L170) + +___ + +### getFeesToPay + +▸ **getFeesToPay**(`amount`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount, in BTC, for which to compute the issue fees | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The fees, in BTC + +#### Defined in + +[src/parachain/issue.ts:175](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L175) + +___ + +### getIssuePeriod + +▸ **getIssuePeriod**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The time difference in number of blocks between an issue request is created +and required completion time by a user. The issue period has an upper limit +to prevent griefing of vault collateral. + +#### Defined in + +[src/parachain/issue.ts:147](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L147) + +___ + +### getRequestById + +▸ **getRequestById**(`issueId`): `Promise`<[`Issue`](Issue.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `issueId` | `string` \| `H256` | The ID of the issue request to fetch | + +#### Returns + +`Promise`<[`Issue`](Issue.md)\> + +An issue request object + +#### Defined in + +[src/parachain/issue.ts:156](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L156) + +___ + +### getRequestLimits + +▸ **getRequestLimits**(`vaults?`): `Promise`<`IssueLimits`\> + +Gets the threshold for issuing with a single vault, and the maximum total +issue request size. Additionally passes the list of vaults for caching. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaults?` | `Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | (optional) A list of the vaults available to issue from. If not provided, will fetch from the parachain (incurring an extra request). | + +#### Returns + +`Promise`<`IssueLimits`\> + +An object of type {singleVault, maxTotal, vaultsCache} + +#### Defined in + +[src/parachain/issue.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L45) + +___ + +### getRequestsByIds + +▸ **getRequestsByIds**(`issueIds`): `Promise`<[`Issue`](Issue.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `issueIds` | (`string` \| `H256`)[] | + +#### Returns + +`Promise`<[`Issue`](Issue.md)[]\> + +The issue request objects + +#### Defined in + +[src/parachain/issue.ts:161](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L161) + +___ + +### getVaultIssuableAmount + +▸ **getVaultIssuableAmount**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The amount of wrapped tokens issuable by this vault + +#### Defined in + +[src/parachain/issue.ts:181](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L181) + +___ + +### list + +▸ **list**(): `Promise`<[`Issue`](Issue.md)[]\> + +#### Returns + +`Promise`<[`Issue`](Issue.md)[]\> + +An array containing the issue requests + +#### Defined in + +[src/parachain/issue.ts:151](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L151) + +___ + +### request + +▸ **request**(`amount`, `vaultAccountId?`, `collateralCurrency?`, `atomic?`, `availableVaults?`, `griefingCollateralCurrency?`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Request issuing wrapped tokens (e.g. interBTC, kBTC). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | wrapped token amount to issue. | +| `vaultAccountId?` | `AccountId` | - | +| `collateralCurrency?` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | (optional) Collateral currency for backing wrapped tokens | +| `atomic?` | `boolean` | (optional) Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. Defaults to false. | +| `availableVaults?` | `Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | (optional) A list of all vaults usable for issue. If not provided, will fetch from the parachain. | +| `griefingCollateralCurrency?` | [`CurrencyExt`](../modules.md#currencyext) | (optional) Currency in which griefing collateral will be locked. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +An extrinsic with event. + +#### Defined in + +[src/parachain/issue.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L72) + +___ + +### requestAdvanced + +▸ **requestAdvanced**(`amountsPerVault`, `atomic`, `griefingCollateralCurrency?`): [`ExtrinsicData`](ExtrinsicData.md) + +Create a batch of aggregated issue transactions (to one or more vaults). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amountsPerVault` | `Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | A mapping of vaults to issue from, and wrapped token amounts to issue using each vault | +| `atomic` | `boolean` | Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. | +| `griefingCollateralCurrency?` | [`CurrencyExt`](../modules.md#currencyext) | (optional) Currency in which griefing collateral will be locked. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/issue.ts:89](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L89) + +___ + +### setIssuePeriod + +▸ **setIssuePeriod**(`blocks`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blocks` | `number` | The time difference in number of blocks between an issue request is created and required completion time by a user. The issue period has an upper limit to prevent griefing of vault collateral. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Testnet utility function + +#### Defined in + +[src/parachain/issue.ts:140](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/issue.ts#L140) diff --git a/interfaces/IssueResult.md b/interfaces/IssueResult.md new file mode 100644 index 000000000..a77dc152a --- /dev/null +++ b/interfaces/IssueResult.md @@ -0,0 +1,41 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / IssueResult + +# Interface: IssueResult + +## Table of contents + +### Properties + +- [finalWrappedTokenBalance](IssueResult.md#finalwrappedtokenbalance) +- [initialWrappedTokenBalance](IssueResult.md#initialwrappedtokenbalance) +- [request](IssueResult.md#request) + +## Properties + +### finalWrappedTokenBalance + +• **finalWrappedTokenBalance**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/issueRedeem.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L22) + +___ + +### initialWrappedTokenBalance + +• **initialWrappedTokenBalance**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/issueRedeem.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L21) + +___ + +### request + +• **request**: [`Issue`](Issue.md) + +#### Defined in + +[src/utils/issueRedeem.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L20) diff --git a/interfaces/LendTokenId.md b/interfaces/LendTokenId.md new file mode 100644 index 000000000..4420f5090 --- /dev/null +++ b/interfaces/LendTokenId.md @@ -0,0 +1,2947 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LendTokenId + +# Interface: LendTokenId + +**`Name`** + +LendTokenId + +## Hierarchy + +- `u32` + + ↳ **`LendTokenId`** + +## Table of contents + +### Properties + +- [#private](LendTokenId.md##private) +- [\_\_UIntType](LendTokenId.md#__uinttype) +- [createdAtHash](LendTokenId.md#createdathash) +- [encodedLength](LendTokenId.md#encodedlength) +- [initialU8aLength](LendTokenId.md#initialu8alength) +- [isStorageFallback](LendTokenId.md#isstoragefallback) +- [isUnsigned](LendTokenId.md#isunsigned) +- [registry](LendTokenId.md#registry) + +### Accessors + +- [hash](LendTokenId.md#hash) +- [isEmpty](LendTokenId.md#isempty) + +### Methods + +- [abs](LendTokenId.md#abs) +- [add](LendTokenId.md#add) +- [addn](LendTokenId.md#addn) +- [and](LendTokenId.md#and) +- [andln](LendTokenId.md#andln) +- [bincn](LendTokenId.md#bincn) +- [bitLength](LendTokenId.md#bitlength) +- [byteLength](LendTokenId.md#bytelength) +- [clone](LendTokenId.md#clone) +- [cmp](LendTokenId.md#cmp) +- [cmpn](LendTokenId.md#cmpn) +- [div](LendTokenId.md#div) +- [divRound](LendTokenId.md#divround) +- [divmod](LendTokenId.md#divmod) +- [divn](LendTokenId.md#divn) +- [egcd](LendTokenId.md#egcd) +- [eq](LendTokenId.md#eq) +- [eqn](LendTokenId.md#eqn) +- [fromTwos](LendTokenId.md#fromtwos) +- [gcd](LendTokenId.md#gcd) +- [gt](LendTokenId.md#gt) +- [gte](LendTokenId.md#gte) +- [gten](LendTokenId.md#gten) +- [gtn](LendTokenId.md#gtn) +- [iabs](LendTokenId.md#iabs) +- [iadd](LendTokenId.md#iadd) +- [iaddn](LendTokenId.md#iaddn) +- [iand](LendTokenId.md#iand) +- [idivn](LendTokenId.md#idivn) +- [imaskn](LendTokenId.md#imaskn) +- [imul](LendTokenId.md#imul) +- [imuln](LendTokenId.md#imuln) +- [ineg](LendTokenId.md#ineg) +- [inotn](LendTokenId.md#inotn) +- [inspect](LendTokenId.md#inspect) +- [invm](LendTokenId.md#invm) +- [ior](LendTokenId.md#ior) +- [isEven](LendTokenId.md#iseven) +- [isMax](LendTokenId.md#ismax) +- [isNeg](LendTokenId.md#isneg) +- [isOdd](LendTokenId.md#isodd) +- [isZero](LendTokenId.md#iszero) +- [ishln](LendTokenId.md#ishln) +- [ishrn](LendTokenId.md#ishrn) +- [isqr](LendTokenId.md#isqr) +- [isub](LendTokenId.md#isub) +- [isubn](LendTokenId.md#isubn) +- [iuand](LendTokenId.md#iuand) +- [iuor](LendTokenId.md#iuor) +- [iushln](LendTokenId.md#iushln) +- [iushrn](LendTokenId.md#iushrn) +- [iuxor](LendTokenId.md#iuxor) +- [ixor](LendTokenId.md#ixor) +- [lt](LendTokenId.md#lt) +- [lte](LendTokenId.md#lte) +- [lten](LendTokenId.md#lten) +- [ltn](LendTokenId.md#ltn) +- [maskn](LendTokenId.md#maskn) +- [mod](LendTokenId.md#mod) +- [modn](LendTokenId.md#modn) +- [modrn](LendTokenId.md#modrn) +- [mul](LendTokenId.md#mul) +- [muln](LendTokenId.md#muln) +- [neg](LendTokenId.md#neg) +- [notn](LendTokenId.md#notn) +- [or](LendTokenId.md#or) +- [pow](LendTokenId.md#pow) +- [setn](LendTokenId.md#setn) +- [shln](LendTokenId.md#shln) +- [shrn](LendTokenId.md#shrn) +- [sqr](LendTokenId.md#sqr) +- [sub](LendTokenId.md#sub) +- [subn](LendTokenId.md#subn) +- [testn](LendTokenId.md#testn) +- [toArray](LendTokenId.md#toarray) +- [toArrayLike](LendTokenId.md#toarraylike) +- [toBigInt](LendTokenId.md#tobigint) +- [toBn](LendTokenId.md#tobn) +- [toBuffer](LendTokenId.md#tobuffer) +- [toHex](LendTokenId.md#tohex) +- [toHuman](LendTokenId.md#tohuman) +- [toJSON](LendTokenId.md#tojson) +- [toNumber](LendTokenId.md#tonumber) +- [toPrimitive](LendTokenId.md#toprimitive) +- [toRawType](LendTokenId.md#torawtype) +- [toRed](LendTokenId.md#tored) +- [toString](LendTokenId.md#tostring) +- [toTwos](LendTokenId.md#totwos) +- [toU8a](LendTokenId.md#tou8a) +- [uand](LendTokenId.md#uand) +- [ucmp](LendTokenId.md#ucmp) +- [umod](LendTokenId.md#umod) +- [uor](LendTokenId.md#uor) +- [ushln](LendTokenId.md#ushln) +- [ushrn](LendTokenId.md#ushrn) +- [uxor](LendTokenId.md#uxor) +- [xor](LendTokenId.md#xor) +- [zeroBits](LendTokenId.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +u32.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### \_\_UIntType + +• `Readonly` **\_\_UIntType**: ``"u32"`` + +#### Inherited from + +u32.\_\_UIntType + +#### Defined in + +node_modules/@polkadot/types-codec/primitive/U32.d.ts:9 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +u32.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +u32.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +u32.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +u32.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +u32.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +u32.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +u32.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +u32.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +u32.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +u32.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +u32.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +u32.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +u32.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +u32.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +u32.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +u32.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +u32.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +u32.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +u32.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +u32.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +u32.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +u32.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +u32.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +u32.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +u32.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +u32.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +u32.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +u32.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +u32.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +u32.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +u32.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +u32.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +u32.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +u32.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +u32.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +u32.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +u32.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +u32.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +u32.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +u32.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +u32.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +u32.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +u32.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +u32.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +u32.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +u32.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +u32.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +u32.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/LendingStats.md b/interfaces/LendingStats.md new file mode 100644 index 000000000..6f77ca17c --- /dev/null +++ b/interfaces/LendingStats.md @@ -0,0 +1,143 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LendingStats + +# Interface: LendingStats + +## Table of contents + +### Properties + +- [borrowLimitBtc](LendingStats.md#borrowlimitbtc) +- [calculateBorrowLimitBtcChange](LendingStats.md#calculateborrowlimitbtcchange) +- [calculateLtvAndThresholdsChange](LendingStats.md#calculateltvandthresholdschange) +- [collateralThresholdWeightedAverage](LendingStats.md#collateralthresholdweightedaverage) +- [liquidationThresholdWeightedAverage](LendingStats.md#liquidationthresholdweightedaverage) +- [ltv](LendingStats.md#ltv) +- [totalBorrowedBtc](LendingStats.md#totalborrowedbtc) +- [totalCollateralBtc](LendingStats.md#totalcollateralbtc) +- [totalLentBtc](LendingStats.md#totallentbtc) + +## Properties + +### borrowLimitBtc + +• **borrowLimitBtc**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/loans.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L24) + +___ + +### calculateBorrowLimitBtcChange + +• **calculateBorrowLimitBtcChange**: (`action`: [`LoanAction`](../modules.md#loanaction), `amount`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>) => `MonetaryAmount`<`Currency`\> + +#### Type declaration + +▸ (`action`, `amount`): `MonetaryAmount`<`Currency`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](../modules.md#loanaction) | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | + +##### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/loans.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L28) + +___ + +### calculateLtvAndThresholdsChange + +• **calculateLtvAndThresholdsChange**: (`action`: [`LoanAction`](../modules.md#loanaction), `amount`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>) => { `collateralThresholdWeightedAverage`: `Big` ; `liquidationThresholdWeightedAverage`: `Big` ; `ltv`: `Big` } + +#### Type declaration + +▸ (`action`, `amount`): `Object` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](../modules.md#loanaction) | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | + +##### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `collateralThresholdWeightedAverage` | `Big` | +| `liquidationThresholdWeightedAverage` | `Big` | +| `ltv` | `Big` | + +#### Defined in + +[src/types/loans.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L29) + +___ + +### collateralThresholdWeightedAverage + +• **collateralThresholdWeightedAverage**: `Big` + +#### Defined in + +[src/types/loans.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L26) + +___ + +### liquidationThresholdWeightedAverage + +• **liquidationThresholdWeightedAverage**: `Big` + +#### Defined in + +[src/types/loans.ts:27](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L27) + +___ + +### ltv + +• **ltv**: `Big` + +#### Defined in + +[src/types/loans.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L25) + +___ + +### totalBorrowedBtc + +• **totalBorrowedBtc**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/loans.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L22) + +___ + +### totalCollateralBtc + +• **totalCollateralBtc**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/loans.ts:23](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L23) + +___ + +### totalLentBtc + +• **totalLentBtc**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/loans.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L21) diff --git a/interfaces/Liquidity.md b/interfaces/Liquidity.md new file mode 100644 index 000000000..f7ee68d8a --- /dev/null +++ b/interfaces/Liquidity.md @@ -0,0 +1,2932 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Liquidity + +# Interface: Liquidity + +**`Name`** + +Liquidity + +## Hierarchy + +- `FixedU128` + + ↳ **`Liquidity`** + +## Table of contents + +### Properties + +- [#private](Liquidity.md##private) +- [createdAtHash](Liquidity.md#createdathash) +- [encodedLength](Liquidity.md#encodedlength) +- [initialU8aLength](Liquidity.md#initialu8alength) +- [isStorageFallback](Liquidity.md#isstoragefallback) +- [isUnsigned](Liquidity.md#isunsigned) +- [registry](Liquidity.md#registry) + +### Accessors + +- [hash](Liquidity.md#hash) +- [isEmpty](Liquidity.md#isempty) + +### Methods + +- [abs](Liquidity.md#abs) +- [add](Liquidity.md#add) +- [addn](Liquidity.md#addn) +- [and](Liquidity.md#and) +- [andln](Liquidity.md#andln) +- [bincn](Liquidity.md#bincn) +- [bitLength](Liquidity.md#bitlength) +- [byteLength](Liquidity.md#bytelength) +- [clone](Liquidity.md#clone) +- [cmp](Liquidity.md#cmp) +- [cmpn](Liquidity.md#cmpn) +- [div](Liquidity.md#div) +- [divRound](Liquidity.md#divround) +- [divmod](Liquidity.md#divmod) +- [divn](Liquidity.md#divn) +- [egcd](Liquidity.md#egcd) +- [eq](Liquidity.md#eq) +- [eqn](Liquidity.md#eqn) +- [fromTwos](Liquidity.md#fromtwos) +- [gcd](Liquidity.md#gcd) +- [gt](Liquidity.md#gt) +- [gte](Liquidity.md#gte) +- [gten](Liquidity.md#gten) +- [gtn](Liquidity.md#gtn) +- [iabs](Liquidity.md#iabs) +- [iadd](Liquidity.md#iadd) +- [iaddn](Liquidity.md#iaddn) +- [iand](Liquidity.md#iand) +- [idivn](Liquidity.md#idivn) +- [imaskn](Liquidity.md#imaskn) +- [imul](Liquidity.md#imul) +- [imuln](Liquidity.md#imuln) +- [ineg](Liquidity.md#ineg) +- [inotn](Liquidity.md#inotn) +- [inspect](Liquidity.md#inspect) +- [invm](Liquidity.md#invm) +- [ior](Liquidity.md#ior) +- [isEven](Liquidity.md#iseven) +- [isMax](Liquidity.md#ismax) +- [isNeg](Liquidity.md#isneg) +- [isOdd](Liquidity.md#isodd) +- [isZero](Liquidity.md#iszero) +- [ishln](Liquidity.md#ishln) +- [ishrn](Liquidity.md#ishrn) +- [isqr](Liquidity.md#isqr) +- [isub](Liquidity.md#isub) +- [isubn](Liquidity.md#isubn) +- [iuand](Liquidity.md#iuand) +- [iuor](Liquidity.md#iuor) +- [iushln](Liquidity.md#iushln) +- [iushrn](Liquidity.md#iushrn) +- [iuxor](Liquidity.md#iuxor) +- [ixor](Liquidity.md#ixor) +- [lt](Liquidity.md#lt) +- [lte](Liquidity.md#lte) +- [lten](Liquidity.md#lten) +- [ltn](Liquidity.md#ltn) +- [maskn](Liquidity.md#maskn) +- [mod](Liquidity.md#mod) +- [modn](Liquidity.md#modn) +- [modrn](Liquidity.md#modrn) +- [mul](Liquidity.md#mul) +- [muln](Liquidity.md#muln) +- [neg](Liquidity.md#neg) +- [notn](Liquidity.md#notn) +- [or](Liquidity.md#or) +- [pow](Liquidity.md#pow) +- [setn](Liquidity.md#setn) +- [shln](Liquidity.md#shln) +- [shrn](Liquidity.md#shrn) +- [sqr](Liquidity.md#sqr) +- [sub](Liquidity.md#sub) +- [subn](Liquidity.md#subn) +- [testn](Liquidity.md#testn) +- [toArray](Liquidity.md#toarray) +- [toArrayLike](Liquidity.md#toarraylike) +- [toBigInt](Liquidity.md#tobigint) +- [toBn](Liquidity.md#tobn) +- [toBuffer](Liquidity.md#tobuffer) +- [toHex](Liquidity.md#tohex) +- [toHuman](Liquidity.md#tohuman) +- [toJSON](Liquidity.md#tojson) +- [toNumber](Liquidity.md#tonumber) +- [toPrimitive](Liquidity.md#toprimitive) +- [toRawType](Liquidity.md#torawtype) +- [toRed](Liquidity.md#tored) +- [toString](Liquidity.md#tostring) +- [toTwos](Liquidity.md#totwos) +- [toU8a](Liquidity.md#tou8a) +- [uand](Liquidity.md#uand) +- [ucmp](Liquidity.md#ucmp) +- [umod](Liquidity.md#umod) +- [uor](Liquidity.md#uor) +- [ushln](Liquidity.md#ushln) +- [ushrn](Liquidity.md#ushrn) +- [uxor](Liquidity.md#uxor) +- [xor](Liquidity.md#xor) +- [zeroBits](Liquidity.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +FixedU128.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +FixedU128.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +FixedU128.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +FixedU128.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +FixedU128.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +FixedU128.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +FixedU128.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +FixedU128.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +FixedU128.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +FixedU128.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +FixedU128.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +FixedU128.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +FixedU128.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +FixedU128.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +FixedU128.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +FixedU128.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +FixedU128.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +FixedU128.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +FixedU128.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +FixedU128.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +FixedU128.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +FixedU128.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +FixedU128.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +FixedU128.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +FixedU128.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +FixedU128.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +FixedU128.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +FixedU128.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +FixedU128.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +FixedU128.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +FixedU128.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +FixedU128.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +FixedU128.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +FixedU128.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +FixedU128.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +FixedU128.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +FixedU128.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +FixedU128.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +FixedU128.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +FixedU128.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +FixedU128.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +FixedU128.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +FixedU128.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +FixedU128.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +FixedU128.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +FixedU128.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +FixedU128.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/LiquidityPoolBase.md b/interfaces/LiquidityPoolBase.md new file mode 100644 index 000000000..020984d51 --- /dev/null +++ b/interfaces/LiquidityPoolBase.md @@ -0,0 +1,90 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LiquidityPoolBase + +# Interface: LiquidityPoolBase + +## Implemented by + +- [`StableLiquidityPool`](../classes/StableLiquidityPool.md) +- [`StandardLiquidityPool`](../classes/StandardLiquidityPool.md) + +## Table of contents + +### Properties + +- [isEmpty](LiquidityPoolBase.md#isempty) +- [lpToken](LiquidityPoolBase.md#lptoken) +- [pooledCurrencies](LiquidityPoolBase.md#pooledcurrencies) +- [rewardAmountsYearly](LiquidityPoolBase.md#rewardamountsyearly) +- [totalSupply](LiquidityPoolBase.md#totalsupply) +- [tradingFee](LiquidityPoolBase.md#tradingfee) +- [type](LiquidityPoolBase.md#type) + +## Properties + +### isEmpty + +• **isEmpty**: `boolean` + +#### Defined in + +[src/parachain/amm/types.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L15) + +___ + +### lpToken + +• **lpToken**: [`LpCurrency`](../modules.md#lpcurrency) + +#### Defined in + +[src/parachain/amm/types.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L10) + +___ + +### pooledCurrencies + +• **pooledCurrencies**: [`PooledCurrencies`](../modules.md#pooledcurrencies) + +#### Defined in + +[src/parachain/amm/types.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L11) + +___ + +### rewardAmountsYearly + +• **rewardAmountsYearly**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>[] + +#### Defined in + +[src/parachain/amm/types.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L14) + +___ + +### totalSupply + +• **totalSupply**: `MonetaryAmount`<[`LpCurrency`](../modules.md#lpcurrency)\> + +#### Defined in + +[src/parachain/amm/types.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L13) + +___ + +### tradingFee + +• **tradingFee**: `Big` + +#### Defined in + +[src/parachain/amm/types.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L12) + +___ + +### type + +• **type**: [`PoolType`](../enums/PoolType.md) + +#### Defined in + +[src/parachain/amm/types.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L9) diff --git a/interfaces/LoanAsset.md b/interfaces/LoanAsset.md new file mode 100644 index 000000000..76f489aa0 --- /dev/null +++ b/interfaces/LoanAsset.md @@ -0,0 +1,162 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LoanAsset + +# Interface: LoanAsset + +## Table of contents + +### Properties + +- [availableCapacity](LoanAsset.md#availablecapacity) +- [borrowApy](LoanAsset.md#borrowapy) +- [borrowCap](LoanAsset.md#borrowcap) +- [borrowReward](LoanAsset.md#borrowreward) +- [collateralThreshold](LoanAsset.md#collateralthreshold) +- [currency](LoanAsset.md#currency) +- [exchangeRate](LoanAsset.md#exchangerate) +- [isActive](LoanAsset.md#isactive) +- [lendApy](LoanAsset.md#lendapy) +- [lendReward](LoanAsset.md#lendreward) +- [liquidationThreshold](LoanAsset.md#liquidationthreshold) +- [supplyCap](LoanAsset.md#supplycap) +- [totalBorrows](LoanAsset.md#totalborrows) +- [totalLiquidity](LoanAsset.md#totalliquidity) + +## Properties + +### availableCapacity + +• **availableCapacity**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L42) + +___ + +### borrowApy + +• **borrowApy**: `Big` + +#### Defined in + +[src/types/loans.ts:38](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L38) + +___ + +### borrowCap + +• **borrowCap**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L48) + +___ + +### borrowReward + +• **borrowReward**: ``null`` \| `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L40) + +___ + +### collateralThreshold + +• **collateralThreshold**: `Big` + +#### Defined in + +[src/types/loans.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L45) + +___ + +### currency + +• **currency**: [`CurrencyExt`](../modules.md#currencyext) + +#### Defined in + +[src/types/loans.ts:36](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L36) + +___ + +### exchangeRate + +• **exchangeRate**: `ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:49](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L49) + +___ + +### isActive + +• **isActive**: `boolean` + +#### Defined in + +[src/types/loans.ts:46](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L46) + +___ + +### lendApy + +• **lendApy**: `Big` + +#### Defined in + +[src/types/loans.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L37) + +___ + +### lendReward + +• **lendReward**: ``null`` \| `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L39) + +___ + +### liquidationThreshold + +• **liquidationThreshold**: `Big` + +#### Defined in + +[src/types/loans.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L44) + +___ + +### supplyCap + +• **supplyCap**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L47) + +___ + +### totalBorrows + +• **totalBorrows**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L43) + +___ + +### totalLiquidity + +• **totalLiquidity**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:41](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L41) diff --git a/interfaces/LoanMarket.md b/interfaces/LoanMarket.md new file mode 100644 index 000000000..0e406f5e1 --- /dev/null +++ b/interfaces/LoanMarket.md @@ -0,0 +1,19 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LoanMarket + +# Interface: LoanMarket + +## Table of contents + +### Properties + +- [lendTokenId](LoanMarket.md#lendtokenid) + +## Properties + +### lendTokenId + +• **lendTokenId**: `number` + +#### Defined in + +[src/types/loans.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L58) diff --git a/interfaces/LoanPosition.md b/interfaces/LoanPosition.md new file mode 100644 index 000000000..22edde77d --- /dev/null +++ b/interfaces/LoanPosition.md @@ -0,0 +1,27 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LoanPosition + +# Interface: LoanPosition + +## Hierarchy + +- **`LoanPosition`** + + ↳ [`CollateralPosition`](CollateralPosition.md) + + ↳ [`BorrowPosition`](BorrowPosition.md) + +## Table of contents + +### Properties + +- [amount](LoanPosition.md#amount) + +## Properties + +### amount + +• **amount**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/types/loans.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L7) diff --git a/interfaces/LoansAPI.md b/interfaces/LoansAPI.md new file mode 100644 index 000000000..99747bbd0 --- /dev/null +++ b/interfaces/LoansAPI.md @@ -0,0 +1,573 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LoansAPI + +# Interface: LoansAPI + +## Implemented by + +- [`DefaultLoansAPI`](../classes/DefaultLoansAPI.md) + +## Table of contents + +### Methods + +- [borrow](LoansAPI.md#borrow) +- [claimAllSubsidyRewards](LoansAPI.md#claimallsubsidyrewards) +- [disableAsCollateral](LoansAPI.md#disableascollateral) +- [enableAsCollateral](LoansAPI.md#enableascollateral) +- [getAccruedRewardsOfAccount](LoansAPI.md#getaccruedrewardsofaccount) +- [getBorrowPositionsOfAccount](LoansAPI.md#getborrowpositionsofaccount) +- [getBorrowerAccountIds](LoansAPI.md#getborroweraccountids) +- [getLendPositionsOfAccount](LoansAPI.md#getlendpositionsofaccount) +- [getLendTokenExchangeRates](LoansAPI.md#getlendtokenexchangerates) +- [getLendTokens](LoansAPI.md#getlendtokens) +- [getLendingStats](LoansAPI.md#getlendingstats) +- [getLiquidationThresholdLiquidity](LoansAPI.md#getliquidationthresholdliquidity) +- [getLoanAssets](LoansAPI.md#getloanassets) +- [getLoansMarkets](LoansAPI.md#getloansmarkets) +- [getUndercollateralizedBorrowers](LoansAPI.md#getundercollateralizedborrowers) +- [lend](LoansAPI.md#lend) +- [liquidateBorrowPosition](LoansAPI.md#liquidateborrowposition) +- [repay](LoansAPI.md#repay) +- [repayAll](LoansAPI.md#repayall) +- [withdraw](LoansAPI.md#withdraw) +- [withdrawAll](LoansAPI.md#withdrawall) + +## Methods + +### borrow + +▸ **borrow**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Borrow currency from the protocol. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to borrow. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to borrow. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no active market for `underlyingCurrency`. + +**`Throws`** + +If there is not enough collateral provided by account for +`amount` of `underlyingCurrency`. + +**`Throws`** + +If `amount` is higher than available amount of `underlyingCurrency` +in the protocol. + +#### Defined in + +[src/parachain/loans.ts:181](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L181) + +___ + +### claimAllSubsidyRewards + +▸ **claimAllSubsidyRewards**(): [`ExtrinsicData`](ExtrinsicData.md) + +Claim subsidy rewards for all markets available for account. + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/loans.ts:167](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L167) + +___ + +### disableAsCollateral + +▸ **disableAsCollateral**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Enable lend position of account as collateral for borrowing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to enable as collateral. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no existing lend position for `currency`. + +**`Throws`** + +If disabling lend position of `currency` would bring +account under collateral threshold. + +#### Defined in + +[src/parachain/loans.ts:161](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L161) + +___ + +### enableAsCollateral + +▸ **enableAsCollateral**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Enable lend position of account as collateral for borrowing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to enable as collateral. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no existing lend position for `currency`. + +#### Defined in + +[src/parachain/loans.ts:150](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L150) + +___ + +### getAccruedRewardsOfAccount + +▸ **getAccruedRewardsOfAccount**(`accountId`): `Promise`<[`AccruedRewards`](AccruedRewards.md)\> + +Get accrued subsidy rewards amounts for the account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account to get rewards for | + +#### Returns + +`Promise`<[`AccruedRewards`](AccruedRewards.md)\> + +Total amount how much rewards the account can claim and rewards per market. + +#### Defined in + +[src/parachain/loans.ts:107](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L107) + +___ + +### getBorrowPositionsOfAccount + +▸ **getBorrowPositionsOfAccount**(`accountId`): `Promise`<[`BorrowPosition`](BorrowPosition.md)[]\> + +Get the borrow positions for given account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | the account Id for which to get borrow positions | + +#### Returns + +`Promise`<[`BorrowPosition`](BorrowPosition.md)[]\> + +Array of borrow positions of account. + +#### Defined in + +[src/parachain/loans.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L61) + +___ + +### getBorrowerAccountIds + +▸ **getBorrowerAccountIds**(): `Promise`<`AccountId`[]\> + +#### Returns + +`Promise`<`AccountId`[]\> + +An array of `AccountId`s which historically borrowed from the lending protocol. +This includes accounts with zero outstanding debt. + +#### Defined in + +[src/parachain/loans.ts:228](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L228) + +___ + +### getLendPositionsOfAccount + +▸ **getLendPositionsOfAccount**(`accountId`): `Promise`<[`CollateralPosition`](CollateralPosition.md)[]\> + +Get the lend positions for given account. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | the account Id for which to get supply positions | + +#### Returns + +`Promise`<[`CollateralPosition`](CollateralPosition.md)[]\> + +Array of lend positions of account. + +#### Defined in + +[src/parachain/loans.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L53) + +___ + +### getLendTokenExchangeRates + +▸ **getLendTokenExchangeRates**(): `Promise`<[`TickerToData`](../modules.md#tickertodata)<`Big`\>\> + +#### Returns + +`Promise`<[`TickerToData`](../modules.md#tickertodata)<`Big`\>\> + +Exchange rates for underlying currency -> lend token. +Representing amount of lend token equal to 1 of underlying currency. + +#### Defined in + +[src/parachain/loans.ts:99](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L99) + +___ + +### getLendTokens + +▸ **getLendTokens**(): `Promise`<[`LendToken`](../modules.md#lendtoken)[]\> + +Get all lend token currencies. + +#### Returns + +`Promise`<[`LendToken`](../modules.md#lendtoken)[]\> + +Array of all LendToken currencies. + +#### Defined in + +[src/parachain/loans.ts:93](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L93) + +___ + +### getLendingStats + +▸ **getLendingStats**(`lendPositions`, `borrowPositions`, `loanAssets`): `undefined` \| [`LendingStats`](LendingStats.md) + +Get collateralization information about account's loans. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `lendPositions` | [`CollateralPosition`](CollateralPosition.md)[] | Lend positions of account. | +| `borrowPositions` | [`BorrowPosition`](BorrowPosition.md)[] | Borrow positions of account. | +| `loanAssets` | [`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](LoanAsset.md)\> | All loan assets data in TickerToData structure. | + +#### Returns + +`undefined` \| [`LendingStats`](LendingStats.md) + +Collateral information about account based on passed positions. + +**`Throws`** + +When `loanAssets` does not contain all of the loan positions currencies. + +#### Defined in + +[src/parachain/loans.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L72) + +___ + +### getLiquidationThresholdLiquidity + +▸ **getLiquidationThresholdLiquidity**(`accountId`): `Promise`<[`AccountLiquidity`](../modules.md#accountliquidity)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | The account whose liquidity to query from the chain | + +#### Returns + +`Promise`<[`AccountLiquidity`](../modules.md#accountliquidity)\> + +An `AccountLiquidity` object, which is valid even for accounts that didn't use the loans pallet at all + +#### Defined in + +[src/parachain/loans.ts:233](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L233) + +___ + +### getLoanAssets + +▸ **getLoanAssets**(): `Promise`<[`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](LoanAsset.md)\>\> + +Get all loan assets. + +#### Returns + +`Promise`<[`TickerToData`](../modules.md#tickertodata)<[`LoanAsset`](LoanAsset.md)\>\> + +Array of all assets that can be lent and borrowed. + +**`Remarks`** + +Method could be refactored to compute APR in lib if we can get underlyingCurrency/rewardCurrency exchange rate, +but is it safe to assume that exchange rate for btc/underlyingCurrency will be +always fed to the oracle and available? + +#### Defined in + +[src/parachain/loans.ts:86](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L86) + +___ + +### getLoansMarkets + +▸ **getLoansMarkets**(): `Promise`<[[`CurrencyExt`](../modules.md#currencyext), [`LoansMarket`](LoansMarket.md)][]\> + +#### Returns + +`Promise`<[[`CurrencyExt`](../modules.md#currencyext), [`LoansMarket`](LoansMarket.md)][]\> + +An array of tuples denoting the underlying currency of a market, and the configuration of that market + +#### Defined in + +[src/parachain/loans.ts:237](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L237) + +___ + +### getUndercollateralizedBorrowers + +▸ **getUndercollateralizedBorrowers**(): `Promise`<[`UndercollateralizedPosition`](../modules.md#undercollateralizedposition)[]\> + +#### Returns + +`Promise`<[`UndercollateralizedPosition`](../modules.md#undercollateralizedposition)[]\> + +An array of `UndercollateralizedPosition`s, with all details needed to +liquidate them (accountId, shortfall - expressed in the wrapped currency, open borrow positions, collateral +deposits). + +#### Defined in + +[src/parachain/loans.ts:223](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L223) + +___ + +### lend + +▸ **lend**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Lend currency to protocol for borrowing. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to lend. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to lend. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is not active market for `underlyingCurrency`. + +**`Throws`** + +If `amount` is exceeding available balance of account. + +#### Defined in + +[src/parachain/loans.ts:118](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L118) + +___ + +### liquidateBorrowPosition + +▸ **liquidateBorrowPosition**(`borrower`, `liquidationCurrency`, `repayAmount`, `collateralCurrency`): [`ExtrinsicData`](ExtrinsicData.md) + +Liquidates borrow position for exchange of collateral. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `borrower` | `AccountId` | AccountId of borrower whose position will be liquidated. | +| `liquidationCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency of position that will be liquidated. | +| `repayAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount to be repaid. | +| `collateralCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Collateral currency which will be claimed by liquidator. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/loans.ts:212](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L212) + +___ + +### repay + +▸ **repay**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Repay borrowed loan. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to repay. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to repay. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is no active market for `underlyingCurrency`. + +**`Throws`** + +If `amount` is higher than available balance of account. + +**`Throws`** + +If `amount` is higher than outstanding loan. + +#### Defined in + +[src/parachain/loans.ts:193](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L193) + +___ + +### repayAll + +▸ **repayAll**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Same as `repay`, but repays full loan. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to repay. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/loans.ts:201](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L201) + +___ + +### withdraw + +▸ **withdraw**(`underlyingCurrency`, `amount`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Withdraw previously lent currency from protocol. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to witdhraw. | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Amount of currency to withdraw. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +If there is not active market for `underlyingCurrency`. + +**`Throws`** + +If `amount` is exceeding lent amount of account. + +**`Throws`** + +If `underlyingCurrency` is used as collateral and withdrawal of +`amount` would bring account under collateral threshold. + +**`Throws`** + +If there is not enough of underlying currency currently +available in the protocol. + +#### Defined in + +[src/parachain/loans.ts:133](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L133) + +___ + +### withdrawAll + +▸ **withdrawAll**(`underlyingCurrency`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Same as `withdraw`, but exits full position. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `underlyingCurrency` | [`CurrencyExt`](../modules.md#currencyext) | Currency to fully withdraw. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/loans.ts:141](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/loans.ts#L141) diff --git a/interfaces/LoansMarket.md b/interfaces/LoansMarket.md new file mode 100644 index 000000000..e63bfe1f4 --- /dev/null +++ b/interfaces/LoansMarket.md @@ -0,0 +1,925 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LoansMarket + +# Interface: LoansMarket + +**`Name`** + +LoansMarket (172) + +## Hierarchy + +- `Struct` + + ↳ **`LoansMarket`** + +## Table of contents + +### Properties + +- [#private](LoansMarket.md##private) +- [[toStringTag]](LoansMarket.md#[tostringtag]) +- [borrowCap](LoansMarket.md#borrowcap) +- [closeFactor](LoansMarket.md#closefactor) +- [collateralFactor](LoansMarket.md#collateralfactor) +- [createdAtHash](LoansMarket.md#createdathash) +- [initialU8aLength](LoansMarket.md#initialu8alength) +- [isStorageFallback](LoansMarket.md#isstoragefallback) +- [lendTokenId](LoansMarket.md#lendtokenid) +- [liquidateIncentive](LoansMarket.md#liquidateincentive) +- [liquidateIncentiveReservedFactor](LoansMarket.md#liquidateincentivereservedfactor) +- [liquidationThreshold](LoansMarket.md#liquidationthreshold) +- [rateModel](LoansMarket.md#ratemodel) +- [registry](LoansMarket.md#registry) +- [reserveFactor](LoansMarket.md#reservefactor) +- [size](LoansMarket.md#size) +- [state](LoansMarket.md#state) +- [supplyCap](LoansMarket.md#supplycap) + +### Accessors + +- [Type](LoansMarket.md#type) +- [defKeys](LoansMarket.md#defkeys) +- [encodedLength](LoansMarket.md#encodedlength) +- [hash](LoansMarket.md#hash) +- [isEmpty](LoansMarket.md#isempty) + +### Methods + +- [[iterator]](LoansMarket.md#[iterator]) +- [clear](LoansMarket.md#clear) +- [delete](LoansMarket.md#delete) +- [entries](LoansMarket.md#entries) +- [eq](LoansMarket.md#eq) +- [forEach](LoansMarket.md#foreach) +- [get](LoansMarket.md#get) +- [getAtIndex](LoansMarket.md#getatindex) +- [getT](LoansMarket.md#gett) +- [has](LoansMarket.md#has) +- [inspect](LoansMarket.md#inspect) +- [keys](LoansMarket.md#keys) +- [set](LoansMarket.md#set) +- [toArray](LoansMarket.md#toarray) +- [toHex](LoansMarket.md#tohex) +- [toHuman](LoansMarket.md#tohuman) +- [toJSON](LoansMarket.md#tojson) +- [toPrimitive](LoansMarket.md#toprimitive) +- [toRawType](LoansMarket.md#torawtype) +- [toString](LoansMarket.md#tostring) +- [toU8a](LoansMarket.md#tou8a) +- [values](LoansMarket.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### borrowCap + +• `Readonly` **borrowCap**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:2390 + +___ + +### closeFactor + +• `Readonly` **closeFactor**: `Permill` + +#### Defined in + +src/interfaces/types-lookup.ts:2384 + +___ + +### collateralFactor + +• `Readonly` **collateralFactor**: `Permill` + +#### Defined in + +src/interfaces/types-lookup.ts:2381 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### lendTokenId + +• `Readonly` **lendTokenId**: `InterbtcPrimitivesCurrencyId` + +#### Defined in + +src/interfaces/types-lookup.ts:2391 + +___ + +### liquidateIncentive + +• `Readonly` **liquidateIncentive**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:2385 + +___ + +### liquidateIncentiveReservedFactor + +• `Readonly` **liquidateIncentiveReservedFactor**: `Permill` + +#### Defined in + +src/interfaces/types-lookup.ts:2386 + +___ + +### liquidationThreshold + +• `Readonly` **liquidationThreshold**: `Permill` + +#### Defined in + +src/interfaces/types-lookup.ts:2382 + +___ + +### rateModel + +• `Readonly` **rateModel**: `LoansRateModelInterestRateModel` + +#### Defined in + +src/interfaces/types-lookup.ts:2387 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### reserveFactor + +• `Readonly` **reserveFactor**: `Permill` + +#### Defined in + +src/interfaces/types-lookup.ts:2383 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +___ + +### state + +• `Readonly` **state**: `LoansMarketState` + +#### Defined in + +src/interfaces/types-lookup.ts:2388 + +___ + +### supplyCap + +• `Readonly` **supplyCap**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:2389 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`LoansMarket`](LoansMarket.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`LoansMarket`](LoansMarket.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/LpToken.md b/interfaces/LpToken.md new file mode 100644 index 000000000..fc905b033 --- /dev/null +++ b/interfaces/LpToken.md @@ -0,0 +1,681 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / LpToken + +# Interface: LpToken + +**`Name`** + +LpToken + +## Hierarchy + +- `Enum` + + ↳ **`LpToken`** + +## Table of contents + +### Properties + +- [#private](LpToken.md##private) +- [asForeignAsset](LpToken.md#asforeignasset) +- [asStableLpToken](LpToken.md#asstablelptoken) +- [asToken](LpToken.md#astoken) +- [createdAtHash](LpToken.md#createdathash) +- [initialU8aLength](LpToken.md#initialu8alength) +- [isForeignAsset](LpToken.md#isforeignasset) +- [isStableLpToken](LpToken.md#isstablelptoken) +- [isStorageFallback](LpToken.md#isstoragefallback) +- [isToken](LpToken.md#istoken) +- [registry](LpToken.md#registry) +- [type](LpToken.md#type) + +### Accessors + +- [defIndexes](LpToken.md#defindexes) +- [defKeys](LpToken.md#defkeys) +- [encodedLength](LpToken.md#encodedlength) +- [hash](LpToken.md#hash) +- [index](LpToken.md#index) +- [inner](LpToken.md#inner) +- [isBasic](LpToken.md#isbasic) +- [isEmpty](LpToken.md#isempty) +- [isNone](LpToken.md#isnone) +- [value](LpToken.md#value) + +### Methods + +- [\_toRawStruct](LpToken.md#_torawstruct) +- [eq](LpToken.md#eq) +- [inspect](LpToken.md#inspect) +- [toHex](LpToken.md#tohex) +- [toHuman](LpToken.md#tohuman) +- [toJSON](LpToken.md#tojson) +- [toNumber](LpToken.md#tonumber) +- [toPrimitive](LpToken.md#toprimitive) +- [toRawType](LpToken.md#torawtype) +- [toString](LpToken.md#tostring) +- [toU8a](LpToken.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### asForeignAsset + +• `Readonly` **asForeignAsset**: [`ForeignAssetId`](ForeignAssetId.md) + +#### Defined in + +src/interfaces/default/types.ts:97 + +___ + +### asStableLpToken + +• `Readonly` **asStableLpToken**: [`StablePoolId`](StablePoolId.md) + +#### Defined in + +src/interfaces/default/types.ts:99 + +___ + +### asToken + +• `Readonly` **asToken**: [`TokenSymbol`](TokenSymbol.md) + +#### Defined in + +src/interfaces/default/types.ts:95 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isForeignAsset + +• `Readonly` **isForeignAsset**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:96 + +___ + +### isStableLpToken + +• `Readonly` **isStableLpToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:98 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### isToken + +• `Readonly` **isToken**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:94 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Token"`` \| ``"ForeignAsset"`` \| ``"StableLpToken"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:100 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/MultiPathElementStableMeta.md b/interfaces/MultiPathElementStableMeta.md new file mode 100644 index 000000000..7396d2343 --- /dev/null +++ b/interfaces/MultiPathElementStableMeta.md @@ -0,0 +1,92 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / MultiPathElementStableMeta + +# Interface: MultiPathElementStableMeta + +## Hierarchy + +- `MultiPathElementBase` + + ↳ **`MultiPathElementStableMeta`** + +## Table of contents + +### Properties + +- [basePool](MultiPathElementStableMeta.md#basepool) +- [fromBase](MultiPathElementStableMeta.md#frombase) +- [input](MultiPathElementStableMeta.md#input) +- [output](MultiPathElementStableMeta.md#output) +- [pool](MultiPathElementStableMeta.md#pool) +- [type](MultiPathElementStableMeta.md#type) + +## Properties + +### basePool + +• **basePool**: [`StableLiquidityPool`](../classes/StableLiquidityPool.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:41](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L41) + +___ + +### fromBase + +• **fromBase**: `boolean` + +#### Defined in + +[src/parachain/amm/trade/types.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L42) + +___ + +### input + +• **input**: [`CurrencyExt`](../modules.md#currencyext) + +#### Inherited from + +MultiPathElementBase.input + +#### Defined in + +[src/parachain/amm/trade/types.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L17) + +___ + +### output + +• **output**: [`CurrencyExt`](../modules.md#currencyext) + +#### Inherited from + +MultiPathElementBase.output + +#### Defined in + +[src/parachain/amm/trade/types.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L18) + +___ + +### pool + +• **pool**: [`StableLiquidityPool`](../classes/StableLiquidityPool.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L40) + +___ + +### type + +• **type**: [`STABLE_META`](../enums/MultiPathElementType.md#stable_meta) + +#### Overrides + +MultiPathElementBase.type + +#### Defined in + +[src/parachain/amm/trade/types.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L39) diff --git a/interfaces/MultiPathElementStablePlain.md b/interfaces/MultiPathElementStablePlain.md new file mode 100644 index 000000000..3a218bf5c --- /dev/null +++ b/interfaces/MultiPathElementStablePlain.md @@ -0,0 +1,70 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / MultiPathElementStablePlain + +# Interface: MultiPathElementStablePlain + +## Hierarchy + +- `MultiPathElementBase` + + ↳ **`MultiPathElementStablePlain`** + +## Table of contents + +### Properties + +- [input](MultiPathElementStablePlain.md#input) +- [output](MultiPathElementStablePlain.md#output) +- [pool](MultiPathElementStablePlain.md#pool) +- [type](MultiPathElementStablePlain.md#type) + +## Properties + +### input + +• **input**: [`CurrencyExt`](../modules.md#currencyext) + +#### Inherited from + +MultiPathElementBase.input + +#### Defined in + +[src/parachain/amm/trade/types.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L17) + +___ + +### output + +• **output**: [`CurrencyExt`](../modules.md#currencyext) + +#### Inherited from + +MultiPathElementBase.output + +#### Defined in + +[src/parachain/amm/trade/types.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L18) + +___ + +### pool + +• **pool**: [`StableLiquidityPool`](../classes/StableLiquidityPool.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L35) + +___ + +### type + +• **type**: [`STABLE_PLAIN`](../enums/MultiPathElementType.md#stable_plain) + +#### Overrides + +MultiPathElementBase.type + +#### Defined in + +[src/parachain/amm/trade/types.ts:34](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L34) diff --git a/interfaces/MultiPathElementStandard.md b/interfaces/MultiPathElementStandard.md new file mode 100644 index 000000000..688f08e98 --- /dev/null +++ b/interfaces/MultiPathElementStandard.md @@ -0,0 +1,81 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / MultiPathElementStandard + +# Interface: MultiPathElementStandard + +## Hierarchy + +- `MultiPathElementBase` + + ↳ **`MultiPathElementStandard`** + +## Table of contents + +### Properties + +- [input](MultiPathElementStandard.md#input) +- [output](MultiPathElementStandard.md#output) +- [pair](MultiPathElementStandard.md#pair) +- [pool](MultiPathElementStandard.md#pool) +- [type](MultiPathElementStandard.md#type) + +## Properties + +### input + +• **input**: [`CurrencyExt`](../modules.md#currencyext) + +#### Inherited from + +MultiPathElementBase.input + +#### Defined in + +[src/parachain/amm/trade/types.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L17) + +___ + +### output + +• **output**: [`CurrencyExt`](../modules.md#currencyext) + +#### Inherited from + +MultiPathElementBase.output + +#### Defined in + +[src/parachain/amm/trade/types.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L18) + +___ + +### pair + +• **pair**: [`TradingPair`](TradingPair.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L29) + +___ + +### pool + +• **pool**: [`StandardLiquidityPool`](../classes/StandardLiquidityPool.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L30) + +___ + +### type + +• **type**: [`STANDARD`](../enums/MultiPathElementType.md#standard) + +#### Overrides + +MultiPathElementBase.type + +#### Defined in + +[src/parachain/amm/trade/types.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L28) diff --git a/interfaces/NominationAPI.md b/interfaces/NominationAPI.md new file mode 100644 index 000000000..87e53dd12 --- /dev/null +++ b/interfaces/NominationAPI.md @@ -0,0 +1,355 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / NominationAPI + +# Interface: NominationAPI + +## Implemented by + +- [`DefaultNominationAPI`](../classes/DefaultNominationAPI.md) + +## Table of contents + +### Methods + +- [depositCollateral](NominationAPI.md#depositcollateral) +- [getActiveNominatorRewards](NominationAPI.md#getactivenominatorrewards) +- [getFilteredNominations](NominationAPI.md#getfilterednominations) +- [getNominatorReward](NominationAPI.md#getnominatorreward) +- [getNonces](NominationAPI.md#getnonces) +- [getTotalNomination](NominationAPI.md#gettotalnomination) +- [isNominationEnabled](NominationAPI.md#isnominationenabled) +- [isVaultOptedIn](NominationAPI.md#isvaultoptedin) +- [list](NominationAPI.md#list) +- [listNominatorRewards](NominationAPI.md#listnominatorrewards) +- [listVaults](NominationAPI.md#listvaults) +- [optIn](NominationAPI.md#optin) +- [optOut](NominationAPI.md#optout) +- [setNominationEnabled](NominationAPI.md#setnominationenabled) +- [withdrawCollateral](NominationAPI.md#withdrawcollateral) + +## Methods + +### depositCollateral + +▸ **depositCollateral**(`vaultAccountId`, `amount`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | Vault to nominate collateral to | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Amount to deposit, as a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/nomination.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L47) + +___ + +### getActiveNominatorRewards + +▸ **getActiveNominatorRewards**(`nominatorId`): `Promise`<`NominationData`[]\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nominatorId` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`NominationData`[]\> + +The rewards a currently active nominator has accumulated + +#### Defined in + +[src/parachain/nomination.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L124) + +___ + +### getFilteredNominations + +▸ **getFilteredNominations**(`vaultAccountId?`, `collateralCurrency?`, `nominatorId?`): `Promise`<`Nomination`[]\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId?` | `AccountId` | Id of vault who is opted in to nomination | +| `collateralCurrency?` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | - | +| `nominatorId?` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`Nomination`[]\> + +**`Remarks`** + +At least one of the parameters must be specified + +#### Defined in + +[src/parachain/nomination.ts:102](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L102) + +___ + +### getNominatorReward + +▸ **getNominatorReward**(`vaultId`, `collateralCurrency`, `rewardCurrency`, `nominatorId`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | `AccountId` | - | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency towards whose issuance the nomination was made | +| `rewardCurrency` | `Currency` | The reward currency, e.g. kBTC, KINT, interBTC, INTR | +| `nominatorId` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The rewards a (possibly inactive) nominator has accumulated + +#### Defined in + +[src/parachain/nomination.ts:132](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L132) + +___ + +### getNonces + +▸ **getNonces**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `number`\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `number`\>\> + +A map (vaultId => nonce), representing the nonces for each reward pool with the given currency + +#### Defined in + +[src/parachain/nomination.ts:141](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L141) + +___ + +### getTotalNomination + +▸ **getTotalNomination**(`vaultAccountId?`, `collateralCurrency?`, `nominatorId?`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId?` | `AccountId` | Id of vault who is opted in to nomination | +| `collateralCurrency?` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The collateral currency of the nominations | +| `nominatorId?` | `AccountId` | Id of user who nominated to one or more vaults | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The total nominated amount, filtered using the given parameters + +**`Remarks`** + +At least one of the parameters must be specified + +#### Defined in + +[src/parachain/nomination.ts:114](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L114) + +___ + +### isNominationEnabled + +▸ **isNominationEnabled**(): `Promise`<`boolean`\> + +#### Returns + +`Promise`<`boolean`\> + +A boolean value representing whether the vault nomination feature is enabled + +#### Defined in + +[src/parachain/nomination.ts:77](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L77) + +___ + +### isVaultOptedIn + +▸ **isVaultOptedIn**(`accountId`, `collateralCurrency`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`boolean`\> + +A boolean value + +#### Defined in + +[src/parachain/nomination.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L95) + +___ + +### list + +▸ **list**(): `Promise`<`Nomination`[]\> + +#### Returns + +`Promise`<`Nomination`[]\> + +All nominations for the wrapped currency set in the API + +#### Defined in + +[src/parachain/nomination.ts:81](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L81) + +___ + +### listNominatorRewards + +▸ **listNominatorRewards**(): `Promise`<`NominationData`[]\> + +#### Returns + +`Promise`<`NominationData`[]\> + +The rewards a nominator has accumulated, in wrapped token (e.g. interBTC, kBTC) + +#### Defined in + +[src/parachain/nomination.ts:86](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L86) + +___ + +### listVaults + +▸ **listVaults**(): `Promise`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md)[]\> + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md)[]\> + +A list of all vaults that opted in to the nomination feature. + +#### Defined in + +[src/parachain/nomination.ts:90](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L90) + +___ + +### optIn + +▸ **optIn**(`collateralCurrency`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Currency to accept as nomination | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Function callable by vaults to opt in to the nomination feature + +#### Defined in + +[src/parachain/nomination.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L62) + +___ + +### optOut + +▸ **optOut**(`collateralCurrency`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Currency to stop accepting as nomination | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Function callable by vaults to opt out of the nomination feature + +#### Defined in + +[src/parachain/nomination.ts:68](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L68) + +___ + +### setNominationEnabled + +▸ **setNominationEnabled**(`enabled`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `enabled` | `boolean` | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Testnet utility function + +#### Defined in + +[src/parachain/nomination.ts:73](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L73) + +___ + +### withdrawCollateral + +▸ **withdrawCollateral**(`vaultAccountId`, `amount`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | Vault that collateral was nominated to | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Amount to withdraw, as a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/nomination.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/nomination.ts#L53) diff --git a/interfaces/NumberOrHex.md b/interfaces/NumberOrHex.md new file mode 100644 index 000000000..b78e348c2 --- /dev/null +++ b/interfaces/NumberOrHex.md @@ -0,0 +1,659 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / NumberOrHex + +# Interface: NumberOrHex + +**`Name`** + +NumberOrHex + +## Hierarchy + +- `Enum` + + ↳ **`NumberOrHex`** + +## Table of contents + +### Properties + +- [#private](NumberOrHex.md##private) +- [asHex](NumberOrHex.md#ashex) +- [asNumber](NumberOrHex.md#asnumber) +- [createdAtHash](NumberOrHex.md#createdathash) +- [initialU8aLength](NumberOrHex.md#initialu8alength) +- [isHex](NumberOrHex.md#ishex) +- [isNumber](NumberOrHex.md#isnumber) +- [isStorageFallback](NumberOrHex.md#isstoragefallback) +- [registry](NumberOrHex.md#registry) +- [type](NumberOrHex.md#type) + +### Accessors + +- [defIndexes](NumberOrHex.md#defindexes) +- [defKeys](NumberOrHex.md#defkeys) +- [encodedLength](NumberOrHex.md#encodedlength) +- [hash](NumberOrHex.md#hash) +- [index](NumberOrHex.md#index) +- [inner](NumberOrHex.md#inner) +- [isBasic](NumberOrHex.md#isbasic) +- [isEmpty](NumberOrHex.md#isempty) +- [isNone](NumberOrHex.md#isnone) +- [value](NumberOrHex.md#value) + +### Methods + +- [\_toRawStruct](NumberOrHex.md#_torawstruct) +- [eq](NumberOrHex.md#eq) +- [inspect](NumberOrHex.md#inspect) +- [toHex](NumberOrHex.md#tohex) +- [toHuman](NumberOrHex.md#tohuman) +- [toJSON](NumberOrHex.md#tojson) +- [toNumber](NumberOrHex.md#tonumber) +- [toPrimitive](NumberOrHex.md#toprimitive) +- [toRawType](NumberOrHex.md#torawtype) +- [toString](NumberOrHex.md#tostring) +- [toU8a](NumberOrHex.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### asHex + +• `Readonly` **asHex**: `u256` + +#### Defined in + +src/interfaces/default/types.ts:108 + +___ + +### asNumber + +• `Readonly` **asNumber**: `u64` + +#### Defined in + +src/interfaces/default/types.ts:106 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isHex + +• `Readonly` **isHex**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:107 + +___ + +### isNumber + +• `Readonly` **isNumber**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:105 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Number"`` \| ``"Hex"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:109 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/OracleAPI.md b/interfaces/OracleAPI.md new file mode 100644 index 000000000..3b5911cb2 --- /dev/null +++ b/interfaces/OracleAPI.md @@ -0,0 +1,256 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / OracleAPI + +# Interface: OracleAPI + +## Implemented by + +- [`DefaultOracleAPI`](../classes/DefaultOracleAPI.md) + +## Table of contents + +### Methods + +- [convertCollateralToWrapped](OracleAPI.md#convertcollateraltowrapped) +- [convertWrappedToCurrency](OracleAPI.md#convertwrappedtocurrency) +- [getBitcoinFees](OracleAPI.md#getbitcoinfees) +- [getExchangeRate](OracleAPI.md#getexchangerate) +- [getOnlineTimeout](OracleAPI.md#getonlinetimeout) +- [getRawValuesUpdated](OracleAPI.md#getrawvaluesupdated) +- [getSourcesById](OracleAPI.md#getsourcesbyid) +- [getValidUntil](OracleAPI.md#getvaliduntil) +- [isOnline](OracleAPI.md#isonline) +- [setBitcoinFees](OracleAPI.md#setbitcoinfees) +- [setExchangeRate](OracleAPI.md#setexchangerate) + +## Methods + +### convertCollateralToWrapped + +▸ **convertCollateralToWrapped**(`amount`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of collateral tokens to convert | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +Converted value + +#### Defined in + +[src/parachain/oracle.ts:81](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L81) + +___ + +### convertWrappedToCurrency + +▸ **convertWrappedToCurrency**(`amount`, `currency`): `Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to convert | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | A `Monetary.js` object | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>\> + +Converted value + +#### Defined in + +[src/parachain/oracle.ts:73](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L73) + +___ + +### getBitcoinFees + +▸ **getBitcoinFees**(): `Promise`<`Big`\> + +Obtains the current fees for BTC transactions, in satoshi/byte. + +#### Returns + +`Promise`<`Big`\> + +Big value for the current inclusion fees. + +#### Defined in + +[src/parachain/oracle.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L42) + +___ + +### getExchangeRate + +▸ **getExchangeRate**(`collateralCurrency`, `wrappedCurrency?`): `Promise`<`ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CurrencyExt`](../modules.md#currencyext) | - | +| `wrappedCurrency?` | `Currency` | The wrapped currency to use in the returned exchange rate type, defaults to `Bitcoin` | + +#### Returns + +`Promise`<`ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\>\> + +The exchange rate between Bitcoin and the provided collateral currency + +#### Defined in + +[src/parachain/oracle.ts:34](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L34) + +___ + +### getOnlineTimeout + +▸ **getOnlineTimeout**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The period of time (in milliseconds) after an oracle's last submission +during which it is considered online + +#### Defined in + +[src/parachain/oracle.ts:86](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L86) + +___ + +### getRawValuesUpdated + +▸ **getRawValuesUpdated**(`key`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `InterbtcPrimitivesOracleKey` | A key defining an exchange rate or a BTC network fee estimate | + +#### Returns + +`Promise`<`boolean`\> + +Whether the oracle entr for the given key has been updated + +#### Defined in + +[src/parachain/oracle.ts:91](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L91) + +___ + +### getSourcesById + +▸ **getSourcesById**(): `Promise`<`Map`<`string`, `string`\>\> + +#### Returns + +`Promise`<`Map`<`string`, `string`\>\> + +A map from the oracle's account id to its name + +#### Defined in + +[src/parachain/oracle.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L50) + +___ + +### getValidUntil + +▸ **getValidUntil**(`counterCurrency`): `Promise`<`Date`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `counterCurrency` | [`CurrencyExt`](../modules.md#currencyext) | + +#### Returns + +`Promise`<`Date`\> + +Last exchange rate time + +#### Defined in + +[src/parachain/oracle.ts:46](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L46) + +___ + +### isOnline + +▸ **isOnline**(`currency`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | Currency for which we check status of oracle. | + +#### Returns + +`Promise`<`boolean`\> + +Boolean value indicating whether the oracle is online for currency + +#### Defined in + +[src/parachain/oracle.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L55) + +___ + +### setBitcoinFees + +▸ **setBitcoinFees**(`fees`): [`ExtrinsicData`](ExtrinsicData.md) + +Create a transaction to set the current fee estimate for BTC transactions + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `fees` | `Big` | Estimated Satoshis per bytes to get a transaction included | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/oracle.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L67) + +___ + +### setExchangeRate + +▸ **setExchangeRate**(`exchangeRate`): [`ExtrinsicData`](ExtrinsicData.md) + +Create a transaction to set the exchange rate between Bitcoin and a collateral currency + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `exchangeRate` | `ExchangeRate`<`Currency`, [`CurrencyExt`](../modules.md#currencyext)\> | The rate to set | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/oracle.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/oracle.ts#L61) diff --git a/interfaces/Rate.md b/interfaces/Rate.md new file mode 100644 index 000000000..a2fc8fac8 --- /dev/null +++ b/interfaces/Rate.md @@ -0,0 +1,2932 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Rate + +# Interface: Rate + +**`Name`** + +Rate + +## Hierarchy + +- `FixedU128` + + ↳ **`Rate`** + +## Table of contents + +### Properties + +- [#private](Rate.md##private) +- [createdAtHash](Rate.md#createdathash) +- [encodedLength](Rate.md#encodedlength) +- [initialU8aLength](Rate.md#initialu8alength) +- [isStorageFallback](Rate.md#isstoragefallback) +- [isUnsigned](Rate.md#isunsigned) +- [registry](Rate.md#registry) + +### Accessors + +- [hash](Rate.md#hash) +- [isEmpty](Rate.md#isempty) + +### Methods + +- [abs](Rate.md#abs) +- [add](Rate.md#add) +- [addn](Rate.md#addn) +- [and](Rate.md#and) +- [andln](Rate.md#andln) +- [bincn](Rate.md#bincn) +- [bitLength](Rate.md#bitlength) +- [byteLength](Rate.md#bytelength) +- [clone](Rate.md#clone) +- [cmp](Rate.md#cmp) +- [cmpn](Rate.md#cmpn) +- [div](Rate.md#div) +- [divRound](Rate.md#divround) +- [divmod](Rate.md#divmod) +- [divn](Rate.md#divn) +- [egcd](Rate.md#egcd) +- [eq](Rate.md#eq) +- [eqn](Rate.md#eqn) +- [fromTwos](Rate.md#fromtwos) +- [gcd](Rate.md#gcd) +- [gt](Rate.md#gt) +- [gte](Rate.md#gte) +- [gten](Rate.md#gten) +- [gtn](Rate.md#gtn) +- [iabs](Rate.md#iabs) +- [iadd](Rate.md#iadd) +- [iaddn](Rate.md#iaddn) +- [iand](Rate.md#iand) +- [idivn](Rate.md#idivn) +- [imaskn](Rate.md#imaskn) +- [imul](Rate.md#imul) +- [imuln](Rate.md#imuln) +- [ineg](Rate.md#ineg) +- [inotn](Rate.md#inotn) +- [inspect](Rate.md#inspect) +- [invm](Rate.md#invm) +- [ior](Rate.md#ior) +- [isEven](Rate.md#iseven) +- [isMax](Rate.md#ismax) +- [isNeg](Rate.md#isneg) +- [isOdd](Rate.md#isodd) +- [isZero](Rate.md#iszero) +- [ishln](Rate.md#ishln) +- [ishrn](Rate.md#ishrn) +- [isqr](Rate.md#isqr) +- [isub](Rate.md#isub) +- [isubn](Rate.md#isubn) +- [iuand](Rate.md#iuand) +- [iuor](Rate.md#iuor) +- [iushln](Rate.md#iushln) +- [iushrn](Rate.md#iushrn) +- [iuxor](Rate.md#iuxor) +- [ixor](Rate.md#ixor) +- [lt](Rate.md#lt) +- [lte](Rate.md#lte) +- [lten](Rate.md#lten) +- [ltn](Rate.md#ltn) +- [maskn](Rate.md#maskn) +- [mod](Rate.md#mod) +- [modn](Rate.md#modn) +- [modrn](Rate.md#modrn) +- [mul](Rate.md#mul) +- [muln](Rate.md#muln) +- [neg](Rate.md#neg) +- [notn](Rate.md#notn) +- [or](Rate.md#or) +- [pow](Rate.md#pow) +- [setn](Rate.md#setn) +- [shln](Rate.md#shln) +- [shrn](Rate.md#shrn) +- [sqr](Rate.md#sqr) +- [sub](Rate.md#sub) +- [subn](Rate.md#subn) +- [testn](Rate.md#testn) +- [toArray](Rate.md#toarray) +- [toArrayLike](Rate.md#toarraylike) +- [toBigInt](Rate.md#tobigint) +- [toBn](Rate.md#tobn) +- [toBuffer](Rate.md#tobuffer) +- [toHex](Rate.md#tohex) +- [toHuman](Rate.md#tohuman) +- [toJSON](Rate.md#tojson) +- [toNumber](Rate.md#tonumber) +- [toPrimitive](Rate.md#toprimitive) +- [toRawType](Rate.md#torawtype) +- [toRed](Rate.md#tored) +- [toString](Rate.md#tostring) +- [toTwos](Rate.md#totwos) +- [toU8a](Rate.md#tou8a) +- [uand](Rate.md#uand) +- [ucmp](Rate.md#ucmp) +- [umod](Rate.md#umod) +- [uor](Rate.md#uor) +- [ushln](Rate.md#ushln) +- [ushrn](Rate.md#ushrn) +- [uxor](Rate.md#uxor) +- [xor](Rate.md#xor) +- [zeroBits](Rate.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +FixedU128.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +FixedU128.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +FixedU128.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +FixedU128.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +FixedU128.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +FixedU128.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +FixedU128.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +FixedU128.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +FixedU128.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +FixedU128.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +FixedU128.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +FixedU128.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +FixedU128.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +FixedU128.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +FixedU128.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +FixedU128.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +FixedU128.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +FixedU128.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +FixedU128.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +FixedU128.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +FixedU128.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +FixedU128.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +FixedU128.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +FixedU128.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +FixedU128.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +FixedU128.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +FixedU128.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +FixedU128.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +FixedU128.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +FixedU128.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +FixedU128.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +FixedU128.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +FixedU128.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +FixedU128.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +FixedU128.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +FixedU128.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +FixedU128.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +FixedU128.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +FixedU128.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +FixedU128.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +FixedU128.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +FixedU128.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +FixedU128.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +FixedU128.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +FixedU128.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +FixedU128.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +FixedU128.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/Ratio.md b/interfaces/Ratio.md new file mode 100644 index 000000000..d3317f4bb --- /dev/null +++ b/interfaces/Ratio.md @@ -0,0 +1,2932 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Ratio + +# Interface: Ratio + +**`Name`** + +Ratio + +## Hierarchy + +- `Permill` + + ↳ **`Ratio`** + +## Table of contents + +### Properties + +- [#private](Ratio.md##private) +- [createdAtHash](Ratio.md#createdathash) +- [encodedLength](Ratio.md#encodedlength) +- [initialU8aLength](Ratio.md#initialu8alength) +- [isStorageFallback](Ratio.md#isstoragefallback) +- [isUnsigned](Ratio.md#isunsigned) +- [registry](Ratio.md#registry) + +### Accessors + +- [hash](Ratio.md#hash) +- [isEmpty](Ratio.md#isempty) + +### Methods + +- [abs](Ratio.md#abs) +- [add](Ratio.md#add) +- [addn](Ratio.md#addn) +- [and](Ratio.md#and) +- [andln](Ratio.md#andln) +- [bincn](Ratio.md#bincn) +- [bitLength](Ratio.md#bitlength) +- [byteLength](Ratio.md#bytelength) +- [clone](Ratio.md#clone) +- [cmp](Ratio.md#cmp) +- [cmpn](Ratio.md#cmpn) +- [div](Ratio.md#div) +- [divRound](Ratio.md#divround) +- [divmod](Ratio.md#divmod) +- [divn](Ratio.md#divn) +- [egcd](Ratio.md#egcd) +- [eq](Ratio.md#eq) +- [eqn](Ratio.md#eqn) +- [fromTwos](Ratio.md#fromtwos) +- [gcd](Ratio.md#gcd) +- [gt](Ratio.md#gt) +- [gte](Ratio.md#gte) +- [gten](Ratio.md#gten) +- [gtn](Ratio.md#gtn) +- [iabs](Ratio.md#iabs) +- [iadd](Ratio.md#iadd) +- [iaddn](Ratio.md#iaddn) +- [iand](Ratio.md#iand) +- [idivn](Ratio.md#idivn) +- [imaskn](Ratio.md#imaskn) +- [imul](Ratio.md#imul) +- [imuln](Ratio.md#imuln) +- [ineg](Ratio.md#ineg) +- [inotn](Ratio.md#inotn) +- [inspect](Ratio.md#inspect) +- [invm](Ratio.md#invm) +- [ior](Ratio.md#ior) +- [isEven](Ratio.md#iseven) +- [isMax](Ratio.md#ismax) +- [isNeg](Ratio.md#isneg) +- [isOdd](Ratio.md#isodd) +- [isZero](Ratio.md#iszero) +- [ishln](Ratio.md#ishln) +- [ishrn](Ratio.md#ishrn) +- [isqr](Ratio.md#isqr) +- [isub](Ratio.md#isub) +- [isubn](Ratio.md#isubn) +- [iuand](Ratio.md#iuand) +- [iuor](Ratio.md#iuor) +- [iushln](Ratio.md#iushln) +- [iushrn](Ratio.md#iushrn) +- [iuxor](Ratio.md#iuxor) +- [ixor](Ratio.md#ixor) +- [lt](Ratio.md#lt) +- [lte](Ratio.md#lte) +- [lten](Ratio.md#lten) +- [ltn](Ratio.md#ltn) +- [maskn](Ratio.md#maskn) +- [mod](Ratio.md#mod) +- [modn](Ratio.md#modn) +- [modrn](Ratio.md#modrn) +- [mul](Ratio.md#mul) +- [muln](Ratio.md#muln) +- [neg](Ratio.md#neg) +- [notn](Ratio.md#notn) +- [or](Ratio.md#or) +- [pow](Ratio.md#pow) +- [setn](Ratio.md#setn) +- [shln](Ratio.md#shln) +- [shrn](Ratio.md#shrn) +- [sqr](Ratio.md#sqr) +- [sub](Ratio.md#sub) +- [subn](Ratio.md#subn) +- [testn](Ratio.md#testn) +- [toArray](Ratio.md#toarray) +- [toArrayLike](Ratio.md#toarraylike) +- [toBigInt](Ratio.md#tobigint) +- [toBn](Ratio.md#tobn) +- [toBuffer](Ratio.md#tobuffer) +- [toHex](Ratio.md#tohex) +- [toHuman](Ratio.md#tohuman) +- [toJSON](Ratio.md#tojson) +- [toNumber](Ratio.md#tonumber) +- [toPrimitive](Ratio.md#toprimitive) +- [toRawType](Ratio.md#torawtype) +- [toRed](Ratio.md#tored) +- [toString](Ratio.md#tostring) +- [toTwos](Ratio.md#totwos) +- [toU8a](Ratio.md#tou8a) +- [uand](Ratio.md#uand) +- [ucmp](Ratio.md#ucmp) +- [umod](Ratio.md#umod) +- [uor](Ratio.md#uor) +- [ushln](Ratio.md#ushln) +- [ushrn](Ratio.md#ushrn) +- [uxor](Ratio.md#uxor) +- [xor](Ratio.md#xor) +- [zeroBits](Ratio.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Permill.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Permill.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +Permill.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Permill.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Permill.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +Permill.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Permill.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Permill.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +Permill.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +Permill.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +Permill.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +Permill.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +Permill.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +Permill.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +Permill.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +Permill.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +Permill.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +Permill.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +Permill.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +Permill.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +Permill.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +Permill.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +Permill.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +Permill.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +Permill.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Permill.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +Permill.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +Permill.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +Permill.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +Permill.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +Permill.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +Permill.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +Permill.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +Permill.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +Permill.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +Permill.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +Permill.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +Permill.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +Permill.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +Permill.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +Permill.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +Permill.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +Permill.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Permill.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +Permill.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +Permill.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +Permill.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +Permill.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +Permill.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +Permill.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +Permill.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +Permill.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +Permill.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +Permill.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +Permill.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +Permill.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +Permill.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +Permill.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +Permill.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +Permill.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +Permill.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +Permill.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +Permill.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +Permill.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +Permill.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +Permill.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +Permill.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +Permill.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +Permill.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +Permill.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +Permill.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +Permill.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +Permill.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +Permill.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +Permill.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +Permill.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +Permill.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +Permill.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +Permill.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +Permill.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +Permill.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +Permill.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +Permill.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +Permill.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +Permill.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +Permill.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +Permill.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +Permill.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +Permill.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Permill.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Permill.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Permill.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +Permill.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +Permill.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Permill.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +Permill.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Permill.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +Permill.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Permill.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +Permill.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +Permill.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +Permill.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +Permill.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +Permill.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +Permill.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +Permill.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +Permill.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +Permill.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/Redeem.md b/interfaces/Redeem.md new file mode 100644 index 000000000..950723374 --- /dev/null +++ b/interfaces/Redeem.md @@ -0,0 +1,173 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Redeem + +# Interface: Redeem + +## Table of contents + +### Properties + +- [amountBTC](Redeem.md#amountbtc) +- [bridgeFee](Redeem.md#bridgefee) +- [btcBlockHeight](Redeem.md#btcblockheight) +- [btcTransferFee](Redeem.md#btctransferfee) +- [btcTxId](Redeem.md#btctxid) +- [collateralPremium](Redeem.md#collateralpremium) +- [confirmations](Redeem.md#confirmations) +- [creationBlock](Redeem.md#creationblock) +- [creationTimestamp](Redeem.md#creationtimestamp) +- [id](Redeem.md#id) +- [period](Redeem.md#period) +- [status](Redeem.md#status) +- [userBTCAddress](Redeem.md#userbtcaddress) +- [userParachainAddress](Redeem.md#userparachainaddress) +- [vaultId](Redeem.md#vaultid) + +## Properties + +### amountBTC + +• **amountBTC**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:49](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L49) + +___ + +### bridgeFee + +• **bridgeFee**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L51) + +___ + +### btcBlockHeight + +• `Optional` **btcBlockHeight**: `number` + +#### Defined in + +[src/types/requestTypes.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L59) + +___ + +### btcTransferFee + +• **btcTransferFee**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L52) + +___ + +### btcTxId + +• `Optional` **btcTxId**: `string` + +#### Defined in + +[src/types/requestTypes.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L57) + +___ + +### collateralPremium + +• **collateralPremium**: `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> + +#### Defined in + +[src/types/requestTypes.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L50) + +___ + +### confirmations + +• `Optional` **confirmations**: `number` + +#### Defined in + +[src/types/requestTypes.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L58) + +___ + +### creationBlock + +• **creationBlock**: `number` + +#### Defined in + +[src/types/requestTypes.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L54) + +___ + +### creationTimestamp + +• `Optional` **creationTimestamp**: `number` + +#### Defined in + +[src/types/requestTypes.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L53) + +___ + +### id + +• **id**: `string` + +#### Defined in + +[src/types/requestTypes.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L47) + +___ + +### period + +• **period**: `number` + +#### Defined in + +[src/types/requestTypes.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L61) + +___ + +### status + +• **status**: [`RedeemStatus`](../enums/RedeemStatus.md) + +#### Defined in + +[src/types/requestTypes.ts:60](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L60) + +___ + +### userBTCAddress + +• **userBTCAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L56) + +___ + +### userParachainAddress + +• **userParachainAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L48) + +___ + +### vaultId + +• **vaultId**: [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/types/requestTypes.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L55) diff --git a/interfaces/RedeemAPI.md b/interfaces/RedeemAPI.md new file mode 100644 index 000000000..0e310ad96 --- /dev/null +++ b/interfaces/RedeemAPI.md @@ -0,0 +1,511 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / RedeemAPI + +# Interface: RedeemAPI + +## Implemented by + +- [`DefaultRedeemAPI`](../classes/DefaultRedeemAPI.md) + +## Table of contents + +### Methods + +- [buildCancelRedeemExtrinsic](RedeemAPI.md#buildcancelredeemextrinsic) +- [buildExecuteRedeemExtrinsic](RedeemAPI.md#buildexecuteredeemextrinsic) +- [buildLiquidationRedeemExtrinsic](RedeemAPI.md#buildliquidationredeemextrinsic) +- [buildRequestRedeemExtrinsic](RedeemAPI.md#buildrequestredeemextrinsic) +- [burn](RedeemAPI.md#burn) +- [cancel](RedeemAPI.md#cancel) +- [execute](RedeemAPI.md#execute) +- [getBurnExchangeRate](RedeemAPI.md#getburnexchangerate) +- [getCurrentInclusionFee](RedeemAPI.md#getcurrentinclusionfee) +- [getDustValue](RedeemAPI.md#getdustvalue) +- [getFeeRate](RedeemAPI.md#getfeerate) +- [getFeesToPay](RedeemAPI.md#getfeestopay) +- [getMaxBurnableTokens](RedeemAPI.md#getmaxburnabletokens) +- [getPremiumRedeemFeeRate](RedeemAPI.md#getpremiumredeemfeerate) +- [getRedeemPeriod](RedeemAPI.md#getredeemperiod) +- [getRequestById](RedeemAPI.md#getrequestbyid) +- [getRequestsByIds](RedeemAPI.md#getrequestsbyids) +- [list](RedeemAPI.md#list) +- [request](RedeemAPI.md#request) +- [requestAdvanced](RedeemAPI.md#requestadvanced) +- [setRedeemPeriod](RedeemAPI.md#setredeemperiod) + +## Methods + +### buildCancelRedeemExtrinsic + +▸ **buildCancelRedeemExtrinsic**(`redeemId`, `reimburse`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a cancel redeem extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` | The ID returned by the redeem request transaction | +| `reimburse` | `boolean` | In case of redeem failure: - `false` = retry redeeming, with a different Vault - `true` = accept reimbursement in wrapped token | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A cancel redeem submittable extrinsic. + +#### Defined in + +[src/parachain/redeem.ts:119](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L119) + +___ + +### buildExecuteRedeemExtrinsic + +▸ **buildExecuteRedeemExtrinsic**(`redeemId`, `btcTxId`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build a redeem execution extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` | The ID returned by the issue request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +An execute redeem submittable extrinsic. + +#### Defined in + +[src/parachain/redeem.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L95) + +___ + +### buildLiquidationRedeemExtrinsic + +▸ **buildLiquidationRedeemExtrinsic**(`amount`, `collateralCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build liquidation redeem extrinsic (without sending it) to burn wrapped tokens for a premium + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to burn | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Liquidated collateral currency to use when burning wrapped tokens | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A liquidation redeem submittable extrinsic. + +#### Defined in + +[src/parachain/redeem.ts:185](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L185) + +___ + +### buildRequestRedeemExtrinsic + +▸ **buildRequestRedeemExtrinsic**(`vaultId`, `amount`, `btcAddress`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a request redeem extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | ID of the vault to redeem with. | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped token amount to redeem | +| `btcAddress` | `string` | Bitcoin transaction ID | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A request redeem submittable extrinsic. + +#### Defined in + +[src/parachain/redeem.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L50) + +___ + +### burn + +▸ **burn**(`amount`, `collateralCurrency`): [`ExtrinsicData`](ExtrinsicData.md) + +Burn wrapped tokens for a premium + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to burn | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Liquidated collateral currency to use when burning wrapped tokens | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/redeem.ts:196](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L196) + +___ + +### cancel + +▸ **cancel**(`redeemId`, `reimburse?`): [`ExtrinsicData`](ExtrinsicData.md) + +Send a redeem cancellation transaction. After the redeem period has elapsed, +the redeemal request can be cancelled. As a result, the griefing collateral +of the vault will be slashed and sent to the redeemer + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` | The ID returned by the redeem request transaction | +| `reimburse?` | `boolean` | (Optional) In case of redeem failure: - (Default) `false` = retry redeeming, with a different Vault - `true` = accept reimbursement in wrapped token | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/redeem.ts:134](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L134) + +___ + +### execute + +▸ **execute**(`requestId`, `btcTxId`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Send a redeem execution transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | - | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +If `txId` is not set, the `merkleProof` and `rawTx` must both be set. + +#### Defined in + +[src/parachain/redeem.ts:108](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L108) + +___ + +### getBurnExchangeRate + +▸ **getBurnExchangeRate**(`collateralCurrency`): `Promise`<`ExchangeRate`<`Currency`, [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Currency whose exchange rate with BTC to fetch | + +#### Returns + +`Promise`<`ExchangeRate`<`Currency`, [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The exchange rate (collateral currency to wrapped token currency) +used when burning tokens + +#### Defined in + +[src/parachain/redeem.ts:207](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L207) + +___ + +### getCurrentInclusionFee + +▸ **getCurrentInclusionFee**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The current inclusion fee based on the expected number of bytes +in the transaction, and the inclusion fee rate reported by the oracle + +#### Defined in + +[src/parachain/redeem.ts:214](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L214) + +___ + +### getDustValue + +▸ **getDustValue**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The minimum amount of wrapped tokens that is accepted for redeem requests; any lower values would +risk the bitcoin client to reject the payment + +#### Defined in + +[src/parachain/redeem.ts:162](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L162) + +___ + +### getFeeRate + +▸ **getFeeRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +The fee charged for redeeming. For instance, "0.005" stands for 0.5% + +#### Defined in + +[src/parachain/redeem.ts:166](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L166) + +___ + +### getFeesToPay + +▸ **getFeesToPay**(`amount`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens for which to compute the redeem fees | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The fees + +#### Defined in + +[src/parachain/redeem.ts:171](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L171) + +___ + +### getMaxBurnableTokens + +▸ **getMaxBurnableTokens**(`collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Liquidated collateral currency to use when burning wrapped tokens | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The maximum amount of tokens that can be burned through a liquidation redeem + +#### Defined in + +[src/parachain/redeem.ts:201](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L201) + +___ + +### getPremiumRedeemFeeRate + +▸ **getPremiumRedeemFeeRate**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +If users execute a redeem with a Vault flagged for premium redeem, +they can earn a premium, slashed from the Vault's collateral. +This value is a percentage of the redeemed amount. + +#### Defined in + +[src/parachain/redeem.ts:177](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L177) + +___ + +### getRedeemPeriod + +▸ **getRedeemPeriod**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The time difference in number of blocks between a redeem request +is created and required completion time by a vault. +The redeem period has an upper limit to ensure the user gets their BTC in time +and to potentially punish a vault for inactivity or stealing BTC. + +#### Defined in + +[src/parachain/redeem.ts:151](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L151) + +___ + +### getRequestById + +▸ **getRequestById**(`redeemId`): `Promise`<[`Redeem`](Redeem.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `redeemId` | `string` \| `H256` | The ID of the redeem request to fetch | + +#### Returns + +`Promise`<[`Redeem`](Redeem.md)\> + +A redeem request object + +#### Defined in + +[src/parachain/redeem.ts:156](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L156) + +___ + +### getRequestsByIds + +▸ **getRequestsByIds**(`redeemIds`): `Promise`<[`Redeem`](Redeem.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `redeemIds` | (`string` \| `H256`)[] | + +#### Returns + +`Promise`<[`Redeem`](Redeem.md)[]\> + +#### Defined in + +[src/parachain/redeem.ts:157](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L157) + +___ + +### list + +▸ **list**(): `Promise`<[`Redeem`](Redeem.md)[]\> + +#### Returns + +`Promise`<[`Redeem`](Redeem.md)[]\> + +An array containing the redeem requests + +#### Defined in + +[src/parachain/redeem.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L40) + +___ + +### request + +▸ **request**(`amount`, `btcAddressEnc`, `vaultId?`, `atomic?`, `availableVaults?`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Create a redeem request transaction + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped token amount to redeem | +| `btcAddressEnc` | `string` | Bitcoin address where the redeemed BTC should be sent | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | (optional) ID of the vault to redeem with. | +| `atomic?` | `boolean` | (optional) Whether the request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. Defaults to false. | +| `availableVaults?` | `Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | (optional) A list of all vaults usable for redeem. If not provided, will fetch from the parachain. | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/redeem.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L65) + +___ + +### requestAdvanced + +▸ **requestAdvanced**(`amountsPerVault`, `btcAddressEnc`, `atomic`): [`ExtrinsicData`](ExtrinsicData.md) + +Create a batch of aggregated redeem transactions (to one or more vaults) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amountsPerVault` | `Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | A mapping of vaults to redeem from, and wrapped token amounts to redeem using each vault | +| `btcAddressEnc` | `string` | Bitcoin address where the redeemed BTC should be sent | +| `atomic` | `boolean` | Whether the issue request should be handled atomically or not. Only makes a difference if more than one vault is needed to fulfil it. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Throws`** + +Rejects the promise if none of the requests succeeded (or if at least one failed, when atomic=true). + +#### Defined in + +[src/parachain/redeem.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L82) + +___ + +### setRedeemPeriod + +▸ **setRedeemPeriod**(`blocks`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blocks` | `number` | The time difference in number of blocks between a redeem request is created and required completion time by a vault. The redeem period has an upper limit to ensure the user gets their BTC in time and to potentially punish a vault for inactivity or stealing BTC. | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Testnet utility function + +#### Defined in + +[src/parachain/redeem.ts:143](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/redeem.ts#L143) diff --git a/interfaces/RefundRequestExt.md b/interfaces/RefundRequestExt.md new file mode 100644 index 000000000..02fa65315 --- /dev/null +++ b/interfaces/RefundRequestExt.md @@ -0,0 +1,96 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / RefundRequestExt + +# Interface: RefundRequestExt + +## Table of contents + +### Properties + +- [amountBtc](RefundRequestExt.md#amountbtc) +- [amountIssuing](RefundRequestExt.md#amountissuing) +- [btcAddress](RefundRequestExt.md#btcaddress) +- [completed](RefundRequestExt.md#completed) +- [fee](RefundRequestExt.md#fee) +- [issueId](RefundRequestExt.md#issueid) +- [issuer](RefundRequestExt.md#issuer) +- [vaultId](RefundRequestExt.md#vaultid) + +## Properties + +### amountBtc + +• **amountBtc**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:79](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L79) + +___ + +### amountIssuing + +• **amountIssuing**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:77](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L77) + +___ + +### btcAddress + +• **btcAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:81](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L81) + +___ + +### completed + +• **completed**: `boolean` + +#### Defined in + +[src/types/requestTypes.ts:83](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L83) + +___ + +### fee + +• **fee**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:78](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L78) + +___ + +### issueId + +• **issueId**: `string` + +#### Defined in + +[src/types/requestTypes.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L82) + +___ + +### issuer + +• **issuer**: `AccountId` + +#### Defined in + +[src/types/requestTypes.ts:80](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L80) + +___ + +### vaultId + +• **vaultId**: [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/types/requestTypes.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L76) diff --git a/interfaces/ReplaceAPI.md b/interfaces/ReplaceAPI.md new file mode 100644 index 000000000..31a78b214 --- /dev/null +++ b/interfaces/ReplaceAPI.md @@ -0,0 +1,347 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ReplaceAPI + +# Interface: ReplaceAPI + +## Implemented by + +- [`DefaultReplaceAPI`](../classes/DefaultReplaceAPI.md) + +## Table of contents + +### Methods + +- [accept](ReplaceAPI.md#accept) +- [buildAcceptReplaceExtrinsic](ReplaceAPI.md#buildacceptreplaceextrinsic) +- [buildExecuteReplaceExtrinsic](ReplaceAPI.md#buildexecutereplaceextrinsic) +- [buildRequestReplaceExtrinsic](ReplaceAPI.md#buildrequestreplaceextrinsic) +- [buildWithdrawReplaceExtrinsic](ReplaceAPI.md#buildwithdrawreplaceextrinsic) +- [execute](ReplaceAPI.md#execute) +- [getDustValue](ReplaceAPI.md#getdustvalue) +- [getReplacePeriod](ReplaceAPI.md#getreplaceperiod) +- [getRequestById](ReplaceAPI.md#getrequestbyid) +- [list](ReplaceAPI.md#list) +- [map](ReplaceAPI.md#map) +- [mapReplaceRequests](ReplaceAPI.md#mapreplacerequests) +- [request](ReplaceAPI.md#request) +- [withdraw](ReplaceAPI.md#withdraw) + +## Methods + +### accept + +▸ **accept**(`oldVault`, `amount`, `collateral`, `btcAddress`): [`ExtrinsicData`](ExtrinsicData.md) + +Accept a replace request + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `oldVault` | `AccountId` | ID of the old vault that to be (possibly partially) replaced | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount of issued tokens to be replaced | +| `collateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral for replacement | +| `btcAddress` | `string` | The address that old-vault should transfer the btc to | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/replace.ts:115](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L115) + +___ + +### buildAcceptReplaceExtrinsic + +▸ **buildAcceptReplaceExtrinsic**(`oldVault`, `amount`, `collateral`, `btcAddress`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build an accept replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `oldVault` | `AccountId` | account ID of the old vault that to be (possibly partially) replaced | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount of issued tokens to be replaced | +| `collateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral for replacement | +| `btcAddress` | `string` | The address that old-vault should transfer the btc to | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +An accept replace submittable extrinsic. + +#### Defined in + +[src/parachain/replace.ts:100](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L100) + +___ + +### buildExecuteReplaceExtrinsic + +▸ **buildExecuteReplaceExtrinsic**(`requestId`, `btcTxId`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build an execute replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID generated by the replace request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +An execute replace submittable extrinsic. + +#### Defined in + +[src/parachain/replace.ts:129](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L129) + +___ + +### buildRequestReplaceExtrinsic + +▸ **buildRequestReplaceExtrinsic**(`amount`, `collateralCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a request replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped token amount to replace. | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency to have replaced | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A request replace submittable extrinsic. + +#### Defined in + +[src/parachain/replace.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L57) + +___ + +### buildWithdrawReplaceExtrinsic + +▸ **buildWithdrawReplaceExtrinsic**(`amount`, `collateralCurrency`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a withdraw replace extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to withdraw from the amount requested to have replaced. | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency to have replaced | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A withdraw replace submittable extrinsic. + +#### Defined in + +[src/parachain/replace.ts:77](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L77) + +___ + +### execute + +▸ **execute**(`requestId`, `btcTxId`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Execute a replace request + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `requestId` | `string` | The ID generated by the replace request transaction | +| `btcTxId` | `string` | Bitcoin transaction ID | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +If `txId` is not set, the `merkleProof` and `rawTx` must both be set. + +#### Defined in + +[src/parachain/replace.ts:142](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L142) + +___ + +### getDustValue + +▸ **getDustValue**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The minimum amount of btc that is accepted for replace requests; any lower values would +risk the bitcoin client to reject the payment + +#### Defined in + +[src/parachain/replace.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L29) + +___ + +### getReplacePeriod + +▸ **getReplacePeriod**(): `Promise`<`BlockNumber`\> + +#### Returns + +`Promise`<`BlockNumber`\> + +The time difference in number of blocks between when a replace request is created +and required completion time by a vault. The replace period has an upper limit +to prevent griefing of vault collateral. + +#### Defined in + +[src/parachain/replace.ts:35](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L35) + +___ + +### getRequestById + +▸ **getRequestById**(`replaceId`, `atBlock?`): `Promise`<[`ReplaceRequestExt`](ReplaceRequestExt.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `replaceId` | `string` \| `H256` | The ID of the replace request to fetch | +| `atBlock?` | `BlockHash` | - | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](ReplaceRequestExt.md)\> + +A replace request object + +#### Defined in + +[src/parachain/replace.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L48) + +___ + +### list + +▸ **list**(): `Promise`<[`ReplaceRequestExt`](ReplaceRequestExt.md)[]\> + +#### Returns + +`Promise`<[`ReplaceRequestExt`](ReplaceRequestExt.md)[]\> + +An array containing the replace requests + +#### Defined in + +[src/parachain/replace.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L39) + +___ + +### map + +▸ **map**(): `Promise`<`Map`<`H256`, [`ReplaceRequestExt`](ReplaceRequestExt.md)\>\> + +#### Returns + +`Promise`<`Map`<`H256`, [`ReplaceRequestExt`](ReplaceRequestExt.md)\>\> + +A mapping from the replace request ID to the replace request object + +#### Defined in + +[src/parachain/replace.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L43) + +___ + +### mapReplaceRequests + +▸ **mapReplaceRequests**(`vaultAccountId`): `Promise`<[`ReplaceRequestExt`](ReplaceRequestExt.md)[]\> + +Fetch the replace requests associated with a vault. In the returned requests, +the vault is either the replaced or the replacing one. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The AccountId of the vault used to filter replace requests | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](ReplaceRequestExt.md)[]\> + +An array with replace requests involving said vault + +#### Defined in + +[src/parachain/replace.ts:150](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L150) + +___ + +### request + +▸ **request**(`amount`, `collateralCurrency`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Amount issued, denoted in Bitcoin, to have replaced by another vault | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency to have replaced | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/replace.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L67) + +___ + +### withdraw + +▸ **withdraw**(`amount`, `collateralCurrency`): [`ExtrinsicData`](ExtrinsicData.md) + +Wihdraw a replace request + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | The amount of wrapped tokens to withdraw from the amount requested to have replaced. | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral currency of the request | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/replace.ts:89](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/replace.ts#L89) diff --git a/interfaces/ReplaceRequestExt.md b/interfaces/ReplaceRequestExt.md new file mode 100644 index 000000000..f74bff883 --- /dev/null +++ b/interfaces/ReplaceRequestExt.md @@ -0,0 +1,129 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / ReplaceRequestExt + +# Interface: ReplaceRequestExt + +## Table of contents + +### Properties + +- [acceptTime](ReplaceRequestExt.md#accepttime) +- [amount](ReplaceRequestExt.md#amount) +- [btcAddress](ReplaceRequestExt.md#btcaddress) +- [btcHeight](ReplaceRequestExt.md#btcheight) +- [collateral](ReplaceRequestExt.md#collateral) +- [griefingCollateral](ReplaceRequestExt.md#griefingcollateral) +- [id](ReplaceRequestExt.md#id) +- [newVault](ReplaceRequestExt.md#newvault) +- [oldVault](ReplaceRequestExt.md#oldvault) +- [period](ReplaceRequestExt.md#period) +- [status](ReplaceRequestExt.md#status) + +## Properties + +### acceptTime + +• **acceptTime**: `number` + +#### Defined in + +[src/types/requestTypes.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L94) + +___ + +### amount + +• **amount**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:91](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L91) + +___ + +### btcAddress + +• **btcAddress**: `string` + +#### Defined in + +[src/types/requestTypes.ts:88](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L88) + +___ + +### btcHeight + +• **btcHeight**: `number` + +#### Defined in + +[src/types/requestTypes.ts:96](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L96) + +___ + +### collateral + +• **collateral**: `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> + +#### Defined in + +[src/types/requestTypes.ts:93](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L93) + +___ + +### griefingCollateral + +• **griefingCollateral**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/requestTypes.ts:92](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L92) + +___ + +### id + +• **id**: `string` + +#### Defined in + +[src/types/requestTypes.ts:87](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L87) + +___ + +### newVault + +• **newVault**: [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/types/requestTypes.ts:89](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L89) + +___ + +### oldVault + +• **oldVault**: [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/types/requestTypes.ts:90](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L90) + +___ + +### period + +• **period**: `number` + +#### Defined in + +[src/types/requestTypes.ts:95](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L95) + +___ + +### status + +• **status**: `InterbtcPrimitivesReplaceReplaceRequestStatus` + +#### Defined in + +[src/types/requestTypes.ts:97](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/requestTypes.ts#L97) diff --git a/interfaces/RewardsAPI.md b/interfaces/RewardsAPI.md new file mode 100644 index 000000000..532569bd7 --- /dev/null +++ b/interfaces/RewardsAPI.md @@ -0,0 +1,88 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / RewardsAPI + +# Interface: RewardsAPI + +## Implemented by + +- [`DefaultRewardsAPI`](../classes/DefaultRewardsAPI.md) + +## Table of contents + +### Methods + +- [computeCollateralInStakingPool](RewardsAPI.md#computecollateralinstakingpool) +- [getStakingPoolNonce](RewardsAPI.md#getstakingpoolnonce) +- [withdrawRewards](RewardsAPI.md#withdrawrewards) + +## Methods + +### computeCollateralInStakingPool + +▸ **computeCollateralInStakingPool**(`vaultId`, `nominatorId`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | The account ID of the staking pool nominee | +| `nominatorId` | `AccountId` | The account ID of the staking pool nominator | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +A Monetary.js amount object, representing the collateral in the given currency + +#### Defined in + +[src/parachain/rewards.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L28) + +___ + +### getStakingPoolNonce + +▸ **getStakingPoolNonce**(`currency`, `vaultId`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | The staked currency | +| `vaultId` | `AccountId` | The account ID of the staking pool nominee | + +#### Returns + +`Promise`<`number`\> + +The current nonce of the staking pool + +#### Defined in + +[src/parachain/rewards.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L22) + +___ + +### withdrawRewards + +▸ **withdrawRewards**(`vaultId`, `nonce?`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | VaultId object | +| `nonce?` | `number` | Staking pool nonce | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Withdraw all rewards from the current account in the `vaultId` staking pool. + +#### Defined in + +[src/parachain/rewards.ts:38](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/rewards.ts#L38) diff --git a/interfaces/Shortfall.md b/interfaces/Shortfall.md new file mode 100644 index 000000000..8ac0ab747 --- /dev/null +++ b/interfaces/Shortfall.md @@ -0,0 +1,2932 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / Shortfall + +# Interface: Shortfall + +**`Name`** + +Shortfall + +## Hierarchy + +- `FixedU128` + + ↳ **`Shortfall`** + +## Table of contents + +### Properties + +- [#private](Shortfall.md##private) +- [createdAtHash](Shortfall.md#createdathash) +- [encodedLength](Shortfall.md#encodedlength) +- [initialU8aLength](Shortfall.md#initialu8alength) +- [isStorageFallback](Shortfall.md#isstoragefallback) +- [isUnsigned](Shortfall.md#isunsigned) +- [registry](Shortfall.md#registry) + +### Accessors + +- [hash](Shortfall.md#hash) +- [isEmpty](Shortfall.md#isempty) + +### Methods + +- [abs](Shortfall.md#abs) +- [add](Shortfall.md#add) +- [addn](Shortfall.md#addn) +- [and](Shortfall.md#and) +- [andln](Shortfall.md#andln) +- [bincn](Shortfall.md#bincn) +- [bitLength](Shortfall.md#bitlength) +- [byteLength](Shortfall.md#bytelength) +- [clone](Shortfall.md#clone) +- [cmp](Shortfall.md#cmp) +- [cmpn](Shortfall.md#cmpn) +- [div](Shortfall.md#div) +- [divRound](Shortfall.md#divround) +- [divmod](Shortfall.md#divmod) +- [divn](Shortfall.md#divn) +- [egcd](Shortfall.md#egcd) +- [eq](Shortfall.md#eq) +- [eqn](Shortfall.md#eqn) +- [fromTwos](Shortfall.md#fromtwos) +- [gcd](Shortfall.md#gcd) +- [gt](Shortfall.md#gt) +- [gte](Shortfall.md#gte) +- [gten](Shortfall.md#gten) +- [gtn](Shortfall.md#gtn) +- [iabs](Shortfall.md#iabs) +- [iadd](Shortfall.md#iadd) +- [iaddn](Shortfall.md#iaddn) +- [iand](Shortfall.md#iand) +- [idivn](Shortfall.md#idivn) +- [imaskn](Shortfall.md#imaskn) +- [imul](Shortfall.md#imul) +- [imuln](Shortfall.md#imuln) +- [ineg](Shortfall.md#ineg) +- [inotn](Shortfall.md#inotn) +- [inspect](Shortfall.md#inspect) +- [invm](Shortfall.md#invm) +- [ior](Shortfall.md#ior) +- [isEven](Shortfall.md#iseven) +- [isMax](Shortfall.md#ismax) +- [isNeg](Shortfall.md#isneg) +- [isOdd](Shortfall.md#isodd) +- [isZero](Shortfall.md#iszero) +- [ishln](Shortfall.md#ishln) +- [ishrn](Shortfall.md#ishrn) +- [isqr](Shortfall.md#isqr) +- [isub](Shortfall.md#isub) +- [isubn](Shortfall.md#isubn) +- [iuand](Shortfall.md#iuand) +- [iuor](Shortfall.md#iuor) +- [iushln](Shortfall.md#iushln) +- [iushrn](Shortfall.md#iushrn) +- [iuxor](Shortfall.md#iuxor) +- [ixor](Shortfall.md#ixor) +- [lt](Shortfall.md#lt) +- [lte](Shortfall.md#lte) +- [lten](Shortfall.md#lten) +- [ltn](Shortfall.md#ltn) +- [maskn](Shortfall.md#maskn) +- [mod](Shortfall.md#mod) +- [modn](Shortfall.md#modn) +- [modrn](Shortfall.md#modrn) +- [mul](Shortfall.md#mul) +- [muln](Shortfall.md#muln) +- [neg](Shortfall.md#neg) +- [notn](Shortfall.md#notn) +- [or](Shortfall.md#or) +- [pow](Shortfall.md#pow) +- [setn](Shortfall.md#setn) +- [shln](Shortfall.md#shln) +- [shrn](Shortfall.md#shrn) +- [sqr](Shortfall.md#sqr) +- [sub](Shortfall.md#sub) +- [subn](Shortfall.md#subn) +- [testn](Shortfall.md#testn) +- [toArray](Shortfall.md#toarray) +- [toArrayLike](Shortfall.md#toarraylike) +- [toBigInt](Shortfall.md#tobigint) +- [toBn](Shortfall.md#tobn) +- [toBuffer](Shortfall.md#tobuffer) +- [toHex](Shortfall.md#tohex) +- [toHuman](Shortfall.md#tohuman) +- [toJSON](Shortfall.md#tojson) +- [toNumber](Shortfall.md#tonumber) +- [toPrimitive](Shortfall.md#toprimitive) +- [toRawType](Shortfall.md#torawtype) +- [toRed](Shortfall.md#tored) +- [toString](Shortfall.md#tostring) +- [toTwos](Shortfall.md#totwos) +- [toU8a](Shortfall.md#tou8a) +- [uand](Shortfall.md#uand) +- [ucmp](Shortfall.md#ucmp) +- [umod](Shortfall.md#umod) +- [uor](Shortfall.md#uor) +- [ushln](Shortfall.md#ushln) +- [ushrn](Shortfall.md#ushrn) +- [uxor](Shortfall.md#uxor) +- [xor](Shortfall.md#xor) +- [zeroBits](Shortfall.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +FixedU128.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +FixedU128.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +FixedU128.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +FixedU128.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +FixedU128.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +FixedU128.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +FixedU128.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +FixedU128.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +FixedU128.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +FixedU128.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +FixedU128.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +FixedU128.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +FixedU128.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +FixedU128.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +FixedU128.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +FixedU128.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +FixedU128.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +FixedU128.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +FixedU128.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +FixedU128.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +FixedU128.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +FixedU128.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +FixedU128.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +FixedU128.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +FixedU128.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +FixedU128.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +FixedU128.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +FixedU128.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +FixedU128.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +FixedU128.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +FixedU128.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +FixedU128.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +FixedU128.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +FixedU128.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +FixedU128.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +FixedU128.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +FixedU128.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +FixedU128.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +FixedU128.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +FixedU128.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +FixedU128.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +FixedU128.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +FixedU128.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +FixedU128.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +FixedU128.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +FixedU128.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +FixedU128.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/SignedFixedPoint.md b/interfaces/SignedFixedPoint.md new file mode 100644 index 000000000..1442aa042 --- /dev/null +++ b/interfaces/SignedFixedPoint.md @@ -0,0 +1,2932 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / SignedFixedPoint + +# Interface: SignedFixedPoint + +**`Name`** + +SignedFixedPoint + +## Hierarchy + +- `FixedU128` + + ↳ **`SignedFixedPoint`** + +## Table of contents + +### Properties + +- [#private](SignedFixedPoint.md##private) +- [createdAtHash](SignedFixedPoint.md#createdathash) +- [encodedLength](SignedFixedPoint.md#encodedlength) +- [initialU8aLength](SignedFixedPoint.md#initialu8alength) +- [isStorageFallback](SignedFixedPoint.md#isstoragefallback) +- [isUnsigned](SignedFixedPoint.md#isunsigned) +- [registry](SignedFixedPoint.md#registry) + +### Accessors + +- [hash](SignedFixedPoint.md#hash) +- [isEmpty](SignedFixedPoint.md#isempty) + +### Methods + +- [abs](SignedFixedPoint.md#abs) +- [add](SignedFixedPoint.md#add) +- [addn](SignedFixedPoint.md#addn) +- [and](SignedFixedPoint.md#and) +- [andln](SignedFixedPoint.md#andln) +- [bincn](SignedFixedPoint.md#bincn) +- [bitLength](SignedFixedPoint.md#bitlength) +- [byteLength](SignedFixedPoint.md#bytelength) +- [clone](SignedFixedPoint.md#clone) +- [cmp](SignedFixedPoint.md#cmp) +- [cmpn](SignedFixedPoint.md#cmpn) +- [div](SignedFixedPoint.md#div) +- [divRound](SignedFixedPoint.md#divround) +- [divmod](SignedFixedPoint.md#divmod) +- [divn](SignedFixedPoint.md#divn) +- [egcd](SignedFixedPoint.md#egcd) +- [eq](SignedFixedPoint.md#eq) +- [eqn](SignedFixedPoint.md#eqn) +- [fromTwos](SignedFixedPoint.md#fromtwos) +- [gcd](SignedFixedPoint.md#gcd) +- [gt](SignedFixedPoint.md#gt) +- [gte](SignedFixedPoint.md#gte) +- [gten](SignedFixedPoint.md#gten) +- [gtn](SignedFixedPoint.md#gtn) +- [iabs](SignedFixedPoint.md#iabs) +- [iadd](SignedFixedPoint.md#iadd) +- [iaddn](SignedFixedPoint.md#iaddn) +- [iand](SignedFixedPoint.md#iand) +- [idivn](SignedFixedPoint.md#idivn) +- [imaskn](SignedFixedPoint.md#imaskn) +- [imul](SignedFixedPoint.md#imul) +- [imuln](SignedFixedPoint.md#imuln) +- [ineg](SignedFixedPoint.md#ineg) +- [inotn](SignedFixedPoint.md#inotn) +- [inspect](SignedFixedPoint.md#inspect) +- [invm](SignedFixedPoint.md#invm) +- [ior](SignedFixedPoint.md#ior) +- [isEven](SignedFixedPoint.md#iseven) +- [isMax](SignedFixedPoint.md#ismax) +- [isNeg](SignedFixedPoint.md#isneg) +- [isOdd](SignedFixedPoint.md#isodd) +- [isZero](SignedFixedPoint.md#iszero) +- [ishln](SignedFixedPoint.md#ishln) +- [ishrn](SignedFixedPoint.md#ishrn) +- [isqr](SignedFixedPoint.md#isqr) +- [isub](SignedFixedPoint.md#isub) +- [isubn](SignedFixedPoint.md#isubn) +- [iuand](SignedFixedPoint.md#iuand) +- [iuor](SignedFixedPoint.md#iuor) +- [iushln](SignedFixedPoint.md#iushln) +- [iushrn](SignedFixedPoint.md#iushrn) +- [iuxor](SignedFixedPoint.md#iuxor) +- [ixor](SignedFixedPoint.md#ixor) +- [lt](SignedFixedPoint.md#lt) +- [lte](SignedFixedPoint.md#lte) +- [lten](SignedFixedPoint.md#lten) +- [ltn](SignedFixedPoint.md#ltn) +- [maskn](SignedFixedPoint.md#maskn) +- [mod](SignedFixedPoint.md#mod) +- [modn](SignedFixedPoint.md#modn) +- [modrn](SignedFixedPoint.md#modrn) +- [mul](SignedFixedPoint.md#mul) +- [muln](SignedFixedPoint.md#muln) +- [neg](SignedFixedPoint.md#neg) +- [notn](SignedFixedPoint.md#notn) +- [or](SignedFixedPoint.md#or) +- [pow](SignedFixedPoint.md#pow) +- [setn](SignedFixedPoint.md#setn) +- [shln](SignedFixedPoint.md#shln) +- [shrn](SignedFixedPoint.md#shrn) +- [sqr](SignedFixedPoint.md#sqr) +- [sub](SignedFixedPoint.md#sub) +- [subn](SignedFixedPoint.md#subn) +- [testn](SignedFixedPoint.md#testn) +- [toArray](SignedFixedPoint.md#toarray) +- [toArrayLike](SignedFixedPoint.md#toarraylike) +- [toBigInt](SignedFixedPoint.md#tobigint) +- [toBn](SignedFixedPoint.md#tobn) +- [toBuffer](SignedFixedPoint.md#tobuffer) +- [toHex](SignedFixedPoint.md#tohex) +- [toHuman](SignedFixedPoint.md#tohuman) +- [toJSON](SignedFixedPoint.md#tojson) +- [toNumber](SignedFixedPoint.md#tonumber) +- [toPrimitive](SignedFixedPoint.md#toprimitive) +- [toRawType](SignedFixedPoint.md#torawtype) +- [toRed](SignedFixedPoint.md#tored) +- [toString](SignedFixedPoint.md#tostring) +- [toTwos](SignedFixedPoint.md#totwos) +- [toU8a](SignedFixedPoint.md#tou8a) +- [uand](SignedFixedPoint.md#uand) +- [ucmp](SignedFixedPoint.md#ucmp) +- [umod](SignedFixedPoint.md#umod) +- [uor](SignedFixedPoint.md#uor) +- [ushln](SignedFixedPoint.md#ushln) +- [ushrn](SignedFixedPoint.md#ushrn) +- [uxor](SignedFixedPoint.md#uxor) +- [xor](SignedFixedPoint.md#xor) +- [zeroBits](SignedFixedPoint.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +FixedU128.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +FixedU128.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +FixedU128.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +FixedU128.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +FixedU128.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +FixedU128.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +FixedU128.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +FixedU128.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +FixedU128.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +FixedU128.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +FixedU128.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +FixedU128.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +FixedU128.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +FixedU128.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +FixedU128.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +FixedU128.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +FixedU128.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +FixedU128.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +FixedU128.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +FixedU128.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +FixedU128.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +FixedU128.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +FixedU128.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +FixedU128.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +FixedU128.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +FixedU128.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +FixedU128.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +FixedU128.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +FixedU128.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +FixedU128.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +FixedU128.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +FixedU128.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +FixedU128.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +FixedU128.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +FixedU128.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +FixedU128.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +FixedU128.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +FixedU128.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +FixedU128.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +FixedU128.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +FixedU128.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +FixedU128.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +FixedU128.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +FixedU128.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +FixedU128.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +FixedU128.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +FixedU128.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/StablePoolId.md b/interfaces/StablePoolId.md new file mode 100644 index 000000000..7e21685bf --- /dev/null +++ b/interfaces/StablePoolId.md @@ -0,0 +1,2947 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / StablePoolId + +# Interface: StablePoolId + +**`Name`** + +StablePoolId + +## Hierarchy + +- `u32` + + ↳ **`StablePoolId`** + +## Table of contents + +### Properties + +- [#private](StablePoolId.md##private) +- [\_\_UIntType](StablePoolId.md#__uinttype) +- [createdAtHash](StablePoolId.md#createdathash) +- [encodedLength](StablePoolId.md#encodedlength) +- [initialU8aLength](StablePoolId.md#initialu8alength) +- [isStorageFallback](StablePoolId.md#isstoragefallback) +- [isUnsigned](StablePoolId.md#isunsigned) +- [registry](StablePoolId.md#registry) + +### Accessors + +- [hash](StablePoolId.md#hash) +- [isEmpty](StablePoolId.md#isempty) + +### Methods + +- [abs](StablePoolId.md#abs) +- [add](StablePoolId.md#add) +- [addn](StablePoolId.md#addn) +- [and](StablePoolId.md#and) +- [andln](StablePoolId.md#andln) +- [bincn](StablePoolId.md#bincn) +- [bitLength](StablePoolId.md#bitlength) +- [byteLength](StablePoolId.md#bytelength) +- [clone](StablePoolId.md#clone) +- [cmp](StablePoolId.md#cmp) +- [cmpn](StablePoolId.md#cmpn) +- [div](StablePoolId.md#div) +- [divRound](StablePoolId.md#divround) +- [divmod](StablePoolId.md#divmod) +- [divn](StablePoolId.md#divn) +- [egcd](StablePoolId.md#egcd) +- [eq](StablePoolId.md#eq) +- [eqn](StablePoolId.md#eqn) +- [fromTwos](StablePoolId.md#fromtwos) +- [gcd](StablePoolId.md#gcd) +- [gt](StablePoolId.md#gt) +- [gte](StablePoolId.md#gte) +- [gten](StablePoolId.md#gten) +- [gtn](StablePoolId.md#gtn) +- [iabs](StablePoolId.md#iabs) +- [iadd](StablePoolId.md#iadd) +- [iaddn](StablePoolId.md#iaddn) +- [iand](StablePoolId.md#iand) +- [idivn](StablePoolId.md#idivn) +- [imaskn](StablePoolId.md#imaskn) +- [imul](StablePoolId.md#imul) +- [imuln](StablePoolId.md#imuln) +- [ineg](StablePoolId.md#ineg) +- [inotn](StablePoolId.md#inotn) +- [inspect](StablePoolId.md#inspect) +- [invm](StablePoolId.md#invm) +- [ior](StablePoolId.md#ior) +- [isEven](StablePoolId.md#iseven) +- [isMax](StablePoolId.md#ismax) +- [isNeg](StablePoolId.md#isneg) +- [isOdd](StablePoolId.md#isodd) +- [isZero](StablePoolId.md#iszero) +- [ishln](StablePoolId.md#ishln) +- [ishrn](StablePoolId.md#ishrn) +- [isqr](StablePoolId.md#isqr) +- [isub](StablePoolId.md#isub) +- [isubn](StablePoolId.md#isubn) +- [iuand](StablePoolId.md#iuand) +- [iuor](StablePoolId.md#iuor) +- [iushln](StablePoolId.md#iushln) +- [iushrn](StablePoolId.md#iushrn) +- [iuxor](StablePoolId.md#iuxor) +- [ixor](StablePoolId.md#ixor) +- [lt](StablePoolId.md#lt) +- [lte](StablePoolId.md#lte) +- [lten](StablePoolId.md#lten) +- [ltn](StablePoolId.md#ltn) +- [maskn](StablePoolId.md#maskn) +- [mod](StablePoolId.md#mod) +- [modn](StablePoolId.md#modn) +- [modrn](StablePoolId.md#modrn) +- [mul](StablePoolId.md#mul) +- [muln](StablePoolId.md#muln) +- [neg](StablePoolId.md#neg) +- [notn](StablePoolId.md#notn) +- [or](StablePoolId.md#or) +- [pow](StablePoolId.md#pow) +- [setn](StablePoolId.md#setn) +- [shln](StablePoolId.md#shln) +- [shrn](StablePoolId.md#shrn) +- [sqr](StablePoolId.md#sqr) +- [sub](StablePoolId.md#sub) +- [subn](StablePoolId.md#subn) +- [testn](StablePoolId.md#testn) +- [toArray](StablePoolId.md#toarray) +- [toArrayLike](StablePoolId.md#toarraylike) +- [toBigInt](StablePoolId.md#tobigint) +- [toBn](StablePoolId.md#tobn) +- [toBuffer](StablePoolId.md#tobuffer) +- [toHex](StablePoolId.md#tohex) +- [toHuman](StablePoolId.md#tohuman) +- [toJSON](StablePoolId.md#tojson) +- [toNumber](StablePoolId.md#tonumber) +- [toPrimitive](StablePoolId.md#toprimitive) +- [toRawType](StablePoolId.md#torawtype) +- [toRed](StablePoolId.md#tored) +- [toString](StablePoolId.md#tostring) +- [toTwos](StablePoolId.md#totwos) +- [toU8a](StablePoolId.md#tou8a) +- [uand](StablePoolId.md#uand) +- [ucmp](StablePoolId.md#ucmp) +- [umod](StablePoolId.md#umod) +- [uor](StablePoolId.md#uor) +- [ushln](StablePoolId.md#ushln) +- [ushrn](StablePoolId.md#ushrn) +- [uxor](StablePoolId.md#uxor) +- [xor](StablePoolId.md#xor) +- [zeroBits](StablePoolId.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +u32.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### \_\_UIntType + +• `Readonly` **\_\_UIntType**: ``"u32"`` + +#### Inherited from + +u32.\_\_UIntType + +#### Defined in + +node_modules/@polkadot/types-codec/primitive/U32.d.ts:9 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +u32.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +u32.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +u32.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +u32.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +u32.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +u32.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +u32.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +u32.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +u32.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +u32.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +u32.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +u32.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +u32.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +u32.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +u32.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +u32.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +u32.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +u32.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +u32.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +u32.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +u32.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +u32.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +u32.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +u32.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +u32.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +u32.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +u32.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +u32.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +u32.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +u32.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +u32.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +u32.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +u32.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +u32.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +u32.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +u32.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +u32.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +u32.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +u32.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +u32.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +u32.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +u32.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +u32.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +u32.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +u32.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +u32.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +u32.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +u32.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +u32.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +u32.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +u32.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +u32.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +u32.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +u32.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +u32.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +u32.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +u32.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +u32.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +u32.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +u32.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +u32.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +u32.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +u32.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +u32.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +u32.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +u32.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +u32.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +u32.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +u32.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/SystemAPI.md b/interfaces/SystemAPI.md new file mode 100644 index 000000000..251548123 --- /dev/null +++ b/interfaces/SystemAPI.md @@ -0,0 +1,177 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / SystemAPI + +# Interface: SystemAPI + +## Implemented by + +- [`DefaultSystemAPI`](../classes/DefaultSystemAPI.md) + +## Table of contents + +### Methods + +- [getBlockHash](SystemAPI.md#getblockhash) +- [getCurrentActiveBlockNumber](SystemAPI.md#getcurrentactiveblocknumber) +- [getCurrentBlockNumber](SystemAPI.md#getcurrentblocknumber) +- [getFutureBlockNumber](SystemAPI.md#getfutureblocknumber) +- [setCode](SystemAPI.md#setcode) +- [subscribeToCurrentBlockHeads](SystemAPI.md#subscribetocurrentblockheads) +- [subscribeToFinalizedBlockHeads](SystemAPI.md#subscribetofinalizedblockheads) + +## Methods + +### getBlockHash + +▸ **getBlockHash**(`blockNumber`): `Promise`<`BlockHash`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `blockNumber` | `number` | The block number to get the hash for | + +#### Returns + +`Promise`<`BlockHash`\> + +The block hash for the given block number + +#### Defined in + +[src/parachain/system.ts:43](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L43) + +___ + +### getCurrentActiveBlockNumber + +▸ **getCurrentActiveBlockNumber**(`atBlock?`): `Promise`<`number`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `atBlock?` | `BlockHash` | + +#### Returns + +`Promise`<`number`\> + +The current active block number being processed. + +#### Defined in + +[src/parachain/system.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L18) + +___ + +### getCurrentBlockNumber + +▸ **getCurrentBlockNumber**(): `Promise`<`number`\> + +#### Returns + +`Promise`<`number`\> + +The current block number being processed. + +#### Defined in + +[src/parachain/system.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L13) + +___ + +### getFutureBlockNumber + +▸ **getFutureBlockNumber**(`secondsFromNow`): `Promise`<`number`\> + +Get number of block that will added in amount of seconds from now. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `secondsFromNow` | `number` | Amount of seconds in the future. | + +#### Returns + +`Promise`<`number`\> + +Number of block added in future. + +**`Note`** + +Based on approximate block time of 12 seconds. + +#### Defined in + +[src/parachain/system.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L53) + +___ + +### setCode + +▸ **setCode**(`code`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `code` | `string` | Hex-encoded wasm blob | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +Upgrades runtime using `sudoUncheckedWeight` + +#### Defined in + +[src/parachain/system.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L37) + +___ + +### subscribeToCurrentBlockHeads + +▸ **subscribeToCurrentBlockHeads**(`callback`): `Promise`<() => `void`\> + +On every new parachain block, call the callback function with the new block header + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callback` | (`blockHeader`: `Header`) => `void` | Function to be called with every new unfinalized block header | + +#### Returns + +`Promise`<() => `void`\> + +#### Defined in + +[src/parachain/system.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L30) + +___ + +### subscribeToFinalizedBlockHeads + +▸ **subscribeToFinalizedBlockHeads**(`callback`): `Promise`<() => `void`\> + +On every new parachain block, call the callback function with the new block header + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `callback` | (`blockHeader`: `Header`) => `void` | Function to be called with every new block header | + +#### Returns + +`Promise`<() => `void`\> + +#### Defined in + +[src/parachain/system.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/system.ts#L24) diff --git a/interfaces/SystemVaultExt.md b/interfaces/SystemVaultExt.md new file mode 100644 index 000000000..d9fb7e20a --- /dev/null +++ b/interfaces/SystemVaultExt.md @@ -0,0 +1,70 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / SystemVaultExt + +# Interface: SystemVaultExt + +## Table of contents + +### Properties + +- [collateral](SystemVaultExt.md#collateral) +- [currencyPair](SystemVaultExt.md#currencypair) +- [issuedTokens](SystemVaultExt.md#issuedtokens) +- [toBeIssuedTokens](SystemVaultExt.md#tobeissuedtokens) +- [toBeRedeemedTokens](SystemVaultExt.md#toberedeemedtokens) + +## Properties + +### collateral + +• **collateral**: `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> + +#### Defined in + +[src/types/vault.ts:127](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L127) + +___ + +### currencyPair + +• **currencyPair**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | +| `wrappedCurrency` | `Currency` | + +#### Defined in + +[src/types/vault.ts:128](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L128) + +___ + +### issuedTokens + +• **issuedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:125](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L125) + +___ + +### toBeIssuedTokens + +• **toBeIssuedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L124) + +___ + +### toBeRedeemedTokens + +• **toBeRedeemedTokens**: `MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/types/vault.ts:126](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/vault.ts#L126) diff --git a/interfaces/TokenSymbol.md b/interfaces/TokenSymbol.md new file mode 100644 index 000000000..9c9abfac0 --- /dev/null +++ b/interfaces/TokenSymbol.md @@ -0,0 +1,681 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / TokenSymbol + +# Interface: TokenSymbol + +**`Name`** + +TokenSymbol + +## Hierarchy + +- `Enum` + + ↳ **`TokenSymbol`** + +## Table of contents + +### Properties + +- [#private](TokenSymbol.md##private) +- [createdAtHash](TokenSymbol.md#createdathash) +- [initialU8aLength](TokenSymbol.md#initialu8alength) +- [isDot](TokenSymbol.md#isdot) +- [isIbtc](TokenSymbol.md#isibtc) +- [isIntr](TokenSymbol.md#isintr) +- [isKbtc](TokenSymbol.md#iskbtc) +- [isKint](TokenSymbol.md#iskint) +- [isKsm](TokenSymbol.md#isksm) +- [isStorageFallback](TokenSymbol.md#isstoragefallback) +- [registry](TokenSymbol.md#registry) +- [type](TokenSymbol.md#type) + +### Accessors + +- [defIndexes](TokenSymbol.md#defindexes) +- [defKeys](TokenSymbol.md#defkeys) +- [encodedLength](TokenSymbol.md#encodedlength) +- [hash](TokenSymbol.md#hash) +- [index](TokenSymbol.md#index) +- [inner](TokenSymbol.md#inner) +- [isBasic](TokenSymbol.md#isbasic) +- [isEmpty](TokenSymbol.md#isempty) +- [isNone](TokenSymbol.md#isnone) +- [value](TokenSymbol.md#value) + +### Methods + +- [\_toRawStruct](TokenSymbol.md#_torawstruct) +- [eq](TokenSymbol.md#eq) +- [inspect](TokenSymbol.md#inspect) +- [toHex](TokenSymbol.md#tohex) +- [toHuman](TokenSymbol.md#tohuman) +- [toJSON](TokenSymbol.md#tojson) +- [toNumber](TokenSymbol.md#tonumber) +- [toPrimitive](TokenSymbol.md#toprimitive) +- [toRawType](TokenSymbol.md#torawtype) +- [toString](TokenSymbol.md#tostring) +- [toU8a](TokenSymbol.md#tou8a) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Enum.#private + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:27 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Enum.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:29 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Enum.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:30 + +___ + +### isDot + +• `Readonly` **isDot**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:129 + +___ + +### isIbtc + +• `Readonly` **isIbtc**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:130 + +___ + +### isIntr + +• `Readonly` **isIntr**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:131 + +___ + +### isKbtc + +• `Readonly` **isKbtc**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:133 + +___ + +### isKint + +• `Readonly` **isKint**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:134 + +___ + +### isKsm + +• `Readonly` **isKsm**: `boolean` + +#### Defined in + +src/interfaces/default/types.ts:132 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Enum.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:31 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Enum.registry + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:28 + +___ + +### type + +• `Readonly` **type**: ``"Dot"`` \| ``"Ibtc"`` \| ``"Intr"`` \| ``"Ksm"`` \| ``"Kbtc"`` \| ``"Kint"`` + +#### Overrides + +Enum.type + +#### Defined in + +src/interfaces/default/types.ts:135 + +## Accessors + +### defIndexes + +• `get` **defIndexes**(): `number`[] + +#### Returns + +`number`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defIndexes + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:65 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this enum + +#### Inherited from + +Enum.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:69 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Enum.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:37 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Enum.hash + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:41 + +___ + +### index + +• `get` **index**(): `number` + +#### Returns + +`number` + +**`Description`** + +The index of the enum value + +#### Inherited from + +Enum.index + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:45 + +___ + +### inner + +• `get` **inner**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.inner + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:49 + +___ + +### isBasic + +• `get` **isBasic**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if this is a basic enum (no values) + +#### Inherited from + +Enum.isBasic + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:53 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Enum.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:57 + +___ + +### isNone + +• `get` **isNone**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the Enum points to a [[Null]] type + +#### Inherited from + +Enum.isNone + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:61 + +___ + +### value + +• `get` **value**(): `Codec` + +#### Returns + +`Codec` + +**`Description`** + +The value of the enum + +#### Inherited from + +Enum.value + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:77 + +## Methods + +### \_toRawStruct + +▸ `Protected` **_toRawStruct**(): `string`[] \| `Record`<`string`, `string` \| `number`\> + +#### Returns + +`string`[] \| `Record`<`string`, `string` \| `number`\> + +**`Description`** + +Returns a raw struct representation of the enum types + +#### Inherited from + +Enum.\_toRawStruct + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:109 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Enum.eq + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:81 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Enum.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:85 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Enum.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:89 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `AnyJson` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Enum.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:93 + +___ + +### toJSON + +▸ **toJSON**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Enum.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:97 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number representation for the value + +#### Inherited from + +Enum.toNumber + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:101 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `AnyJson` + +#### Returns + +`AnyJson` + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Enum.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:105 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Enum.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:113 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Enum.toString + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:117 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Enum.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/base/Enum.d.ts:122 diff --git a/interfaces/TokensAPI.md b/interfaces/TokensAPI.md new file mode 100644 index 000000000..ee090ef2e --- /dev/null +++ b/interfaces/TokensAPI.md @@ -0,0 +1,169 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / TokensAPI + +# Interface: TokensAPI + +## Implemented by + +- [`DefaultTokensAPI`](../classes/DefaultTokensAPI.md) + +## Table of contents + +### Methods + +- [balance](TokensAPI.md#balance) +- [buildTransferExtrinsic](TokensAPI.md#buildtransferextrinsic) +- [setBalance](TokensAPI.md#setbalance) +- [subscribeToBalance](TokensAPI.md#subscribetobalance) +- [total](TokensAPI.md#total) +- [transfer](TokensAPI.md#transfer) + +## Methods + +### balance + +▸ **balance**(`currency`, `id`): `Promise`<[`ChainBalance`](../classes/ChainBalance.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | The currency specification, `Monetary.js` object or `ForeignAsset` | +| `id` | `AccountId` | The AccountId of a user | + +#### Returns + +`Promise`<[`ChainBalance`](../classes/ChainBalance.md)\> + +The user's balance + +#### Defined in + +[src/parachain/tokens.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L25) + +___ + +### buildTransferExtrinsic + +▸ **buildTransferExtrinsic**(`destination`, `amount`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build a transfer extrinsic without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `destination` | `string` | The address of a user | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | The amount to transfer, as `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A transfer submittable extrinsic. + +#### Defined in + +[src/parachain/tokens.ts:33](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L33) + +___ + +### setBalance + +▸ **setBalance**(`accountId`, `freeBalance`, `lockedBalance?`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accountId` | `AccountId` | Account whose balance to set | +| `freeBalance` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Free balance to set, as a Monetary.js object | +| `lockedBalance?` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | Locked balance to set, as a Monetary.js object | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +**`Remarks`** + +This extrinsic is only valid if submitted by a sudo account + +#### Defined in + +[src/parachain/tokens.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L62) + +___ + +### subscribeToBalance + +▸ **subscribeToBalance**(`currency`, `account`, `callback`): `Promise`<() => `void`\> + +Subscribe to balance updates + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | [`CurrencyExt`](../modules.md#currencyext) | The currency specification, `Monetary.js` object or `ForeignAsset` | +| `account` | `string` | AccountId string | +| `callback` | (`account`: `string`, `balance`: [`ChainBalance`](../classes/ChainBalance.md)) => `void` | Function to be called whenever the balance of an account is updated. Its parameters are (accountIdString, freeBalance) | + +#### Returns + +`Promise`<() => `void`\> + +#### Defined in + +[src/parachain/tokens.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L50) + +___ + +### total + +▸ **total**<`CurrencyT`\>(`currency`): `Promise`<`MonetaryAmount`<`CurrencyT`\>\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `CurrencyT` | extends [`CurrencyExt`](../modules.md#currencyext) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `currency` | `CurrencyT` | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<`CurrencyT`\>\> + +The total amount in the system + +#### Defined in + +[src/parachain/tokens.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L19) + +___ + +### transfer + +▸ **transfer**(`destination`, `amount`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `destination` | `string` | The address of a user | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | The amount to transfer, as `Monetary.js` object or `ForeignAsset` | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/tokens.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/tokens.ts#L42) diff --git a/interfaces/TradingPair.md b/interfaces/TradingPair.md new file mode 100644 index 000000000..945a02c03 --- /dev/null +++ b/interfaces/TradingPair.md @@ -0,0 +1,102 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / TradingPair + +# Interface: TradingPair + +## Table of contents + +### Properties + +- [getOutputAmount](TradingPair.md#getoutputamount) +- [pathOf](TradingPair.md#pathof) +- [reserve0](TradingPair.md#reserve0) +- [reserve1](TradingPair.md#reserve1) +- [token0](TradingPair.md#token0) +- [token1](TradingPair.md#token1) + +## Properties + +### getOutputAmount + +• **getOutputAmount**: (`inputAmount`: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\>) => `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Type declaration + +▸ (`inputAmount`): `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> | + +##### Returns + +`MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/trade/types.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L11) + +___ + +### pathOf + +• **pathOf**: (`inputCurrency`: [`CurrencyExt`](../modules.md#currencyext)) => [`MultiPathElement`](../modules.md#multipathelement) + +#### Type declaration + +▸ (`inputCurrency`): [`MultiPathElement`](../modules.md#multipathelement) + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `inputCurrency` | [`CurrencyExt`](../modules.md#currencyext) | + +##### Returns + +[`MultiPathElement`](../modules.md#multipathelement) + +#### Defined in + +[src/parachain/amm/trade/types.ts:12](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L12) + +___ + +### reserve0 + +• **reserve0**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/trade/types.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L9) + +___ + +### reserve1 + +• **reserve1**: `MonetaryAmount`<[`CurrencyExt`](../modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/trade/types.ts:10](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L10) + +___ + +### token0 + +• **token0**: [`CurrencyExt`](../modules.md#currencyext) + +#### Defined in + +[src/parachain/amm/trade/types.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L7) + +___ + +### token1 + +• **token1**: [`CurrencyExt`](../modules.md#currencyext) + +#### Defined in + +[src/parachain/amm/trade/types.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L8) diff --git a/interfaces/TransactionAPI.md b/interfaces/TransactionAPI.md new file mode 100644 index 000000000..355568cad --- /dev/null +++ b/interfaces/TransactionAPI.md @@ -0,0 +1,187 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / TransactionAPI + +# Interface: TransactionAPI + +## Implemented by + +- [`DefaultTransactionAPI`](../classes/DefaultTransactionAPI.md) + +## Table of contents + +### Properties + +- [api](TransactionAPI.md#api) + +### Methods + +- [buildBatchExtrinsic](TransactionAPI.md#buildbatchextrinsic) +- [dryRun](TransactionAPI.md#dryrun) +- [getAccount](TransactionAPI.md#getaccount) +- [getFeeEstimate](TransactionAPI.md#getfeeestimate) +- [removeAccount](TransactionAPI.md#removeaccount) +- [sendLogged](TransactionAPI.md#sendlogged) +- [setAccount](TransactionAPI.md#setaccount) + +## Properties + +### api + +• **api**: `ApiPromise` + +#### Defined in + +[src/parachain/transaction.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L15) + +## Methods + +### buildBatchExtrinsic + +▸ **buildBatchExtrinsic**(`extrinsics`, `atomic?`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Builds a submittable extrinsic to send other extrinsic in batch. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `extrinsics` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>[] | An array of extrinsics to be submitted as batch. | +| `atomic?` | `boolean` | Whether the given extrinsics should be handled atomically or not. When true (default) all extrinsics will rollback if one fails (batchAll), otherwise allows partial successes (batch). | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A batch/batchAll submittable extrinsic. + +#### Defined in + +[src/parachain/transaction.ts:33](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L33) + +___ + +### dryRun + +▸ **dryRun**(`extrinsic`): `Promise`<[`DryRunResult`](DryRunResult.md)\> + +Tests extrinsic execution against runtime. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `extrinsic` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | Extrinsic to dry run. | + +#### Returns + +`Promise`<[`DryRunResult`](DryRunResult.md)\> + +Object consisting of `success` boolean that is true if extrinsic +was successfully executed, false otherwise. If execution fails, caught error is exposed. + +#### Defined in + +[src/parachain/transaction.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L54) + +___ + +### getAccount + +▸ **getAccount**(): `undefined` \| `AddressOrPair` + +#### Returns + +`undefined` \| `AddressOrPair` + +#### Defined in + +[src/parachain/transaction.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L18) + +___ + +### getFeeEstimate + +▸ **getFeeEstimate**(`extrinsic`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +Getter for fee estimate of the extrinsic. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `extrinsic` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | Extrinsic to get fee estimation about. | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +amount of native currency that will be paid as transaction fee. + +**`Note`** + +This fee estimation does not include tip. + +#### Defined in + +[src/parachain/transaction.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L45) + +___ + +### removeAccount + +▸ **removeAccount**(): `void` + +#### Returns + +`void` + +#### Defined in + +[src/parachain/transaction.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L17) + +___ + +### sendLogged + +▸ **sendLogged**<`T`\>(`transaction`, `successEventType?`, `extrinsicStatus?`): `Promise`<`ISubmittableResult`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `Codec`[] | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `transaction` | `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> | +| `successEventType?` | `AugmentedEvent`<`ApiTypes`, `T`\> | +| `extrinsicStatus?` | `ExtrinsicStatus` | + +#### Returns + +`Promise`<`ISubmittableResult`\> + +#### Defined in + +[src/parachain/transaction.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L19) + +___ + +### setAccount + +▸ **setAccount**(`account`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `account` | `AddressOrPair` | + +#### Returns + +`void` + +#### Defined in + +[src/parachain/transaction.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/transaction.ts#L16) diff --git a/interfaces/TransactionInput.md b/interfaces/TransactionInput.md new file mode 100644 index 000000000..0ee40c0f2 --- /dev/null +++ b/interfaces/TransactionInput.md @@ -0,0 +1,52 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / TransactionInput + +# Interface: TransactionInput + +## Table of contents + +### Properties + +- [script](TransactionInput.md#script) +- [sequence](TransactionInput.md#sequence) +- [source](TransactionInput.md#source) +- [witness](TransactionInput.md#witness) + +## Properties + +### script + +• **script**: \`0x${string}\` + +#### Defined in + +[src/types/bitcoin.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L30) + +___ + +### sequence + +• **sequence**: `number` + +#### Defined in + +[src/types/bitcoin.ts:31](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L31) + +___ + +### source + +• **source**: [`TransactionInputSource`](../modules.md#transactioninputsource) + +#### Defined in + +[src/types/bitcoin.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L29) + +___ + +### witness + +• **witness**: \`0x${string}\`[] + +#### Defined in + +[src/types/bitcoin.ts:32](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L32) diff --git a/interfaces/TransactionOutput.md b/interfaces/TransactionOutput.md new file mode 100644 index 000000000..fa0f17a81 --- /dev/null +++ b/interfaces/TransactionOutput.md @@ -0,0 +1,36 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / TransactionOutput + +# Interface: TransactionOutput + +## Table of contents + +### Properties + +- [script](TransactionOutput.md#script) +- [value](TransactionOutput.md#value) + +## Properties + +### script + +• **script**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `bytes` | \`0x${string}\` | + +#### Defined in + +[src/types/bitcoin.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L37) + +___ + +### value + +• **value**: `number` + +#### Defined in + +[src/types/bitcoin.ts:36](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L36) diff --git a/interfaces/UnsignedFixedPoint.md b/interfaces/UnsignedFixedPoint.md new file mode 100644 index 000000000..61cd5e6f7 --- /dev/null +++ b/interfaces/UnsignedFixedPoint.md @@ -0,0 +1,2932 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / UnsignedFixedPoint + +# Interface: UnsignedFixedPoint + +**`Name`** + +UnsignedFixedPoint + +## Hierarchy + +- `FixedU128` + + ↳ **`UnsignedFixedPoint`** + +## Table of contents + +### Properties + +- [#private](UnsignedFixedPoint.md##private) +- [createdAtHash](UnsignedFixedPoint.md#createdathash) +- [encodedLength](UnsignedFixedPoint.md#encodedlength) +- [initialU8aLength](UnsignedFixedPoint.md#initialu8alength) +- [isStorageFallback](UnsignedFixedPoint.md#isstoragefallback) +- [isUnsigned](UnsignedFixedPoint.md#isunsigned) +- [registry](UnsignedFixedPoint.md#registry) + +### Accessors + +- [hash](UnsignedFixedPoint.md#hash) +- [isEmpty](UnsignedFixedPoint.md#isempty) + +### Methods + +- [abs](UnsignedFixedPoint.md#abs) +- [add](UnsignedFixedPoint.md#add) +- [addn](UnsignedFixedPoint.md#addn) +- [and](UnsignedFixedPoint.md#and) +- [andln](UnsignedFixedPoint.md#andln) +- [bincn](UnsignedFixedPoint.md#bincn) +- [bitLength](UnsignedFixedPoint.md#bitlength) +- [byteLength](UnsignedFixedPoint.md#bytelength) +- [clone](UnsignedFixedPoint.md#clone) +- [cmp](UnsignedFixedPoint.md#cmp) +- [cmpn](UnsignedFixedPoint.md#cmpn) +- [div](UnsignedFixedPoint.md#div) +- [divRound](UnsignedFixedPoint.md#divround) +- [divmod](UnsignedFixedPoint.md#divmod) +- [divn](UnsignedFixedPoint.md#divn) +- [egcd](UnsignedFixedPoint.md#egcd) +- [eq](UnsignedFixedPoint.md#eq) +- [eqn](UnsignedFixedPoint.md#eqn) +- [fromTwos](UnsignedFixedPoint.md#fromtwos) +- [gcd](UnsignedFixedPoint.md#gcd) +- [gt](UnsignedFixedPoint.md#gt) +- [gte](UnsignedFixedPoint.md#gte) +- [gten](UnsignedFixedPoint.md#gten) +- [gtn](UnsignedFixedPoint.md#gtn) +- [iabs](UnsignedFixedPoint.md#iabs) +- [iadd](UnsignedFixedPoint.md#iadd) +- [iaddn](UnsignedFixedPoint.md#iaddn) +- [iand](UnsignedFixedPoint.md#iand) +- [idivn](UnsignedFixedPoint.md#idivn) +- [imaskn](UnsignedFixedPoint.md#imaskn) +- [imul](UnsignedFixedPoint.md#imul) +- [imuln](UnsignedFixedPoint.md#imuln) +- [ineg](UnsignedFixedPoint.md#ineg) +- [inotn](UnsignedFixedPoint.md#inotn) +- [inspect](UnsignedFixedPoint.md#inspect) +- [invm](UnsignedFixedPoint.md#invm) +- [ior](UnsignedFixedPoint.md#ior) +- [isEven](UnsignedFixedPoint.md#iseven) +- [isMax](UnsignedFixedPoint.md#ismax) +- [isNeg](UnsignedFixedPoint.md#isneg) +- [isOdd](UnsignedFixedPoint.md#isodd) +- [isZero](UnsignedFixedPoint.md#iszero) +- [ishln](UnsignedFixedPoint.md#ishln) +- [ishrn](UnsignedFixedPoint.md#ishrn) +- [isqr](UnsignedFixedPoint.md#isqr) +- [isub](UnsignedFixedPoint.md#isub) +- [isubn](UnsignedFixedPoint.md#isubn) +- [iuand](UnsignedFixedPoint.md#iuand) +- [iuor](UnsignedFixedPoint.md#iuor) +- [iushln](UnsignedFixedPoint.md#iushln) +- [iushrn](UnsignedFixedPoint.md#iushrn) +- [iuxor](UnsignedFixedPoint.md#iuxor) +- [ixor](UnsignedFixedPoint.md#ixor) +- [lt](UnsignedFixedPoint.md#lt) +- [lte](UnsignedFixedPoint.md#lte) +- [lten](UnsignedFixedPoint.md#lten) +- [ltn](UnsignedFixedPoint.md#ltn) +- [maskn](UnsignedFixedPoint.md#maskn) +- [mod](UnsignedFixedPoint.md#mod) +- [modn](UnsignedFixedPoint.md#modn) +- [modrn](UnsignedFixedPoint.md#modrn) +- [mul](UnsignedFixedPoint.md#mul) +- [muln](UnsignedFixedPoint.md#muln) +- [neg](UnsignedFixedPoint.md#neg) +- [notn](UnsignedFixedPoint.md#notn) +- [or](UnsignedFixedPoint.md#or) +- [pow](UnsignedFixedPoint.md#pow) +- [setn](UnsignedFixedPoint.md#setn) +- [shln](UnsignedFixedPoint.md#shln) +- [shrn](UnsignedFixedPoint.md#shrn) +- [sqr](UnsignedFixedPoint.md#sqr) +- [sub](UnsignedFixedPoint.md#sub) +- [subn](UnsignedFixedPoint.md#subn) +- [testn](UnsignedFixedPoint.md#testn) +- [toArray](UnsignedFixedPoint.md#toarray) +- [toArrayLike](UnsignedFixedPoint.md#toarraylike) +- [toBigInt](UnsignedFixedPoint.md#tobigint) +- [toBn](UnsignedFixedPoint.md#tobn) +- [toBuffer](UnsignedFixedPoint.md#tobuffer) +- [toHex](UnsignedFixedPoint.md#tohex) +- [toHuman](UnsignedFixedPoint.md#tohuman) +- [toJSON](UnsignedFixedPoint.md#tojson) +- [toNumber](UnsignedFixedPoint.md#tonumber) +- [toPrimitive](UnsignedFixedPoint.md#toprimitive) +- [toRawType](UnsignedFixedPoint.md#torawtype) +- [toRed](UnsignedFixedPoint.md#tored) +- [toString](UnsignedFixedPoint.md#tostring) +- [toTwos](UnsignedFixedPoint.md#totwos) +- [toU8a](UnsignedFixedPoint.md#tou8a) +- [uand](UnsignedFixedPoint.md#uand) +- [ucmp](UnsignedFixedPoint.md#ucmp) +- [umod](UnsignedFixedPoint.md#umod) +- [uor](UnsignedFixedPoint.md#uor) +- [ushln](UnsignedFixedPoint.md#ushln) +- [ushrn](UnsignedFixedPoint.md#ushrn) +- [uxor](UnsignedFixedPoint.md#uxor) +- [xor](UnsignedFixedPoint.md#xor) +- [zeroBits](UnsignedFixedPoint.md#zerobits) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +FixedU128.#private + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:12 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +FixedU128.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:16 + +___ + +### encodedLength + +• `Readonly` **encodedLength**: `number` + +#### Inherited from + +FixedU128.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:14 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +FixedU128.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:17 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +FixedU128.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:18 + +___ + +### isUnsigned + +• `Readonly` **isUnsigned**: `boolean` + +#### Inherited from + +FixedU128.isUnsigned + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:15 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +FixedU128.registry + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:13 + +## Accessors + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +FixedU128.hash + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:23 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is a zero value (align elsewhere) + +#### Inherited from + +FixedU128.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:27 + +## Methods + +### abs + +▸ **abs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.abs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:235 + +___ + +### add + +▸ **add**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.add + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:245 + +___ + +### addn + +▸ **addn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.addn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:255 + +___ + +### and + +▸ **and**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.and + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:386 + +___ + +### andln + +▸ **andln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +and (NOTE: `andln` is going to be replaced with `andn` in future) + +#### Inherited from + +FixedU128.andln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:406 + +___ + +### bincn + +▸ **bincn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +add `1 << b` to the number + +#### Inherited from + +FixedU128.bincn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:490 + +___ + +### bitLength + +▸ **bitLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +Returns the number of bits in the value + +#### Inherited from + +FixedU128.bitLength + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:31 + +___ + +### byteLength + +▸ **byteLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of bytes occupied + +#### Inherited from + +FixedU128.byteLength + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:125 + +___ + +### clone + +▸ **clone**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +clone number + +#### Inherited from + +FixedU128.clone + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:70 + +___ + +### cmp + +▸ **cmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:150 + +___ + +### cmpn + +▸ **cmpn**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.cmpn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:160 + +___ + +### div + +▸ **div**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.div + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:320 + +___ + +### divRound + +▸ **divRound**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +rounded division + +#### Inherited from + +FixedU128.divRound + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:361 + +___ + +### divmod + +▸ **divmod**(`b`, `mode?`, `positive?`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | +| `mode?` | ``"div"`` \| ``"mod"`` | +| `positive?` | `boolean` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `div` | `BN` | +| `mod` | `BN` | + +**`Description`** + +division with remainder + +#### Inherited from + +FixedU128.divmod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:335 + +___ + +### divn + +▸ **divn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.divn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:325 + +___ + +### egcd + +▸ **egcd**(`b`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `a` | `BN` | +| `b` | `BN` | +| `gcd` | `BN` | + +**`Description`** + +Extended GCD results `({ a: ..., b: ..., gcd: ... })` + +#### Inherited from + +FixedU128.egcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:510 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +FixedU128.eq + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:35 + +___ + +### eqn + +▸ **eqn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a equals b + +#### Inherited from + +FixedU128.eqn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:210 + +___ + +### fromTwos + +▸ **fromTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert from two's complement representation, where width is the bit width + +#### Inherited from + +FixedU128.fromTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:220 + +___ + +### gcd + +▸ **gcd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +GCD + +#### Inherited from + +FixedU128.gcd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:505 + +___ + +### gt + +▸ **gt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:185 + +___ + +### gte + +▸ **gte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:195 + +___ + +### gten + +▸ **gten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than or equals b + +#### Inherited from + +FixedU128.gten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:200 + +___ + +### gtn + +▸ **gtn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a greater than b + +#### Inherited from + +FixedU128.gtn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:190 + +___ + +### iabs + +▸ **iabs**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +absolute value + +#### Inherited from + +FixedU128.iabs + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:240 + +___ + +### iadd + +▸ **iadd**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iadd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:250 + +___ + +### iaddn + +▸ **iaddn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +addition + +#### Inherited from + +FixedU128.iaddn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:260 + +___ + +### iand + +▸ **iand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:391 + +___ + +### idivn + +▸ **idivn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +divide + +#### Inherited from + +FixedU128.idivn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:330 + +___ + +### imaskn + +▸ **imaskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.imaskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:486 + +___ + +### imul + +▸ **imul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:290 + +___ + +### imuln + +▸ **imuln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.imuln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:300 + +___ + +### ineg + +▸ **ineg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.ineg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:230 + +___ + +### inotn + +▸ **inotn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.inotn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:500 + +___ + +### inspect + +▸ **inspect**(): `Inspect` + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +FixedU128.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:39 + +___ + +### invm + +▸ **invm**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +inverse `a` modulo `b` + +#### Inherited from + +FixedU128.invm + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:515 + +___ + +### ior + +▸ **ior**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.ior + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:371 + +___ + +### isEven + +▸ **isEven**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is even + +#### Inherited from + +FixedU128.isEven + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:135 + +___ + +### isMax + +▸ **isMax**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +True if this value is the max of the type + +#### Inherited from + +FixedU128.isMax + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:43 + +___ + +### isNeg + +▸ **isNeg**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +true if the number is negative + +#### Inherited from + +FixedU128.isNeg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:130 + +___ + +### isOdd + +▸ **isOdd**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is odd + +#### Inherited from + +FixedU128.isOdd + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:140 + +___ + +### isZero + +▸ **isZero**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +check if value is zero + +#### Inherited from + +FixedU128.isZero + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:145 + +___ + +### ishln + +▸ **ishln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ishln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:441 + +___ + +### ishrn + +▸ **ishrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086) + +#### Inherited from + +FixedU128.ishrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:461 + +___ + +### isqr + +▸ **isqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.isqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:310 + +___ + +### isub + +▸ **isub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:270 + +___ + +### isubn + +▸ **isubn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.isubn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:280 + +___ + +### iuand + +▸ **iuand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.iuand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:401 + +___ + +### iuor + +▸ **iuor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.iuor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:381 + +___ + +### iushln + +▸ **iushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.iushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:451 + +___ + +### iushrn + +▸ **iushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.iushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:471 + +___ + +### iuxor + +▸ **iuxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.iuxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:426 + +___ + +### ixor + +▸ **ixor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.ixor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:416 + +___ + +### lt + +▸ **lt**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.lt + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:165 + +___ + +### lte + +▸ **lte**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lte + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:175 + +___ + +### lten + +▸ **lten**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than or equals b + +#### Inherited from + +FixedU128.lten + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:180 + +___ + +### ltn + +▸ **ltn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +a less than b + +#### Inherited from + +FixedU128.ltn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:170 + +___ + +### maskn + +▸ **maskn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +clear bits with indexes higher or equal to `b` + +#### Inherited from + +FixedU128.maskn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:481 + +___ + +### mod + +▸ **mod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.mod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:340 + +___ + +### modn + +▸ **modn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Deprecated`** + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:351 + +___ + +### modrn + +▸ **modrn**(`b`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`number` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.modrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:356 + +___ + +### mul + +▸ **mul**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.mul + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:285 + +___ + +### muln + +▸ **muln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +multiply + +#### Inherited from + +FixedU128.muln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:295 + +___ + +### neg + +▸ **neg**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +negate sign + +#### Inherited from + +FixedU128.neg + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:225 + +___ + +### notn + +▸ **notn**(`w`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `w` | `number` | + +#### Returns + +`BN` + +**`Description`** + +not (for the width specified by `w`) + +#### Inherited from + +FixedU128.notn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:495 + +___ + +### or + +▸ **or**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.or + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:366 + +___ + +### pow + +▸ **pow**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +raise `a` to the power of `b` + +#### Inherited from + +FixedU128.pow + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:315 + +___ + +### setn + +▸ **setn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +set specified bit to 1 + +#### Inherited from + +FixedU128.setn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:431 + +___ + +### shln + +▸ **shln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.shln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:436 + +___ + +### shrn + +▸ **shrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.shrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:456 + +___ + +### sqr + +▸ **sqr**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +square + +#### Inherited from + +FixedU128.sqr + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:305 + +___ + +### sub + +▸ **sub**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.sub + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:265 + +___ + +### subn + +▸ **subn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +subtraction + +#### Inherited from + +FixedU128.subn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:275 + +___ + +### testn + +▸ **testn**(`b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`boolean` + +**`Description`** + +test if specified bit is set + +#### Inherited from + +FixedU128.testn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:476 + +___ + +### toArray + +▸ **toArray**(`endian?`, `length?`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`number`[] + +**`Description`** + +convert to byte Array, and optionally zero pad to length, throwing if already exceeding + +#### Inherited from + +FixedU128.toArray + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:90 + +___ + +### toArrayLike + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `BufferConstructor` | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to an instance of `type`, which must behave like an Array + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:95 + +▸ **toArrayLike**(`ArrayType`, `endian?`, `length?`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ArrayType` | `any`[] | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`any`[] + +#### Inherited from + +FixedU128.toArrayLike + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:101 + +___ + +### toBigInt + +▸ **toBigInt**(): `bigint` + +#### Returns + +`bigint` + +**`Description`** + +Returns a BigInt representation of the number + +#### Inherited from + +FixedU128.toBigInt + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:47 + +___ + +### toBn + +▸ **toBn**(): `BN` + +#### Returns + +`BN` + +**`Description`** + +Returns the BN representation of the number. (Compatibility) + +#### Inherited from + +FixedU128.toBn + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:51 + +___ + +### toBuffer + +▸ **toBuffer**(`endian?`, `length?`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endian?` | `Endianness` | +| `length?` | `number` | + +#### Returns + +`Buffer` + +**`Description`** + +convert to Node.js Buffer (if available). For compatibility with browserify and similar tools, use this instead: a.toArrayLike(Buffer, endian, length) + +#### Inherited from + +FixedU128.toBuffer + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:110 + +___ + +### toHex + +▸ **toHex**(`isLe?`): \`0x${string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isLe?` | `boolean` | + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +FixedU128.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:55 + +___ + +### toHuman + +▸ **toHuman**(`isExpanded?`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExpanded?` | `boolean` | + +#### Returns + +`string` + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +FixedU128.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:59 + +___ + +### toJSON + +▸ **toJSON**(`onlyHex?`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `onlyHex?` | `boolean` | + +#### Returns + +`any` + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +FixedU128.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:63 + +___ + +### toNumber + +▸ **toNumber**(): `number` + +#### Returns + +`number` + +**`Description`** + +convert to Javascript Number (limited to 53 bits) + +#### Inherited from + +FixedU128.toNumber + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:80 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `string` \| `number` + +#### Returns + +`string` \| `number` + +**`Description`** + +Returns the value in a primitive form, either number when <= 52 bits, or string otherwise + +#### Inherited from + +FixedU128.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:67 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +FixedU128.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:71 + +___ + +### toRed + +▸ **toRed**(`reductionContext`): `RedBN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `reductionContext` | `ReductionContext` | + +#### Returns + +`RedBN` + +**`Description`** + +Convert number to red + +#### Inherited from + +FixedU128.toRed + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:520 + +___ + +### toString + +▸ **toString**(`base?`): `string` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `base?` | `number` | The base to use for the conversion | + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +FixedU128.toString + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:76 + +___ + +### toTwos + +▸ **toTwos**(`width`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `width` | `number` | + +#### Returns + +`BN` + +**`Description`** + +convert to two's complement representation, where width is bit width + +#### Inherited from + +FixedU128.toTwos + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:215 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `boolean` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +FixedU128.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/abstract/Int.d.ts:81 + +___ + +### uand + +▸ **uand**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +and + +#### Inherited from + +FixedU128.uand + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:396 + +___ + +### ucmp + +▸ **ucmp**(`b`): ``0`` \| ``1`` \| ``-1`` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +``0`` \| ``1`` \| ``-1`` + +**`Description`** + +compare numbers and return `-1 (a < b)`, `0 (a == b)`, or `1 (a > b)` depending on the comparison result + +#### Inherited from + +FixedU128.ucmp + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:155 + +___ + +### umod + +▸ **umod**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +reduct + +#### Inherited from + +FixedU128.umod + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:345 + +___ + +### uor + +▸ **uor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +or + +#### Inherited from + +FixedU128.uor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:376 + +___ + +### ushln + +▸ **ushln**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift left + +#### Inherited from + +FixedU128.ushln + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:446 + +___ + +### ushrn + +▸ **ushrn**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `number` | + +#### Returns + +`BN` + +**`Description`** + +shift right + +#### Inherited from + +FixedU128.ushrn + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:466 + +___ + +### uxor + +▸ **uxor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.uxor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:421 + +___ + +### xor + +▸ **xor**(`b`): `BN` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `b` | `BN` | + +#### Returns + +`BN` + +**`Description`** + +xor + +#### Inherited from + +FixedU128.xor + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:411 + +___ + +### zeroBits + +▸ **zeroBits**(): `number` + +#### Returns + +`number` + +**`Description`** + +return number of less-significant consequent zero bits (example: 1010000 has 4 zero bits) + +#### Inherited from + +FixedU128.zeroBits + +#### Defined in + +node_modules/@types/bn.js/index.d.ts:120 diff --git a/interfaces/VaultCurrencyPair.md b/interfaces/VaultCurrencyPair.md new file mode 100644 index 000000000..7ddaa925a --- /dev/null +++ b/interfaces/VaultCurrencyPair.md @@ -0,0 +1,826 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / VaultCurrencyPair + +# Interface: VaultCurrencyPair + +**`Name`** + +VaultCurrencyPair + +## Hierarchy + +- `Struct` + + ↳ **`VaultCurrencyPair`** + +## Table of contents + +### Properties + +- [#private](VaultCurrencyPair.md##private) +- [[toStringTag]](VaultCurrencyPair.md#[tostringtag]) +- [collateral](VaultCurrencyPair.md#collateral) +- [createdAtHash](VaultCurrencyPair.md#createdathash) +- [initialU8aLength](VaultCurrencyPair.md#initialu8alength) +- [isStorageFallback](VaultCurrencyPair.md#isstoragefallback) +- [registry](VaultCurrencyPair.md#registry) +- [size](VaultCurrencyPair.md#size) +- [wrapped](VaultCurrencyPair.md#wrapped) + +### Accessors + +- [Type](VaultCurrencyPair.md#type) +- [defKeys](VaultCurrencyPair.md#defkeys) +- [encodedLength](VaultCurrencyPair.md#encodedlength) +- [hash](VaultCurrencyPair.md#hash) +- [isEmpty](VaultCurrencyPair.md#isempty) + +### Methods + +- [[iterator]](VaultCurrencyPair.md#[iterator]) +- [clear](VaultCurrencyPair.md#clear) +- [delete](VaultCurrencyPair.md#delete) +- [entries](VaultCurrencyPair.md#entries) +- [eq](VaultCurrencyPair.md#eq) +- [forEach](VaultCurrencyPair.md#foreach) +- [get](VaultCurrencyPair.md#get) +- [getAtIndex](VaultCurrencyPair.md#getatindex) +- [getT](VaultCurrencyPair.md#gett) +- [has](VaultCurrencyPair.md#has) +- [inspect](VaultCurrencyPair.md#inspect) +- [keys](VaultCurrencyPair.md#keys) +- [set](VaultCurrencyPair.md#set) +- [toArray](VaultCurrencyPair.md#toarray) +- [toHex](VaultCurrencyPair.md#tohex) +- [toHuman](VaultCurrencyPair.md#tohuman) +- [toJSON](VaultCurrencyPair.md#tojson) +- [toPrimitive](VaultCurrencyPair.md#toprimitive) +- [toRawType](VaultCurrencyPair.md#torawtype) +- [toString](VaultCurrencyPair.md#tostring) +- [toU8a](VaultCurrencyPair.md#tou8a) +- [values](VaultCurrencyPair.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### collateral + +• `Readonly` **collateral**: [`CurrencyId`](CurrencyId.md) + +#### Defined in + +src/interfaces/default/types.ts:143 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +___ + +### wrapped + +• `Readonly` **wrapped**: [`CurrencyId`](CurrencyId.md) + +#### Defined in + +src/interfaces/default/types.ts:144 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`VaultCurrencyPair`](VaultCurrencyPair.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`VaultCurrencyPair`](VaultCurrencyPair.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/VaultId.md b/interfaces/VaultId.md new file mode 100644 index 000000000..2e270e9dd --- /dev/null +++ b/interfaces/VaultId.md @@ -0,0 +1,826 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / VaultId + +# Interface: VaultId + +**`Name`** + +VaultId + +## Hierarchy + +- `Struct` + + ↳ **`VaultId`** + +## Table of contents + +### Properties + +- [#private](VaultId.md##private) +- [[toStringTag]](VaultId.md#[tostringtag]) +- [account\_id](VaultId.md#account_id) +- [createdAtHash](VaultId.md#createdathash) +- [currencies](VaultId.md#currencies) +- [initialU8aLength](VaultId.md#initialu8alength) +- [isStorageFallback](VaultId.md#isstoragefallback) +- [registry](VaultId.md#registry) +- [size](VaultId.md#size) + +### Accessors + +- [Type](VaultId.md#type) +- [defKeys](VaultId.md#defkeys) +- [encodedLength](VaultId.md#encodedlength) +- [hash](VaultId.md#hash) +- [isEmpty](VaultId.md#isempty) + +### Methods + +- [[iterator]](VaultId.md#[iterator]) +- [clear](VaultId.md#clear) +- [delete](VaultId.md#delete) +- [entries](VaultId.md#entries) +- [eq](VaultId.md#eq) +- [forEach](VaultId.md#foreach) +- [get](VaultId.md#get) +- [getAtIndex](VaultId.md#getatindex) +- [getT](VaultId.md#gett) +- [has](VaultId.md#has) +- [inspect](VaultId.md#inspect) +- [keys](VaultId.md#keys) +- [set](VaultId.md#set) +- [toArray](VaultId.md#toarray) +- [toHex](VaultId.md#tohex) +- [toHuman](VaultId.md#tohuman) +- [toJSON](VaultId.md#tojson) +- [toPrimitive](VaultId.md#toprimitive) +- [toRawType](VaultId.md#torawtype) +- [toString](VaultId.md#tostring) +- [toU8a](VaultId.md#tou8a) +- [values](VaultId.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### account\_id + +• `Readonly` **account\_id**: `AccountId` + +#### Defined in + +src/interfaces/default/types.ts:149 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### currencies + +• `Readonly` **currencies**: [`VaultCurrencyPair`](VaultCurrencyPair.md) + +#### Defined in + +src/interfaces/default/types.ts:150 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`VaultId`](VaultId.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`VaultId`](VaultId.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/VaultRegistryVault.md b/interfaces/VaultRegistryVault.md new file mode 100644 index 000000000..97e14db71 --- /dev/null +++ b/interfaces/VaultRegistryVault.md @@ -0,0 +1,925 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / VaultRegistryVault + +# Interface: VaultRegistryVault + +**`Name`** + +VaultRegistryVault (461) + +## Hierarchy + +- `Struct` + + ↳ **`VaultRegistryVault`** + +## Table of contents + +### Properties + +- [#private](VaultRegistryVault.md##private) +- [[toStringTag]](VaultRegistryVault.md#[tostringtag]) +- [activeReplaceCollateral](VaultRegistryVault.md#activereplacecollateral) +- [bannedUntil](VaultRegistryVault.md#banneduntil) +- [createdAtHash](VaultRegistryVault.md#createdathash) +- [id](VaultRegistryVault.md#id) +- [initialU8aLength](VaultRegistryVault.md#initialu8alength) +- [isStorageFallback](VaultRegistryVault.md#isstoragefallback) +- [issuedTokens](VaultRegistryVault.md#issuedtokens) +- [liquidatedCollateral](VaultRegistryVault.md#liquidatedcollateral) +- [registry](VaultRegistryVault.md#registry) +- [replaceCollateral](VaultRegistryVault.md#replacecollateral) +- [secureCollateralThreshold](VaultRegistryVault.md#securecollateralthreshold) +- [size](VaultRegistryVault.md#size) +- [status](VaultRegistryVault.md#status) +- [toBeIssuedTokens](VaultRegistryVault.md#tobeissuedtokens) +- [toBeRedeemedTokens](VaultRegistryVault.md#toberedeemedtokens) +- [toBeReplacedTokens](VaultRegistryVault.md#tobereplacedtokens) + +### Accessors + +- [Type](VaultRegistryVault.md#type) +- [defKeys](VaultRegistryVault.md#defkeys) +- [encodedLength](VaultRegistryVault.md#encodedlength) +- [hash](VaultRegistryVault.md#hash) +- [isEmpty](VaultRegistryVault.md#isempty) + +### Methods + +- [[iterator]](VaultRegistryVault.md#[iterator]) +- [clear](VaultRegistryVault.md#clear) +- [delete](VaultRegistryVault.md#delete) +- [entries](VaultRegistryVault.md#entries) +- [eq](VaultRegistryVault.md#eq) +- [forEach](VaultRegistryVault.md#foreach) +- [get](VaultRegistryVault.md#get) +- [getAtIndex](VaultRegistryVault.md#getatindex) +- [getT](VaultRegistryVault.md#gett) +- [has](VaultRegistryVault.md#has) +- [inspect](VaultRegistryVault.md#inspect) +- [keys](VaultRegistryVault.md#keys) +- [set](VaultRegistryVault.md#set) +- [toArray](VaultRegistryVault.md#toarray) +- [toHex](VaultRegistryVault.md#tohex) +- [toHuman](VaultRegistryVault.md#tohuman) +- [toJSON](VaultRegistryVault.md#tojson) +- [toPrimitive](VaultRegistryVault.md#toprimitive) +- [toRawType](VaultRegistryVault.md#torawtype) +- [toString](VaultRegistryVault.md#tostring) +- [toU8a](VaultRegistryVault.md#tou8a) +- [values](VaultRegistryVault.md#values) + +## Properties + +### #private + +• `Private` **#private**: `any` + +#### Inherited from + +Struct.#private + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:28 + +___ + +### [toStringTag] + +• `Readonly` **[toStringTag]**: `string` + +#### Inherited from + +Struct.[toStringTag] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 + +___ + +### activeReplaceCollateral + +• `Readonly` **activeReplaceCollateral**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5168 + +___ + +### bannedUntil + +• `Readonly` **bannedUntil**: `Option`<`u32`\> + +#### Defined in + +src/interfaces/types-lookup.ts:5161 + +___ + +### createdAtHash + +• `Optional` **createdAtHash**: `IU8a` + +#### Inherited from + +Struct.createdAtHash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:30 + +___ + +### id + +• `Readonly` **id**: [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) + +#### Defined in + +src/interfaces/types-lookup.ts:5159 + +___ + +### initialU8aLength + +• `Optional` **initialU8aLength**: `number` + +#### Inherited from + +Struct.initialU8aLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:31 + +___ + +### isStorageFallback + +• `Optional` **isStorageFallback**: `boolean` + +#### Inherited from + +Struct.isStorageFallback + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:32 + +___ + +### issuedTokens + +• `Readonly` **issuedTokens**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5164 + +___ + +### liquidatedCollateral + +• `Readonly` **liquidatedCollateral**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5169 + +___ + +### registry + +• `Readonly` **registry**: `Registry` + +#### Inherited from + +Struct.registry + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:29 + +___ + +### replaceCollateral + +• `Readonly` **replaceCollateral**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5167 + +___ + +### secureCollateralThreshold + +• `Readonly` **secureCollateralThreshold**: `Option`<`u128`\> + +#### Defined in + +src/interfaces/types-lookup.ts:5162 + +___ + +### size + +• `Readonly` **size**: `number` + +#### Inherited from + +Struct.size + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:46 + +___ + +### status + +• `Readonly` **status**: `VaultRegistryVaultStatus` + +#### Defined in + +src/interfaces/types-lookup.ts:5160 + +___ + +### toBeIssuedTokens + +• `Readonly` **toBeIssuedTokens**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5163 + +___ + +### toBeRedeemedTokens + +• `Readonly` **toBeRedeemedTokens**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5165 + +___ + +### toBeReplacedTokens + +• `Readonly` **toBeReplacedTokens**: `u128` + +#### Defined in + +src/interfaces/types-lookup.ts:5166 + +## Accessors + +### Type + +• `get` **Type**(): `E` + +#### Returns + +`E` + +**`Description`** + +Returns the Type description of the structure + +#### Inherited from + +Struct.Type + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:54 + +___ + +### defKeys + +• `get` **defKeys**(): `string`[] + +#### Returns + +`string`[] + +**`Description`** + +The available keys for this struct + +#### Inherited from + +Struct.defKeys + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:38 + +___ + +### encodedLength + +• `get` **encodedLength**(): `number` + +#### Returns + +`number` + +**`Description`** + +The length of the value when encoded as a Uint8Array + +#### Inherited from + +Struct.encodedLength + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:46 + +___ + +### hash + +• `get` **hash**(): `IU8a` + +#### Returns + +`IU8a` + +**`Description`** + +returns a hash of the contents + +#### Inherited from + +Struct.hash + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:50 + +___ + +### isEmpty + +• `get` **isEmpty**(): `boolean` + +#### Returns + +`boolean` + +**`Description`** + +Checks if the value is an empty value + +#### Inherited from + +Struct.isEmpty + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:42 + +## Methods + +### [iterator] + +▸ **[iterator]**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of entries in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.[iterator] + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:119 + +___ + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Inherited from + +Struct.clear + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:21 + +___ + +### delete + +▸ **delete**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +true if an element in the Map existed and has been removed, or false if the element does not exist. + +#### Inherited from + +Struct.delete + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:25 + +___ + +### entries + +▸ **entries**(): `IterableIterator`<[`string`, `Codec`]\> + +Returns an iterable of key, value pairs for every entry in the map. + +#### Returns + +`IterableIterator`<[`string`, `Codec`]\> + +#### Inherited from + +Struct.entries + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:124 + +___ + +### eq + +▸ **eq**(`other?`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `other?` | `unknown` | + +#### Returns + +`boolean` + +**`Description`** + +Compares the value of the input to see if there is a match + +#### Inherited from + +Struct.eq + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:58 + +___ + +### forEach + +▸ **forEach**(`callbackfn`, `thisArg?`): `void` + +Executes a provided function once per each key/value pair in the Map, in insertion order. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `callbackfn` | (`value`: `Codec`, `key`: `string`, `map`: `Map`<`string`, `Codec`\>) => `void` | +| `thisArg?` | `any` | + +#### Returns + +`void` + +#### Inherited from + +Struct.forEach + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:29 + +___ + +### get + +▸ **get**(`key`): `undefined` \| `Codec` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `string` | The name of the entry to retrieve | + +#### Returns + +`undefined` \| `Codec` + +**`Description`** + +Returns a specific names entry in the structure + +#### Inherited from + +Struct.get + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:63 + +___ + +### getAtIndex + +▸ **getAtIndex**(`index`): `Codec` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +`Codec` + +**`Description`** + +Returns the values of a member at a specific index (Rather use get(name) for performance) + +#### Inherited from + +Struct.getAtIndex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:67 + +___ + +### getT + +▸ **getT**<`T`\>(`key`): `T` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`T` + +**`Description`** + +Returns the a types value by name + +#### Inherited from + +Struct.getT + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:71 + +___ + +### has + +▸ **has**(`key`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`boolean` + +boolean indicating whether an element with the specified key exists or not. + +#### Inherited from + +Struct.has + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:38 + +___ + +### inspect + +▸ **inspect**(`isBare?`): `Inspect` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isBare?` | `BareOpts` | + +#### Returns + +`Inspect` + +**`Description`** + +Returns a breakdown of the hex encoding for this Codec + +#### Inherited from + +Struct.inspect + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:75 + +___ + +### keys + +▸ **keys**(): `IterableIterator`<`string`\> + +Returns an iterable of keys in the map + +#### Returns + +`IterableIterator`<`string`\> + +#### Inherited from + +Struct.keys + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:129 + +___ + +### set + +▸ **set**(`key`, `value`): [`VaultRegistryVault`](VaultRegistryVault.md) + +Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `Codec` | + +#### Returns + +[`VaultRegistryVault`](VaultRegistryVault.md) + +#### Inherited from + +Struct.set + +#### Defined in + +node_modules/typescript/lib/lib.es2015.collection.d.ts:42 + +___ + +### toArray + +▸ **toArray**(): `Codec`[] + +#### Returns + +`Codec`[] + +**`Description`** + +Converts the Object to an standard JavaScript Array + +#### Inherited from + +Struct.toArray + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:79 + +___ + +### toHex + +▸ **toHex**(): \`0x${string}\` + +#### Returns + +\`0x${string}\` + +**`Description`** + +Returns a hex string representation of the value + +#### Inherited from + +Struct.toHex + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:83 + +___ + +### toHuman + +▸ **toHuman**(`isExtended?`): `Record`<`string`, `AnyJson`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `isExtended?` | `boolean` | + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information + +#### Inherited from + +Struct.toHuman + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:87 + +___ + +### toJSON + +▸ **toJSON**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the Object to JSON, typically used for RPC transfers + +#### Inherited from + +Struct.toJSON + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:91 + +___ + +### toPrimitive + +▸ **toPrimitive**(): `Record`<`string`, `AnyJson`\> + +#### Returns + +`Record`<`string`, `AnyJson`\> + +**`Description`** + +Converts the value in a best-fit primitive form + +#### Inherited from + +Struct.toPrimitive + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:95 + +___ + +### toRawType + +▸ **toRawType**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the base runtime type name for this instance + +#### Inherited from + +Struct.toRawType + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:99 + +___ + +### toString + +▸ **toString**(): `string` + +#### Returns + +`string` + +**`Description`** + +Returns the string representation of the value + +#### Inherited from + +Struct.toString + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:103 + +___ + +### toU8a + +▸ **toU8a**(`isBare?`): `Uint8Array` + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `isBare?` | `BareOpts` | true when the value has none of the type-specific prefixes (internal) | + +#### Returns + +`Uint8Array` + +**`Description`** + +Encodes the value as a Uint8Array as per the SCALE specifications + +#### Inherited from + +Struct.toU8a + +#### Defined in + +node_modules/@polkadot/types-codec/native/Struct.d.ts:108 + +___ + +### values + +▸ **values**(): `IterableIterator`<`Codec`\> + +Returns an iterable of values in the map + +#### Returns + +`IterableIterator`<`Codec`\> + +#### Inherited from + +Struct.values + +#### Defined in + +node_modules/typescript/lib/lib.es2015.iterable.d.ts:134 diff --git a/interfaces/VaultsAPI.md b/interfaces/VaultsAPI.md new file mode 100644 index 000000000..14d1214fc --- /dev/null +++ b/interfaces/VaultsAPI.md @@ -0,0 +1,1032 @@ +[@interlay/interbtc-api](../README.md) / [Exports](../modules.md) / VaultsAPI + +# Interface: VaultsAPI + +## Implemented by + +- [`DefaultVaultsAPI`](../classes/DefaultVaultsAPI.md) + +## Table of contents + +### Methods + +- [buildAcceptNewIssuesExtrinsic](VaultsAPI.md#buildacceptnewissuesextrinsic) +- [buildDepositCollateralExtrinsic](VaultsAPI.md#builddepositcollateralextrinsic) +- [buildRegisterPublicKeyExtrinsic](VaultsAPI.md#buildregisterpublickeyextrinsic) +- [buildRegisterVaultExtrinsic](VaultsAPI.md#buildregistervaultextrinsic) +- [buildWithdrawCollateralExtrinsic](VaultsAPI.md#buildwithdrawcollateralextrinsic) +- [calculateCapacity](VaultsAPI.md#calculatecapacity) +- [computeBackingCollateral](VaultsAPI.md#computebackingcollateral) +- [computeReward](VaultsAPI.md#computereward) +- [depositCollateral](VaultsAPI.md#depositcollateral) +- [get](VaultsAPI.md#get) +- [getAPY](VaultsAPI.md#getapy) +- [getBlockRewardAPY](VaultsAPI.md#getblockrewardapy) +- [getCollateral](VaultsAPI.md#getcollateral) +- [getExchangeRateForLiquidation](VaultsAPI.md#getexchangerateforliquidation) +- [getGovernanceReward](VaultsAPI.md#getgovernancereward) +- [getIssuableTokensFromVault](VaultsAPI.md#getissuabletokensfromvault) +- [getIssuedAmount](VaultsAPI.md#getissuedamount) +- [getLiquidationCollateralThreshold](VaultsAPI.md#getliquidationcollateralthreshold) +- [getLiquidationVault](VaultsAPI.md#getliquidationvault) +- [getMaxNominationRatio](VaultsAPI.md#getmaxnominationratio) +- [getMinimumCollateral](VaultsAPI.md#getminimumcollateral) +- [getOrNull](VaultsAPI.md#getornull) +- [getPremiumRedeemThreshold](VaultsAPI.md#getpremiumredeemthreshold) +- [getPremiumRedeemVaults](VaultsAPI.md#getpremiumredeemvaults) +- [getPunishmentFee](VaultsAPI.md#getpunishmentfee) +- [getRequiredCollateralForVault](VaultsAPI.md#getrequiredcollateralforvault) +- [getSecureCollateralThreshold](VaultsAPI.md#getsecurecollateralthreshold) +- [getStakingCapacity](VaultsAPI.md#getstakingcapacity) +- [getTotalIssuableAmount](VaultsAPI.md#gettotalissuableamount) +- [getTotalIssuedAmount](VaultsAPI.md#gettotalissuedamount) +- [getVaultCollateralization](VaultsAPI.md#getvaultcollateralization) +- [getVaultsWithIssuableTokens](VaultsAPI.md#getvaultswithissuabletokens) +- [getVaultsWithRedeemableTokens](VaultsAPI.md#getvaultswithredeemabletokens) +- [getWrappedCurrency](VaultsAPI.md#getwrappedcurrency) +- [getWrappedReward](VaultsAPI.md#getwrappedreward) +- [isVaultFlaggedForTheft](VaultsAPI.md#isvaultflaggedfortheft) +- [list](VaultsAPI.md#list) +- [registerNewCollateralVault](VaultsAPI.md#registernewcollateralvault) +- [selectRandomVaultIssue](VaultsAPI.md#selectrandomvaultissue) +- [selectRandomVaultRedeem](VaultsAPI.md#selectrandomvaultredeem) +- [toggleIssueRequests](VaultsAPI.md#toggleissuerequests) +- [withdrawCollateral](VaultsAPI.md#withdrawcollateral) + +## Methods + +### buildAcceptNewIssuesExtrinsic + +▸ **buildAcceptNewIssuesExtrinsic**(`collateralCurrency`, `acceptNewIssues`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build accept new issues extrinsic without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | the collateral currency for which to change the accepting status, | +| `acceptNewIssues` | `boolean` | Boolean denoting whether issuing should be enabled or not | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +An accept new issues submittable extrinsic. + +#### Defined in + +[src/parachain/vaults.ts:340](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L340) + +___ + +### buildDepositCollateralExtrinsic + +▸ **buildDepositCollateralExtrinsic**(`amount`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build deposit collateral extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of extra collateral to lock | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A deposit collateral submittable extrinsic. + +#### Defined in + +[src/parachain/vaults.ts:236](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L236) + +___ + +### buildRegisterPublicKeyExtrinsic + +▸ **buildRegisterPublicKeyExtrinsic**(`publicKey`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build extrinsic to register a public key. + +This extrinsic can be used together with a register vault extrinsic (see: [buildRegisterVaultExtrinsic](VaultsAPI.md#buildregistervaultextrinsic)) +to register the first vault for the logged in account id. + +Registering the public key should only be done once per account id when it is not associated with a running vault, yet. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `publicKey` | `string` | The BTC public key of the vault to derive deposit keys with the [On-Chain Key Derivation Scheme](https://spec.interlay.io/security_performance/xclaim-security.html#okd). | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A register vault submittable extrinsic. + +#### Defined in + +[src/parachain/vaults.ts:365](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L365) + +___ + +### buildRegisterVaultExtrinsic + +▸ **buildRegisterVaultExtrinsic**(`collateralAmount`): `SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +Build extrinsic to register a new vault. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral amount to register the vault with - in the new collateral currency. | + +#### Returns + +`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\> + +A register vault submittable extrinsic. + +#### Defined in + +[src/parachain/vaults.ts:373](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L373) + +___ + +### buildWithdrawCollateralExtrinsic + +▸ **buildWithdrawCollateralExtrinsic**(`amount`): `Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +Build withdraw collateral extrinsic (transaction) without sending it. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of collateral to withdraw | + +#### Returns + +`Promise`<`SubmittableExtrinsic`<``"promise"``, `ISubmittableResult`\>\> + +A withdraw collateral submittable extrinsic as promise. + +#### Defined in + +[src/parachain/vaults.ts:220](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L220) + +___ + +### calculateCapacity + +▸ **calculateCapacity**(`collateral`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateral` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | Amount of collateral to calculate issuable capacity for | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +Issuable amount by the vault, given the collateral amount + +#### Defined in + +[src/parachain/vaults.ts:137](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L137) + +___ + +### computeBackingCollateral + +▸ **computeBackingCollateral**(`vaultId`, `nonce?`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | Vault ID object | +| `nonce?` | `number` | Nonce of the staking pool | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The entire collateral backing a vault's issued tokens. + +#### Defined in + +[src/parachain/vaults.ts:288](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L288) + +___ + +### computeReward + +▸ **computeReward**(`vaultAccountId`, `collateralCurrency`, `rewardCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +Compute the total reward, including the staking (local) pool and the rewards (global) pool + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault ID whose reward pool to check | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | - | +| `rewardCurrency` | `Currency` | The reward currency, e.g. kBTC, KINT, interBTC, INTR | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +A Monetary.js amount object, representing the total reward in the given currency + +#### Defined in + +[src/parachain/vaults.ts:305](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L305) + +___ + +### depositCollateral + +▸ **depositCollateral**(`amount`): [`ExtrinsicData`](ExtrinsicData.md) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of extra collateral to lock | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/vaults.ts:244](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L244) + +___ + +### get + +▸ **get**(`vaultAccountId`, `collateralCurrency`): `Promise`<[`VaultExt`](../classes/VaultExt.md)\> + +Get a vault by account ID and collateral currency. Rejects if no vault exists. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The ID of the vault to fetch | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by vault | + +#### Returns + +`Promise`<[`VaultExt`](../classes/VaultExt.md)\> + +A vault object, rejects if no vault with the given ID and currency pair exists + +#### Defined in + +[src/parachain/vaults.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L67) + +___ + +### getAPY + +▸ **getAPY**(`vaultAccountId`, `collateralCurrency`): `Promise`<`Big`\> + +Get the total APY for a vault based on the income in wrapped and collateral tokens +divided by the locked collateral. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`Big`\> + +the APY as a percentage string + +**`Note`** + +this does not account for interest compounding + +#### Defined in + +[src/parachain/vaults.ts:198](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L198) + +___ + +### getBlockRewardAPY + +▸ **getBlockRewardAPY**(`vaultAccountId`, `collateralCurrency`): `Promise`<`Big`\> + +Gets the estimated APY for just the block rewards (in governance tokens). + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultAccountId` | `AccountId` | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +the APY as a percentage + +#### Defined in + +[src/parachain/vaults.ts:205](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L205) + +___ + +### getCollateral + +▸ **getCollateral**(`vaultId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | `AccountId` | - | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The collateral of a vault, taking slashes into account. + +#### Defined in + +[src/parachain/vaults.ts:255](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L255) + +___ + +### getExchangeRateForLiquidation + +▸ **getExchangeRateForLiquidation**(`vaultAccountId`, `collateralCurrency`): `Promise`<`undefined` \| `Big`\> + +Get the target exchange rate at which a vault will be forced to liquidate, given its +current locked collateral and issued as well as to be issued tokens. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault's account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The collateral currency for the vault with the account id above | + +#### Returns + +`Promise`<`undefined` \| `Big`\> + +The theoretical collateral per wrapped currency rate below which the vault would be liquidated. + Returns undefined if a value cannot be calculated, eg. if the vault has no issued tokens. + +#### Defined in + +[src/parachain/vaults.ts:396](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L396) + +___ + +### getGovernanceReward + +▸ **getGovernanceReward**(`vaultAccountId`, `vaultCollateral`, `governanceCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault ID whose reward pool to check | +| `vaultCollateral` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by the vault | +| `governanceCurrency` | `Currency` | The fee reward currency | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total reward collected by the vault + +#### Defined in + +[src/parachain/vaults.ts:327](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L327) + +___ + +### getIssuableTokensFromVault + +▸ **getIssuableTokensFromVault**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +Returns issuable amount for a given vault + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The issuable amount of a vault + +#### Defined in + +[src/parachain/vaults.ts:265](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L265) + +___ + +### getIssuedAmount + +▸ **getIssuedAmount**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The amount of wrapped tokens issued by the given vault + +#### Defined in + +[src/parachain/vaults.ts:120](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L120) + +___ + +### getLiquidationCollateralThreshold + +▸ **getLiquidationCollateralThreshold**(`collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +The lower bound for vault collateralization. +If a Vault’s collateral rate +drops below this, automatic liquidation (forced Redeem) is triggered. + +#### Defined in + +[src/parachain/vaults.ts:173](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L173) + +___ + +### getLiquidationVault + +▸ **getLiquidationVault**(`collateralCurrency`): `Promise`<[`SystemVaultExt`](SystemVaultExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<[`SystemVaultExt`](SystemVaultExt.md)\> + +A vault object representing the liquidation vault + +#### Defined in + +[src/parachain/vaults.ts:249](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L249) + +___ + +### getMaxNominationRatio + +▸ **getMaxNominationRatio**(`collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The collateral currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`Big`\> + +The maximum collateral a vault can accept as nomination, as a ratio of its own collateral + +#### Defined in + +[src/parachain/vaults.ts:273](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L273) + +___ + +### getMinimumCollateral + +▸ **getMinimumCollateral**(`collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +Get the minimum secured collateral amount required to activate a vault + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +the minimum collateral to register a vault + +#### Defined in + +[src/parachain/vaults.ts:114](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L114) + +___ + +### getOrNull + +▸ **getOrNull**(`vaultAccountId`, `collateralCurrency`): `Promise`<``null`` \| [`VaultExt`](../classes/VaultExt.md)\> + +Get a vault by account ID and collateral currency. +Does not reject if the vault does not exist, but returns null instead. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The ID of the vault to fetch | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by vault | + +#### Returns + +`Promise`<``null`` \| [`VaultExt`](../classes/VaultExt.md)\> + +A vault object, or null if no vault with the given ID and currency pair exists + +#### Defined in + +[src/parachain/vaults.ts:60](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L60) + +___ + +### getPremiumRedeemThreshold + +▸ **getPremiumRedeemThreshold**(`collateralCurrency`): `Promise`<`Big`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +The collateral rate at which users receive +a premium allocated from the Vault’s collateral, when performing a redeem with this Vault. + +#### Defined in + +[src/parachain/vaults.ts:179](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L179) + +___ + +### getPremiumRedeemVaults + +▸ **getPremiumRedeemVaults**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +Vaults below the premium redeem threshold, sorted in descending order of their redeemable tokens + +#### Defined in + +[src/parachain/vaults.ts:151](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L151) + +___ + +### getPunishmentFee + +▸ **getPunishmentFee**(): `Promise`<`Big`\> + +#### Returns + +`Promise`<`Big`\> + +Fee that a Vault has to pay, as a percentage, if it fails to execute +redeem or replace requests (for redeem, on top of the slashed wrapped-token-to-collateral +value of the request). The fee is paid in collateral currency based on the wrapped token +amount at the current exchange rate. + +#### Defined in + +[src/parachain/vaults.ts:212](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L212) + +___ + +### getRequiredCollateralForVault + +▸ **getRequiredCollateralForVault**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +Get the amount of collateral required for the given vault to be at the +current SecureCollateralThreshold with the current exchange rate + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +The required collateral the vault needs to deposit to stay +above the threshold limit + +#### Defined in + +[src/parachain/vaults.ts:105](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L105) + +___ + +### getSecureCollateralThreshold + +▸ **getSecureCollateralThreshold**(`collateralCurrency`): `Promise`<`Big`\> + +Get the global secure collateral threshold. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<`Big`\> + +The global over-collateralization rate for collateral locked +by Vaults, necessary for issuing wrapped tokens + +#### Defined in + +[src/parachain/vaults.ts:186](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L186) + +___ + +### getStakingCapacity + +▸ **getStakingCapacity**(`vaultAccountId`, `collateralCurrency`): `Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault account ID | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | The currency specification, a `Monetary.js` object or `ForeignAsset` | + +#### Returns + +`Promise`<`MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\>\> + +Staking capacity, as a collateral currency (e.g. DOT) + +#### Defined in + +[src/parachain/vaults.ts:279](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L279) + +___ + +### getTotalIssuableAmount + +▸ **getTotalIssuableAmount**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total amount of wrapped tokens that can be issued, considering the collateral +locked by the vaults + +#### Defined in + +[src/parachain/vaults.ts:132](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L132) + +___ + +### getTotalIssuedAmount + +▸ **getTotalIssuedAmount**(): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total amount of wrapped tokens issued by the vaults + +#### Defined in + +[src/parachain/vaults.ts:127](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L127) + +___ + +### getVaultCollateralization + +▸ **getVaultCollateralization**(`vaultAccountId`, `collateralCurrency`, `newCollateral?`, `onlyIssued?`): `Promise`<`undefined` \| `Big`\> + +Get the collateralization of a single vault measured by dividing the value of issued (wrapped) tokens +by the value of total locked collateral. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | the vault account id | +| `collateralCurrency` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by vault | +| `newCollateral?` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | use this instead of the vault's actual collateral | +| `onlyIssued?` | `boolean` | optional, defaults to `false`. Specifies whether the collateralization should only include the issued tokens, leaving out unsettled ("to-be-issued") tokens | + +#### Returns + +`Promise`<`undefined` \| `Big`\> + +the vault collateralization + +**`Remarks`** + +Undefined collateralization is handled as infinite collateralization in the UI. +If no tokens have been issued, the `collateralFunds / issuedFunds` ratio divides by zero, +which means collateralization is infinite. + +#### Defined in + +[src/parachain/vaults.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L82) + +___ + +### getVaultsWithIssuableTokens + +▸ **getVaultsWithIssuableTokens**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +Vaults with issuable tokens, not sorted in any particular order. + +**`Remarks`** + +The result is not sorted as an attempt to randomize the assignment of requests to vaults. + +#### Defined in + +[src/parachain/vaults.ts:156](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L156) + +___ + +### getVaultsWithRedeemableTokens + +▸ **getVaultsWithRedeemableTokens**(): `Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +#### Returns + +`Promise`<`Map`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\>\> + +Vaults with redeemable tokens, sorted in descending order. + +#### Defined in + +[src/parachain/vaults.ts:160](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L160) + +___ + +### getWrappedCurrency + +▸ **getWrappedCurrency**(): `Currency` + +#### Returns + +`Currency` + +The wrapped currency issued by the vaults + +#### Defined in + +[src/parachain/vaults.ts:296](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L296) + +___ + +### getWrappedReward + +▸ **getWrappedReward**(`vaultAccountId`, `vaultCollateral`, `rewardCurrency`): `Promise`<`MonetaryAmount`<`Currency`\>\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultAccountId` | `AccountId` | The vault ID whose reward pool to check | +| `vaultCollateral` | [`CollateralCurrencyExt`](../modules.md#collateralcurrencyext) | Collateral used by the vault | +| `rewardCurrency` | `Currency` | The fee reward currency | + +#### Returns + +`Promise`<`MonetaryAmount`<`Currency`\>\> + +The total reward collected by the vault + +#### Defined in + +[src/parachain/vaults.ts:316](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L316) + +___ + +### isVaultFlaggedForTheft + +▸ **isVaultFlaggedForTheft**(`vaultId`, `btcTxId`): `Promise`<`boolean`\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | The vault ID | +| `btcTxId` | `string` | ID of the Bitcoin transaction to check | + +#### Returns + +`Promise`<`boolean`\> + +A bollean value + +#### Defined in + +[src/parachain/vaults.ts:166](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L166) + +___ + +### list + +▸ **list**(`atBlock?`): `Promise`<[`VaultExt`](../classes/VaultExt.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `atBlock?` | `BlockHash` | + +#### Returns + +`Promise`<[`VaultExt`](../classes/VaultExt.md)[]\> + +An array containing the vaults with non-zero backing collateral + +#### Defined in + +[src/parachain/vaults.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L52) + +___ + +### registerNewCollateralVault + +▸ **registerNewCollateralVault**(`collateralAmount`): [`ExtrinsicData`](ExtrinsicData.md) + +Registers a new vault for the current account ID with a new collateral amount. +Only applicable if the connected account ID already has a running vault with a different collateral currency. + +Rejects with an Error if unable to register. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The collateral amount to register the vault with - in the new collateral currency | + +#### Returns + +[`ExtrinsicData`](ExtrinsicData.md) + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/vaults.ts:386](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L386) + +___ + +### selectRandomVaultIssue + +▸ **selectRandomVaultIssue**(`amount`): `Promise`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped tokens amount to issue | + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md)\> + +A vault that has sufficient collateral to issue the given amount + +#### Defined in + +[src/parachain/vaults.ts:142](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L142) + +___ + +### selectRandomVaultRedeem + +▸ **selectRandomVaultRedeem**(`amount`): `Promise`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<`Currency`\> | Wrapped tokens amount to redeem | + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md)\> + +A vault that has issued sufficient wrapped tokens to redeem the given amount + +#### Defined in + +[src/parachain/vaults.ts:147](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L147) + +___ + +### toggleIssueRequests + +▸ **toggleIssueRequests**(`vaultId`, `acceptNewIssues`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +Enables or disables issue requests for given vault + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `vaultId` | [`InterbtcPrimitivesVaultId`](InterbtcPrimitivesVaultId.md) | The vault ID whose issuing will be toggled | +| `acceptNewIssues` | `boolean` | Boolean denoting whether issuing should be enabled or not | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/vaults.ts:351](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L351) + +___ + +### withdrawCollateral + +▸ **withdrawCollateral**(`amount`): `Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `amount` | `MonetaryAmount`<[`CollateralCurrencyExt`](../modules.md#collateralcurrencyext)\> | The amount of collateral to withdraw | + +#### Returns + +`Promise`<[`ExtrinsicData`](ExtrinsicData.md)\> + +A submittable extrinsic and an event that is emitted when extrinsic is submitted. + +#### Defined in + +[src/parachain/vaults.ts:228](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/vaults.ts#L228) diff --git a/modules.md b/modules.md new file mode 100644 index 000000000..da7ecae3c --- /dev/null +++ b/modules.md @@ -0,0 +1,3198 @@ +[@interlay/interbtc-api](README.md) / Exports + +# @interlay/interbtc-api + +## Table of contents + +### Enumerations + +- [CurrencyIdLiteral](enums/CurrencyIdLiteral.md) +- [ExecuteRedeem](enums/ExecuteRedeem.md) +- [IssueStatus](enums/IssueStatus.md) +- [MultiPathElementType](enums/MultiPathElementType.md) +- [NominationStatus](enums/NominationStatus.md) +- [PoolType](enums/PoolType.md) +- [RedeemStatus](enums/RedeemStatus.md) +- [VaultStatusExt](enums/VaultStatusExt.md) + +### Clients Classes + +- [FaucetClient](classes/FaucetClient.md) + +### BTC Bridge Classes + +- [DefaultInterBtcApi](classes/DefaultInterBtcApi.md) + +### Other Classes + +- [BitcoinCoreClient](classes/BitcoinCoreClient.md) +- [BitcoinMerkleProof](classes/BitcoinMerkleProof.md) +- [ChainBalance](classes/ChainBalance.md) +- [DefaultAMMAPI](classes/DefaultAMMAPI.md) +- [DefaultAssetRegistryAPI](classes/DefaultAssetRegistryAPI.md) +- [DefaultBTCRelayAPI](classes/DefaultBTCRelayAPI.md) +- [DefaultConstantsAPI](classes/DefaultConstantsAPI.md) +- [DefaultElectrsAPI](classes/DefaultElectrsAPI.md) +- [DefaultEscrowAPI](classes/DefaultEscrowAPI.md) +- [DefaultFeeAPI](classes/DefaultFeeAPI.md) +- [DefaultIssueAPI](classes/DefaultIssueAPI.md) +- [DefaultLoansAPI](classes/DefaultLoansAPI.md) +- [DefaultNominationAPI](classes/DefaultNominationAPI.md) +- [DefaultOracleAPI](classes/DefaultOracleAPI.md) +- [DefaultRedeemAPI](classes/DefaultRedeemAPI.md) +- [DefaultReplaceAPI](classes/DefaultReplaceAPI.md) +- [DefaultRewardsAPI](classes/DefaultRewardsAPI.md) +- [DefaultSystemAPI](classes/DefaultSystemAPI.md) +- [DefaultTokensAPI](classes/DefaultTokensAPI.md) +- [DefaultTransactionAPI](classes/DefaultTransactionAPI.md) +- [DefaultVaultsAPI](classes/DefaultVaultsAPI.md) +- [StableLiquidityMetaPool](classes/StableLiquidityMetaPool.md) +- [StableLiquidityPool](classes/StableLiquidityPool.md) +- [StandardLiquidityPool](classes/StandardLiquidityPool.md) +- [Trade](classes/Trade.md) +- [VaultExt](classes/VaultExt.md) + +### Bitcoin Core Interfaces + +- [ElectrsAPI](interfaces/ElectrsAPI.md) + +### BTC Bridge Interfaces + +- [AssetRegistryAPI](interfaces/AssetRegistryAPI.md) +- [BTCRelayAPI](interfaces/BTCRelayAPI.md) +- [EscrowAPI](interfaces/EscrowAPI.md) +- [FeeAPI](interfaces/FeeAPI.md) +- [IssueAPI](interfaces/IssueAPI.md) +- [NominationAPI](interfaces/NominationAPI.md) +- [OracleAPI](interfaces/OracleAPI.md) +- [RedeemAPI](interfaces/RedeemAPI.md) +- [ReplaceAPI](interfaces/ReplaceAPI.md) +- [SystemAPI](interfaces/SystemAPI.md) +- [TokensAPI](interfaces/TokensAPI.md) +- [VaultsAPI](interfaces/VaultsAPI.md) + +### BTC Bridge +The type Big represents Wrapped or Collateral token denominations, +while the type BN represents Planck or Satoshi denominations. Interfaces + +- [ConstantsAPI](interfaces/ConstantsAPI.md) + +### Lending protocol Interfaces + +- [LoansAPI](interfaces/LoansAPI.md) + +### Other Interfaces + +- [AMMAPI](interfaces/AMMAPI.md) +- [AccruedRewards](interfaces/AccruedRewards.md) +- [BalanceWrapper](interfaces/BalanceWrapper.md) +- [BorrowPosition](interfaces/BorrowPosition.md) +- [CollateralPosition](interfaces/CollateralPosition.md) +- [CurrencyId](interfaces/CurrencyId.md) +- [DecodedRequest](interfaces/DecodedRequest.md) +- [DecodedRequestExt](interfaces/DecodedRequestExt.md) +- [DryRunResult](interfaces/DryRunResult.md) +- [ExtrinsicData](interfaces/ExtrinsicData.md) +- [ForeignAssetId](interfaces/ForeignAssetId.md) +- [FundAccountJsonRpcRequest](interfaces/FundAccountJsonRpcRequest.md) +- [H256Le](interfaces/H256Le.md) +- [InterBtcApi](interfaces/InterBtcApi.md) +- [InterbtcForeignAssetId](interfaces/InterbtcForeignAssetId.md) +- [InterbtcLendTokenId](interfaces/InterbtcLendTokenId.md) +- [InterbtcLpToken](interfaces/InterbtcLpToken.md) +- [InterbtcPrimitivesCurrencyId](interfaces/InterbtcPrimitivesCurrencyId.md) +- [InterbtcPrimitivesTokenSymbol](interfaces/InterbtcPrimitivesTokenSymbol.md) +- [InterbtcPrimitivesVaultId](interfaces/InterbtcPrimitivesVaultId.md) +- [InterbtcStablePoolId](interfaces/InterbtcStablePoolId.md) +- [Issue](interfaces/Issue.md) +- [IssueResult](interfaces/IssueResult.md) +- [LendTokenId](interfaces/LendTokenId.md) +- [LendingStats](interfaces/LendingStats.md) +- [Liquidity](interfaces/Liquidity.md) +- [LiquidityPoolBase](interfaces/LiquidityPoolBase.md) +- [LoanAsset](interfaces/LoanAsset.md) +- [LoanMarket](interfaces/LoanMarket.md) +- [LoanPosition](interfaces/LoanPosition.md) +- [LoansMarket](interfaces/LoansMarket.md) +- [LpToken](interfaces/LpToken.md) +- [MultiPathElementStableMeta](interfaces/MultiPathElementStableMeta.md) +- [MultiPathElementStablePlain](interfaces/MultiPathElementStablePlain.md) +- [MultiPathElementStandard](interfaces/MultiPathElementStandard.md) +- [NumberOrHex](interfaces/NumberOrHex.md) +- [Rate](interfaces/Rate.md) +- [Ratio](interfaces/Ratio.md) +- [Redeem](interfaces/Redeem.md) +- [RefundRequestExt](interfaces/RefundRequestExt.md) +- [ReplaceRequestExt](interfaces/ReplaceRequestExt.md) +- [RewardsAPI](interfaces/RewardsAPI.md) +- [Shortfall](interfaces/Shortfall.md) +- [SignedFixedPoint](interfaces/SignedFixedPoint.md) +- [StablePoolId](interfaces/StablePoolId.md) +- [SystemVaultExt](interfaces/SystemVaultExt.md) +- [TokenSymbol](interfaces/TokenSymbol.md) +- [TradingPair](interfaces/TradingPair.md) +- [TransactionAPI](interfaces/TransactionAPI.md) +- [TransactionInput](interfaces/TransactionInput.md) +- [TransactionOutput](interfaces/TransactionOutput.md) +- [UnsignedFixedPoint](interfaces/UnsignedFixedPoint.md) +- [VaultCurrencyPair](interfaces/VaultCurrencyPair.md) +- [VaultId](interfaces/VaultId.md) +- [VaultRegistryVault](interfaces/VaultRegistryVault.md) + +### Type Aliases + +- [AccountLiquidity](modules.md#accountliquidity) +- [BitcoinNetwork](modules.md#bitcoinnetwork) +- [BlockHeader](modules.md#blockheader) +- [CollateralCurrencyExt](modules.md#collateralcurrencyext) +- [CollateralIdLiteral](modules.md#collateralidliteral) +- [CurrencyExt](modules.md#currencyext) +- [CurrencyIdentifier](modules.md#currencyidentifier) +- [ForeignAsset](modules.md#foreignasset) +- [GovernanceCurrency](modules.md#governancecurrency) +- [GovernanceIdLiteral](modules.md#governanceidliteral) +- [HexString](modules.md#hexstring) +- [LendToken](modules.md#lendtoken) +- [LiquidityPool](modules.md#liquiditypool) +- [LoanAction](modules.md#loanaction) +- [LpCurrency](modules.md#lpcurrency) +- [MerkleProof](modules.md#merkleproof) +- [MultiPath](modules.md#multipath) +- [MultiPathElement](modules.md#multipathelement) +- [MultiPathElementStable](modules.md#multipathelementstable) +- [PHANTOM\_DEFAULT](modules.md#phantom_default) +- [PooledCurrencies](modules.md#pooledcurrencies) +- [StableLpToken](modules.md#stablelptoken) +- [StakedBalance](modules.md#stakedbalance) +- [StandardLpToken](modules.md#standardlptoken) +- [StandardPooledTokenIdentifier](modules.md#standardpooledtokenidentifier) +- [TickerToData](modules.md#tickertodata) +- [Transaction](modules.md#transaction) +- [TransactionInputSource](modules.md#transactioninputsource) +- [TransactionLocktime](modules.md#transactionlocktime) +- [TxStatus](modules.md#txstatus) +- [UndercollateralizedPosition](modules.md#undercollateralizedposition) +- [VotingCurrency](modules.md#votingcurrency) +- [WrappedAmount](modules.md#wrappedamount) +- [WrappedCurrency](modules.md#wrappedcurrency) +- [WrappedIdLiteral](modules.md#wrappedidliteral) + +### Variables + +- [ACCOUNT\_NOT\_SET\_ERROR\_MESSAGE](modules.md#account_not_set_error_message) +- [ATOMIC\_UNIT](modules.md#atomic_unit) +- [BLOCK\_TIME\_SECONDS](modules.md#block_time_seconds) +- [FIXEDI128\_SCALING\_FACTOR](modules.md#fixedi128_scaling_factor) +- [GovernanceCurrency](modules.md#governancecurrency-1) +- [IGNORED\_ERROR\_MESSAGES](modules.md#ignored_error_messages) +- [LOANS\_REWARD\_INDEX\_SCALING\_FACTOR](modules.md#loans_reward_index_scaling_factor) +- [MS\_PER\_YEAR](modules.md#ms_per_year) +- [PERMILL\_BASE](modules.md#permill_base) +- [SLEEP\_TIME\_MS](modules.md#sleep_time_ms) +- [STABLE\_POOLS\_APPROXIMATION\_PRECISION](modules.md#stable_pools_approximation_precision) +- [VotingCurrency](modules.md#votingcurrency-1) +- [WrappedAmount](modules.md#wrappedamount-1) +- [WrappedCurrency](modules.md#wrappedcurrency-1) + +### Functions + +- [addHexPrefix](modules.md#addhexprefix) +- [addressOrPairAsAccountId](modules.md#addressorpairasaccountid) +- [adjustToThreshold](modules.md#adjusttothreshold) +- [allocateAmountsToVaults](modules.md#allocateamountstovaults) +- [atomicToBaseAmount](modules.md#atomictobaseamount) +- [btcAddressFromParams](modules.md#btcaddressfromparams) +- [bufferToHexString](modules.md#buffertohexstring) +- [calculateAnnualizedRewardAmount](modules.md#calculateannualizedrewardamount) +- [calculateBorrowLimit](modules.md#calculateborrowlimit) +- [calculateBorrowLimitBtcChangeFactory](modules.md#calculateborrowlimitbtcchangefactory) +- [calculateCollateralAmountBtc](modules.md#calculatecollateralamountbtc) +- [calculateLtv](modules.md#calculateltv) +- [calculateLtvAndThresholdsChangeFactory](modules.md#calculateltvandthresholdschangefactory) +- [calculateThreshold](modules.md#calculatethreshold) +- [calculateTotalBorrowedBtcChange](modules.md#calculatetotalborrowedbtcchange) +- [computeLazyDistribution](modules.md#computelazydistribution) +- [computePriceImpact](modules.md#computepriceimpact) +- [convertMoment](modules.md#convertmoment) +- [createAPIRegistry](modules.md#createapiregistry) +- [createExchangeRateOracleKey](modules.md#createexchangerateoraclekey) +- [createFeeEstimationOracleKey](modules.md#createfeeestimationoraclekey) +- [createInterBtcApi](modules.md#createinterbtcapi) +- [createProvider](modules.md#createprovider) +- [createSubstrateAPI](modules.md#createsubstrateapi) +- [currencyIdToMonetaryCurrency](modules.md#currencyidtomonetarycurrency) +- [decodeBtcAddress](modules.md#decodebtcaddress) +- [decodeBytesAsString](modules.md#decodebytesasstring) +- [decodeFixedPointType](modules.md#decodefixedpointtype) +- [decodeNumberOrHex](modules.md#decodenumberorhex) +- [decodePermill](modules.md#decodepermill) +- [decodeRpcVaultId](modules.md#decoderpcvaultid) +- [encodeBtcAddress](modules.md#encodebtcaddress) +- [encodeSwapParamsForStandardAndStablePools](modules.md#encodeswapparamsforstandardandstablepools) +- [encodeSwapParamsForStandardPoolsOnly](modules.md#encodeswapparamsforstandardpoolsonly) +- [encodeUnsignedFixedPoint](modules.md#encodeunsignedfixedpoint) +- [encodeVaultId](modules.md#encodevaultid) +- [ensureHashEncoded](modules.md#ensurehashencoded) +- [filterNonEmptyPools](modules.md#filternonemptypools) +- [findBestTradeRecursively](modules.md#findbesttraderecursively) +- [getAPITypes](modules.md#getapitypes) +- [getAllTradingPairs](modules.md#getalltradingpairs) +- [getBitcoinNetwork](modules.md#getbitcoinnetwork) +- [getCollateralCurrencies](modules.md#getcollateralcurrencies) +- [getCurrencyIdentifier](modules.md#getcurrencyidentifier) +- [getForeignAssetFromId](modules.md#getforeignassetfromid) +- [getIssueRequestsFromExtrinsicResult](modules.md#getissuerequestsfromextrinsicresult) +- [getRPCTypes](modules.md#getrpctypes) +- [getRedeemRequestsFromExtrinsicResult](modules.md#getredeemrequestsfromextrinsicresult) +- [getRequestIdsFromEvents](modules.md#getrequestidsfromevents) +- [getRuntimeDefs](modules.md#getruntimedefs) +- [getSS58Prefix](modules.md#getss58prefix) +- [getStableLpTokenFromCurrencyId](modules.md#getstablelptokenfromcurrencyid) +- [getStableSwapOutputAmount](modules.md#getstableswapoutputamount) +- [getStandardLpTokenFromCurrencyId](modules.md#getstandardlptokenfromcurrencyid) +- [getTotalAmountBtc](modules.md#gettotalamountbtc) +- [getTxProof](modules.md#gettxproof) +- [getUnderlyingCurrencyFromLendTokenId](modules.md#getunderlyingcurrencyfromlendtokenid) +- [intoAccountTruncating](modules.md#intoaccounttruncating) +- [isCurrency](modules.md#iscurrency) +- [isCurrencyEqual](modules.md#iscurrencyequal) +- [isForeignAsset](modules.md#isforeignasset) +- [isLendToken](modules.md#islendtoken) +- [isStableLpToken](modules.md#isstablelptoken) +- [isStableMetaMultiPathElement](modules.md#isstablemetamultipathelement) +- [isStableMetaPool](modules.md#isstablemetapool) +- [isStableMultiPathElement](modules.md#isstablemultipathelement) +- [isStablePlainMultiPathElement](modules.md#isstableplainmultipathelement) +- [isStablePool](modules.md#isstablepool) +- [isStandardLpToken](modules.md#isstandardlptoken) +- [isStandardMultiPathElement](modules.md#isstandardmultipathelement) +- [isStandardPool](modules.md#isstandardpool) +- [issueAndRedeem](modules.md#issueandredeem) +- [issueSingle](modules.md#issuesingle) +- [monetaryAmountToRawString](modules.md#monetaryamounttorawstring) +- [newAccountId](modules.md#newaccountid) +- [newCollateralBTCExchangeRate](modules.md#newcollateralbtcexchangerate) +- [newCurrencyId](modules.md#newcurrencyid) +- [newExtrinsicStatus](modules.md#newextrinsicstatus) +- [newForeignAssetId](modules.md#newforeignassetid) +- [newMonetaryAmount](modules.md#newmonetaryamount) +- [newVaultCurrencyPair](modules.md#newvaultcurrencypair) +- [newVaultId](modules.md#newvaultid) +- [parseEscrowLockedBalance](modules.md#parseescrowlockedbalance) +- [parseIssueRequest](modules.md#parseissuerequest) +- [parseOrmlTokensAccountData](modules.md#parseormltokensaccountdata) +- [parseRedeemRequest](modules.md#parseredeemrequest) +- [parseRedeemRequestStatus](modules.md#parseredeemrequeststatus) +- [parseReplaceRequest](modules.md#parsereplacerequest) +- [parseSystemVault](modules.md#parsesystemvault) +- [queryNominationsMap](modules.md#querynominationsmap) +- [redeem](modules.md#redeem) +- [reverseEndianness](modules.md#reverseendianness) +- [reverseEndiannessHex](modules.md#reverseendiannesshex) +- [setRawStorage](modules.md#setrawstorage) +- [setStorageAtKey](modules.md#setstorageatkey) +- [sleep](modules.md#sleep) +- [storageKeyToNthInner](modules.md#storagekeytonthinner) +- [stripHexPrefix](modules.md#striphexprefix) +- [toVoting](modules.md#tovoting) +- [tokenSymbolToCurrency](modules.md#tokensymboltocurrency) +- [uint8ArrayToString](modules.md#uint8arraytostring) +- [unwrapRawExchangeRate](modules.md#unwraprawexchangerate) +- [waitForBlockFinalization](modules.md#waitforblockfinalization) +- [waitForBlockRelaying](modules.md#waitforblockrelaying) + +## Type Aliases + +### AccountLiquidity + +Ƭ **AccountLiquidity**: `Object` + +The liquidity status of an account, based on the value of its collateral and loans. +* `liquidity` is `max(totalCollateralValueAsWrapped - totalBorrowedValueAsWrapped, 0)`, where each +item in the `totalCollateralValueAsWrapped` sum is first scaled down by the collateralization +required by that market (e.g `100 satoshi * 0.75 + 150 satoshi * 0.8`, where `0.75` and `0.8` +are the collateralization thresholds). +* `shortfall` is very similar to liquidity: `max(totalBorrowedValueAsWrapped - totalCollateralValueAsWrapped, 0)` +so it is only positive when the total borrowed amount exceeds what the collateral can cover. + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `liquidity` | `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\> | +| `shortfall` | `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\> | + +#### Defined in + +[src/types/loans.ts:70](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L70) + +___ + +### BitcoinNetwork + +Ƭ **BitcoinNetwork**: ``"mainnet"`` \| ``"testnet"`` \| ``"regtest"`` + +#### Defined in + +[src/types/bitcoin.ts:3](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L3) + +___ + +### BlockHeader + +Ƭ **BlockHeader**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `hashPrevBlock` | [`HexString`](modules.md#hexstring) | +| `hash_` | [`HexString`](modules.md#hexstring) | +| `merkleRoot` | [`HexString`](modules.md#hexstring) | +| `nonce` | `number` | +| `target` | [`HexString`](modules.md#hexstring) | +| `timestamp` | `number` | +| `version` | `number` | + +#### Defined in + +[src/types/bitcoin.ts:5](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L5) + +___ + +### CollateralCurrencyExt + +Ƭ **CollateralCurrencyExt**: `CollateralCurrency` \| [`ForeignAsset`](modules.md#foreignasset) \| [`LendToken`](modules.md#lendtoken) + +#### Defined in + +[src/types/currency.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L52) + +___ + +### CollateralIdLiteral + +Ƭ **CollateralIdLiteral**: [`DOT`](enums/CurrencyIdLiteral.md#dot) \| [`KSM`](enums/CurrencyIdLiteral.md#ksm) \| [`KINT`](enums/CurrencyIdLiteral.md#kint) \| [`INTR`](enums/CurrencyIdLiteral.md#intr) + +#### Defined in + +[src/types/currency.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L30) + +___ + +### CurrencyExt + +Ƭ **CurrencyExt**: `Currency` \| [`ForeignAsset`](modules.md#foreignasset) \| [`LendToken`](modules.md#lendtoken) \| [`LpCurrency`](modules.md#lpcurrency) + +#### Defined in + +[src/types/currency.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L53) + +___ + +### CurrencyIdentifier + +Ƭ **CurrencyIdentifier**: `NativeCurrencyIdentifier` \| `ForeignAssetIdentifier` \| `LendTokenIdentifier` \| `StableLpTokenIdentifier` \| `StandardLpTokenIdentifier` + +#### Defined in + +[src/types/currency.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L94) + +___ + +### ForeignAsset + +Ƭ **ForeignAsset**: `Currency` & { `foreignAsset`: { `coingeckoId`: `string` ; `id`: `number` } } + +#### Defined in + +[src/types/currency.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L39) + +___ + +### GovernanceCurrency + +Ƭ **GovernanceCurrency**: typeof [`GovernanceCurrency`](modules.md#governancecurrency-1)[`number`] + +#### Defined in + +[src/types/currency.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L61) + +[src/types/currency.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L62) + +___ + +### GovernanceIdLiteral + +Ƭ **GovernanceIdLiteral**: [`INTR`](enums/CurrencyIdLiteral.md#intr) \| [`KINT`](enums/CurrencyIdLiteral.md#kint) + +#### Defined in + +[src/types/currency.ts:29](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L29) + +___ + +### HexString + +Ƭ **HexString**: \`0x${string}\` + +#### Defined in + +[src/types/encoding.ts:1](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/encoding.ts#L1) + +___ + +### LendToken + +Ƭ **LendToken**: `Currency` & { `lendToken`: { `id`: `number` } } + +#### Defined in + +[src/types/currency.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L40) + +___ + +### LiquidityPool + +Ƭ **LiquidityPool**: [`StandardLiquidityPool`](classes/StandardLiquidityPool.md) \| [`StableLiquidityPool`](classes/StableLiquidityPool.md) \| [`StableLiquidityMetaPool`](classes/StableLiquidityMetaPool.md) + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:6](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L6) + +___ + +### LoanAction + +Ƭ **LoanAction**: ``"lend"`` \| ``"withdraw"`` \| ``"borrow"`` \| ``"repay"`` + +#### Defined in + +[src/types/loans.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L19) + +___ + +### LpCurrency + +Ƭ **LpCurrency**: [`StandardLpToken`](modules.md#standardlptoken) \| [`StableLpToken`](modules.md#stablelptoken) + +#### Defined in + +[src/types/currency.ts:51](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L51) + +___ + +### MerkleProof + +Ƭ **MerkleProof**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `blockHeader` | [`BlockHeader`](modules.md#blockheader) | +| `flagBits` | `boolean`[] | +| `hashes` | [`HexString`](modules.md#hexstring)[] | +| `transactionsCount` | `number` | + +#### Defined in + +[src/types/bitcoin.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L15) + +___ + +### MultiPath + +Ƭ **MultiPath**: [`MultiPathElement`](modules.md#multipathelement)[] + +#### Defined in + +[src/parachain/amm/trade/types.ts:57](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L57) + +___ + +### MultiPathElement + +Ƭ **MultiPathElement**: [`MultiPathElementStandard`](interfaces/MultiPathElementStandard.md) \| [`MultiPathElementStable`](modules.md#multipathelementstable) + +#### Defined in + +[src/parachain/amm/trade/types.ts:46](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L46) + +___ + +### MultiPathElementStable + +Ƭ **MultiPathElementStable**: [`MultiPathElementStablePlain`](interfaces/MultiPathElementStablePlain.md) \| [`MultiPathElementStableMeta`](interfaces/MultiPathElementStableMeta.md) + +#### Defined in + +[src/parachain/amm/trade/types.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L45) + +___ + +### PHANTOM\_DEFAULT + +Ƭ **PHANTOM\_DEFAULT**: ``"default"`` + +#### Defined in + +src/interfaces/default/types.ts:153 + +___ + +### PooledCurrencies + +Ƭ **PooledCurrencies**: `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\>[] + +#### Defined in + +[src/parachain/amm/types.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/types.ts#L24) + +___ + +### StableLpToken + +Ƭ **StableLpToken**: `Currency` & { `stableLpToken`: { `poolId`: `number` } } + +#### Defined in + +[src/types/currency.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L48) + +___ + +### StakedBalance + +Ƭ **StakedBalance**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`GovernanceCurrency`](modules.md#governancecurrency-1)\> | +| `endBlock` | `number` | + +#### Defined in + +[src/types/currency.ts:67](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L67) + +___ + +### StandardLpToken + +Ƭ **StandardLpToken**: `Currency` & { `lpToken`: { `token0`: `StandardLpUnderlyingToken` ; `token1`: `StandardLpUnderlyingToken` } } + +#### Defined in + +[src/types/currency.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L44) + +___ + +### StandardPooledTokenIdentifier + +Ƭ **StandardPooledTokenIdentifier**: `NativeCurrencyIdentifier` \| `ForeignAssetIdentifier` \| `StableLpTokenIdentifier` + +#### Defined in + +[src/types/currency.ts:88](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L88) + +___ + +### TickerToData + +Ƭ **TickerToData**<`T`\>: `Object` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Index signature + +▪ [ticker: `string`]: `T` + +#### Defined in + +[src/types/loans.ts:53](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L53) + +___ + +### Transaction + +Ƭ **Transaction**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `inputs` | [`TransactionInput`](interfaces/TransactionInput.md)[] | +| `lockAt` | [`TransactionLocktime`](modules.md#transactionlocktime) | +| `outputs` | [`TransactionOutput`](interfaces/TransactionOutput.md)[] | +| `version` | `number` | + +#### Defined in + +[src/types/bitcoin.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L48) + +___ + +### TransactionInputSource + +Ƭ **TransactionInputSource**: ``"coinbase"`` \| { `fromOutput`: [[`HexString`](modules.md#hexstring), `number`] } + +#### Defined in + +[src/types/bitcoin.ts:22](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L22) + +___ + +### TransactionLocktime + +Ƭ **TransactionLocktime**: { `time`: `number` } \| { `blockHeight`: `number` } + +#### Defined in + +[src/types/bitcoin.ts:40](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L40) + +___ + +### TxStatus + +Ƭ **TxStatus**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `blockHash?` | `string` | +| `blockHeight?` | `number` | +| `confirmations` | `number` | +| `confirmed` | `boolean` | + +#### Defined in + +[src/types/bitcoin.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/bitcoin.ts#L55) + +___ + +### UndercollateralizedPosition + +Ƭ **UndercollateralizedPosition**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `accountId` | `AccountId` | +| `borrowPositions` | [`BorrowPosition`](interfaces/BorrowPosition.md)[] | +| `collateralPositions` | [`CollateralPosition`](interfaces/CollateralPosition.md)[] | +| `shortfall` | `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\> | + +#### Defined in + +[src/types/loans.ts:75](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/loans.ts#L75) + +___ + +### VotingCurrency + +Ƭ **VotingCurrency**: typeof [`VotingCurrency`](modules.md#votingcurrency-1)[`number`] + +#### Defined in + +[src/types/currency.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L64) + +[src/types/currency.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L65) + +___ + +### WrappedAmount + +Ƭ **WrappedAmount**: typeof [`WrappedAmount`](modules.md#wrappedamount-1)[`number`] + +#### Defined in + +[src/types/currency.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L58) + +[src/types/currency.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L59) + +___ + +### WrappedCurrency + +Ƭ **WrappedCurrency**: typeof [`WrappedCurrency`](modules.md#wrappedcurrency-1)[`number`] + +#### Defined in + +[src/types/currency.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L55) + +[src/types/currency.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L56) + +___ + +### WrappedIdLiteral + +Ƭ **WrappedIdLiteral**: [`INTERBTC`](enums/CurrencyIdLiteral.md#interbtc) \| [`KBTC`](enums/CurrencyIdLiteral.md#kbtc) + +#### Defined in + +[src/types/currency.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L28) + +## Variables + +### ACCOUNT\_NOT\_SET\_ERROR\_MESSAGE + +• `Const` **ACCOUNT\_NOT\_SET\_ERROR\_MESSAGE**: ``"cannot sign transaction without setting account"`` + +#### Defined in + +[src/utils/constants.ts:13](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L13) + +___ + +### ATOMIC\_UNIT + +• `Const` **ATOMIC\_UNIT**: ``0`` + +#### Defined in + +[src/utils/currency.ts:42](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L42) + +___ + +### BLOCK\_TIME\_SECONDS + +• `Const` **BLOCK\_TIME\_SECONDS**: ``12`` + +#### Defined in + +[src/utils/constants.ts:17](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L17) + +___ + +### FIXEDI128\_SCALING\_FACTOR + +• `Const` **FIXEDI128\_SCALING\_FACTOR**: ``18`` + +#### Defined in + +[src/utils/constants.ts:4](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L4) + +___ + +### GovernanceCurrency + +• `Const` **GovernanceCurrency**: `Currency`[] + +#### Defined in + +[src/types/currency.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L61) + +[src/types/currency.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L62) + +___ + +### IGNORED\_ERROR\_MESSAGES + +• `Const` **IGNORED\_ERROR\_MESSAGES**: `string`[] + +#### Defined in + +[src/utils/constants.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L11) + +___ + +### LOANS\_REWARD\_INDEX\_SCALING\_FACTOR + +• `Const` **LOANS\_REWARD\_INDEX\_SCALING\_FACTOR**: `number` + +#### Defined in + +[src/utils/constants.ts:28](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L28) + +___ + +### MS\_PER\_YEAR + +• `Const` **MS\_PER\_YEAR**: `Big` + +#### Defined in + +[src/utils/constants.ts:15](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L15) + +___ + +### PERMILL\_BASE + +• `Const` **PERMILL\_BASE**: ``1000000`` + +#### Defined in + +[src/utils/constants.ts:7](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L7) + +___ + +### SLEEP\_TIME\_MS + +• `Const` **SLEEP\_TIME\_MS**: ``1000`` + +#### Defined in + +[src/utils/constants.ts:19](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L19) + +___ + +### STABLE\_POOLS\_APPROXIMATION\_PRECISION + +• `Const` **STABLE\_POOLS\_APPROXIMATION\_PRECISION**: `Big` + +#### Defined in + +[src/utils/constants.ts:26](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L26) + +___ + +### VotingCurrency + +• `Const` **VotingCurrency**: `Currency`[] + +#### Defined in + +[src/types/currency.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L64) + +[src/types/currency.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L65) + +___ + +### WrappedAmount + +• `Const` **WrappedAmount**: typeof `InterBtcAmount`[] + +#### Defined in + +[src/types/currency.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L58) + +[src/types/currency.ts:59](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L59) + +___ + +### WrappedCurrency + +• `Const` **WrappedCurrency**: `Currency`[] + +#### Defined in + +[src/types/currency.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L55) + +[src/types/currency.ts:56](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L56) + +## Functions + +### addHexPrefix + +▸ **addHexPrefix**(`str`): `string` + +Ensure the `0x` hex prefix is present + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/encoding.ts:85](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L85) + +___ + +### addressOrPairAsAccountId + +▸ **addressOrPairAsAccountId**(`api`, `addyOrpair`): `AccountId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `addyOrpair` | `AddressOrPair` | + +#### Returns + +`AccountId` + +#### Defined in + +[src/utils/encoding.ts:222](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L222) + +___ + +### adjustToThreshold + +▸ **adjustToThreshold**(`amount`, `threshold`): `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `threshold` | `Big` | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/utils/loans.ts:36](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L36) + +___ + +### allocateAmountsToVaults + +▸ **allocateAmountsToVaults**(`vaultsWithAvailableAmounts`, `amountToAllocate`): `Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\>\> + +Given a list of vaults with availabilities (e.g. collateral for issue, tokens +for redeem) and an amount to allocate, selects one or more vaults to fulfil +the request. +If the amount cannot be allocated by a single vault, greedily selects the vault +with highest available amount and tries again for the remainder. If at leaast +one vault can fulfil a request alone, a random one among them is selected. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `vaultsWithAvailableAmounts` | `Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<`Currency`\>\> | +| `amountToAllocate` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `MonetaryAmount`<[`WrappedCurrency`](modules.md#wrappedcurrency-1)\>\> + +#### Defined in + +[src/utils/issueRedeem.ts:81](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L81) + +___ + +### atomicToBaseAmount + +▸ **atomicToBaseAmount**(`atomicAmount`, `currency`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `atomicAmount` | `BigSource` | +| `currency` | `Currency` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/currency.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L48) + +___ + +### btcAddressFromParams + +▸ **btcAddressFromParams**(`registry`, `params`): `BitcoinAddress` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `registry` | `TypeRegistry` | +| `params` | { `p2pkh`: `string` \| `H160` } \| { `p2sh`: `string` \| `H160` } \| { `p2wpkhv0`: `string` \| `H160` } | + +#### Returns + +`BitcoinAddress` + +#### Defined in + +[src/utils/bitcoin.ts:82](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L82) + +___ + +### bufferToHexString + +▸ **bufferToHexString**(`buffer`): [`HexString`](modules.md#hexstring) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `buffer` | `Buffer` | + +#### Returns + +[`HexString`](modules.md#hexstring) + +#### Defined in + +[src/utils/encoding.ts:401](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L401) + +___ + +### calculateAnnualizedRewardAmount + +▸ **calculateAnnualizedRewardAmount**(`amountPerBlock`, `blockTimeMs`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amountPerBlock` | `Big` | +| `blockTimeMs` | `number` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/rewards.ts:4](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/rewards.ts#L4) + +___ + +### calculateBorrowLimit + +▸ **calculateBorrowLimit**(`totalBorrowedAmount`, `totalCollateralThresholdAdjustedAmount`): `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `totalBorrowedAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `totalCollateralThresholdAdjustedAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/utils/loans.ts:39](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L39) + +___ + +### calculateBorrowLimitBtcChangeFactory + +▸ **calculateBorrowLimitBtcChangeFactory**(`loanAssets`, `totalBorrowedBtc`, `totalCollateralThresholdAdjustedCollateralBtc`): (`action`: [`LoanAction`](modules.md#loanaction), `amount`: `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\>) => `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `loanAssets` | [`TickerToData`](modules.md#tickertodata)<[`LoanAsset`](interfaces/LoanAsset.md)\> | +| `totalBorrowedBtc` | `MonetaryAmount`<`Currency`\> | +| `totalCollateralThresholdAdjustedCollateralBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`fn` + +▸ (`action`, `amount`): `MonetaryAmount`<`Currency`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +##### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L76) + +___ + +### calculateCollateralAmountBtc + +▸ **calculateCollateralAmountBtc**(`action`, `currentCollateralAmountBtc`, `actionAmountBtc`): `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `currentCollateralAmountBtc` | `MonetaryAmount`<`Currency`\> | +| `actionAmountBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L21) + +___ + +### calculateLtv + +▸ **calculateLtv**(`collateralAmount`, `borrowedAmount`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `borrowedAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/loans.ts:65](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L65) + +___ + +### calculateLtvAndThresholdsChangeFactory + +▸ **calculateLtvAndThresholdsChangeFactory**(`loanAssets`, `totalBorrowedBtc`, `totalCollateralBtc`, `totalCollateralThresholdAdjustedCollateralBtc`, `totalLiquidationThresholdAdjustedCollateralBtc`): (`action`: [`LoanAction`](modules.md#loanaction), `amount`: `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\>) => { `collateralThresholdWeightedAverage`: `Big` ; `liquidationThresholdWeightedAverage`: `Big` ; `ltv`: `Big` } + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `loanAssets` | [`TickerToData`](modules.md#tickertodata)<[`LoanAsset`](interfaces/LoanAsset.md)\> | +| `totalBorrowedBtc` | `MonetaryAmount`<`Currency`\> | +| `totalCollateralBtc` | `MonetaryAmount`<`Currency`\> | +| `totalCollateralThresholdAdjustedCollateralBtc` | `MonetaryAmount`<`Currency`\> | +| `totalLiquidationThresholdAdjustedCollateralBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`fn` + +▸ (`action`, `amount`): `Object` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +##### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `collateralThresholdWeightedAverage` | `Big` | +| `liquidationThresholdWeightedAverage` | `Big` | +| `ltv` | `Big` | + +#### Defined in + +[src/utils/loans.ts:98](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L98) + +___ + +### calculateThreshold + +▸ **calculateThreshold**(`collateralAmount`, `thresholdAdjustedCollateralAmount`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `collateralAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `thresholdAdjustedCollateralAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/loans.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L55) + +___ + +### calculateTotalBorrowedBtcChange + +▸ **calculateTotalBorrowedBtcChange**(`action`, `currentTotalBorrowedBtc`, `actionAmountBtc`): `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `action` | [`LoanAction`](modules.md#loanaction) | +| `currentTotalBorrowedBtc` | `MonetaryAmount`<`Currency`\> | +| `actionAmountBtc` | `MonetaryAmount`<`Currency`\> | + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:6](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L6) + +___ + +### computeLazyDistribution + +▸ **computeLazyDistribution**(`stake`, `perToken`, `tally`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stake` | `Big` | +| `perToken` | `Big` | +| `tally` | `Big` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/currency.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L44) + +___ + +### computePriceImpact + +▸ **computePriceImpact**(`path`, `inputAmount`, `outputAmount`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `path` | [`MultiPath`](modules.md#multipath) | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | +| `outputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Big` + +#### Defined in + +[src/parachain/amm/trade/utils.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/utils.ts#L64) + +___ + +### convertMoment + +▸ **convertMoment**(`moment`): `Date` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `moment` | `Moment` | + +#### Returns + +`Date` + +#### Defined in + +[src/utils/encoding.ts:335](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L335) + +___ + +### createAPIRegistry + +▸ **createAPIRegistry**(): `TypeRegistry` + +#### Returns + +`TypeRegistry` + +#### Defined in + +[src/factory.ts:62](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L62) + +___ + +### createExchangeRateOracleKey + +▸ **createExchangeRateOracleKey**(`api`, `collateralCurrency`): `InterbtcPrimitivesOracleKey` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `collateralCurrency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +`InterbtcPrimitivesOracleKey` + +#### Defined in + +[src/utils/currency.ts:76](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L76) + +___ + +### createFeeEstimationOracleKey + +▸ **createFeeEstimationOracleKey**(`api`): `InterbtcPrimitivesOracleKey` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Returns + +`InterbtcPrimitivesOracleKey` + +#### Defined in + +[src/utils/currency.ts:72](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L72) + +___ + +### createInterBtcApi + +▸ **createInterBtcApi**(`endpoint`, `network?`, `account?`, `autoConnect?`): `Promise`<[`InterBtcApi`](interfaces/InterBtcApi.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `endpoint` | `string` | `undefined` | +| `network` | [`BitcoinNetwork`](modules.md#bitcoinnetwork) | `"mainnet"` | +| `account?` | `AddressOrPair` | `undefined` | +| `autoConnect?` | `number` \| ``false`` | `undefined` | + +#### Returns + +`Promise`<[`InterBtcApi`](interfaces/InterBtcApi.md)\> + +#### Defined in + +[src/factory.ts:44](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L44) + +___ + +### createProvider + +▸ **createProvider**(`endpoint`, `autoConnect?`): `ProviderInterface` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endpoint` | `string` | +| `autoConnect?` | `number` \| ``false`` | + +#### Returns + +`ProviderInterface` + +#### Defined in + +[src/factory.ts:14](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L14) + +___ + +### createSubstrateAPI + +▸ **createSubstrateAPI**(`endpoint`, `autoConnect?`, `noInitWarn?`): `Promise`<`ApiPromise`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `endpoint` | `string` | +| `autoConnect?` | `number` \| ``false`` | +| `noInitWarn?` | `boolean` | + +#### Returns + +`Promise`<`ApiPromise`\> + +#### Defined in + +[src/factory.ts:24](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L24) + +___ + +### currencyIdToMonetaryCurrency + +▸ **currencyIdToMonetaryCurrency**(`api`, `currencyId`): `Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `currencyId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | + +#### Returns + +`Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/utils/currency.ts:185](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L185) + +___ + +### decodeBtcAddress + +▸ **decodeBtcAddress**(`address`, `network`): { `p2pkh`: `string` } \| { `p2sh`: `string` } \| { `p2wpkhv0`: `string` } \| { `p2wshv0`: `string` } + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `network` | `Network` | + +#### Returns + +{ `p2pkh`: `string` } \| { `p2sh`: `string` } \| { `p2wpkhv0`: `string` } \| { `p2wshv0`: `string` } + +#### Defined in + +[src/utils/bitcoin.ts:92](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L92) + +___ + +### decodeBytesAsString + +▸ **decodeBytesAsString**(`bytes`): `string` + +Convert Bytes to a string. Will remove `0x` prefix if present. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bytes` | `Bytes` | Bytes to decode | + +#### Returns + +`string` + +the decoded string + +#### Defined in + +[src/utils/encoding.ts:133](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L133) + +___ + +### decodeFixedPointType + +▸ **decodeFixedPointType**(`x`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `x` | [`SignedFixedPoint`](interfaces/SignedFixedPoint.md) \| [`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/encoding.ts:122](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L122) + +___ + +### decodeNumberOrHex + +▸ **decodeNumberOrHex**(`value`): `Big` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | [`NumberOrHex`](interfaces/NumberOrHex.md) | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/encoding.ts:386](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L386) + +___ + +### decodePermill + +▸ **decodePermill**(`amount`, `inPercentage?`): `Big` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `amount` | `Permill` | `undefined` | +| `inPercentage` | `boolean` | `false` | + +#### Returns + +`Big` + +#### Defined in + +[src/utils/encoding.ts:378](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L378) + +___ + +### decodeRpcVaultId + +▸ **decodeRpcVaultId**(`api`, `vaultId`): `Promise`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultId` | [`VaultId`](interfaces/VaultId.md) | + +#### Returns + +`Promise`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md)\> + +#### Defined in + +[src/utils/encoding.ts:191](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L191) + +___ + +### encodeBtcAddress + +▸ **encodeBtcAddress**(`address`, `network`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `BitcoinAddress` | +| `network` | `Network` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/bitcoin.ts:30](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L30) + +___ + +### encodeSwapParamsForStandardAndStablePools + +▸ **encodeSwapParamsForStandardAndStablePools**(`api`, `trade`, `minimumAmountOut`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `trade` | [`Trade`](classes/Trade.md) | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `amountIn` | `string` | +| `amountOutMin` | `string` | +| `path` | ({ `Stable`: { `basePoolId`: `number` ; `fromCurrency`: [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) ; `mode`: `string` ; `poolId`: `number` ; `toCurrency`: [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) } } \| { `Normal`: [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md)[] })[] | + +#### Defined in + +[src/parachain/amm/encoding.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/encoding.ts#L25) + +___ + +### encodeSwapParamsForStandardPoolsOnly + +▸ **encodeSwapParamsForStandardPoolsOnly**(`api`, `trade`, `minimumAmountOut`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `trade` | [`Trade`](classes/Trade.md) | +| `minimumAmountOut` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `amountIn` | `string` | +| `amountOutMin` | `string` | +| `path` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md)[] | + +#### Defined in + +[src/parachain/amm/encoding.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/encoding.ts#L8) + +___ + +### encodeUnsignedFixedPoint + +▸ **encodeUnsignedFixedPoint**(`api`, `x`): [`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `x` | `Big` | + +#### Returns + +[`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) + +#### Defined in + +[src/utils/encoding.ts:137](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L137) + +___ + +### encodeVaultId + +▸ **encodeVaultId**(`api`, `id`): `Promise`<`string`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `id` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | + +#### Returns + +`Promise`<`string`\> + +#### Defined in + +[src/utils/encoding.ts:343](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L343) + +___ + +### ensureHashEncoded + +▸ **ensureHashEncoded**(`api`, `hash`): `H256` + +Ensure a hash value is an encoded H256 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | The polkadot API promise used to encode if necessary | +| `hash` | `string` \| `H256` | The either H256 or string encoded hash | + +#### Returns + +`H256` + +#### Defined in + +[src/utils/encoding.ts:94](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L94) + +___ + +### filterNonEmptyPools + +▸ **filterNonEmptyPools**(`pools`): [`LiquidityPool`](modules.md#liquiditypool)[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pools` | [`LiquidityPool`](modules.md#liquiditypool)[] | + +#### Returns + +[`LiquidityPool`](modules.md#liquiditypool)[] + +#### Defined in + +[src/parachain/amm/liquidity-pool/utils.ts:16](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/utils.ts#L16) + +___ + +### findBestTradeRecursively + +▸ **findBestTradeRecursively**(`inputAmount`, `outputCurrency`, `pairs`, `hopLimit`, `path?`, `initialInputAmount?`): ``null`` \| [`Trade`](classes/Trade.md) + +Recursive function to find best trade path for provided trading pairs, +input amount, output currencies and limited amount of hops between +pools. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | `undefined` | Input currency amount to be exchanged. | +| `outputCurrency` | [`CurrencyExt`](modules.md#currencyext) | `undefined` | Output currency to be received. | +| `pairs` | [`TradingPair`](interfaces/TradingPair.md)[] | `undefined` | Array of all trading pairs to include in search. | +| `hopLimit` | `number` | `undefined` | Maximum number of hops between liquidity pools. | +| `path` | [`MultiPath`](modules.md#multipath) | `[]` | Recursively generated parameter containing current trading path. | +| `initialInputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | `inputAmount` | Initial input amount. | + +#### Returns + +``null`` \| [`Trade`](classes/Trade.md) + +#### Defined in + +[src/parachain/amm/utils.ts:20](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/utils.ts#L20) + +___ + +### getAPITypes + +▸ **getAPITypes**(): `RegistryTypes` + +#### Returns + +`RegistryTypes` + +#### Defined in + +[src/factory.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L54) + +___ + +### getAllTradingPairs + +▸ **getAllTradingPairs**(`pools`): [`TradingPair`](interfaces/TradingPair.md)[] + +Get all trading pairs based on provided pools. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pools` | [`LiquidityPool`](modules.md#liquiditypool)[] | + +#### Returns + +[`TradingPair`](interfaces/TradingPair.md)[] + +All trading pairs. + +#### Defined in + +[src/parachain/amm/liquidity-pool/utils.ts:25](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/utils.ts#L25) + +___ + +### getBitcoinNetwork + +▸ **getBitcoinNetwork**(`network?`): `Network` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `network` | [`BitcoinNetwork`](modules.md#bitcoinnetwork) | `"mainnet"` | + +#### Returns + +`Network` + +#### Defined in + +[src/interbtc-api.ts:32](https://github.com/interlay/interbtc-api/blob/6262ea7/src/interbtc-api.ts#L32) + +___ + +### getCollateralCurrencies + +▸ **getCollateralCurrencies**(`api`): `Promise`<[`CollateralCurrencyExt`](modules.md#collateralcurrencyext)[]\> + +Get all collateral currencies (tokens as well as foreign assets). + +Will return all collateral currencies for which the parachain has a system collateral ceiling value +greater than zero. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | ApiPromise instance to query the parachain | + +#### Returns + +`Promise`<[`CollateralCurrencyExt`](modules.md#collateralcurrencyext)[]\> + +An array of collateral currencies. + +#### Defined in + +[src/utils/currency.ts:103](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L103) + +___ + +### getCurrencyIdentifier + +▸ **getCurrencyIdentifier**(`currency`): [`CurrencyIdentifier`](modules.md#currencyidentifier) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +[`CurrencyIdentifier`](modules.md#currencyidentifier) + +#### Defined in + +[src/utils/currency.ts:166](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L166) + +___ + +### getForeignAssetFromId + +▸ **getForeignAssetFromId**(`api`, `id`): `Promise`<[`ForeignAsset`](modules.md#foreignasset)\> + +Get foreign asset by its id. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `id` | `number` \| `u32` | The id of the foreign asset. | + +#### Returns + +`Promise`<[`ForeignAsset`](modules.md#foreignasset)\> + +The foreign asset. + +#### Defined in + +[src/utils/currency.ts:233](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L233) + +___ + +### getIssueRequestsFromExtrinsicResult + +▸ **getIssueRequestsFromExtrinsicResult**(`interBtcApi`, `result`): `Promise`<[`Issue`](interfaces/Issue.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | +| `result` | `ISubmittableResult` | + +#### Returns + +`Promise`<[`Issue`](interfaces/Issue.md)[]\> + +#### Defined in + +[src/utils/issueRedeem.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L55) + +___ + +### getRPCTypes + +▸ **getRPCTypes**(): `Record`<`string`, `Record`<`string`, `DefinitionRpc` \| `DefinitionRpcSub`\>\> + +#### Returns + +`Record`<`string`, `Record`<`string`, `DefinitionRpc` \| `DefinitionRpcSub`\>\> + +#### Defined in + +[src/factory.ts:58](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L58) + +___ + +### getRedeemRequestsFromExtrinsicResult + +▸ **getRedeemRequestsFromExtrinsicResult**(`interBtcApi`, `result`): `Promise`<[`Redeem`](interfaces/Redeem.md)[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | +| `result` | `ISubmittableResult` | + +#### Returns + +`Promise`<[`Redeem`](interfaces/Redeem.md)[]\> + +#### Defined in + +[src/utils/issueRedeem.ts:64](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L64) + +___ + +### getRequestIdsFromEvents + +▸ **getRequestIdsFromEvents**(`events`, `eventToFind`, `api`): `Hash`[] + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `events` | `EventRecord`[] | The EventRecord array returned after sending a transaction | +| `eventToFind` | `AugmentedEvent`<`ApiTypes`, `AnyTuple`\> | - | +| `api` | `ApiPromise` | - | + +#### Returns + +`Hash`[] + +The id associated with the transaction. If the EventRecord array does not +contain required events, the function throws an error. + +#### Defined in + +[src/utils/issueRedeem.ts:37](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L37) + +___ + +### getRuntimeDefs + +▸ **getRuntimeDefs**(): `DefinitionsCall` + +#### Returns + +`DefinitionsCall` + +#### Defined in + +[src/factory.ts:125](https://github.com/interlay/interbtc-api/blob/6262ea7/src/factory.ts#L125) + +___ + +### getSS58Prefix + +▸ **getSS58Prefix**(`api`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | + +#### Returns + +`number` + +#### Defined in + +[src/utils/encoding.ts:374](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L374) + +___ + +### getStableLpTokenFromCurrencyId + +▸ **getStableLpTokenFromCurrencyId**(`api`, `currencyId`): `Promise`<[`StableLpToken`](modules.md#stablelptoken)\> + +Get stable LP token currency lib type from currencyId primitive. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `currencyId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | Id of stable LP token. | + +#### Returns + +`Promise`<[`StableLpToken`](modules.md#stablelptoken)\> + +Lib type currency object for stable LP token. + +#### Defined in + +[src/utils/currency.ts:308](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L308) + +___ + +### getStableSwapOutputAmount + +▸ **getStableSwapOutputAmount**(`path`, `inputAmount`): `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `path` | [`MultiPathElementStable`](modules.md#multipathelementstable) | +| `inputAmount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> + +#### Defined in + +[src/parachain/amm/liquidity-pool/utils.ts:177](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/utils.ts#L177) + +___ + +### getStandardLpTokenFromCurrencyId + +▸ **getStandardLpTokenFromCurrencyId**(`api`, `currencyId`): `Promise`<[`StandardLpToken`](modules.md#standardlptoken)\> + +Get standard LP token currency lib type from currencyId primitive. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `currencyId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | Id of standard LP token. | + +#### Returns + +`Promise`<[`StandardLpToken`](modules.md#standardlptoken)\> + +Lib type currency object for standard LP token. + +#### Defined in + +[src/utils/currency.ts:277](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L277) + +___ + +### getTotalAmountBtc + +▸ **getTotalAmountBtc**(`positions`, `loanAssets`): `MonetaryAmount`<`Currency`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `positions` | [`LoanPosition`](interfaces/LoanPosition.md)[] | +| `loanAssets` | [`TickerToData`](modules.md#tickertodata)<[`LoanAsset`](interfaces/LoanAsset.md)\> | + +#### Returns + +`MonetaryAmount`<`Currency`\> + +#### Defined in + +[src/utils/loans.ts:45](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/loans.ts#L45) + +___ + +### getTxProof + +▸ **getTxProof**(`electrsAPI`, `userTxId`): `Promise`<{ `coinbaseProof`: `PartialTxProof` ; `userTxProof`: `PartialTxProof` }\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `electrsAPI` | [`ElectrsAPI`](interfaces/ElectrsAPI.md) | +| `userTxId` | `string` | + +#### Returns + +`Promise`<{ `coinbaseProof`: `PartialTxProof` ; `userTxProof`: `PartialTxProof` }\> + +#### Defined in + +[src/utils/bitcoin.ts:181](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L181) + +___ + +### getUnderlyingCurrencyFromLendTokenId + +▸ **getUnderlyingCurrencyFromLendTokenId**(`api`, `lendTokenId`): `Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +Get underlying currency of lend token id, + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | - | +| `lendTokenId` | [`InterbtcPrimitivesCurrencyId`](interfaces/InterbtcPrimitivesCurrencyId.md) | Currency id of the lend token to get currency from | + +#### Returns + +`Promise`<[`CurrencyExt`](modules.md#currencyext)\> + +Underlying CurrencyExt for provided lend token + +#### Defined in + +[src/utils/currency.ts:260](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L260) + +___ + +### intoAccountTruncating + +▸ **intoAccountTruncating**(`api`, `palletId`): `AccountId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `palletId` | `Uint8Array` | + +#### Returns + +`AccountId` + +#### Defined in + +[src/utils/encoding.ts:47](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L47) + +___ + +### isCurrency + +▸ **isCurrency**(`currencyExt`): currencyExt is Currency + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is Currency + +#### Defined in + +[src/utils/currency.ts:138](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L138) + +___ + +### isCurrencyEqual + +▸ **isCurrencyEqual**(`currency`, `otherCurrency`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | +| `otherCurrency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +`boolean` + +#### Defined in + +[src/utils/currency.ts:147](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L147) + +___ + +### isForeignAsset + +▸ **isForeignAsset**(`currencyExt`): currencyExt is ForeignAsset + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is ForeignAsset + +#### Defined in + +[src/utils/currency.ts:118](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L118) + +___ + +### isLendToken + +▸ **isLendToken**(`currencyExt`): currencyExt is LendToken + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is LendToken + +#### Defined in + +[src/utils/currency.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L124) + +___ + +### isStableLpToken + +▸ **isStableLpToken**(`currencyExt`): currencyExt is StableLpToken + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is StableLpToken + +#### Defined in + +[src/utils/currency.ts:134](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L134) + +___ + +### isStableMetaMultiPathElement + +▸ **isStableMetaMultiPathElement**(`pathElement`): pathElement is MultiPathElementStableMeta + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStableMeta + +#### Defined in + +[src/parachain/amm/trade/types.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L52) + +___ + +### isStableMetaPool + +▸ **isStableMetaPool**(`pool`): pool is StableLiquidityMetaPool + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pool` | [`LiquidityPool`](modules.md#liquiditypool) | + +#### Returns + +pool is StableLiquidityMetaPool + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:11](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L11) + +___ + +### isStableMultiPathElement + +▸ **isStableMultiPathElement**(`pathElement`): pathElement is MultiPathElementStable + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStable + +#### Defined in + +[src/parachain/amm/trade/types.ts:50](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L50) + +___ + +### isStablePlainMultiPathElement + +▸ **isStablePlainMultiPathElement**(`pathElement`): pathElement is MultiPathElementStablePlain + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStablePlain + +#### Defined in + +[src/parachain/amm/trade/types.ts:54](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L54) + +___ + +### isStablePool + +▸ **isStablePool**(`pool`): pool is StableLiquidityPool \| StableLiquidityMetaPool + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pool` | [`LiquidityPool`](modules.md#liquiditypool) | + +#### Returns + +pool is StableLiquidityPool \| StableLiquidityMetaPool + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:9](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L9) + +___ + +### isStandardLpToken + +▸ **isStandardLpToken**(`currencyExt`): currencyExt is StandardLpToken + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `currencyExt` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +currencyExt is StandardLpToken + +#### Defined in + +[src/utils/currency.ts:130](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L130) + +___ + +### isStandardMultiPathElement + +▸ **isStandardMultiPathElement**(`pathElement`): pathElement is MultiPathElementStandard + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pathElement` | [`MultiPathElement`](modules.md#multipathelement) | + +#### Returns + +pathElement is MultiPathElementStandard + +#### Defined in + +[src/parachain/amm/trade/types.ts:48](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/trade/types.ts#L48) + +___ + +### isStandardPool + +▸ **isStandardPool**(`pool`): pool is StandardLiquidityPool + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `pool` | [`LiquidityPool`](modules.md#liquiditypool) | + +#### Returns + +pool is StandardLiquidityPool + +#### Defined in + +[src/parachain/amm/liquidity-pool/types.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/parachain/amm/liquidity-pool/types.ts#L8) + +___ + +### issueAndRedeem + +▸ **issueAndRedeem**(`InterBtcApi`, `bitcoinCoreClient`, `account`, `vaultId?`, `issueAmount?`, `redeemAmount?`, `autoExecuteIssue?`, `autoExecuteRedeem?`, `triggerRefund?`, `atomic?`): `Promise`<[[`Issue`](interfaces/Issue.md), [`Redeem`](interfaces/Redeem.md)]\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `InterBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | `undefined` | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | `undefined` | +| `account` | `KeyringPair` | `undefined` | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `issueAmount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `redeemAmount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `autoExecuteIssue` | `boolean` | `true` | +| `autoExecuteRedeem` | [`ExecuteRedeem`](enums/ExecuteRedeem.md) | `ExecuteRedeem.Auto` | +| `triggerRefund` | `boolean` | `false` | +| `atomic` | `boolean` | `true` | + +#### Returns + +`Promise`<[[`Issue`](interfaces/Issue.md), [`Redeem`](interfaces/Redeem.md)]\> + +#### Defined in + +[src/utils/issueRedeem.ts:255](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L255) + +___ + +### issueSingle + +▸ **issueSingle**(`interBtcApi`, `bitcoinCoreClient`, `issuingAccount`, `amount`, `vaultId?`, `autoExecute?`, `triggerRefund?`, `atomic?`): `Promise`<[`IssueResult`](interfaces/IssueResult.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | `undefined` | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | `undefined` | +| `issuingAccount` | `KeyringPair` | `undefined` | +| `amount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `autoExecute` | `boolean` | `true` | +| `triggerRefund` | `boolean` | `false` | +| `atomic` | `boolean` | `true` | + +#### Returns + +`Promise`<[`IssueResult`](interfaces/IssueResult.md)\> + +#### Defined in + +[src/utils/issueRedeem.ts:121](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L121) + +___ + +### monetaryAmountToRawString + +▸ **monetaryAmountToRawString**(`amount`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `amount` | `MonetaryAmount`<[`CurrencyExt`](modules.md#currencyext)\> | + +#### Returns + +`string` + +#### Defined in + +[src/utils/encoding.ts:393](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L393) + +___ + +### newAccountId + +▸ **newAccountId**(`api`, `accountId`): `AccountId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `accountId` | `string` | + +#### Returns + +`AccountId` + +#### Defined in + +[src/utils/encoding.ts:176](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L176) + +___ + +### newCollateralBTCExchangeRate + +▸ **newCollateralBTCExchangeRate**(`rate`, `counterCurrency`, `useBaseUnits?`): `ExchangeRate`<`Bitcoin`, `Currency`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `rate` | `Big` | `undefined` | +| `counterCurrency` | `Currency` | `undefined` | +| `useBaseUnits` | `boolean` | `false` | + +#### Returns + +`ExchangeRate`<`Bitcoin`, `Currency`\> + +#### Defined in + +[src/utils/currency.ts:61](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L61) + +___ + +### newCurrencyId + +▸ **newCurrencyId**(`api`, `currency`): `InterbtcPrimitivesCurrencyId` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +`InterbtcPrimitivesCurrencyId` + +#### Defined in + +[src/utils/encoding.ts:213](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L213) + +___ + +### newExtrinsicStatus + +▸ **newExtrinsicStatus**(`api`, `type`): `ExtrinsicStatus` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `type` | ``"Ready"`` \| ``"Future"`` \| ``"Broadcast"`` \| ``"InBlock"`` \| ``"Retracted"`` \| ``"FinalityTimeout"`` \| ``"Finalized"`` \| ``"Usurped"`` \| ``"Dropped"`` \| ``"Invalid"`` | + +#### Returns + +`ExtrinsicStatus` + +#### Defined in + +[src/utils/encoding.ts:397](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L397) + +___ + +### newForeignAssetId + +▸ **newForeignAssetId**(`api`, `id`): `u32` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `id` | `number` | + +#### Returns + +`u32` + +#### Defined in + +[src/utils/encoding.ts:218](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L218) + +___ + +### newMonetaryAmount + +▸ **newMonetaryAmount**<`CurrencyT`\>(`amount`, `currency`, `base?`): `MonetaryAmount`<`CurrencyT`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `CurrencyT` | extends [`CurrencyExt`](modules.md#currencyext) | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `amount` | `BigSource` | `undefined` | +| `currency` | `CurrencyT` | `undefined` | +| `base` | `boolean` | `false` | + +#### Returns + +`MonetaryAmount`<`CurrencyT`\> + +#### Defined in + +[src/utils/currency.ts:52](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L52) + +___ + +### newVaultCurrencyPair + +▸ **newVaultCurrencyPair**(`api`, `collateralCurrency`, `wrappedCurrency`): `InterbtcPrimitivesVaultCurrencyPair` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `collateralCurrency` | [`CollateralCurrencyExt`](modules.md#collateralcurrencyext) | +| `wrappedCurrency` | `Currency` | + +#### Returns + +`InterbtcPrimitivesVaultCurrencyPair` + +#### Defined in + +[src/utils/encoding.ts:200](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L200) + +___ + +### newVaultId + +▸ **newVaultId**(`api`, `accountId`, `collateralCurrency`, `wrappedCurrency`): [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `accountId` | `string` | +| `collateralCurrency` | [`CollateralCurrencyExt`](modules.md#collateralcurrencyext) | +| `wrappedCurrency` | `Currency` | + +#### Returns + +[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) + +#### Defined in + +[src/utils/encoding.ts:180](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L180) + +___ + +### parseEscrowLockedBalance + +▸ **parseEscrowLockedBalance**(`governanceCurrency`, `escrowLockedBalance`): [`StakedBalance`](modules.md#stakedbalance) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `governanceCurrency` | `Currency` | +| `escrowLockedBalance` | `EscrowLockedBalance` | + +#### Returns + +[`StakedBalance`](modules.md#stakedbalance) + +#### Defined in + +[src/types/currency.ts:133](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L133) + +___ + +### parseIssueRequest + +▸ **parseIssueRequest**(`api`, `vaultsAPI`, `req`, `network`, `id`): `Promise`<[`Issue`](interfaces/Issue.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultsAPI` | [`VaultsAPI`](interfaces/VaultsAPI.md) | +| `req` | `InterbtcPrimitivesIssueIssueRequest` | +| `network` | `Network` | +| `id` | `string` \| `H256` | + +#### Returns + +`Promise`<[`Issue`](interfaces/Issue.md)\> + +#### Defined in + +[src/utils/encoding.ts:250](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L250) + +___ + +### parseOrmlTokensAccountData + +▸ **parseOrmlTokensAccountData**(`data`, `currency`): [`ChainBalance`](classes/ChainBalance.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `OrmlTokensAccountData` | +| `currency` | [`CurrencyExt`](modules.md#currencyext) | + +#### Returns + +[`ChainBalance`](classes/ChainBalance.md) + +#### Defined in + +[src/types/currency.ts:124](https://github.com/interlay/interbtc-api/blob/6262ea7/src/types/currency.ts#L124) + +___ + +### parseRedeemRequest + +▸ **parseRedeemRequest**(`api`, `vaultsAPI`, `req`, `network`, `id`, `redeemPeriod`, `activeBlockCount`): `Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vaultsAPI` | [`VaultsAPI`](interfaces/VaultsAPI.md) | +| `req` | `InterbtcPrimitivesRedeemRedeemRequest` | +| `network` | `Network` | +| `id` | `string` \| `H256` | +| `redeemPeriod` | `number` | +| `activeBlockCount` | `number` | + +#### Returns + +`Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Defined in + +[src/utils/encoding.ts:308](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L308) + +___ + +### parseRedeemRequestStatus + +▸ **parseRedeemRequestStatus**(`req`, `redeemPeriod`, `activeBlockCount`): [`RedeemStatus`](enums/RedeemStatus.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `req` | `InterbtcPrimitivesRedeemRedeemRequest` | +| `redeemPeriod` | `number` | +| `activeBlockCount` | `number` | + +#### Returns + +[`RedeemStatus`](enums/RedeemStatus.md) + +#### Defined in + +[src/utils/encoding.ts:278](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L278) + +___ + +### parseReplaceRequest + +▸ **parseReplaceRequest**(`api`, `req`, `network`, `wrappedCurrency`, `id`): `Promise`<[`ReplaceRequestExt`](interfaces/ReplaceRequestExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `req` | `InterbtcPrimitivesReplaceReplaceRequest` | +| `network` | `Network` | +| `wrappedCurrency` | `Currency` | +| `id` | `string` \| `H256` | + +#### Returns + +`Promise`<[`ReplaceRequestExt`](interfaces/ReplaceRequestExt.md)\> + +#### Defined in + +[src/utils/encoding.ts:227](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L227) + +___ + +### parseSystemVault + +▸ **parseSystemVault**(`api`, `vault`, `wrappedCurrency`, `collateralCurrency`): `Promise`<[`SystemVaultExt`](interfaces/SystemVaultExt.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `vault` | `VaultRegistrySystemVault` | +| `wrappedCurrency` | `Currency` | +| `collateralCurrency` | [`CollateralCurrencyExt`](modules.md#collateralcurrencyext) | + +#### Returns + +`Promise`<[`SystemVaultExt`](interfaces/SystemVaultExt.md)\> + +#### Defined in + +[src/utils/encoding.ts:158](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L158) + +___ + +### queryNominationsMap + +▸ **queryNominationsMap**(`api`, `map`, `vaultId`): `Promise`<`number` \| `undefined`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `map` | `Map`<[`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md), `number`\> | +| `vaultId` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | + +#### Returns + +`Promise`<`number` \| `undefined`\> + +#### Defined in + +[src/utils/encoding.ts:361](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L361) + +___ + +### redeem + +▸ **redeem**(`interBtcApi`, `bitcoinCoreClient`, `redeemingAccount`, `amount`, `vaultId?`, `autoExecute?`, `atomic?`, `timeout?`): `Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `interBtcApi` | [`InterBtcApi`](interfaces/InterBtcApi.md) | `undefined` | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | `undefined` | +| `redeemingAccount` | `KeyringPair` | `undefined` | +| `amount` | `MonetaryAmount`<`Currency`\> | `undefined` | +| `vaultId?` | [`InterbtcPrimitivesVaultId`](interfaces/InterbtcPrimitivesVaultId.md) | `undefined` | +| `autoExecute` | [`ExecuteRedeem`](enums/ExecuteRedeem.md) | `ExecuteRedeem.Auto` | +| `atomic` | `boolean` | `true` | +| `timeout` | `number` | `undefined` | + +#### Returns + +`Promise`<[`Redeem`](interfaces/Redeem.md)\> + +#### Defined in + +[src/utils/issueRedeem.ts:211](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/issueRedeem.ts#L211) + +___ + +### reverseEndianness + +▸ **reverseEndianness**(`bytes`): `Uint8Array` + +Converts endianness of a Uint8Array + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bytes` | `Uint8Array` | Uint8Array, to be converted LE<>BE | + +#### Returns + +`Uint8Array` + +#### Defined in + +[src/utils/encoding.ts:55](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L55) + +___ + +### reverseEndiannessHex + +▸ **reverseEndiannessHex**(`hex`): `string` + +Reverse the endianness of the given hex string + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `hex` | `string` | + +#### Returns + +`string` + +**`Dev`** + +Will remove `0x` prefix if present + +#### Defined in + +[src/utils/encoding.ts:107](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L107) + +___ + +### setRawStorage + +▸ **setRawStorage**(`api`, `key`, `value`, `account`, `isLittleEndian?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `api` | `ApiPromise` | `undefined` | +| `key` | `string` | `undefined` | +| `value` | `Codec` | `undefined` | +| `account` | `AddressOrPair` | `undefined` | +| `isLittleEndian` | `boolean` | `true` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/storage.ts:8](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/storage.ts#L8) + +___ + +### setStorageAtKey + +▸ **setStorageAtKey**(`api`, `key`, `data`, `sudoAccount`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `api` | `ApiPromise` | +| `key` | `string` | +| `data` | \`0x${string}\` | +| `sudoAccount` | `AddressOrPair` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/storage.ts:18](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/storage.ts#L18) + +___ + +### sleep + +▸ **sleep**(`ms`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ms` | `number` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/constants.ts:21](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/constants.ts#L21) + +___ + +### storageKeyToNthInner + +▸ **storageKeyToNthInner**<`T`\>(`s`, `n?`): `T` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `Codec` | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `s` | `StorageKey`<`T`[]\> | `undefined` | +| `n` | `number` | `0` | + +#### Returns + +`T` + +#### Defined in + +[src/utils/encoding.ts:145](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L145) + +___ + +### stripHexPrefix + +▸ **stripHexPrefix**(`str`): `string` + +Remove the `0x` hex prefix if present + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`string` + +#### Defined in + +[src/utils/encoding.ts:77](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L77) + +___ + +### toVoting + +▸ **toVoting**(`governanceCurrency`): `Currency` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `governanceCurrency` | `Currency` | + +#### Returns + +`Currency` + +#### Defined in + +[src/utils/currency.ts:84](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L84) + +___ + +### tokenSymbolToCurrency + +▸ **tokenSymbolToCurrency**(`tokenSymbol`): `Currency` + +A method that will only try to find a hard-coded currencies. +Only for use when we are certain the currency is not a foreign asset. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `tokenSymbol` | [`InterbtcPrimitivesTokenSymbol`](interfaces/InterbtcPrimitivesTokenSymbol.md) | the InterbtcPrimitivesTokenSymbol to look up | + +#### Returns + +`Currency` + +#### Defined in + +[src/utils/currency.ts:211](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/currency.ts#L211) + +___ + +### uint8ArrayToString + +▸ **uint8ArrayToString**(`bytes`): `string` + +Converts a Uint8Array to string + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bytes` | `Uint8Array` | + +#### Returns + +`string` + +**`Dev`** + +Will remove `0x` prefix if present + +#### Defined in + +[src/utils/encoding.ts:118](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L118) + +___ + +### unwrapRawExchangeRate + +▸ **unwrapRawExchangeRate**(`option`): [`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) \| `undefined` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `option` | `Option`<[`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md)\> | + +#### Returns + +[`UnsignedFixedPoint`](interfaces/UnsignedFixedPoint.md) \| `undefined` + +#### Defined in + +[src/utils/encoding.ts:339](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/encoding.ts#L339) + +___ + +### waitForBlockFinalization + +▸ **waitForBlockFinalization**(`bitcoinCoreClient`, `btcRelayAPI`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bitcoinCoreClient` | [`BitcoinCoreClient`](classes/BitcoinCoreClient.md) | +| `btcRelayAPI` | [`BTCRelayAPI`](interfaces/BTCRelayAPI.md) | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin.ts:219](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L219) + +___ + +### waitForBlockRelaying + +▸ **waitForBlockRelaying**(`btcRelayAPI`, `blockHash`, `sleepMs?`): `Promise`<`void`\> + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `btcRelayAPI` | [`BTCRelayAPI`](interfaces/BTCRelayAPI.md) | `undefined` | +| `blockHash` | `string` | `undefined` | +| `sleepMs` | `number` | `SLEEP_TIME_MS` | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[src/utils/bitcoin.ts:208](https://github.com/interlay/interbtc-api/blob/6262ea7/src/utils/bitcoin.ts#L208)