From 6bfb90882528b4369bd707ce2c1b13d8074e4e72 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 26 Jan 2024 13:55:56 +0200 Subject: [PATCH 1/2] Remove references to Exchange contract in ck --- .changeset/silly-moose-type.md | 5 + packages/sdk/contractkit/README.md | 4 +- packages/sdk/contractkit/src/base.ts | 8 - .../src/basic-contract-cache-type.ts | 5 - .../sdk/contractkit/src/celo-tokens.test.ts | 2 +- packages/sdk/contractkit/src/celo-tokens.ts | 26 +- .../contractkit/src/contract-cache.test.ts | 2 - .../sdk/contractkit/src/contract-cache.ts | 11 +- packages/sdk/contractkit/src/kit.ts | 5 +- .../contractkit/src/mini-contract-cache.ts | 21 +- packages/sdk/contractkit/src/proxy.ts | 4 - .../contractkit/src/web3-contract-cache.ts | 16 +- .../contractkit/src/wrappers/Exchange.test.ts | 181 --------- .../sdk/contractkit/src/wrappers/Exchange.ts | 346 ------------------ .../explorer/fixtures/contract.metadata.json | 7 - 15 files changed, 12 insertions(+), 631 deletions(-) create mode 100644 .changeset/silly-moose-type.md delete mode 100644 packages/sdk/contractkit/src/wrappers/Exchange.test.ts delete mode 100644 packages/sdk/contractkit/src/wrappers/Exchange.ts diff --git a/.changeset/silly-moose-type.md b/.changeset/silly-moose-type.md new file mode 100644 index 000000000..633191772 --- /dev/null +++ b/.changeset/silly-moose-type.md @@ -0,0 +1,5 @@ +--- +'@celo/contractkit': major +--- + +Remove all references to now defunkt mento exchange contracts diff --git a/packages/sdk/contractkit/README.md b/packages/sdk/contractkit/README.md index 4ce255a79..753a2b856 100644 --- a/packages/sdk/contractkit/README.md +++ b/packages/sdk/contractkit/README.md @@ -145,7 +145,6 @@ There are many core contracts. - EpochRewardsWrapper - Erc20Wrapper - EscrowWrapper -- ExchangeWrapper - FreezerWrapper - GasPriceMinimumWrapper - GoldTokenWrapper @@ -197,7 +196,7 @@ Some user might want to access web3 native contract wrappers. To do so, you can: ```ts -const web3Exchange = await kit._web3Contracts.getExchange() +const feeCurrencyWhitelist = await kit._web3Contracts.getFeeCurrencyWhitelist() ``` We expose native wrappers for all Celo core contracts. @@ -208,7 +207,6 @@ The complete list of Celo Core contracts is: - Attestations - LockedGold - Escrow -- Exchange - FeeCurrencyWhitelist - GasPriceMinimum - GoldToken diff --git a/packages/sdk/contractkit/src/base.ts b/packages/sdk/contractkit/src/base.ts index fa19ddf2e..3ae198f82 100644 --- a/packages/sdk/contractkit/src/base.ts +++ b/packages/sdk/contractkit/src/base.ts @@ -8,9 +8,6 @@ export enum CeloContract { EpochRewards = 'EpochRewards', ERC20 = 'ERC20', Escrow = 'Escrow', - Exchange = 'Exchange', - ExchangeEUR = 'ExchangeEUR', - ExchangeBRL = 'ExchangeBRL', FederatedAttestations = 'FederatedAttestations', FeeCurrencyWhitelist = 'FeeCurrencyWhitelist', FeeHandler = 'FeeHandler', @@ -38,11 +35,6 @@ export type StableTokenContract = | CeloContract.StableTokenEUR | CeloContract.StableTokenBRL -export type ExchangeContract = - | CeloContract.Exchange - | CeloContract.ExchangeEUR - | CeloContract.ExchangeBRL - export type CeloTokenContract = StableTokenContract | CeloContract.GoldToken /** * Deprecated alias for CeloTokenContract. diff --git a/packages/sdk/contractkit/src/basic-contract-cache-type.ts b/packages/sdk/contractkit/src/basic-contract-cache-type.ts index f576a340a..d5e9854cd 100644 --- a/packages/sdk/contractkit/src/basic-contract-cache-type.ts +++ b/packages/sdk/contractkit/src/basic-contract-cache-type.ts @@ -1,7 +1,6 @@ import { StableToken } from '@celo/base' import { CeloContract, CeloTokenContract } from './base' import { AccountsWrapper } from './wrappers/Accounts' -import { ExchangeWrapper } from './wrappers/Exchange' import { GoldTokenWrapper, GoldTokenWrapperType } from './wrappers/GoldTokenWrapper' import { StableTokenWrapper } from './wrappers/StableTokenWrapper' @@ -11,15 +10,11 @@ import { StableTokenWrapper } from './wrappers/StableTokenWrapper' */ export interface ContractCacheType { getAccounts(): Promise - getExchange(stableToken: StableToken): Promise getGoldToken(): Promise getStableToken(stableToken: StableToken): Promise - getContract( - contract: CeloContract.Exchange | CeloContract.ExchangeEUR | CeloContract.ExchangeBRL - ): Promise getContract(contract: CeloTokenContract): Promise getContract(contract: CeloContract.GoldToken): Promise } diff --git a/packages/sdk/contractkit/src/celo-tokens.test.ts b/packages/sdk/contractkit/src/celo-tokens.test.ts index cf6a20c08..6767347a3 100644 --- a/packages/sdk/contractkit/src/celo-tokens.test.ts +++ b/packages/sdk/contractkit/src/celo-tokens.test.ts @@ -46,7 +46,7 @@ describe('CeloTokens', () => { }) it('returns false if the contract is not a stable token contract', () => { - expect(celoTokens.isStableTokenContract(CeloContract.Exchange)).toEqual(false) + expect(celoTokens.isStableTokenContract(CeloContract.ERC20)).toEqual(false) }) }) }) diff --git a/packages/sdk/contractkit/src/celo-tokens.ts b/packages/sdk/contractkit/src/celo-tokens.ts index 6cb9f05fd..764190bd2 100644 --- a/packages/sdk/contractkit/src/celo-tokens.ts +++ b/packages/sdk/contractkit/src/celo-tokens.ts @@ -1,7 +1,7 @@ import { CeloTokenType, StableToken, Token } from '@celo/base' import { BigNumber } from 'bignumber.js' import { AddressRegistry } from './address-registry' -import { CeloContract, CeloTokenContract, ExchangeContract, StableTokenContract } from './base' +import { CeloContract, CeloTokenContract, StableTokenContract } from './base' import { ContractCacheType } from './basic-contract-cache-type' import { GoldTokenWrapper } from './wrappers/GoldTokenWrapper' import { StableTokenWrapper } from './wrappers/StableTokenWrapper' @@ -20,7 +20,6 @@ export interface CeloTokenInfo { export interface StableTokenInfo extends CeloTokenInfo { contract: StableTokenContract - exchangeContract: ExchangeContract } /** Basic info for each stable token */ @@ -29,17 +28,14 @@ export const stableTokenInfos: { } = { [StableToken.cUSD]: { contract: CeloContract.StableToken, - exchangeContract: CeloContract.Exchange, symbol: StableToken.cUSD, }, [StableToken.cEUR]: { contract: CeloContract.StableTokenEUR, - exchangeContract: CeloContract.ExchangeEUR, symbol: StableToken.cEUR, }, [StableToken.cREAL]: { contract: CeloContract.StableTokenBRL, - exchangeContract: CeloContract.ExchangeBRL, symbol: StableToken.cREAL, }, } @@ -100,16 +96,6 @@ export class CeloTokens { }) } - async getExchangesConfigs(humanReadable: boolean = false) { - return this.forStableCeloToken(async (info: StableTokenInfo) => { - const exchangeWrapper = await this.contracts.getContract(info.exchangeContract) - if (humanReadable) { - return exchangeWrapper.getHumanReadableConfig() - } - return exchangeWrapper.getConfig() - }) - } - /** * Runs fn for each celo token found in celoTokenInfos, and returns the * value of each call in an object keyed by the token. @@ -196,7 +182,6 @@ export class CeloTokens { try { // The registry add the valid addresses to a cache await this.registry.addressFor(info.contract) - await this.registry.addressFor(info.exchangeContract) return true } catch { // The contract was not deployed in the chain @@ -230,15 +215,6 @@ export class CeloTokens { return celoTokenInfos[token].contract } - /** - * Gets the exchange contract for the provided stable token - * @param token the stable token to get exchange contract of - * @return The exchange contract for the token - */ - getExchangeContract(token: StableToken) { - return stableTokenInfos[token].exchangeContract - } - /** * Gets the address of the contract for the provided token. * @param token the token to get the (proxy) contract address for diff --git a/packages/sdk/contractkit/src/contract-cache.test.ts b/packages/sdk/contractkit/src/contract-cache.test.ts index b20c8f285..eb5516469 100644 --- a/packages/sdk/contractkit/src/contract-cache.test.ts +++ b/packages/sdk/contractkit/src/contract-cache.test.ts @@ -9,8 +9,6 @@ const TestedWrappers: ValidWrappers[] = [ CeloContract.GoldToken, CeloContract.StableToken, CeloContract.StableTokenEUR, - CeloContract.Exchange, - CeloContract.ExchangeEUR, CeloContract.Validators, CeloContract.LockedGold, ] diff --git a/packages/sdk/contractkit/src/contract-cache.ts b/packages/sdk/contractkit/src/contract-cache.ts index 306cfa2a0..898307948 100644 --- a/packages/sdk/contractkit/src/contract-cache.ts +++ b/packages/sdk/contractkit/src/contract-cache.ts @@ -14,7 +14,6 @@ import { ElectionWrapper } from './wrappers/Election' import { EpochRewardsWrapper } from './wrappers/EpochRewards' import { Erc20Wrapper } from './wrappers/Erc20Wrapper' import { EscrowWrapper } from './wrappers/Escrow' -import { ExchangeWrapper } from './wrappers/Exchange' import { FederatedAttestationsWrapper } from './wrappers/FederatedAttestations' import { FreezerWrapper } from './wrappers/Freezer' import { GasPriceMinimumWrapper } from './wrappers/GasPriceMinimum' @@ -34,9 +33,6 @@ const WrapperFactories = { [CeloContract.EpochRewards]: EpochRewardsWrapper, [CeloContract.ERC20]: Erc20Wrapper, [CeloContract.Escrow]: EscrowWrapper, - [CeloContract.Exchange]: ExchangeWrapper, - [CeloContract.ExchangeEUR]: ExchangeWrapper, - [CeloContract.ExchangeBRL]: ExchangeWrapper, [CeloContract.FederatedAttestations]: FederatedAttestationsWrapper, // [CeloContract.FeeCurrencyWhitelist]: FeeCurrencyWhitelistWrapper, [CeloContract.Freezer]: FreezerWrapper, @@ -86,9 +82,6 @@ interface WrapperCacheMap { [CeloContract.EpochRewards]?: EpochRewardsWrapper [CeloContract.ERC20]?: Erc20Wrapper [CeloContract.Escrow]?: EscrowWrapper - [CeloContract.Exchange]?: ExchangeWrapper - [CeloContract.ExchangeEUR]?: ExchangeWrapper - [CeloContract.ExchangeBRL]?: ExchangeWrapper [CeloContract.FederatedAttestations]?: FederatedAttestationsWrapper // [CeloContract.FeeCurrencyWhitelist]?: FeeCurrencyWhitelistWrapper, [CeloContract.Freezer]?: FreezerWrapper @@ -154,9 +147,7 @@ export class WrapperCache implements ContractCacheType { getEscrow(): Promise { return this.getContract(CeloContract.Escrow) } - getExchange(stableToken: StableToken = StableToken.cUSD) { - return this.getContract(stableTokenInfos[stableToken].exchangeContract) - } + getFreezer() { return this.getContract(CeloContract.Freezer) } diff --git a/packages/sdk/contractkit/src/kit.ts b/packages/sdk/contractkit/src/kit.ts index 827897636..50df245d5 100644 --- a/packages/sdk/contractkit/src/kit.ts +++ b/packages/sdk/contractkit/src/kit.ts @@ -27,7 +27,6 @@ import { AttestationsConfig } from './wrappers/Attestations' import { BlockchainParametersConfig } from './wrappers/BlockchainParameters' import { DowntimeSlasherConfig } from './wrappers/DowntimeSlasher' import { ElectionConfig } from './wrappers/Election' -import { ExchangeConfig } from './wrappers/Exchange' import { GasPriceMinimumConfig } from './wrappers/GasPriceMinimum' import { GovernanceConfig } from './wrappers/Governance' import { LockedGoldConfig } from './wrappers/LockedGold' @@ -68,7 +67,6 @@ export function newKitFromWeb3(web3: Web3, wallet: ReadOnlyWallet = new LocalWal return new ContractKit(new Connection(web3, wallet)) } export interface NetworkConfig { - exchanges: EachCeloToken stableTokens: EachCeloToken election: ElectionConfig attestations: AttestationsConfig @@ -141,7 +139,7 @@ export class ContractKit { async getNetworkConfig( humanReadable = false - ): Promise> { + ): Promise> { const configContracts: ValidWrappers[] = [ CeloContract.Election, CeloContract.Attestations, @@ -181,7 +179,6 @@ export class ContractKit { configArray.forEach((config, index) => (configMap[configContracts[index]] = config)) return { - exchanges: await this.celoTokens.getExchangesConfigs(humanReadable), stableTokens: await this.celoTokens.getStablesConfigs(humanReadable), ...configMap, } diff --git a/packages/sdk/contractkit/src/mini-contract-cache.ts b/packages/sdk/contractkit/src/mini-contract-cache.ts index c4b6e25d1..25c220f2f 100644 --- a/packages/sdk/contractkit/src/mini-contract-cache.ts +++ b/packages/sdk/contractkit/src/mini-contract-cache.ts @@ -1,9 +1,6 @@ import { newGasPriceMinimum } from '@celo/abis/web3/0.8/GasPriceMinimum' import { newAccounts } from '@celo/abis/web3/Accounts' import { newGoldToken } from '@celo/abis/web3/GoldToken' -import { newExchange } from '@celo/abis/web3/mento/Exchange' -import { newExchangeBRL } from '@celo/abis/web3/mento/ExchangeBRL' -import { newExchangeEUR } from '@celo/abis/web3/mento/ExchangeEUR' import { newStableToken } from '@celo/abis/web3/mento/StableToken' import { newStableTokenBRL } from '@celo/abis/web3/mento/StableTokenBRL' import { newStableTokenEUR } from '@celo/abis/web3/mento/StableTokenEUR' @@ -14,7 +11,6 @@ import { CeloContract } from './base' import { ContractCacheType } from './basic-contract-cache-type' import { stableTokenInfos } from './celo-tokens' import { AccountsWrapper } from './wrappers/Accounts' -import { ExchangeWrapper } from './wrappers/Exchange' import { GasPriceMinimumWrapper } from './wrappers/GasPriceMinimum' import { GoldTokenWrapper } from './wrappers/GoldTokenWrapper' import { StableTokenWrapper } from './wrappers/StableTokenWrapper' @@ -32,18 +28,6 @@ const MINIMUM_CONTRACTS = { newInstance: newGoldToken, wrapper: GoldTokenWrapper, }, - [CeloContract.Exchange]: { - newInstance: newExchange, - wrapper: ExchangeWrapper, - }, - [CeloContract.ExchangeEUR]: { - newInstance: newExchangeEUR, - wrapper: ExchangeWrapper, - }, - [CeloContract.ExchangeBRL]: { - newInstance: newExchangeBRL, - wrapper: ExchangeWrapper, - }, [CeloContract.StableToken]: { newInstance: newStableToken, wrapper: StableTokenWrapper, @@ -77,7 +61,7 @@ const contractsWhichRequireCache = new Set([ /** * Alternative Contract Cache with Minimal Contracts * - * Provides access to a subset of wrappers: {@link AccountsWrapper}, {@link ExchangeWrapper}, {@link GasPriceMinimumWrapper} and Celo Token contracts + * Provides access to a subset of wrappers: {@link AccountsWrapper}, {@link GasPriceMinimumWrapper} and Celo Token contracts * Used internally by {@link MiniContractKit} * * @param connection – {@link Connection} @@ -96,9 +80,6 @@ export class MiniContractCache implements ContractCacheType { getAccounts(): Promise { return this.getContract(CeloContract.Accounts) } - getExchange(stableToken: StableToken = StableToken.cUSD): Promise { - return this.getContract(stableTokenInfos[stableToken].exchangeContract) - } getGoldToken(): Promise { return this.getContract(CeloContract.GoldToken) diff --git a/packages/sdk/contractkit/src/proxy.ts b/packages/sdk/contractkit/src/proxy.ts index 7ea7257d7..a5418c6db 100644 --- a/packages/sdk/contractkit/src/proxy.ts +++ b/packages/sdk/contractkit/src/proxy.ts @@ -26,7 +26,6 @@ import { ABI as RegistryABI } from '@celo/abis/web3/Registry' import { ABI as SortedOraclesABI } from '@celo/abis/web3/SortedOracles' import { ABI as UniswapFeeHandlerSellerABI } from '@celo/abis/web3/UniswapFeeHandlerSeller' import { ABI as ValidatorsABI } from '@celo/abis/web3/Validators' -import { ABI as ExchangeABI } from '@celo/abis/web3/mento/Exchange' import { ABI as ReserveABI } from '@celo/abis/web3/mento/Reserve' import { ABI as StableTokenABI } from '@celo/abis/web3/mento/StableToken' @@ -103,9 +102,6 @@ const initializeAbiMap = { ElectionProxy: findInitializeAbi(ElectionABI), EpochRewardsProxy: findInitializeAbi(EpochRewardsABI), EscrowProxy: findInitializeAbi(EscrowABI), - ExchangeProxy: findInitializeAbi(ExchangeABI), - ExchangeEURProxy: findInitializeAbi(ExchangeABI), - ExchangeBRLProxy: findInitializeAbi(ExchangeABI), FederatedAttestationsProxy: findInitializeAbi(FederatedAttestationsABI), FeeCurrencyWhitelistProxy: findInitializeAbi(FeeCurrencyWhitelistABI), FeeHandlerProxy: findInitializeAbi(FeeHandlerABI), diff --git a/packages/sdk/contractkit/src/web3-contract-cache.ts b/packages/sdk/contractkit/src/web3-contract-cache.ts index 05e1aca46..da802f0b9 100644 --- a/packages/sdk/contractkit/src/web3-contract-cache.ts +++ b/packages/sdk/contractkit/src/web3-contract-cache.ts @@ -27,9 +27,6 @@ import { newRandom } from '@celo/abis/web3/Random' import { newRegistry } from '@celo/abis/web3/Registry' import { newSortedOracles } from '@celo/abis/web3/SortedOracles' import { newValidators } from '@celo/abis/web3/Validators' -import { newExchange } from '@celo/abis/web3/mento/Exchange' -import { newExchangeBRL } from '@celo/abis/web3/mento/ExchangeBRL' -import { newExchangeEUR } from '@celo/abis/web3/mento/ExchangeEUR' import { newReserve } from '@celo/abis/web3/mento/Reserve' import { newStableToken } from '@celo/abis/web3/mento/StableToken' @@ -48,9 +45,6 @@ export const ContractFactories = { [CeloContract.EpochRewards]: newEpochRewards, [CeloContract.ERC20]: newIERC20, [CeloContract.Escrow]: newEscrow, - [CeloContract.Exchange]: newExchange, - [CeloContract.ExchangeEUR]: newExchangeEUR, - [CeloContract.ExchangeBRL]: newExchangeBRL, [CeloContract.FederatedAttestations]: newFederatedAttestations, [CeloContract.FeeCurrencyWhitelist]: newFeeCurrencyWhitelist, [CeloContract.Freezer]: newFreezer, @@ -79,12 +73,6 @@ const StableToContract = { [StableToken.cREAL]: CeloContract.StableTokenBRL, } -const StableToExchange = { - [StableToken.cEUR]: CeloContract.ExchangeEUR, - [StableToken.cUSD]: CeloContract.Exchange, - [StableToken.cREAL]: CeloContract.ExchangeBRL, -} - export type CFType = typeof ContractFactories type ContractCacheMap = { [K in keyof CFType]?: ReturnType } @@ -127,9 +115,7 @@ export class Web3ContractCache { getEscrow() { return this.getContract(CeloContract.Escrow) } - getExchange(stableToken: StableToken = StableToken.cUSD) { - return this.getContract(StableToExchange[stableToken]) - } + getFederatedAttestations() { return this.getContract(CeloContract.FederatedAttestations) } diff --git a/packages/sdk/contractkit/src/wrappers/Exchange.test.ts b/packages/sdk/contractkit/src/wrappers/Exchange.test.ts deleted file mode 100644 index a7782c4db..000000000 --- a/packages/sdk/contractkit/src/wrappers/Exchange.test.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' -import { StableToken } from '../celo-tokens' -import { ContractKit, newKitFromWeb3 } from '../kit' -import { ExchangeWrapper } from './Exchange' -import { StableTokenWrapper } from './StableTokenWrapper' - -/* -TEST NOTES: -- In migrations: The only account that has a stable balance is accounts[0] -*/ - -testWithGanache('Exchange Wrapper', (web3) => { - const kit = newKitFromWeb3(web3) - for (const stableToken of Object.values(StableToken)) { - describe(`${stableToken}`, () => { - testExchange(kit, stableToken) - }) - } -}) - -export function testExchange(kit: ContractKit, stableTokenName: StableToken) { - const web3 = kit.web3 - const ONE = web3.utils.toWei('1', 'ether') - - const LARGE_BUY_AMOUNT = web3.utils.toWei('1000', 'ether') - - let accounts: string[] = [] - let exchange: ExchangeWrapper - let stableToken: StableTokenWrapper - - beforeAll(async () => { - accounts = await web3.eth.getAccounts() - kit.defaultAccount = accounts[0] - exchange = await kit.contracts.getExchange(stableTokenName) - stableToken = await kit.contracts.getStableToken(stableTokenName) - }) - - test('SBAT check buckets', async () => { - const [buyBucket, sellBucket] = await exchange.getBuyAndSellBuckets(true) - expect(buyBucket).toBeBigNumber() - expect(sellBucket).toBeBigNumber() - expect(buyBucket.toNumber()).toBeGreaterThan(0) - expect(sellBucket.toNumber()).toBeGreaterThan(0) - }) - - describe('#exchange', () => { - test('executes successfully', async () => { - const minBuyAmount = '100' - await stableToken.approve(exchange.address, ONE).sendAndWaitForReceipt({ from: accounts[0] }) - const result = await exchange - .exchange(ONE, minBuyAmount, false) - .sendAndWaitForReceipt({ from: accounts[0] }) - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.sellAmount).toBe(ONE) - }) - }) - - describe('#sell', () => { - test('executes successfully', async () => { - const minBuyAmount = '100' - await stableToken.approve(exchange.address, ONE).sendAndWaitForReceipt({ from: accounts[0] }) - const result = await exchange - .sell(ONE, minBuyAmount, false) - .sendAndWaitForReceipt({ from: accounts[0] }) - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.sellAmount).toBe(ONE) - }) - }) - - describe('#buy', () => { - test('executes successfully', async () => { - const stableAmount = (await exchange.quoteGoldBuy(ONE)).toString() - await stableToken - .approve(exchange.address, stableAmount) - .sendAndWaitForReceipt({ from: accounts[0] }) - const result = await exchange - .buy(ONE, stableAmount, true) - .sendAndWaitForReceipt({ from: accounts[0] }) - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.buyAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(false) - }) - }) - - test('SBAT quoteStableSell', () => expect(exchange.quoteStableSell(ONE)).resolves.toBeBigNumber()) - test('SBAT quoteGoldSell', () => expect(exchange.quoteGoldSell(ONE)).resolves.toBeBigNumber()) - test('SBAT quoteStableBuy', () => expect(exchange.quoteStableBuy(ONE)).resolves.toBeBigNumber()) - test('SBAT quoteGoldBuy', () => expect(exchange.quoteGoldBuy(ONE)).resolves.toBeBigNumber()) - - test('SBAT sellStable', async () => { - const goldAmount = await exchange.quoteStableSell(ONE) - const approveTx = await stableToken.approve(exchange.address, ONE).send() - await approveTx.waitReceipt() - const sellTx = await exchange.sellStable(ONE, goldAmount).send() - const result = await sellTx.waitReceipt() - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.sellAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(false) - }) - - test('SBAT sellGold', async () => { - const stableAmount = await exchange.quoteGoldSell(ONE) - const goldToken = await kit.contracts.getGoldToken() - const approveTx = await goldToken.approve(exchange.address, ONE).send() - await approveTx.waitReceipt() - const sellTx = await exchange.sellGold(ONE, stableAmount).send() - const result = await sellTx.waitReceipt() - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.sellAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(true) - }) - - test('SBAT buyStable', async () => { - const goldAmount = await exchange.quoteStableBuy(ONE) - const goldToken = await kit.contracts.getGoldToken() - const approveTx = await goldToken.approve(exchange.address, goldAmount.toString()).send() - await approveTx.waitReceipt() - const buyTx = await exchange.buyStable(ONE, goldAmount).send() - const result = await buyTx.waitReceipt() - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.buyAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(true) - }) - - test('SBAT buyGold', async () => { - const stableAmount = await exchange.quoteGoldBuy(ONE) - const approveTx = await stableToken.approve(exchange.address, stableAmount.toString()).send() - await approveTx.waitReceipt() - const buyTx = await exchange.buyGold(ONE, stableAmount).send() - const result = await buyTx.waitReceipt() - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.buyAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(false) - }) - - test('SBAT getExchangeRate for selling gold', async () => { - const sellGoldRate = await exchange.getExchangeRate(LARGE_BUY_AMOUNT, true) - expect(sellGoldRate.toNumber()).toBeGreaterThan(0) - }) - - test('SBAT getExchangeRate for selling stables', async () => { - const sellGoldRate = await exchange.getStableExchangeRate(LARGE_BUY_AMOUNT) - expect(sellGoldRate.toNumber()).toBeGreaterThan(0) - }) - - /** Deprecated USD-specific functions kept as aliases for backward compatibility */ - - test('SBAT use quoteUsdSell as an alias for quoteStableSell', () => - expect(exchange.quoteUsdSell(ONE)).resolves.toBeBigNumber()) - - test('SBAT use quoteUsdBuy as an alias for quoteStableBuy', () => - expect(exchange.quoteUsdBuy(ONE)).resolves.toBeBigNumber()) - - test('SBAT use sellDollar as an alias for sellStable', async () => { - const goldAmount = await exchange.quoteUsdSell(ONE) - const approveTx = await stableToken.approve(exchange.address, ONE).send() - await approveTx.waitReceipt() - const sellTx = await exchange.sellDollar(ONE, goldAmount).send() - const result = await sellTx.waitReceipt() - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.sellAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(false) - }) - - test('SBAT use buyDollar as an alias for buyStable', async () => { - const goldAmount = await exchange.quoteStableBuy(ONE) - const goldToken = await kit.contracts.getGoldToken() - const approveTx = await goldToken.approve(exchange.address, goldAmount.toString()).send() - await approveTx.waitReceipt() - const buyTx = await exchange.buyDollar(ONE, goldAmount).send() - const result = await buyTx.waitReceipt() - expect(result.events?.Exchanged).toBeDefined() - expect(result.events?.Exchanged.returnValues.buyAmount).toBe(ONE) - expect(result.events?.Exchanged.returnValues.soldGold).toBe(true) - }) - - test('SBAT use getUsdExchangeRate as an alias for getStableExchangeRate', async () => { - const sellGoldRate = await exchange.getUsdExchangeRate(LARGE_BUY_AMOUNT) - expect(sellGoldRate.toNumber()).toBeGreaterThan(0) - }) -} diff --git a/packages/sdk/contractkit/src/wrappers/Exchange.ts b/packages/sdk/contractkit/src/wrappers/Exchange.ts deleted file mode 100644 index 8ebb1482e..000000000 --- a/packages/sdk/contractkit/src/wrappers/Exchange.ts +++ /dev/null @@ -1,346 +0,0 @@ -import { Exchange } from '@celo/abis/web3/mento/Exchange' -import { CeloTransactionObject } from '@celo/connect' -import BigNumber from 'bignumber.js' -import { - BaseWrapper, - fixidityValueToBigNumber, - identity, - proxyCall, - proxySend, - secondsToDurationString, - tupleParser, - unixSecondsTimestampToDateString, - valueToBigNumber, - valueToFrac, - valueToString, -} from './BaseWrapper' - -export interface ExchangeConfig { - spread: BigNumber - reserveFraction: BigNumber - updateFrequency: BigNumber - minimumReports: BigNumber - lastBucketUpdate: BigNumber -} - -/** - * Contract that allows to exchange StableToken for GoldToken and vice versa - * using a Constant Product Market Maker Model aka Mento - */ -export class ExchangeWrapper extends BaseWrapper { - /** - * Query spread parameter - * @returns Current spread charged on exchanges - */ - spread = proxyCall(this.contract.methods.spread, undefined, fixidityValueToBigNumber) - /** - * Query reserve fraction parameter - * @returns Current fraction to commit to the gold bucket - */ - reserveFraction = proxyCall( - this.contract.methods.reserveFraction, - undefined, - fixidityValueToBigNumber - ) - /** - * Query update frequency parameter - * @returns The time period that needs to elapse between bucket - * updates - */ - updateFrequency = proxyCall(this.contract.methods.updateFrequency, undefined, valueToBigNumber) - /** - * Query minimum reports parameter - * @returns The minimum number of fresh reports that need to be - * present in the oracle to update buckets - * commit to the gold bucket - */ - minimumReports = proxyCall(this.contract.methods.minimumReports, undefined, valueToBigNumber) - /** - * Query last bucket update - * @returns The timestamp of the last time exchange buckets were updated. - */ - lastBucketUpdate = proxyCall(this.contract.methods.lastBucketUpdate, undefined, valueToBigNumber) - - /** - * DEPRECATED: use function sell - * Exchanges sellAmount of sellToken in exchange for at least minBuyAmount of buyToken - * Requires the sellAmount to have been approved to the exchange - * @param sellAmount The amount of sellToken the user is selling to the exchange - * @param minBuyAmount The minimum amount of buyToken the user has to receive for this - * transaction to succeed - * @param sellGold `true` if gold is the sell token - * @return The amount of buyToken that was transfered - */ - exchange: ( - sellAmount: BigNumber.Value, - minBuyAmount: BigNumber.Value, - sellGold: boolean - ) => CeloTransactionObject = proxySend( - this.connection, - this.contract.methods.exchange, - tupleParser(valueToString, valueToString, identity) - ) - - /** - * Sells sellAmount of sellToken in exchange for at least minBuyAmount of buyToken - * Requires the sellAmount to have been approved to the exchange - * @param sellAmount The amount of sellToken the user is selling to the exchange - * @param minBuyAmount The minimum amount of buyToken the user has to receive for this - * transaction to succeed - * @param sellGold `true` if gold is the sell token - * @return The amount of buyToken that was transfered - */ - sell: ( - sellAmount: BigNumber.Value, - minBuyAmount: BigNumber.Value, - sellGold: boolean - ) => CeloTransactionObject = proxySend( - this.connection, - this.contract.methods.sell, - tupleParser(valueToString, valueToString, identity) - ) - - /** - * Sells sellAmount of sellToken in exchange for at least minBuyAmount of buyToken - * Requires the sellAmount to have been approved to the exchange - * @param buyAmount The amount of sellToken the user is selling to the exchange - * @param maxSellAmount The maximum amount of sellToken the user will sell for this - * transaction to succeed - * @param buyGold `true` if gold is the buy token - * @return The amount of buyToken that was transfered - */ - buy: ( - buyAmount: BigNumber.Value, - maxSellAmount: BigNumber.Value, - buyGold: boolean - ) => CeloTransactionObject = proxySend( - this.connection, - this.contract.methods.buy, - tupleParser(valueToString, valueToString, identity) - ) - - /** - * @dev Returns the amount of buyToken a user would get for sellAmount of sellToken - * @param sellAmount The amount of sellToken the user is selling to the exchange - * @param sellGold `true` if gold is the sell token - * @return The corresponding buyToken amount. - */ - async getBuyTokenAmount(sellAmount: BigNumber.Value, sellGold: boolean): Promise { - const sell = valueToString(sellAmount) - if (new BigNumber(sell).eq(0)) { - return new BigNumber(0) - } - const res = await this.contract.methods.getBuyTokenAmount(sell, sellGold).call() - return valueToBigNumber(res) - } - - /** - * Returns the amount of sellToken a user would need to exchange to receive buyAmount of - * buyToken. - * @param buyAmount The amount of buyToken the user would like to purchase. - * @param sellGold `true` if gold is the sell token - * @return The corresponding sellToken amount. - */ - async getSellTokenAmount(buyAmount: BigNumber.Value, sellGold: boolean): Promise { - const buy = valueToString(buyAmount) - if (new BigNumber(buy).eq(0)) { - return new BigNumber(0) - } - const res = await this.contract.methods.getSellTokenAmount(buy, sellGold).call() - return valueToBigNumber(res) - } - - /** - * Returns the buy token and sell token bucket sizes, in order. The ratio of - * the two also represents the exchange rate between the two. - * @param sellGold `true` if gold is the sell token - * @return [buyTokenBucket, sellTokenBucket] - */ - getBuyAndSellBuckets: (sellGold: boolean) => Promise<[BigNumber, BigNumber]> = proxyCall( - this.contract.methods.getBuyAndSellBuckets, - undefined, - (callRes: { 0: string; 1: string }) => - [valueToBigNumber(callRes[0]), valueToBigNumber(callRes[1])] as [BigNumber, BigNumber] - ) - - /** - * Sell amount of CELO in exchange for at least minStableAmount of the stable token - * Requires the amount to have been approved to the exchange - * @param amount The amount of CELO the user is selling to the exchange - * @param minStableAmount The minimum amount of the stable token the user has to receive for this - * transaction to succeed - */ - sellGold = (amount: BigNumber.Value, minStableAmount: BigNumber.Value) => - this.sell(amount, minStableAmount, true) - - /** - * Sell amount of the stable token in exchange for at least minGoldAmount of CELO - * Requires the amount to have been approved to the exchange - * @param amount The amount of the stable token the user is selling to the exchange - * @param minGoldAmount The minimum amount of CELO the user has to receive for this - * transaction to succeed - */ - sellStable = (amount: BigNumber.Value, minGoldAmount: BigNumber.Value) => - this.sell(amount, minGoldAmount, false) - - /** - * Deprecated alias of sellStable. - * Sell amount of the stable token in exchange for at least minGoldAmount of CELO - * Requires the amount to have been approved to the exchange - * @deprecated use sellStable instead - * @param amount The amount of the stable token the user is selling to the exchange - * @param minGoldAmount The minimum amount of CELO the user has to receive for this - * transaction to succeed - */ - sellDollar = this.sellStable - - /** - * Buy amount of CELO in exchange for at most maxStableAmount of the stable token - * Requires the amount to have been approved to the exchange - * @param amount The amount of CELO the user is buying from the exchange - * @param maxStableAmount The maximum amount of the stable token the user will pay for this - * transaction to succeed - */ - buyGold = (amount: BigNumber.Value, maxStableAmount: BigNumber.Value) => - this.buy(amount, maxStableAmount, true) - - /** - * Buy amount of the stable token in exchange for at least minGoldAmount of CELO - * Requires the amount to have been approved to the exchange - * @param amount The amount of the stable token the user is selling to the exchange - * @param maxGoldAmount The maximum amount of CELO the user will pay for this - * transaction to succeed - */ - buyStable = (amount: BigNumber.Value, maxGoldAmount: BigNumber.Value) => - this.buy(amount, maxGoldAmount, false) - - /** - * Deprecated alias of buyStable. - * Buy amount of the stable token in exchange for at least minGoldAmount of CELO - * Requires the amount to have been approved to the exchange - * @deprecated use buyStable instead - * @param amount The amount of the stable token the user is selling to the exchange - * @param maxGoldAmount The maximum amount of CELO the user will pay for this - * transaction to succeed - */ - buyDollar = this.buyStable - - /** - * Returns the amount of CELO a user would get for sellAmount of the stable token - * @param sellAmount The amount of the stable token the user is selling to the exchange - * @return The corresponding CELO amount. - */ - quoteStableSell = (sellAmount: BigNumber.Value) => this.getBuyTokenAmount(sellAmount, false) - - /** - * Deprecated alias of quoteStableSell. - * Returns the amount of CELO a user would get for sellAmount of the stable token - * @deprecated Use quoteStableSell instead - * @param sellAmount The amount of the stable token the user is selling to the exchange - * @return The corresponding CELO amount. - */ - quoteUsdSell = this.quoteStableSell - - /** - * Returns the amount of the stable token a user would get for sellAmount of CELO - * @param sellAmount The amount of CELO the user is selling to the exchange - * @return The corresponding stable token amount. - */ - quoteGoldSell = (sellAmount: BigNumber.Value) => this.getBuyTokenAmount(sellAmount, true) - - /** - * Returns the amount of CELO a user would need to exchange to receive buyAmount of - * the stable token. - * @param buyAmount The amount of the stable token the user would like to purchase. - * @return The corresponding CELO amount. - */ - quoteStableBuy = (buyAmount: BigNumber.Value) => this.getSellTokenAmount(buyAmount, false) - - /** - * Deprecated alias of quoteStableBuy. - * Returns the amount of CELO a user would need to exchange to receive buyAmount of - * the stable token. - * @deprecated Use quoteStableBuy instead - * @param buyAmount The amount of the stable token the user would like to purchase. - * @return The corresponding CELO amount. - */ - quoteUsdBuy = this.quoteStableBuy - - /** - * Returns the amount of the stable token a user would need to exchange to receive buyAmount of - * CELO. - * @param buyAmount The amount of CELO the user would like to purchase. - * @return The corresponding stable token amount. - */ - quoteGoldBuy = (buyAmount: BigNumber.Value) => this.getSellTokenAmount(buyAmount, true) - - /** - * @dev Returns the current configuration of the exchange contract - * @return ExchangeConfig object - */ - async getConfig(): Promise { - const res = await Promise.all([ - this.spread(), - this.reserveFraction(), - this.updateFrequency(), - this.minimumReports(), - this.lastBucketUpdate(), - ]) - return { - spread: res[0], - reserveFraction: res[1], - updateFrequency: res[2], - minimumReports: res[3], - lastBucketUpdate: res[4], - } - } - - /** - * @dev Returns human readable configuration of the exchange contract - * @return ExchangeConfig object - */ - async getHumanReadableConfig() { - const config = await this.getConfig() - return { - ...config, - updateFrequency: secondsToDurationString(config.updateFrequency), - lastBucketUpdate: unixSecondsTimestampToDateString(config.lastBucketUpdate), - } - } - - /** - * Returns the exchange rate estimated at buyAmount. - * @param buyAmount The amount of buyToken in wei to estimate the exchange rate at - * @param sellGold `true` if gold is the sell token - * @return The exchange rate (number of sellTokens received for one buyToken). - */ - async getExchangeRate(buyAmount: BigNumber.Value, sellGold: boolean): Promise { - const takerAmount = await this.getBuyTokenAmount(buyAmount, sellGold) - return valueToFrac(buyAmount, takerAmount) // Number of sellTokens received for one buyToken - } - - /** - * Returns the exchange rate for the stable token estimated at the buyAmount - * @param buyAmount The amount of the stable token in wei to estimate the exchange rate at - * @return The exchange rate (number of CELO received for one stable token) - */ - getStableExchangeRate = (buyAmount: BigNumber.Value) => this.getExchangeRate(buyAmount, false) - - /** - * Deprecated alias of getStableExchangeRate. - * Returns the exchange rate for the stable token estimated at the buyAmount - * @deprecated Use getStableExchangeRate instead - * @param buyAmount The amount of the stable token in wei to estimate the exchange rate at - * @return The exchange rate (number of CELO received for one stable token) - */ - getUsdExchangeRate = this.getStableExchangeRate - - /** - * Returns the exchange rate for CELO estimated at the buyAmount - * @param buyAmount The amount of CELO in wei to estimate the exchange rate at - * @return The exchange rate (number of stable tokens received for one CELO) - */ - getGoldExchangeRate = (buyAmount: BigNumber.Value) => this.getExchangeRate(buyAmount, true) -} - -export type ExchangeWrapperType = ExchangeWrapper diff --git a/packages/sdk/explorer/fixtures/contract.metadata.json b/packages/sdk/explorer/fixtures/contract.metadata.json index e6e522a32..06546bdb4 100644 --- a/packages/sdk/explorer/fixtures/contract.metadata.json +++ b/packages/sdk/explorer/fixtures/contract.metadata.json @@ -2827,13 +2827,6 @@ "dweb:/ipfs/QmRDDTXUqbA6dHfJe4ZS1442JDAfwoHq2eH9LHnQyzsh44" ] }, - "/home/bowd/Workspace/job/celo/celo-monorepo/packages/protocol/contracts/stability/interfaces/IExchange.sol": { - "keccak256": "0xbfcf77e30fc62218decbb73297d5161b9c490f7e44f75158f1c79674e4b8b83c", - "urls": [ - "bzz-raw://ad0caaddcb552a2c040e827e9336cdec7dfaf629cca9f30e5f5bc12645abde43", - "dweb:/ipfs/QmTjnGbfoSkZhNWhrbcYdLjF1LLqAJcviJ2ZKSMH9KWz95" - ] - }, "/home/bowd/Workspace/job/celo/celo-monorepo/packages/protocol/contracts/stability/interfaces/IReserve.sol": { "keccak256": "0x8da4d702b47a7e60981ca416f2d0f24a3c1dea9ab44f04b695c0fde02c84a38e", "urls": [ From 775000192ef808101a9cf52fbaf50519da709be0 Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 6 Feb 2024 14:03:11 +0200 Subject: [PATCH 2/2] update docs --- .../docs/command-line-interface/exchange.md | 36 +- packages/docs/sdk/docs/contractkit/README.md | 4 +- .../classes/celo_tokens.CeloTokens.md | 84 +- .../classes/contract_cache.WrapperCache.md | 79 +- .../contractkit/classes/kit.ContractKit.md | 60 +- .../mini_contract_cache.MiniContractCache.md | 60 +- .../web3_contract_cache.Web3ContractCache.md | 83 +- .../wrappers_BaseWrapper.BaseWrapper.md | 2 - .../wrappers_Exchange.ExchangeWrapper.md | 1137 ----------------- .../wrappers_FeeHandler.FeeHandlerWrapper.md | 2 +- .../contractkit/enums/base.CeloContract.md | 73 +- ...c_contract_cache_type.ContractCacheType.md | 47 +- .../interfaces/celo_tokens.StableTokenInfo.md | 11 - .../interfaces/kit.NetworkConfig.md | 31 +- .../wrappers_Exchange.ExchangeConfig.md | 65 - packages/docs/sdk/docs/contractkit/modules.md | 1 - .../docs/sdk/docs/contractkit/modules/base.md | 27 +- .../docs/contractkit/modules/celo_tokens.md | 6 +- .../contractkit/modules/contract_cache.md | 2 +- .../docs/sdk/docs/contractkit/modules/kit.md | 6 +- .../modules/mini_contract_cache.md | 2 +- .../sdk/docs/contractkit/modules/proxy.md | 18 +- .../modules/web3_contract_cache.md | 7 +- .../contractkit/modules/wrappers_Exchange.md | 27 - 24 files changed, 201 insertions(+), 1669 deletions(-) delete mode 100644 packages/docs/sdk/docs/contractkit/classes/wrappers_Exchange.ExchangeWrapper.md delete mode 100644 packages/docs/sdk/docs/contractkit/interfaces/wrappers_Exchange.ExchangeConfig.md delete mode 100644 packages/docs/sdk/docs/contractkit/modules/wrappers_Exchange.md diff --git a/packages/docs/command-line-interface/exchange.md b/packages/docs/command-line-interface/exchange.md index 7685bcd0c..0cc2233f2 100644 --- a/packages/docs/command-line-interface/exchange.md +++ b/packages/docs/command-line-interface/exchange.md @@ -1,7 +1,7 @@ `celocli exchange` ================== -Exchange Celo Dollars and CELO via the stability mechanism +Exchange Celo Dollars and CELO via Mento * [`celocli exchange:celo`](#celocli-exchangecelo) * [`celocli exchange:dollars`](#celocli-exchangedollars) @@ -13,7 +13,7 @@ Exchange Celo Dollars and CELO via the stability mechanism ## `celocli exchange:celo` -Exchange CELO for StableTokens via the stability mechanism. (Note: this is the equivalent of the old exchange:gold) +Exchange CELO for StableTokens via Mento. (Note: this is the equivalent of the old exchange:gold) ``` USAGE @@ -35,8 +35,8 @@ FLAGS exchange for a StableToken DESCRIPTION - Exchange CELO for StableTokens via the stability mechanism. (Note: this is the - equivalent of the old exchange:gold) + Exchange CELO for StableTokens via Mento. (Note: this is the equivalent of the old + exchange:gold) EXAMPLES celo --value 5000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d @@ -48,7 +48,7 @@ _See code: [src/commands/exchange/celo.ts](https://github.com/celo-org/developer ## `celocli exchange:dollars` -Exchange Celo Dollars for CELO via the stability mechanism +Exchange Celo Dollars for CELO via Mento ``` USAGE @@ -65,7 +65,7 @@ FLAGS Dollars to exchange for CELO DESCRIPTION - Exchange Celo Dollars for CELO via the stability mechanism + Exchange Celo Dollars for CELO via Mento EXAMPLES dollars --value 10000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d @@ -77,7 +77,7 @@ _See code: [src/commands/exchange/dollars.ts](https://github.com/celo-org/develo ## `celocli exchange:euros` -Exchange Celo Euros for CELO via the stability mechanism +Exchange Celo Euros for CELO via Mento ``` USAGE @@ -94,7 +94,7 @@ FLAGS to exchange for CELO DESCRIPTION - Exchange Celo Euros for CELO via the stability mechanism + Exchange Celo Euros for CELO via Mento EXAMPLES euros --value 10000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d @@ -106,7 +106,7 @@ _See code: [src/commands/exchange/euros.ts](https://github.com/celo-org/develope ## `celocli exchange:gold` -Exchange CELO for StableTokens via the stability mechanism. *DEPRECATION WARNING* Use the "exchange:celo" command instead +Exchange CELO for StableTokens via Mento. *DEPRECATION WARNING* Use the "exchange:celo" command instead ``` USAGE @@ -128,8 +128,8 @@ FLAGS exchange for a StableToken DESCRIPTION - Exchange CELO for StableTokens via the stability mechanism. *DEPRECATION WARNING* Use - the "exchange:celo" command instead + Exchange CELO for StableTokens via Mento. *DEPRECATION WARNING* Use the + "exchange:celo" command instead EXAMPLES gold --value 5000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d @@ -137,11 +137,9 @@ EXAMPLES gold --value 5000000000000 --forAtLeast 100000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d --stableToken cUSD ``` -_See code: [src/commands/exchange/gold.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/exchange/gold.ts)_ - ## `celocli exchange:reals` -Exchange Celo Brazilian Real (cREAL) for CELO via the stability mechanism +Exchange Celo Brazilian Real (cREAL) for CELO via Mento ``` USAGE @@ -158,7 +156,7 @@ FLAGS Brazilian Real to exchange for CELO DESCRIPTION - Exchange Celo Brazilian Real (cREAL) for CELO via the stability mechanism + Exchange Celo Brazilian Real (cREAL) for CELO via Mento EXAMPLES reals --value 10000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d @@ -170,7 +168,7 @@ _See code: [src/commands/exchange/reals.ts](https://github.com/celo-org/develope ## `celocli exchange:show` -Show the current exchange rates offered by the Exchange +Show the current exchange rates offered by the Broker ``` USAGE @@ -182,7 +180,7 @@ FLAGS --globalHelp View all available global flags DESCRIPTION - Show the current exchange rates offered by the Exchange + Show the current exchange rates offered by the Broker EXAMPLES list @@ -192,7 +190,7 @@ _See code: [src/commands/exchange/show.ts](https://github.com/celo-org/developer ## `celocli exchange:stable` -Exchange Stable Token for CELO via the stability mechanism +Exchange Stable Token for CELO via Mento ``` USAGE @@ -213,7 +211,7 @@ FLAGS Tokens to exchange for CELO DESCRIPTION - Exchange Stable Token for CELO via the stability mechanism + Exchange Stable Token for CELO via Mento EXAMPLES stable --value 10000000000000 --from 0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d --stableToken cStableTokenSymbol diff --git a/packages/docs/sdk/docs/contractkit/README.md b/packages/docs/sdk/docs/contractkit/README.md index e2d58d7f9..56b5cf02a 100644 --- a/packages/docs/sdk/docs/contractkit/README.md +++ b/packages/docs/sdk/docs/contractkit/README.md @@ -145,7 +145,6 @@ There are many core contracts. - EpochRewardsWrapper - Erc20Wrapper - EscrowWrapper -- ExchangeWrapper - FreezerWrapper - GasPriceMinimumWrapper - GoldTokenWrapper @@ -195,7 +194,7 @@ Some user might want to access web3 native contract wrappers. To do so, you can: ```ts -const web3Exchange = await kit._web3Contracts.getExchange() +const feeCurrencyWhitelist = await kit._web3Contracts.getFeeCurrencyWhitelist() ``` We expose native wrappers for all Celo core contracts. @@ -206,7 +205,6 @@ The complete list of Celo Core contracts is: - Attestations - LockedGold - Escrow -- Exchange - FeeCurrencyWhitelist - GasPriceMinimum - GoldToken diff --git a/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md b/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md index e6983c95b..3f1da1a77 100644 --- a/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md +++ b/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md @@ -26,8 +26,6 @@ A helper class to interact with all Celo tokens, ie CELO and stable tokens - [getAddress](celo_tokens.CeloTokens.md#getaddress) - [getAddresses](celo_tokens.CeloTokens.md#getaddresses) - [getContract](celo_tokens.CeloTokens.md#getcontract) -- [getExchangeContract](celo_tokens.CeloTokens.md#getexchangecontract) -- [getExchangesConfigs](celo_tokens.CeloTokens.md#getexchangesconfigs) - [getFeeCurrencyAddress](celo_tokens.CeloTokens.md#getfeecurrencyaddress) - [getStablesConfigs](celo_tokens.CeloTokens.md#getstablesconfigs) - [getWrapper](celo_tokens.CeloTokens.md#getwrapper) @@ -55,7 +53,7 @@ A helper class to interact with all Celo tokens, ie CELO and stable tokens #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L62) +[packages/sdk/contractkit/src/celo-tokens.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L58) ## Properties @@ -65,7 +63,7 @@ A helper class to interact with all Celo tokens, ie CELO and stable tokens #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L62) +[packages/sdk/contractkit/src/celo-tokens.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L58) ___ @@ -89,7 +87,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:272](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L272) +[packages/sdk/contractkit/src/celo-tokens.ts:248](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L248) ___ @@ -99,7 +97,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L62) +[packages/sdk/contractkit/src/celo-tokens.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L58) ## Methods @@ -124,7 +122,7 @@ a promise resolving to an object containing the address's balance #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L70) +[packages/sdk/contractkit/src/celo-tokens.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L66) ___ @@ -156,7 +154,7 @@ an object containing the resolved value the call to fn for each #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:120](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L120) +[packages/sdk/contractkit/src/celo-tokens.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L106) ___ @@ -188,7 +186,7 @@ an object containing the resolved value the call to fn for each #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:143](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L143) +[packages/sdk/contractkit/src/celo-tokens.ts:129](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L129) ___ @@ -212,7 +210,7 @@ A promise resolving to the address of the token's contract #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:247](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L247) +[packages/sdk/contractkit/src/celo-tokens.ts:223](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L223) ___ @@ -230,7 +228,7 @@ an promise resolving to an object containing the address for each celo token pro #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:89](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L89) +[packages/sdk/contractkit/src/celo-tokens.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L85) ___ @@ -254,51 +252,7 @@ The contract for the token #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:228](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L228) - -___ - -### getExchangeContract - -▸ **getExchangeContract**(`token`): [`ExchangeContract`](../modules/base.md#exchangecontract) - -Gets the exchange contract for the provided stable token - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `token` | [`StableToken`](../enums/celo_tokens.StableToken.md) | the stable token to get exchange contract of | - -#### Returns - -[`ExchangeContract`](../modules/base.md#exchangecontract) - -The exchange contract for the token - -#### Defined in - -[packages/sdk/contractkit/src/celo-tokens.ts:238](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L238) - -___ - -### getExchangesConfigs - -▸ **getExchangesConfigs**(`humanReadable?`): `Promise`\<[`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`ExchangeConfig`](../interfaces/wrappers_Exchange.ExchangeConfig.md) \| \{ `lastBucketUpdate`: `string` ; `minimumReports`: `BigNumber` ; `reserveFraction`: `BigNumber` ; `spread`: `BigNumber` ; `updateFrequency`: `string` }\>\> - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `humanReadable` | `boolean` | `false` | - -#### Returns - -`Promise`\<[`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`ExchangeConfig`](../interfaces/wrappers_Exchange.ExchangeConfig.md) \| \{ `lastBucketUpdate`: `string` ; `minimumReports`: `BigNumber` ; `reserveFraction`: `BigNumber` ; `spread`: `BigNumber` ; `updateFrequency`: `string` }\>\> - -#### Defined in - -[packages/sdk/contractkit/src/celo-tokens.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L103) +[packages/sdk/contractkit/src/celo-tokens.ts:213](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L213) ___ @@ -323,7 +277,7 @@ If not CELO, the address of the token's contract. If CELO, undefined. #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:255](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L255) +[packages/sdk/contractkit/src/celo-tokens.ts:231](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L231) ___ @@ -343,7 +297,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:93](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L93) +[packages/sdk/contractkit/src/celo-tokens.ts:89](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L89) ___ @@ -367,7 +321,7 @@ an promise resolving to the wrapper for the token #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:216](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L216) +[packages/sdk/contractkit/src/celo-tokens.ts:201](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L201) ▸ **getWrapper**(`token`): `Promise`\<[`GoldTokenWrapper`](wrappers_GoldTokenWrapper.GoldTokenWrapper.md)\> @@ -383,7 +337,7 @@ an promise resolving to the wrapper for the token #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:217](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L217) +[packages/sdk/contractkit/src/celo-tokens.ts:202](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L202) ▸ **getWrapper**(`token`): `Promise`\<[`CeloTokenWrapper`](../modules/celo_tokens.md#celotokenwrapper)\> @@ -399,7 +353,7 @@ an promise resolving to the wrapper for the token #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:218](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L218) +[packages/sdk/contractkit/src/celo-tokens.ts:203](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L203) ___ @@ -417,7 +371,7 @@ an promise resolving to an object containing the wrapper for each celo token. #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:81](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L81) +[packages/sdk/contractkit/src/celo-tokens.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L77) ___ @@ -441,7 +395,7 @@ if token is a StableToken #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:267](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L267) +[packages/sdk/contractkit/src/celo-tokens.ts:243](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L243) ___ @@ -455,7 +409,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:176](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L176) +[packages/sdk/contractkit/src/celo-tokens.ts:162](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L162) ___ @@ -469,4 +423,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:193](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L193) +[packages/sdk/contractkit/src/celo-tokens.ts:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L179) diff --git a/packages/docs/sdk/docs/contractkit/classes/contract_cache.WrapperCache.md b/packages/docs/sdk/docs/contractkit/classes/contract_cache.WrapperCache.md index 9f539a355..650940c97 100644 --- a/packages/docs/sdk/docs/contractkit/classes/contract_cache.WrapperCache.md +++ b/packages/docs/sdk/docs/contractkit/classes/contract_cache.WrapperCache.md @@ -41,7 +41,6 @@ Consider Using MiniWrapperCache, building your own, or if you only need one Wrap - [getEpochRewards](contract_cache.WrapperCache.md#getepochrewards) - [getErc20](contract_cache.WrapperCache.md#geterc20) - [getEscrow](contract_cache.WrapperCache.md#getescrow) -- [getExchange](contract_cache.WrapperCache.md#getexchange) - [getFederatedAttestations](contract_cache.WrapperCache.md#getfederatedattestations) - [getFreezer](contract_cache.WrapperCache.md#getfreezer) - [getGasPriceMinimum](contract_cache.WrapperCache.md#getgaspriceminimum) @@ -76,7 +75,7 @@ Consider Using MiniWrapperCache, building your own, or if you only need one Wrap #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:124](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L124) +[packages/sdk/contractkit/src/contract-cache.ts:117](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L117) ## Properties @@ -86,7 +85,7 @@ Consider Using MiniWrapperCache, building your own, or if you only need one Wrap #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:126](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L126) +[packages/sdk/contractkit/src/contract-cache.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L119) ___ @@ -96,7 +95,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L125) +[packages/sdk/contractkit/src/contract-cache.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L118) ___ @@ -106,7 +105,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:127](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L127) +[packages/sdk/contractkit/src/contract-cache.ts:120](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L120) ## Methods @@ -124,7 +123,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L130) +[packages/sdk/contractkit/src/contract-cache.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L123) ___ @@ -138,7 +137,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:133](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L133) +[packages/sdk/contractkit/src/contract-cache.ts:126](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L126) ___ @@ -152,7 +151,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L136) +[packages/sdk/contractkit/src/contract-cache.ts:129](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L129) ___ @@ -185,7 +184,7 @@ Get Contract wrapper #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:200](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L200) +[packages/sdk/contractkit/src/contract-cache.ts:191](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L191) ___ @@ -199,7 +198,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L139) +[packages/sdk/contractkit/src/contract-cache.ts:132](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L132) ___ @@ -213,7 +212,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L142) +[packages/sdk/contractkit/src/contract-cache.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L135) ___ @@ -227,7 +226,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:145](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L145) +[packages/sdk/contractkit/src/contract-cache.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L138) ___ @@ -241,7 +240,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:148](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L148) +[packages/sdk/contractkit/src/contract-cache.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L141) ___ @@ -261,7 +260,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:151](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L151) +[packages/sdk/contractkit/src/contract-cache.ts:144](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L144) ___ @@ -275,31 +274,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:154](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L154) - -___ - -### getExchange - -▸ **getExchange**(`stableToken?`): `Promise`\<[`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md)\> - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `stableToken` | [`StableToken`](../enums/celo_tokens.StableToken.md) | `StableToken.cUSD` | - -#### Returns - -`Promise`\<[`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md)\> - -#### Implementation of - -[ContractCacheType](../interfaces/basic_contract_cache_type.ContractCacheType.md).[getExchange](../interfaces/basic_contract_cache_type.ContractCacheType.md#getexchange) - -#### Defined in - -[packages/sdk/contractkit/src/contract-cache.ts:157](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L157) +[packages/sdk/contractkit/src/contract-cache.ts:147](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L147) ___ @@ -313,7 +288,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:163](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L163) +[packages/sdk/contractkit/src/contract-cache.ts:154](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L154) ___ @@ -327,7 +302,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:160](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L160) +[packages/sdk/contractkit/src/contract-cache.ts:151](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L151) ___ @@ -341,7 +316,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L166) +[packages/sdk/contractkit/src/contract-cache.ts:157](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L157) ___ @@ -359,7 +334,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:169](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L169) +[packages/sdk/contractkit/src/contract-cache.ts:160](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L160) ___ @@ -373,7 +348,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:172](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L172) +[packages/sdk/contractkit/src/contract-cache.ts:163](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L163) ___ @@ -387,7 +362,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:175](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L175) +[packages/sdk/contractkit/src/contract-cache.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L166) ___ @@ -407,7 +382,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:178](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L178) +[packages/sdk/contractkit/src/contract-cache.ts:169](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L169) ___ @@ -421,7 +396,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:181](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L181) +[packages/sdk/contractkit/src/contract-cache.ts:172](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L172) ___ @@ -435,7 +410,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:184](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L184) +[packages/sdk/contractkit/src/contract-cache.ts:175](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L175) ___ @@ -449,7 +424,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:187](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L187) +[packages/sdk/contractkit/src/contract-cache.ts:178](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L178) ___ @@ -473,7 +448,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:190](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L190) +[packages/sdk/contractkit/src/contract-cache.ts:181](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L181) ___ @@ -487,7 +462,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:193](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L193) +[packages/sdk/contractkit/src/contract-cache.ts:184](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L184) ___ @@ -513,4 +488,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:224](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L224) +[packages/sdk/contractkit/src/contract-cache.ts:215](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L215) diff --git a/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md b/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md index d0a8e3e99..17c6cb7b1 100644 --- a/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md +++ b/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md @@ -63,7 +63,7 @@ #### Defined in -[packages/sdk/contractkit/src/kit.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L114) +[packages/sdk/contractkit/src/kit.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L112) ## Properties @@ -75,7 +75,7 @@ factory for core contract's native web3 wrappers #### Defined in -[packages/sdk/contractkit/src/kit.ts:105](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L105) +[packages/sdk/contractkit/src/kit.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L103) ___ @@ -87,7 +87,7 @@ helper for interacting with CELO & stable tokens #### Defined in -[packages/sdk/contractkit/src/kit.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L109) +[packages/sdk/contractkit/src/kit.ts:107](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L107) ___ @@ -97,7 +97,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L114) +[packages/sdk/contractkit/src/kit.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L112) ___ @@ -109,7 +109,7 @@ factory for core contract's kit wrappers #### Defined in -[packages/sdk/contractkit/src/kit.ts:107](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L107) +[packages/sdk/contractkit/src/kit.ts:105](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L105) ___ @@ -123,7 +123,7 @@ no longer needed since gasPrice is available on node rpc #### Defined in -[packages/sdk/contractkit/src/kit.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L112) +[packages/sdk/contractkit/src/kit.ts:110](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L110) ___ @@ -135,7 +135,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L103) +[packages/sdk/contractkit/src/kit.ts:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L101) ## Accessors @@ -149,7 +149,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:236](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L236) +[packages/sdk/contractkit/src/kit.ts:233](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L233) • `set` **defaultAccount**(`address`): `void` @@ -165,7 +165,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:232](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L232) +[packages/sdk/contractkit/src/kit.ts:229](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L229) ___ @@ -179,7 +179,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:252](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L252) +[packages/sdk/contractkit/src/kit.ts:249](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L249) • `set` **defaultFeeCurrency**(`address`): `void` @@ -195,7 +195,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:248](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L248) +[packages/sdk/contractkit/src/kit.ts:245](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L245) ___ @@ -209,7 +209,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:244](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L244) +[packages/sdk/contractkit/src/kit.ts:241](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L241) • `set` **gasInflationFactor**(`factor`): `void` @@ -225,7 +225,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:240](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L240) +[packages/sdk/contractkit/src/kit.ts:237](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L237) ___ @@ -239,7 +239,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:283](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L283) +[packages/sdk/contractkit/src/kit.ts:280](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L280) ## Methods @@ -259,7 +259,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:228](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L228) +[packages/sdk/contractkit/src/kit.ts:225](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L225) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:219](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L219) +[packages/sdk/contractkit/src/kit.ts:216](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L216) ___ @@ -293,7 +293,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:204](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L204) +[packages/sdk/contractkit/src/kit.ts:201](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L201) ___ @@ -313,7 +313,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:209](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L209) +[packages/sdk/contractkit/src/kit.ts:206](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L206) ___ @@ -327,7 +327,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:190](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L190) +[packages/sdk/contractkit/src/kit.ts:187](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L187) ___ @@ -347,7 +347,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:214](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L214) +[packages/sdk/contractkit/src/kit.ts:211](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L211) ___ @@ -367,7 +367,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L142) +[packages/sdk/contractkit/src/kit.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L140) ___ @@ -387,7 +387,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L125) +[packages/sdk/contractkit/src/kit.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L123) ___ @@ -401,7 +401,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L121) +[packages/sdk/contractkit/src/kit.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L119) ___ @@ -415,7 +415,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:256](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L256) +[packages/sdk/contractkit/src/kit.ts:253](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L253) ___ @@ -429,7 +429,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:260](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L260) +[packages/sdk/contractkit/src/kit.ts:257](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L257) ___ @@ -449,7 +449,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:264](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L264) +[packages/sdk/contractkit/src/kit.ts:261](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L261) ___ @@ -470,7 +470,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:268](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L268) +[packages/sdk/contractkit/src/kit.ts:265](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L265) ___ @@ -492,7 +492,7 @@ Set CeloToken to use to pay for gas fees #### Defined in -[packages/sdk/contractkit/src/kit.ts:196](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L196) +[packages/sdk/contractkit/src/kit.ts:193](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L193) ___ @@ -513,7 +513,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:275](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L275) +[packages/sdk/contractkit/src/kit.ts:272](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L272) ___ @@ -527,4 +527,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:279](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L279) +[packages/sdk/contractkit/src/kit.ts:276](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L276) diff --git a/packages/docs/sdk/docs/contractkit/classes/mini_contract_cache.MiniContractCache.md b/packages/docs/sdk/docs/contractkit/classes/mini_contract_cache.MiniContractCache.md index d6bf33e89..ce9b87850 100644 --- a/packages/docs/sdk/docs/contractkit/classes/mini_contract_cache.MiniContractCache.md +++ b/packages/docs/sdk/docs/contractkit/classes/mini_contract_cache.MiniContractCache.md @@ -6,7 +6,7 @@ Alternative Contract Cache with Minimal Contracts -Provides access to a subset of wrappers: [AccountsWrapper](wrappers_Accounts.AccountsWrapper.md), [ExchangeWrapper](wrappers_Exchange.ExchangeWrapper.md), [GasPriceMinimumWrapper](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) and Celo Token contracts +Provides access to a subset of wrappers: [AccountsWrapper](wrappers_Accounts.AccountsWrapper.md), [GasPriceMinimumWrapper](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) and Celo Token contracts Used internally by MiniContractKit **`Param`** @@ -36,7 +36,6 @@ Used internally by MiniContractKit - [getAccounts](mini_contract_cache.MiniContractCache.md#getaccounts) - [getContract](mini_contract_cache.MiniContractCache.md#getcontract) -- [getExchange](mini_contract_cache.MiniContractCache.md#getexchange) - [getGoldToken](mini_contract_cache.MiniContractCache.md#getgoldtoken) - [getStableToken](mini_contract_cache.MiniContractCache.md#getstabletoken) - [invalidateContract](mini_contract_cache.MiniContractCache.md#invalidatecontract) @@ -57,15 +56,6 @@ Used internally by MiniContractKit | `contractClasses.Accounts` | `Object` | `undefined` | | `contractClasses.Accounts.newInstance` | (`web3`: `default`, `address`: `string`) => `Accounts` | `newAccounts` | | `contractClasses.Accounts.wrapper` | typeof [`AccountsWrapper`](wrappers_Accounts.AccountsWrapper.md) | `AccountsWrapper` | -| `contractClasses.Exchange` | `Object` | `undefined` | -| `contractClasses.Exchange.newInstance` | (`web3`: `default`, `address`: `string`) => `Exchange` | `newExchange` | -| `contractClasses.Exchange.wrapper` | typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) | `ExchangeWrapper` | -| `contractClasses.ExchangeBRL` | `Object` | `undefined` | -| `contractClasses.ExchangeBRL.newInstance` | (`web3`: `default`, `address`: `string`) => `ExchangeBRL` | `newExchangeBRL` | -| `contractClasses.ExchangeBRL.wrapper` | typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) | `ExchangeWrapper` | -| `contractClasses.ExchangeEUR` | `Object` | `undefined` | -| `contractClasses.ExchangeEUR.newInstance` | (`web3`: `default`, `address`: `string`) => `ExchangeEUR` | `newExchangeEUR` | -| `contractClasses.ExchangeEUR.wrapper` | typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) | `ExchangeWrapper` | | `contractClasses.GasPriceMinimum` | `Object` | `undefined` | | `contractClasses.GasPriceMinimum.newInstance` | (`web3`: `default`, `address`: `string`) => `GasPriceMinimum` | `newGasPriceMinimum` | | `contractClasses.GasPriceMinimum.wrapper` | typeof [`GasPriceMinimumWrapper`](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) | `GasPriceMinimumWrapper` | @@ -88,7 +78,7 @@ Used internally by MiniContractKit #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:90](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L90) +[packages/sdk/contractkit/src/mini-contract-cache.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L74) ## Properties @@ -98,7 +88,7 @@ Used internally by MiniContractKit #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:91](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L91) +[packages/sdk/contractkit/src/mini-contract-cache.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L75) ___ @@ -108,7 +98,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:92](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L92) +[packages/sdk/contractkit/src/mini-contract-cache.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L76) ## Methods @@ -126,13 +116,13 @@ ___ #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:96](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L96) +[packages/sdk/contractkit/src/mini-contract-cache.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L80) ___ ### getContract -▸ **getContract**\<`ContractKey`\>(`contract`, `address?`): `Promise`\<`InstanceType`\<\{ `Accounts`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `Accounts` = newAccounts; `wrapper`: typeof [`AccountsWrapper`](wrappers_Accounts.AccountsWrapper.md) = AccountsWrapper } ; `Exchange`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `Exchange` = newExchange; `wrapper`: typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) = ExchangeWrapper } ; `ExchangeBRL`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `ExchangeBRL` = newExchangeBRL; `wrapper`: typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) = ExchangeWrapper } ; `ExchangeEUR`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `ExchangeEUR` = newExchangeEUR; `wrapper`: typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) = ExchangeWrapper } ; `GasPriceMinimum`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GasPriceMinimum` = newGasPriceMinimum; `wrapper`: typeof [`GasPriceMinimumWrapper`](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) = GasPriceMinimumWrapper } ; `GoldToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GoldToken` = newGoldToken; `wrapper`: typeof [`GoldTokenWrapper`](wrappers_GoldTokenWrapper.GoldTokenWrapper.md) = GoldTokenWrapper } ; `StableToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableToken` = newStableToken; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenBRL`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenBRL` = newStableTokenBRL; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenEUR`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenEUR` = newStableTokenEUR; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } }[`ContractKey`][``"wrapper"``]\>\> +▸ **getContract**\<`ContractKey`\>(`contract`, `address?`): `Promise`\<`InstanceType`\<\{ `Accounts`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `Accounts` = newAccounts; `wrapper`: typeof [`AccountsWrapper`](wrappers_Accounts.AccountsWrapper.md) = AccountsWrapper } ; `GasPriceMinimum`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GasPriceMinimum` = newGasPriceMinimum; `wrapper`: typeof [`GasPriceMinimumWrapper`](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) = GasPriceMinimumWrapper } ; `GoldToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GoldToken` = newGoldToken; `wrapper`: typeof [`GoldTokenWrapper`](wrappers_GoldTokenWrapper.GoldTokenWrapper.md) = GoldTokenWrapper } ; `StableToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableToken` = newStableToken; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenBRL`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenBRL` = newStableTokenBRL; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenEUR`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenEUR` = newStableTokenEUR; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } }[`ContractKey`][``"wrapper"``]\>\> Get Contract wrapper @@ -140,7 +130,7 @@ Get Contract wrapper | Name | Type | | :------ | :------ | -| `ContractKey` | extends [`Accounts`](../enums/base.CeloContract.md#accounts) \| [`Exchange`](../enums/base.CeloContract.md#exchange) \| [`ExchangeEUR`](../enums/base.CeloContract.md#exchangeeur) \| [`ExchangeBRL`](../enums/base.CeloContract.md#exchangebrl) \| [`GasPriceMinimum`](../enums/base.CeloContract.md#gaspriceminimum) \| [`GoldToken`](../enums/base.CeloContract.md#goldtoken) \| [`StableToken`](../enums/base.CeloContract.md#stabletoken) \| [`StableTokenEUR`](../enums/base.CeloContract.md#stabletokeneur) \| [`StableTokenBRL`](../enums/base.CeloContract.md#stabletokenbrl) | +| `ContractKey` | extends [`Accounts`](../enums/base.CeloContract.md#accounts) \| [`GasPriceMinimum`](../enums/base.CeloContract.md#gaspriceminimum) \| [`GoldToken`](../enums/base.CeloContract.md#goldtoken) \| [`StableToken`](../enums/base.CeloContract.md#stabletoken) \| [`StableTokenEUR`](../enums/base.CeloContract.md#stabletokeneur) \| [`StableTokenBRL`](../enums/base.CeloContract.md#stabletokenbrl) | #### Parameters @@ -151,7 +141,7 @@ Get Contract wrapper #### Returns -`Promise`\<`InstanceType`\<\{ `Accounts`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `Accounts` = newAccounts; `wrapper`: typeof [`AccountsWrapper`](wrappers_Accounts.AccountsWrapper.md) = AccountsWrapper } ; `Exchange`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `Exchange` = newExchange; `wrapper`: typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) = ExchangeWrapper } ; `ExchangeBRL`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `ExchangeBRL` = newExchangeBRL; `wrapper`: typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) = ExchangeWrapper } ; `ExchangeEUR`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `ExchangeEUR` = newExchangeEUR; `wrapper`: typeof [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) = ExchangeWrapper } ; `GasPriceMinimum`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GasPriceMinimum` = newGasPriceMinimum; `wrapper`: typeof [`GasPriceMinimumWrapper`](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) = GasPriceMinimumWrapper } ; `GoldToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GoldToken` = newGoldToken; `wrapper`: typeof [`GoldTokenWrapper`](wrappers_GoldTokenWrapper.GoldTokenWrapper.md) = GoldTokenWrapper } ; `StableToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableToken` = newStableToken; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenBRL`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenBRL` = newStableTokenBRL; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenEUR`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenEUR` = newStableTokenEUR; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } }[`ContractKey`][``"wrapper"``]\>\> +`Promise`\<`InstanceType`\<\{ `Accounts`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `Accounts` = newAccounts; `wrapper`: typeof [`AccountsWrapper`](wrappers_Accounts.AccountsWrapper.md) = AccountsWrapper } ; `GasPriceMinimum`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GasPriceMinimum` = newGasPriceMinimum; `wrapper`: typeof [`GasPriceMinimumWrapper`](wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md) = GasPriceMinimumWrapper } ; `GoldToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `GoldToken` = newGoldToken; `wrapper`: typeof [`GoldTokenWrapper`](wrappers_GoldTokenWrapper.GoldTokenWrapper.md) = GoldTokenWrapper } ; `StableToken`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableToken` = newStableToken; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenBRL`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenBRL` = newStableTokenBRL; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } ; `StableTokenEUR`: \{ `newInstance`: (`web3`: `default`, `address`: `string`) => `StableTokenEUR` = newStableTokenEUR; `wrapper`: typeof [`StableTokenWrapper`](wrappers_StableTokenWrapper.StableTokenWrapper.md) = StableTokenWrapper } }[`ContractKey`][``"wrapper"``]\>\> #### Implementation of @@ -159,31 +149,7 @@ Get Contract wrapper #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L114) - -___ - -### getExchange - -▸ **getExchange**(`stableToken?`): `Promise`\<[`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md)\> - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `stableToken` | [`StableToken`](../enums/celo_tokens.StableToken.md) | `StableToken.cUSD` | - -#### Returns - -`Promise`\<[`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md)\> - -#### Implementation of - -[ContractCacheType](../interfaces/basic_contract_cache_type.ContractCacheType.md).[getExchange](../interfaces/basic_contract_cache_type.ContractCacheType.md#getexchange) - -#### Defined in - -[packages/sdk/contractkit/src/mini-contract-cache.ts:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L99) +[packages/sdk/contractkit/src/mini-contract-cache.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L95) ___ @@ -201,7 +167,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L103) +[packages/sdk/contractkit/src/mini-contract-cache.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L84) ___ @@ -225,7 +191,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:107](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L107) +[packages/sdk/contractkit/src/mini-contract-cache.ts:88](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L88) ___ @@ -237,7 +203,7 @@ ___ | Name | Type | | :------ | :------ | -| `C` | extends [`Accounts`](../enums/base.CeloContract.md#accounts) \| [`Exchange`](../enums/base.CeloContract.md#exchange) \| [`ExchangeEUR`](../enums/base.CeloContract.md#exchangeeur) \| [`ExchangeBRL`](../enums/base.CeloContract.md#exchangebrl) \| [`GasPriceMinimum`](../enums/base.CeloContract.md#gaspriceminimum) \| [`GoldToken`](../enums/base.CeloContract.md#goldtoken) \| [`StableToken`](../enums/base.CeloContract.md#stabletoken) \| [`StableTokenEUR`](../enums/base.CeloContract.md#stabletokeneur) \| [`StableTokenBRL`](../enums/base.CeloContract.md#stabletokenbrl) | +| `C` | extends [`Accounts`](../enums/base.CeloContract.md#accounts) \| [`GasPriceMinimum`](../enums/base.CeloContract.md#gaspriceminimum) \| [`GoldToken`](../enums/base.CeloContract.md#goldtoken) \| [`StableToken`](../enums/base.CeloContract.md#stabletoken) \| [`StableTokenEUR`](../enums/base.CeloContract.md#stabletokeneur) \| [`StableTokenBRL`](../enums/base.CeloContract.md#stabletokenbrl) | #### Parameters @@ -251,4 +217,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:154](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L154) +[packages/sdk/contractkit/src/mini-contract-cache.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L135) diff --git a/packages/docs/sdk/docs/contractkit/classes/web3_contract_cache.Web3ContractCache.md b/packages/docs/sdk/docs/contractkit/classes/web3_contract_cache.Web3ContractCache.md index b8740065e..035f78d73 100644 --- a/packages/docs/sdk/docs/contractkit/classes/web3_contract_cache.Web3ContractCache.md +++ b/packages/docs/sdk/docs/contractkit/classes/web3_contract_cache.Web3ContractCache.md @@ -33,7 +33,6 @@ a contract wrapper - [getEpochRewards](web3_contract_cache.Web3ContractCache.md#getepochrewards) - [getErc20](web3_contract_cache.Web3ContractCache.md#geterc20) - [getEscrow](web3_contract_cache.Web3ContractCache.md#getescrow) -- [getExchange](web3_contract_cache.Web3ContractCache.md#getexchange) - [getFederatedAttestations](web3_contract_cache.Web3ContractCache.md#getfederatedattestations) - [getFeeCurrencyWhitelist](web3_contract_cache.Web3ContractCache.md#getfeecurrencywhitelist) - [getFeeHandler](web3_contract_cache.Web3ContractCache.md#getfeehandler) @@ -72,7 +71,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:102](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L102) +[packages/sdk/contractkit/src/web3-contract-cache.ts:90](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L90) ## Properties @@ -82,7 +81,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:102](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L102) +[packages/sdk/contractkit/src/web3-contract-cache.ts:90](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L90) ## Methods @@ -96,7 +95,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L103) +[packages/sdk/contractkit/src/web3-contract-cache.ts:91](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L91) ___ @@ -110,7 +109,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L106) +[packages/sdk/contractkit/src/web3-contract-cache.ts:94](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L94) ___ @@ -124,7 +123,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L109) +[packages/sdk/contractkit/src/web3-contract-cache.ts:97](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L97) ___ @@ -153,7 +152,7 @@ Get native web3 contract wrapper #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:186](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L186) +[packages/sdk/contractkit/src/web3-contract-cache.ts:172](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L172) ___ @@ -167,7 +166,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L112) +[packages/sdk/contractkit/src/web3-contract-cache.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L100) ___ @@ -181,7 +180,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L115) +[packages/sdk/contractkit/src/web3-contract-cache.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L103) ___ @@ -195,7 +194,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L118) +[packages/sdk/contractkit/src/web3-contract-cache.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L106) ___ @@ -209,7 +208,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L121) +[packages/sdk/contractkit/src/web3-contract-cache.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L109) ___ @@ -229,7 +228,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:124](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L124) +[packages/sdk/contractkit/src/web3-contract-cache.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L112) ___ @@ -243,27 +242,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:127](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L127) - -___ - -### getExchange - -▸ **getExchange**(`stableToken?`): `Promise`\<`NonNullable`\<`undefined` \| `Registry` \| `Accounts` \| `Exchange` \| `IERC20` \| `GoldToken` \| `StableToken` \| `Attestations` \| `BlockchainParameters` \| `DoubleSigningSlasher` \| `DowntimeSlasher` \| `Election` \| `EpochRewards` \| `Escrow` \| `ExchangeEUR` \| `ExchangeBRL` \| `FederatedAttestations` \| `FeeCurrencyWhitelist` \| `Freezer` \| `FeeHandler` \| `MentoFeeHandlerSeller` \| `UniswapFeeHandlerSeller` \| `GasPriceMinimum` \| `Governance` \| `LockedGold` \| `MultiSig` \| `OdisPayments` \| `Random` \| `Reserve` \| `SortedOracles` \| `Validators`\>\> - -#### Parameters - -| Name | Type | Default value | -| :------ | :------ | :------ | -| `stableToken` | [`StableToken`](../enums/celo_tokens.StableToken.md) | `StableToken.cUSD` | - -#### Returns - -`Promise`\<`NonNullable`\<`undefined` \| `Registry` \| `Accounts` \| `Exchange` \| `IERC20` \| `GoldToken` \| `StableToken` \| `Attestations` \| `BlockchainParameters` \| `DoubleSigningSlasher` \| `DowntimeSlasher` \| `Election` \| `EpochRewards` \| `Escrow` \| `ExchangeEUR` \| `ExchangeBRL` \| `FederatedAttestations` \| `FeeCurrencyWhitelist` \| `Freezer` \| `FeeHandler` \| `MentoFeeHandlerSeller` \| `UniswapFeeHandlerSeller` \| `GasPriceMinimum` \| `Governance` \| `LockedGold` \| `MultiSig` \| `OdisPayments` \| `Random` \| `Reserve` \| `SortedOracles` \| `Validators`\>\> - -#### Defined in - -[packages/sdk/contractkit/src/web3-contract-cache.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L130) +[packages/sdk/contractkit/src/web3-contract-cache.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L115) ___ @@ -277,7 +256,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:133](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L133) +[packages/sdk/contractkit/src/web3-contract-cache.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L119) ___ @@ -291,7 +270,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L136) +[packages/sdk/contractkit/src/web3-contract-cache.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L122) ___ @@ -305,7 +284,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L142) +[packages/sdk/contractkit/src/web3-contract-cache.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L128) ___ @@ -319,7 +298,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L139) +[packages/sdk/contractkit/src/web3-contract-cache.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L125) ___ @@ -333,7 +312,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:145](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L145) +[packages/sdk/contractkit/src/web3-contract-cache.ts:131](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L131) ___ @@ -347,7 +326,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:148](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L148) +[packages/sdk/contractkit/src/web3-contract-cache.ts:134](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L134) ___ @@ -361,7 +340,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:151](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L151) +[packages/sdk/contractkit/src/web3-contract-cache.ts:137](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L137) ___ @@ -375,7 +354,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:155](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L155) +[packages/sdk/contractkit/src/web3-contract-cache.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L141) ___ @@ -395,7 +374,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L158) +[packages/sdk/contractkit/src/web3-contract-cache.ts:144](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L144) ___ @@ -409,7 +388,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:161](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L161) +[packages/sdk/contractkit/src/web3-contract-cache.ts:147](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L147) ___ @@ -423,7 +402,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:164](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L164) +[packages/sdk/contractkit/src/web3-contract-cache.ts:150](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L150) ___ @@ -437,7 +416,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L167) +[packages/sdk/contractkit/src/web3-contract-cache.ts:153](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L153) ___ @@ -451,7 +430,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:170](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L170) +[packages/sdk/contractkit/src/web3-contract-cache.ts:156](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L156) ___ @@ -465,13 +444,13 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:173](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L173) +[packages/sdk/contractkit/src/web3-contract-cache.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L159) ___ ### getStableToken -▸ **getStableToken**(`stableToken?`): `Promise`\<`NonNullable`\<`undefined` \| `Registry` \| `Accounts` \| `Exchange` \| `IERC20` \| `GoldToken` \| `StableToken` \| `Attestations` \| `BlockchainParameters` \| `DoubleSigningSlasher` \| `DowntimeSlasher` \| `Election` \| `EpochRewards` \| `Escrow` \| `ExchangeEUR` \| `ExchangeBRL` \| `FederatedAttestations` \| `FeeCurrencyWhitelist` \| `Freezer` \| `FeeHandler` \| `MentoFeeHandlerSeller` \| `UniswapFeeHandlerSeller` \| `GasPriceMinimum` \| `Governance` \| `LockedGold` \| `MultiSig` \| `OdisPayments` \| `Random` \| `Reserve` \| `SortedOracles` \| `Validators`\>\> +▸ **getStableToken**(`stableToken?`): `Promise`\<`NonNullable`\<`undefined` \| `Registry` \| `Accounts` \| `IERC20` \| `GoldToken` \| `StableToken` \| `Attestations` \| `BlockchainParameters` \| `DoubleSigningSlasher` \| `DowntimeSlasher` \| `Election` \| `EpochRewards` \| `Escrow` \| `FederatedAttestations` \| `FeeCurrencyWhitelist` \| `Freezer` \| `FeeHandler` \| `MentoFeeHandlerSeller` \| `UniswapFeeHandlerSeller` \| `GasPriceMinimum` \| `Governance` \| `LockedGold` \| `MultiSig` \| `OdisPayments` \| `Random` \| `Reserve` \| `SortedOracles` \| `Validators`\>\> #### Parameters @@ -481,11 +460,11 @@ ___ #### Returns -`Promise`\<`NonNullable`\<`undefined` \| `Registry` \| `Accounts` \| `Exchange` \| `IERC20` \| `GoldToken` \| `StableToken` \| `Attestations` \| `BlockchainParameters` \| `DoubleSigningSlasher` \| `DowntimeSlasher` \| `Election` \| `EpochRewards` \| `Escrow` \| `ExchangeEUR` \| `ExchangeBRL` \| `FederatedAttestations` \| `FeeCurrencyWhitelist` \| `Freezer` \| `FeeHandler` \| `MentoFeeHandlerSeller` \| `UniswapFeeHandlerSeller` \| `GasPriceMinimum` \| `Governance` \| `LockedGold` \| `MultiSig` \| `OdisPayments` \| `Random` \| `Reserve` \| `SortedOracles` \| `Validators`\>\> +`Promise`\<`NonNullable`\<`undefined` \| `Registry` \| `Accounts` \| `IERC20` \| `GoldToken` \| `StableToken` \| `Attestations` \| `BlockchainParameters` \| `DoubleSigningSlasher` \| `DowntimeSlasher` \| `Election` \| `EpochRewards` \| `Escrow` \| `FederatedAttestations` \| `FeeCurrencyWhitelist` \| `Freezer` \| `FeeHandler` \| `MentoFeeHandlerSeller` \| `UniswapFeeHandlerSeller` \| `GasPriceMinimum` \| `Governance` \| `LockedGold` \| `MultiSig` \| `OdisPayments` \| `Random` \| `Reserve` \| `SortedOracles` \| `Validators`\>\> #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:176](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L176) +[packages/sdk/contractkit/src/web3-contract-cache.ts:162](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L162) ___ @@ -499,7 +478,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L179) +[packages/sdk/contractkit/src/web3-contract-cache.ts:165](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L165) ___ @@ -525,4 +504,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:205](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L205) +[packages/sdk/contractkit/src/web3-contract-cache.ts:191](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L191) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapper.BaseWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapper.BaseWrapper.md index 7558192a6..708956a3d 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapper.BaseWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapper.BaseWrapper.md @@ -30,8 +30,6 @@ ↳ [`EscrowWrapper`](wrappers_Escrow.EscrowWrapper.md) - ↳ [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) - ↳ [`FederatedAttestationsWrapper`](wrappers_FederatedAttestations.FederatedAttestationsWrapper.md) ↳ [`FeeHandlerWrapper`](wrappers_FeeHandler.FeeHandlerWrapper.md) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Exchange.ExchangeWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Exchange.ExchangeWrapper.md deleted file mode 100644 index 708391df8..000000000 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Exchange.ExchangeWrapper.md +++ /dev/null @@ -1,1137 +0,0 @@ -[@celo/contractkit](../README.md) / [Exports](../modules.md) / [wrappers/Exchange](../modules/wrappers_Exchange.md) / ExchangeWrapper - -# Class: ExchangeWrapper - -[wrappers/Exchange](../modules/wrappers_Exchange.md).ExchangeWrapper - -Contract that allows to exchange StableToken for GoldToken and vice versa -using a Constant Product Market Maker Model aka Mento - -## Hierarchy - -- [`BaseWrapper`](wrappers_BaseWrapper.BaseWrapper.md)\<`Exchange`\> - - ↳ **`ExchangeWrapper`** - -## Table of contents - -### Constructors - -- [constructor](wrappers_Exchange.ExchangeWrapper.md#constructor) - -### Properties - -- [buy](wrappers_Exchange.ExchangeWrapper.md#buy) -- [buyDollar](wrappers_Exchange.ExchangeWrapper.md#buydollar) -- [eventTypes](wrappers_Exchange.ExchangeWrapper.md#eventtypes) -- [events](wrappers_Exchange.ExchangeWrapper.md#events) -- [exchange](wrappers_Exchange.ExchangeWrapper.md#exchange) -- [getBuyAndSellBuckets](wrappers_Exchange.ExchangeWrapper.md#getbuyandsellbuckets) -- [getUsdExchangeRate](wrappers_Exchange.ExchangeWrapper.md#getusdexchangerate) -- [lastBucketUpdate](wrappers_Exchange.ExchangeWrapper.md#lastbucketupdate) -- [methodIds](wrappers_Exchange.ExchangeWrapper.md#methodids) -- [minimumReports](wrappers_Exchange.ExchangeWrapper.md#minimumreports) -- [quoteUsdBuy](wrappers_Exchange.ExchangeWrapper.md#quoteusdbuy) -- [quoteUsdSell](wrappers_Exchange.ExchangeWrapper.md#quoteusdsell) -- [reserveFraction](wrappers_Exchange.ExchangeWrapper.md#reservefraction) -- [sell](wrappers_Exchange.ExchangeWrapper.md#sell) -- [sellDollar](wrappers_Exchange.ExchangeWrapper.md#selldollar) -- [spread](wrappers_Exchange.ExchangeWrapper.md#spread) -- [updateFrequency](wrappers_Exchange.ExchangeWrapper.md#updatefrequency) - -### Accessors - -- [address](wrappers_Exchange.ExchangeWrapper.md#address) - -### Methods - -- [buyGold](wrappers_Exchange.ExchangeWrapper.md#buygold) -- [buyStable](wrappers_Exchange.ExchangeWrapper.md#buystable) -- [getBuyTokenAmount](wrappers_Exchange.ExchangeWrapper.md#getbuytokenamount) -- [getConfig](wrappers_Exchange.ExchangeWrapper.md#getconfig) -- [getExchangeRate](wrappers_Exchange.ExchangeWrapper.md#getexchangerate) -- [getGoldExchangeRate](wrappers_Exchange.ExchangeWrapper.md#getgoldexchangerate) -- [getHumanReadableConfig](wrappers_Exchange.ExchangeWrapper.md#gethumanreadableconfig) -- [getPastEvents](wrappers_Exchange.ExchangeWrapper.md#getpastevents) -- [getSellTokenAmount](wrappers_Exchange.ExchangeWrapper.md#getselltokenamount) -- [getStableExchangeRate](wrappers_Exchange.ExchangeWrapper.md#getstableexchangerate) -- [quoteGoldBuy](wrappers_Exchange.ExchangeWrapper.md#quotegoldbuy) -- [quoteGoldSell](wrappers_Exchange.ExchangeWrapper.md#quotegoldsell) -- [quoteStableBuy](wrappers_Exchange.ExchangeWrapper.md#quotestablebuy) -- [quoteStableSell](wrappers_Exchange.ExchangeWrapper.md#quotestablesell) -- [sellGold](wrappers_Exchange.ExchangeWrapper.md#sellgold) -- [sellStable](wrappers_Exchange.ExchangeWrapper.md#sellstable) -- [version](wrappers_Exchange.ExchangeWrapper.md#version) - -## Constructors - -### constructor - -• **new ExchangeWrapper**(`connection`, `contract`): [`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `connection` | `Connection` | -| `contract` | `Exchange` | - -#### Returns - -[`ExchangeWrapper`](wrappers_Exchange.ExchangeWrapper.md) - -#### Inherited from - -[BaseWrapper](wrappers_BaseWrapper.BaseWrapper.md).[constructor](wrappers_BaseWrapper.BaseWrapper.md#constructor) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L34) - -## Properties - -### buy - -• **buy**: (`buyAmount`: `Value`, `maxSellAmount`: `Value`, `buyGold`: `boolean`) => `CeloTransactionObject`\<`string`\> - -Sells sellAmount of sellToken in exchange for at least minBuyAmount of buyToken -Requires the sellAmount to have been approved to the exchange - -**`Param`** - -The amount of sellToken the user is selling to the exchange - -**`Param`** - -The maximum amount of sellToken the user will sell for this -transaction to succeed - -**`Param`** - -`true` if gold is the buy token - -#### Type declaration - -▸ (`buyAmount`, `maxSellAmount`, `buyGold`): `CeloTransactionObject`\<`string`\> - -Sells sellAmount of sellToken in exchange for at least minBuyAmount of buyToken -Requires the sellAmount to have been approved to the exchange - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of sellToken the user is selling to the exchange | -| `maxSellAmount` | `Value` | The maximum amount of sellToken the user will sell for this transaction to succeed | -| `buyGold` | `boolean` | `true` if gold is the buy token | - -##### Returns - -`CeloTransactionObject`\<`string`\> - -The amount of buyToken that was transfered - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L112) - -___ - -### buyDollar - -• **buyDollar**: (`amount`: `Value`, `maxGoldAmount`: `Value`) => `CeloTransactionObject`\<`string`\> - -Deprecated alias of buyStable. -Buy amount of the stable token in exchange for at least minGoldAmount of CELO -Requires the amount to have been approved to the exchange - -**`Deprecated`** - -use buyStable instead - -**`Param`** - -The amount of the stable token the user is selling to the exchange - -**`Param`** - -The maximum amount of CELO the user will pay for this -transaction to succeed - -#### Type declaration - -▸ (`amount`, `maxGoldAmount`): `CeloTransactionObject`\<`string`\> - -Deprecated alias of buyStable. -Buy amount of the stable token in exchange for at least minGoldAmount of CELO -Requires the amount to have been approved to the exchange - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `amount` | `Value` | The amount of the stable token the user is selling to the exchange | -| `maxGoldAmount` | `Value` | The maximum amount of CELO the user will pay for this transaction to succeed | - -##### Returns - -`CeloTransactionObject`\<`string`\> - -**`Deprecated`** - -use buyStable instead - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:226](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L226) - -___ - -### eventTypes - -• **eventTypes**: `EventsEnum`\<`Exchange`\> - -#### Inherited from - -[BaseWrapper](wrappers_BaseWrapper.BaseWrapper.md).[eventTypes](wrappers_BaseWrapper.BaseWrapper.md#eventtypes) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L63) - -___ - -### events - -• **events**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `BucketsUpdated` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `goldBucket`: `string` ; `stableBucket`: `string` }\> | -| `Exchanged` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `2`: `string` ; `3`: `boolean` ; `buyAmount`: `string` ; `exchanger`: `string` ; `sellAmount`: `string` ; `soldGold`: `boolean` }\> | -| `MinimumReportsSet` | `ContractEvent`\<`string`\> | -| `OwnershipTransferred` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `newOwner`: `string` ; `previousOwner`: `string` }\> | -| `RegistrySet` | `ContractEvent`\<`string`\> | -| `ReserveFractionSet` | `ContractEvent`\<`string`\> | -| `SpreadSet` | `ContractEvent`\<`string`\> | -| `StableTokenSet` | `ContractEvent`\<`string`\> | -| `UpdateFrequencySet` | `ContractEvent`\<`string`\> | -| `allEvents` | (`options?`: `EventOptions`, `cb?`: `Callback`\<`EventLog`\>) => `EventEmitter` | - -#### Inherited from - -[BaseWrapper](wrappers_BaseWrapper.BaseWrapper.md).[events](wrappers_BaseWrapper.BaseWrapper.md#events) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L61) - -___ - -### exchange - -• **exchange**: (`sellAmount`: `Value`, `minBuyAmount`: `Value`, `sellGold`: `boolean`) => `CeloTransactionObject`\<`string`\> - -DEPRECATED: use function sell -Exchanges sellAmount of sellToken in exchange for at least minBuyAmount of buyToken -Requires the sellAmount to have been approved to the exchange - -**`Param`** - -The amount of sellToken the user is selling to the exchange - -**`Param`** - -The minimum amount of buyToken the user has to receive for this -transaction to succeed - -**`Param`** - -`true` if gold is the sell token - -#### Type declaration - -▸ (`sellAmount`, `minBuyAmount`, `sellGold`): `CeloTransactionObject`\<`string`\> - -DEPRECATED: use function sell -Exchanges sellAmount of sellToken in exchange for at least minBuyAmount of buyToken -Requires the sellAmount to have been approved to the exchange - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellAmount` | `Value` | The amount of sellToken the user is selling to the exchange | -| `minBuyAmount` | `Value` | The minimum amount of buyToken the user has to receive for this transaction to succeed | -| `sellGold` | `boolean` | `true` if gold is the sell token | - -##### Returns - -`CeloTransactionObject`\<`string`\> - -The amount of buyToken that was transfered - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L74) - -___ - -### getBuyAndSellBuckets - -• **getBuyAndSellBuckets**: (`sellGold`: `boolean`) => `Promise`\<[`BigNumber`, `BigNumber`]\> - -Returns the buy token and sell token bucket sizes, in order. The ratio of -the two also represents the exchange rate between the two. - -**`Param`** - -`true` if gold is the sell token - -#### Type declaration - -▸ (`sellGold`): `Promise`\<[`BigNumber`, `BigNumber`]\> - -Returns the buy token and sell token bucket sizes, in order. The ratio of -the two also represents the exchange rate between the two. - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellGold` | `boolean` | `true` if gold is the sell token | - -##### Returns - -`Promise`\<[`BigNumber`, `BigNumber`]\> - -[buyTokenBucket, sellTokenBucket] - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L159) - -___ - -### getUsdExchangeRate - -• **getUsdExchangeRate**: (`buyAmount`: `Value`) => `Promise`\<`BigNumber`\> - -Deprecated alias of getStableExchangeRate. -Returns the exchange rate for the stable token estimated at the buyAmount - -**`Deprecated`** - -Use getStableExchangeRate instead - -**`Param`** - -The amount of the stable token in wei to estimate the exchange rate at - -#### Type declaration - -▸ (`buyAmount`): `Promise`\<`BigNumber`\> - -Deprecated alias of getStableExchangeRate. -Returns the exchange rate for the stable token estimated at the buyAmount - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of the stable token in wei to estimate the exchange rate at | - -##### Returns - -`Promise`\<`BigNumber`\> - -The exchange rate (number of CELO received for one stable token) - -**`Deprecated`** - -Use getStableExchangeRate instead - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:336](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L336) - -___ - -### lastBucketUpdate - -• **lastBucketUpdate**: (...`args`: []) => `Promise`\<`BigNumber`\> - -Query last bucket update - -#### Type declaration - -▸ (`...args`): `Promise`\<`BigNumber`\> - -Query last bucket update - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `...args` | [] | - -##### Returns - -`Promise`\<`BigNumber`\> - -The timestamp of the last time exchange buckets were updated. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L62) - -___ - -### methodIds - -• **methodIds**: `Record`\<``"spread"`` \| ``"reserveFraction"`` \| ``"updateFrequency"`` \| ``"minimumReports"`` \| ``"lastBucketUpdate"`` \| ``"initialized"`` \| ``"isOwner"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"getVersionNumber"`` \| ``"initialize"`` \| ``"goldBucket"`` \| ``"stable"`` \| ``"stableBucket"`` \| ``"stableTokenRegistryId"`` \| ``"activateStable"`` \| ``"sell"`` \| ``"exchange"`` \| ``"buy"`` \| ``"getBuyTokenAmount"`` \| ``"getSellTokenAmount"`` \| ``"getBuyAndSellBuckets"`` \| ``"setUpdateFrequency"`` \| ``"setMinimumReports"`` \| ``"setStableToken"`` \| ``"setSpread"`` \| ``"setReserveFraction"``, `string`\> - -#### Inherited from - -[BaseWrapper](wrappers_BaseWrapper.BaseWrapper.md).[methodIds](wrappers_BaseWrapper.BaseWrapper.md#methodids) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L68) - -___ - -### minimumReports - -• **minimumReports**: (...`args`: []) => `Promise`\<`BigNumber`\> - -Query minimum reports parameter - -#### Type declaration - -▸ (`...args`): `Promise`\<`BigNumber`\> - -Query minimum reports parameter - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `...args` | [] | - -##### Returns - -`Promise`\<`BigNumber`\> - -The minimum number of fresh reports that need to be -present in the oracle to update buckets -commit to the gold bucket - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L57) - -___ - -### quoteUsdBuy - -• **quoteUsdBuy**: (`buyAmount`: `Value`) => `Promise`\<`BigNumber`\> - -Deprecated alias of quoteStableBuy. -Returns the amount of CELO a user would need to exchange to receive buyAmount of -the stable token. - -**`Deprecated`** - -Use quoteStableBuy instead - -**`Param`** - -The amount of the stable token the user would like to purchase. - -#### Type declaration - -▸ (`buyAmount`): `Promise`\<`BigNumber`\> - -Deprecated alias of quoteStableBuy. -Returns the amount of CELO a user would need to exchange to receive buyAmount of -the stable token. - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of the stable token the user would like to purchase. | - -##### Returns - -`Promise`\<`BigNumber`\> - -The corresponding CELO amount. - -**`Deprecated`** - -Use quoteStableBuy instead - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:267](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L267) - -___ - -### quoteUsdSell - -• **quoteUsdSell**: (`sellAmount`: `Value`) => `Promise`\<`BigNumber`\> - -Deprecated alias of quoteStableSell. -Returns the amount of CELO a user would get for sellAmount of the stable token - -**`Deprecated`** - -Use quoteStableSell instead - -**`Param`** - -The amount of the stable token the user is selling to the exchange - -#### Type declaration - -▸ (`sellAmount`): `Promise`\<`BigNumber`\> - -Deprecated alias of quoteStableSell. -Returns the amount of CELO a user would get for sellAmount of the stable token - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellAmount` | `Value` | The amount of the stable token the user is selling to the exchange | - -##### Returns - -`Promise`\<`BigNumber`\> - -The corresponding CELO amount. - -**`Deprecated`** - -Use quoteStableSell instead - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:242](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L242) - -___ - -### reserveFraction - -• **reserveFraction**: (...`args`: []) => `Promise`\<`BigNumber`\> - -Query reserve fraction parameter - -#### Type declaration - -▸ (`...args`): `Promise`\<`BigNumber`\> - -Query reserve fraction parameter - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `...args` | [] | - -##### Returns - -`Promise`\<`BigNumber`\> - -Current fraction to commit to the gold bucket - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:40](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L40) - -___ - -### sell - -• **sell**: (`sellAmount`: `Value`, `minBuyAmount`: `Value`, `sellGold`: `boolean`) => `CeloTransactionObject`\<`string`\> - -Sells sellAmount of sellToken in exchange for at least minBuyAmount of buyToken -Requires the sellAmount to have been approved to the exchange - -**`Param`** - -The amount of sellToken the user is selling to the exchange - -**`Param`** - -The minimum amount of buyToken the user has to receive for this -transaction to succeed - -**`Param`** - -`true` if gold is the sell token - -#### Type declaration - -▸ (`sellAmount`, `minBuyAmount`, `sellGold`): `CeloTransactionObject`\<`string`\> - -Sells sellAmount of sellToken in exchange for at least minBuyAmount of buyToken -Requires the sellAmount to have been approved to the exchange - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellAmount` | `Value` | The amount of sellToken the user is selling to the exchange | -| `minBuyAmount` | `Value` | The minimum amount of buyToken the user has to receive for this transaction to succeed | -| `sellGold` | `boolean` | `true` if gold is the sell token | - -##### Returns - -`CeloTransactionObject`\<`string`\> - -The amount of buyToken that was transfered - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:93](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L93) - -___ - -### sellDollar - -• **sellDollar**: (`amount`: `Value`, `minGoldAmount`: `Value`) => `CeloTransactionObject`\<`string`\> - -Deprecated alias of sellStable. -Sell amount of the stable token in exchange for at least minGoldAmount of CELO -Requires the amount to have been approved to the exchange - -**`Deprecated`** - -use sellStable instead - -**`Param`** - -The amount of the stable token the user is selling to the exchange - -**`Param`** - -The minimum amount of CELO the user has to receive for this -transaction to succeed - -#### Type declaration - -▸ (`amount`, `minGoldAmount`): `CeloTransactionObject`\<`string`\> - -Deprecated alias of sellStable. -Sell amount of the stable token in exchange for at least minGoldAmount of CELO -Requires the amount to have been approved to the exchange - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `amount` | `Value` | The amount of the stable token the user is selling to the exchange | -| `minGoldAmount` | `Value` | The minimum amount of CELO the user has to receive for this transaction to succeed | - -##### Returns - -`CeloTransactionObject`\<`string`\> - -**`Deprecated`** - -use sellStable instead - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:195](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L195) - -___ - -### spread - -• **spread**: (...`args`: []) => `Promise`\<`BigNumber`\> - -Query spread parameter - -#### Type declaration - -▸ (`...args`): `Promise`\<`BigNumber`\> - -Query spread parameter - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `...args` | [] | - -##### Returns - -`Promise`\<`BigNumber`\> - -Current spread charged on exchanges - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:35](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L35) - -___ - -### updateFrequency - -• **updateFrequency**: (...`args`: []) => `Promise`\<`BigNumber`\> - -Query update frequency parameter - -#### Type declaration - -▸ (`...args`): `Promise`\<`BigNumber`\> - -Query update frequency parameter - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `...args` | [] | - -##### Returns - -`Promise`\<`BigNumber`\> - -The time period that needs to elapse between bucket -updates - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L50) - -## Accessors - -### address - -• `get` **address**(): `string` - -Contract address - -#### Returns - -`string` - -#### Inherited from - -BaseWrapper.address - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:37](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L37) - -## Methods - -### buyGold - -▸ **buyGold**(`amount`, `maxStableAmount`): `CeloTransactionObject`\<`string`\> - -Buy amount of CELO in exchange for at most maxStableAmount of the stable token -Requires the amount to have been approved to the exchange - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `amount` | `Value` | The amount of CELO the user is buying from the exchange | -| `maxStableAmount` | `Value` | The maximum amount of the stable token the user will pay for this transaction to succeed | - -#### Returns - -`CeloTransactionObject`\<`string`\> - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:204](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L204) - -___ - -### buyStable - -▸ **buyStable**(`amount`, `maxGoldAmount`): `CeloTransactionObject`\<`string`\> - -Buy amount of the stable token in exchange for at least minGoldAmount of CELO -Requires the amount to have been approved to the exchange - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `amount` | `Value` | The amount of the stable token the user is selling to the exchange | -| `maxGoldAmount` | `Value` | The maximum amount of CELO the user will pay for this transaction to succeed | - -#### Returns - -`CeloTransactionObject`\<`string`\> - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:214](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L214) - -___ - -### getBuyTokenAmount - -▸ **getBuyTokenAmount**(`sellAmount`, `sellGold`): `Promise`\<`BigNumber`\> - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellAmount` | `Value` | The amount of sellToken the user is selling to the exchange | -| `sellGold` | `boolean` | `true` if gold is the sell token | - -#### Returns - -`Promise`\<`BigNumber`\> - -The corresponding buyToken amount. - -**`Dev`** - -Returns the amount of buyToken a user would get for sellAmount of sellToken - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L128) - -___ - -### getConfig - -▸ **getConfig**(): `Promise`\<[`ExchangeConfig`](../interfaces/wrappers_Exchange.ExchangeConfig.md)\> - -#### Returns - -`Promise`\<[`ExchangeConfig`](../interfaces/wrappers_Exchange.ExchangeConfig.md)\> - -ExchangeConfig object - -**`Dev`** - -Returns the current configuration of the exchange contract - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:281](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L281) - -___ - -### getExchangeRate - -▸ **getExchangeRate**(`buyAmount`, `sellGold`): `Promise`\<`BigNumber`\> - -Returns the exchange rate estimated at buyAmount. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of buyToken in wei to estimate the exchange rate at | -| `sellGold` | `boolean` | `true` if gold is the sell token | - -#### Returns - -`Promise`\<`BigNumber`\> - -The exchange rate (number of sellTokens received for one buyToken). - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:317](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L317) - -___ - -### getGoldExchangeRate - -▸ **getGoldExchangeRate**(`buyAmount`): `Promise`\<`BigNumber`\> - -Returns the exchange rate for CELO estimated at the buyAmount - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of CELO in wei to estimate the exchange rate at | - -#### Returns - -`Promise`\<`BigNumber`\> - -The exchange rate (number of stable tokens received for one CELO) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:343](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L343) - -___ - -### getHumanReadableConfig - -▸ **getHumanReadableConfig**(): `Promise`\<\{ `lastBucketUpdate`: `string` ; `minimumReports`: `BigNumber` ; `reserveFraction`: `BigNumber` ; `spread`: `BigNumber` ; `updateFrequency`: `string` }\> - -#### Returns - -`Promise`\<\{ `lastBucketUpdate`: `string` ; `minimumReports`: `BigNumber` ; `reserveFraction`: `BigNumber` ; `spread`: `BigNumber` ; `updateFrequency`: `string` }\> - -ExchangeConfig object - -**`Dev`** - -Returns human readable configuration of the exchange contract - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:302](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L302) - -___ - -### getPastEvents - -▸ **getPastEvents**(`event`, `options`): `Promise`\<`EventLog`[]\> - -Contract getPastEvents - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `event` | ``"OwnershipTransferred"`` \| ``"RegistrySet"`` \| ``"allEvents"`` \| ``"BucketsUpdated"`` \| ``"Exchanged"`` \| ``"MinimumReportsSet"`` \| ``"ReserveFractionSet"`` \| ``"SpreadSet"`` \| ``"StableTokenSet"`` \| ``"UpdateFrequencySet"`` | -| `options` | `PastEventOptions` | - -#### Returns - -`Promise`\<`EventLog`[]\> - -#### Inherited from - -[BaseWrapper](wrappers_BaseWrapper.BaseWrapper.md).[getPastEvents](wrappers_BaseWrapper.BaseWrapper.md#getpastevents) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L57) - -___ - -### getSellTokenAmount - -▸ **getSellTokenAmount**(`buyAmount`, `sellGold`): `Promise`\<`BigNumber`\> - -Returns the amount of sellToken a user would need to exchange to receive buyAmount of -buyToken. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of buyToken the user would like to purchase. | -| `sellGold` | `boolean` | `true` if gold is the sell token | - -#### Returns - -`Promise`\<`BigNumber`\> - -The corresponding sellToken amount. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:144](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L144) - -___ - -### getStableExchangeRate - -▸ **getStableExchangeRate**(`buyAmount`): `Promise`\<`BigNumber`\> - -Returns the exchange rate for the stable token estimated at the buyAmount - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of the stable token in wei to estimate the exchange rate at | - -#### Returns - -`Promise`\<`BigNumber`\> - -The exchange rate (number of CELO received for one stable token) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:327](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L327) - -___ - -### quoteGoldBuy - -▸ **quoteGoldBuy**(`buyAmount`): `Promise`\<`BigNumber`\> - -Returns the amount of the stable token a user would need to exchange to receive buyAmount of -CELO. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of CELO the user would like to purchase. | - -#### Returns - -`Promise`\<`BigNumber`\> - -The corresponding stable token amount. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:275](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L275) - -___ - -### quoteGoldSell - -▸ **quoteGoldSell**(`sellAmount`): `Promise`\<`BigNumber`\> - -Returns the amount of the stable token a user would get for sellAmount of CELO - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellAmount` | `Value` | The amount of CELO the user is selling to the exchange | - -#### Returns - -`Promise`\<`BigNumber`\> - -The corresponding stable token amount. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:249](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L249) - -___ - -### quoteStableBuy - -▸ **quoteStableBuy**(`buyAmount`): `Promise`\<`BigNumber`\> - -Returns the amount of CELO a user would need to exchange to receive buyAmount of -the stable token. - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `buyAmount` | `Value` | The amount of the stable token the user would like to purchase. | - -#### Returns - -`Promise`\<`BigNumber`\> - -The corresponding CELO amount. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:257](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L257) - -___ - -### quoteStableSell - -▸ **quoteStableSell**(`sellAmount`): `Promise`\<`BigNumber`\> - -Returns the amount of CELO a user would get for sellAmount of the stable token - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `sellAmount` | `Value` | The amount of the stable token the user is selling to the exchange | - -#### Returns - -`Promise`\<`BigNumber`\> - -The corresponding CELO amount. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:233](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L233) - -___ - -### sellGold - -▸ **sellGold**(`amount`, `minStableAmount`): `CeloTransactionObject`\<`string`\> - -Sell amount of CELO in exchange for at least minStableAmount of the stable token -Requires the amount to have been approved to the exchange - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `amount` | `Value` | The amount of CELO the user is selling to the exchange | -| `minStableAmount` | `Value` | The minimum amount of the stable token the user has to receive for this transaction to succeed | - -#### Returns - -`CeloTransactionObject`\<`string`\> - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:173](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L173) - -___ - -### sellStable - -▸ **sellStable**(`amount`, `minGoldAmount`): `CeloTransactionObject`\<`string`\> - -Sell amount of the stable token in exchange for at least minGoldAmount of CELO -Requires the amount to have been approved to the exchange - -#### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `amount` | `Value` | The amount of the stable token the user is selling to the exchange | -| `minGoldAmount` | `Value` | The minimum amount of CELO the user has to receive for this transaction to succeed | - -#### Returns - -`CeloTransactionObject`\<`string`\> - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:183](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L183) - -___ - -### version - -▸ **version**(): `Promise`\<[`ContractVersion`](versions.ContractVersion.md)\> - -#### Returns - -`Promise`\<[`ContractVersion`](versions.ContractVersion.md)\> - -#### Inherited from - -[BaseWrapper](wrappers_BaseWrapper.BaseWrapper.md).[version](wrappers_BaseWrapper.BaseWrapper.md#version) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/BaseWrapper.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts#L41) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeHandler.FeeHandlerWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeHandler.FeeHandlerWrapper.md index adb08dcee..a0493482a 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeHandler.FeeHandlerWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeHandler.FeeHandlerWrapper.md @@ -161,7 +161,7 @@ ___ ### methodIds -• **methodIds**: `Record`\<``"initialized"`` \| ``"isOwner"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"getVersionNumber"`` \| ``"initialize"`` \| ``"addToken"`` \| ``"removeToken"`` \| ``"transfer"`` \| ``"sell"`` \| ``"FIXED1_UINT"`` \| ``"MIN_BURN"`` \| ``"burnFraction"`` \| ``"celoToBeBurned"`` \| ``"feeBeneficiary"`` \| ``"lastLimitDay"`` \| ``"getTokenHandler"`` \| ``"getTokenActive"`` \| ``"getTokenMaxSlippage"`` \| ``"getTokenDailySellLimit"`` \| ``"getTokenCurrentDaySellLimit"`` \| ``"getTokenToDistribute"`` \| ``"getActiveTokens"`` \| ``"setFeeBeneficiary"`` \| ``"setBurnFraction"`` \| ``"activateToken"`` \| ``"deactivateToken"`` \| ``"setHandler"`` \| ``"distribute"`` \| ``"setMaxSplippage"`` \| ``"setDailySellLimit"`` \| ``"burnCelo"`` \| ``"distributeAll"`` \| ``"handleAll"`` \| ``"handle"`` \| ``"getPastBurnForToken"`` \| ``"dailySellLimitHit"``, `string`\> +• **methodIds**: `Record`\<``"initialized"`` \| ``"isOwner"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"getVersionNumber"`` \| ``"initialize"`` \| ``"addToken"`` \| ``"removeToken"`` \| ``"transfer"`` \| ``"FIXED1_UINT"`` \| ``"MIN_BURN"`` \| ``"burnFraction"`` \| ``"celoToBeBurned"`` \| ``"feeBeneficiary"`` \| ``"lastLimitDay"`` \| ``"getTokenHandler"`` \| ``"getTokenActive"`` \| ``"getTokenMaxSlippage"`` \| ``"getTokenDailySellLimit"`` \| ``"getTokenCurrentDaySellLimit"`` \| ``"getTokenToDistribute"`` \| ``"getActiveTokens"`` \| ``"setFeeBeneficiary"`` \| ``"setBurnFraction"`` \| ``"sell"`` \| ``"activateToken"`` \| ``"deactivateToken"`` \| ``"setHandler"`` \| ``"distribute"`` \| ``"setMaxSplippage"`` \| ``"setDailySellLimit"`` \| ``"burnCelo"`` \| ``"distributeAll"`` \| ``"handleAll"`` \| ``"handle"`` \| ``"getPastBurnForToken"`` \| ``"dailySellLimitHit"``, `string`\> #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/enums/base.CeloContract.md b/packages/docs/sdk/docs/contractkit/enums/base.CeloContract.md index d2a60d9c2..00335426a 100644 --- a/packages/docs/sdk/docs/contractkit/enums/base.CeloContract.md +++ b/packages/docs/sdk/docs/contractkit/enums/base.CeloContract.md @@ -17,9 +17,6 @@ - [Election](base.CeloContract.md#election) - [EpochRewards](base.CeloContract.md#epochrewards) - [Escrow](base.CeloContract.md#escrow) -- [Exchange](base.CeloContract.md#exchange) -- [ExchangeBRL](base.CeloContract.md#exchangebrl) -- [ExchangeEUR](base.CeloContract.md#exchangeeur) - [FederatedAttestations](base.CeloContract.md#federatedattestations) - [FeeCurrencyWhitelist](base.CeloContract.md#feecurrencywhitelist) - [FeeHandler](base.CeloContract.md#feehandler) @@ -133,43 +130,13 @@ ___ ___ -### Exchange - -• **Exchange** = ``"Exchange"`` - -#### Defined in - -[packages/sdk/contractkit/src/base.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L11) - -___ - -### ExchangeBRL - -• **ExchangeBRL** = ``"ExchangeBRL"`` - -#### Defined in - -[packages/sdk/contractkit/src/base.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L13) - -___ - -### ExchangeEUR - -• **ExchangeEUR** = ``"ExchangeEUR"`` - -#### Defined in - -[packages/sdk/contractkit/src/base.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L12) - -___ - ### FederatedAttestations • **FederatedAttestations** = ``"FederatedAttestations"`` #### Defined in -[packages/sdk/contractkit/src/base.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L14) +[packages/sdk/contractkit/src/base.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L11) ___ @@ -179,7 +146,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L15) +[packages/sdk/contractkit/src/base.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L12) ___ @@ -189,7 +156,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L16) +[packages/sdk/contractkit/src/base.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L13) ___ @@ -199,7 +166,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L17) +[packages/sdk/contractkit/src/base.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L14) ___ @@ -209,7 +176,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L18) +[packages/sdk/contractkit/src/base.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L15) ___ @@ -219,7 +186,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L19) +[packages/sdk/contractkit/src/base.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L16) ___ @@ -229,7 +196,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L20) +[packages/sdk/contractkit/src/base.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L17) ___ @@ -239,7 +206,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:21](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L21) +[packages/sdk/contractkit/src/base.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L18) ___ @@ -249,7 +216,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L22) +[packages/sdk/contractkit/src/base.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L19) ___ @@ -259,7 +226,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:24](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L24) +[packages/sdk/contractkit/src/base.ts:21](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L21) ___ @@ -269,7 +236,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L25) +[packages/sdk/contractkit/src/base.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L22) ___ @@ -279,7 +246,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L26) +[packages/sdk/contractkit/src/base.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L23) ___ @@ -289,7 +256,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L27) +[packages/sdk/contractkit/src/base.ts:24](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L24) ___ @@ -299,7 +266,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L28) +[packages/sdk/contractkit/src/base.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L25) ___ @@ -309,7 +276,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L29) +[packages/sdk/contractkit/src/base.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L26) ___ @@ -319,7 +286,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:30](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L30) +[packages/sdk/contractkit/src/base.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L27) ___ @@ -329,7 +296,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L32) +[packages/sdk/contractkit/src/base.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L29) ___ @@ -339,7 +306,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:31](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L31) +[packages/sdk/contractkit/src/base.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L28) ___ @@ -349,7 +316,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L23) +[packages/sdk/contractkit/src/base.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L20) ___ @@ -359,4 +326,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L33) +[packages/sdk/contractkit/src/base.ts:30](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L30) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/basic_contract_cache_type.ContractCacheType.md b/packages/docs/sdk/docs/contractkit/interfaces/basic_contract_cache_type.ContractCacheType.md index 8a1281a8a..441b3ffa4 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/basic_contract_cache_type.ContractCacheType.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/basic_contract_cache_type.ContractCacheType.md @@ -18,7 +18,6 @@ to make a MiniContractKit or CeloTokens Class - [getAccounts](basic_contract_cache_type.ContractCacheType.md#getaccounts) - [getContract](basic_contract_cache_type.ContractCacheType.md#getcontract) -- [getExchange](basic_contract_cache_type.ContractCacheType.md#getexchange) - [getGoldToken](basic_contract_cache_type.ContractCacheType.md#getgoldtoken) - [getStableToken](basic_contract_cache_type.ContractCacheType.md#getstabletoken) @@ -34,28 +33,12 @@ to make a MiniContractKit or CeloTokens Class #### Defined in -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L13) +[packages/sdk/contractkit/src/basic-contract-cache-type.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L12) ___ ### getContract -▸ **getContract**(`contract`): `Promise`\<[`ExchangeWrapper`](../classes/wrappers_Exchange.ExchangeWrapper.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `contract` | [`Exchange`](../enums/base.CeloContract.md#exchange) \| [`ExchangeEUR`](../enums/base.CeloContract.md#exchangeeur) \| [`ExchangeBRL`](../enums/base.CeloContract.md#exchangebrl) | - -#### Returns - -`Promise`\<[`ExchangeWrapper`](../classes/wrappers_Exchange.ExchangeWrapper.md)\> - -#### Defined in - -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L20) - ▸ **getContract**(`contract`): `Promise`\<[`StableTokenWrapper`](../classes/wrappers_StableTokenWrapper.StableTokenWrapper.md)\> #### Parameters @@ -70,7 +53,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L23) +[packages/sdk/contractkit/src/basic-contract-cache-type.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L18) ▸ **getContract**(`contract`): `Promise`\<[`GoldTokenWrapper`](../classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md)\> @@ -86,27 +69,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:24](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L24) - -___ - -### getExchange - -▸ **getExchange**(`stableToken`): `Promise`\<[`ExchangeWrapper`](../classes/wrappers_Exchange.ExchangeWrapper.md)\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `stableToken` | [`StableToken`](../enums/celo_tokens.StableToken.md) | - -#### Returns - -`Promise`\<[`ExchangeWrapper`](../classes/wrappers_Exchange.ExchangeWrapper.md)\> - -#### Defined in - -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L14) +[packages/sdk/contractkit/src/basic-contract-cache-type.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L19) ___ @@ -120,7 +83,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L16) +[packages/sdk/contractkit/src/basic-contract-cache-type.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L14) ___ @@ -140,4 +103,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/basic-contract-cache-type.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L18) +[packages/sdk/contractkit/src/basic-contract-cache-type.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/basic-contract-cache-type.ts#L16) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/celo_tokens.StableTokenInfo.md b/packages/docs/sdk/docs/contractkit/interfaces/celo_tokens.StableTokenInfo.md index cb53804c8..beee105fe 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/celo_tokens.StableTokenInfo.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/celo_tokens.StableTokenInfo.md @@ -15,7 +15,6 @@ ### Properties - [contract](celo_tokens.StableTokenInfo.md#contract) -- [exchangeContract](celo_tokens.StableTokenInfo.md#exchangecontract) - [symbol](celo_tokens.StableTokenInfo.md#symbol) ## Properties @@ -34,16 +33,6 @@ ___ -### exchangeContract - -• **exchangeContract**: [`ExchangeContract`](../modules/base.md#exchangecontract) - -#### Defined in - -[packages/sdk/contractkit/src/celo-tokens.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L23) - -___ - ### symbol • **symbol**: [`CeloTokenType`](../modules/celo_tokens.md#celotokentype) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md b/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md index 682e8bf38..5e353d413 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md @@ -12,7 +12,6 @@ - [blockchainParameters](kit.NetworkConfig.md#blockchainparameters) - [downtimeSlasher](kit.NetworkConfig.md#downtimeslasher) - [election](kit.NetworkConfig.md#election) -- [exchanges](kit.NetworkConfig.md#exchanges) - [gasPriceMinimum](kit.NetworkConfig.md#gaspriceminimum) - [governance](kit.NetworkConfig.md#governance) - [lockedGold](kit.NetworkConfig.md#lockedgold) @@ -29,7 +28,7 @@ #### Defined in -[packages/sdk/contractkit/src/kit.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L74) +[packages/sdk/contractkit/src/kit.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L72) ___ @@ -39,7 +38,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:82](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L82) +[packages/sdk/contractkit/src/kit.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L80) ___ @@ -49,7 +48,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:81](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L81) +[packages/sdk/contractkit/src/kit.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L79) ___ @@ -59,16 +58,6 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L73) - -___ - -### exchanges - -• **exchanges**: [`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`ExchangeConfig`](wrappers_Exchange.ExchangeConfig.md)\> - -#### Defined in - [packages/sdk/contractkit/src/kit.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L71) ___ @@ -79,7 +68,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L78) +[packages/sdk/contractkit/src/kit.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L76) ___ @@ -89,7 +78,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L75) +[packages/sdk/contractkit/src/kit.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L73) ___ @@ -99,7 +88,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L76) +[packages/sdk/contractkit/src/kit.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L74) ___ @@ -109,7 +98,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L79) +[packages/sdk/contractkit/src/kit.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L77) ___ @@ -119,7 +108,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L77) +[packages/sdk/contractkit/src/kit.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L75) ___ @@ -129,7 +118,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L72) +[packages/sdk/contractkit/src/kit.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L70) ___ @@ -139,4 +128,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L80) +[packages/sdk/contractkit/src/kit.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L78) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Exchange.ExchangeConfig.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Exchange.ExchangeConfig.md deleted file mode 100644 index 0826901aa..000000000 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Exchange.ExchangeConfig.md +++ /dev/null @@ -1,65 +0,0 @@ -[@celo/contractkit](../README.md) / [Exports](../modules.md) / [wrappers/Exchange](../modules/wrappers_Exchange.md) / ExchangeConfig - -# Interface: ExchangeConfig - -[wrappers/Exchange](../modules/wrappers_Exchange.md).ExchangeConfig - -## Table of contents - -### Properties - -- [lastBucketUpdate](wrappers_Exchange.ExchangeConfig.md#lastbucketupdate) -- [minimumReports](wrappers_Exchange.ExchangeConfig.md#minimumreports) -- [reserveFraction](wrappers_Exchange.ExchangeConfig.md#reservefraction) -- [spread](wrappers_Exchange.ExchangeConfig.md#spread) -- [updateFrequency](wrappers_Exchange.ExchangeConfig.md#updatefrequency) - -## Properties - -### lastBucketUpdate - -• **lastBucketUpdate**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L23) - -___ - -### minimumReports - -• **minimumReports**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L22) - -___ - -### reserveFraction - -• **reserveFraction**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L20) - -___ - -### spread - -• **spread**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L19) - -___ - -### updateFrequency - -• **updateFrequency**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:21](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L21) diff --git a/packages/docs/sdk/docs/contractkit/modules.md b/packages/docs/sdk/docs/contractkit/modules.md index 910197449..109a4fcb4 100644 --- a/packages/docs/sdk/docs/contractkit/modules.md +++ b/packages/docs/sdk/docs/contractkit/modules.md @@ -45,7 +45,6 @@ - [wrappers/EpochRewards](modules/wrappers_EpochRewards.md) - [wrappers/Erc20Wrapper](modules/wrappers_Erc20Wrapper.md) - [wrappers/Escrow](modules/wrappers_Escrow.md) -- [wrappers/Exchange](modules/wrappers_Exchange.md) - [wrappers/FederatedAttestations](modules/wrappers_FederatedAttestations.md) - [wrappers/FeeHandler](modules/wrappers_FeeHandler.md) - [wrappers/Freezer](modules/wrappers_Freezer.md) diff --git a/packages/docs/sdk/docs/contractkit/modules/base.md b/packages/docs/sdk/docs/contractkit/modules/base.md index 986ff2b5a..fe7416176 100644 --- a/packages/docs/sdk/docs/contractkit/modules/base.md +++ b/packages/docs/sdk/docs/contractkit/modules/base.md @@ -12,7 +12,6 @@ - [CeloToken](base.md#celotoken) - [CeloTokenContract](base.md#celotokencontract) -- [ExchangeContract](base.md#exchangecontract) - [StableTokenContract](base.md#stabletokencontract) ### Variables @@ -40,7 +39,7 @@ Use CeloTokenContract instead #### Defined in -[packages/sdk/contractkit/src/base.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L51) +[packages/sdk/contractkit/src/base.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L43) ___ @@ -50,17 +49,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L46) - -___ - -### ExchangeContract - -Ƭ **ExchangeContract**: [`Exchange`](../enums/base.CeloContract.md#exchange) \| [`ExchangeEUR`](../enums/base.CeloContract.md#exchangeeur) \| [`ExchangeBRL`](../enums/base.CeloContract.md#exchangebrl) - -#### Defined in - -[packages/sdk/contractkit/src/base.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L41) +[packages/sdk/contractkit/src/base.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L38) ___ @@ -70,7 +59,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:36](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L36) +[packages/sdk/contractkit/src/base.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L33) ## Variables @@ -80,7 +69,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L53) +[packages/sdk/contractkit/src/base.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L45) ___ @@ -90,7 +79,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L64) +[packages/sdk/contractkit/src/base.ts:56](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L56) ___ @@ -100,7 +89,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:55](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L55) +[packages/sdk/contractkit/src/base.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L47) ## Functions @@ -120,7 +109,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L58) +[packages/sdk/contractkit/src/base.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L50) ___ @@ -140,4 +129,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/base.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L61) +[packages/sdk/contractkit/src/base.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/base.ts#L53) diff --git a/packages/docs/sdk/docs/contractkit/modules/celo_tokens.md b/packages/docs/sdk/docs/contractkit/modules/celo_tokens.md index 9576af5d7..6b03a3f07 100644 --- a/packages/docs/sdk/docs/contractkit/modules/celo_tokens.md +++ b/packages/docs/sdk/docs/contractkit/modules/celo_tokens.md @@ -79,7 +79,7 @@ Basic info for each supported celo token, including stable tokens #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L48) +[packages/sdk/contractkit/src/celo-tokens.ts:44](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L44) ___ @@ -91,7 +91,7 @@ Basic info for each stable token #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L27) +[packages/sdk/contractkit/src/celo-tokens.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L26) ## Functions @@ -111,4 +111,4 @@ Basic info for each stable token #### Defined in -[packages/sdk/contractkit/src/celo-tokens.ts:275](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L275) +[packages/sdk/contractkit/src/celo-tokens.ts:251](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/celo-tokens.ts#L251) diff --git a/packages/docs/sdk/docs/contractkit/modules/contract_cache.md b/packages/docs/sdk/docs/contractkit/modules/contract_cache.md index ce049d077..ecf22dea3 100644 --- a/packages/docs/sdk/docs/contractkit/modules/contract_cache.md +++ b/packages/docs/sdk/docs/contractkit/modules/contract_cache.md @@ -20,4 +20,4 @@ #### Defined in -[packages/sdk/contractkit/src/contract-cache.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L72) +[packages/sdk/contractkit/src/contract-cache.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L68) diff --git a/packages/docs/sdk/docs/contractkit/modules/kit.md b/packages/docs/sdk/docs/contractkit/modules/kit.md index c99cf1414..de273bf72 100644 --- a/packages/docs/sdk/docs/contractkit/modules/kit.md +++ b/packages/docs/sdk/docs/contractkit/modules/kit.md @@ -65,7 +65,7 @@ options to pass to the Web3 HttpProvider constructor #### Defined in -[packages/sdk/contractkit/src/kit.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L46) +[packages/sdk/contractkit/src/kit.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L45) ___ @@ -88,7 +88,7 @@ Creates a new instance of the `ContractKit` with a web3 instance #### Defined in -[packages/sdk/contractkit/src/kit.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L66) +[packages/sdk/contractkit/src/kit.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L65) ___ @@ -116,4 +116,4 @@ wallet to reuse or add a wallet different than the default (example ledger-walle #### Defined in -[packages/sdk/contractkit/src/kit.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L57) +[packages/sdk/contractkit/src/kit.ts:56](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L56) diff --git a/packages/docs/sdk/docs/contractkit/modules/mini_contract_cache.md b/packages/docs/sdk/docs/contractkit/modules/mini_contract_cache.md index 71a2b9728..03b65ee72 100644 --- a/packages/docs/sdk/docs/contractkit/modules/mini_contract_cache.md +++ b/packages/docs/sdk/docs/contractkit/modules/mini_contract_cache.md @@ -20,4 +20,4 @@ #### Defined in -[packages/sdk/contractkit/src/mini-contract-cache.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L61) +[packages/sdk/contractkit/src/mini-contract-cache.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/mini-contract-cache.ts#L45) diff --git a/packages/docs/sdk/docs/contractkit/modules/proxy.md b/packages/docs/sdk/docs/contractkit/modules/proxy.md index d22684d19..3d88b146e 100644 --- a/packages/docs/sdk/docs/contractkit/modules/proxy.md +++ b/packages/docs/sdk/docs/contractkit/modules/proxy.md @@ -26,7 +26,7 @@ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L33) +[packages/sdk/contractkit/src/proxy.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L32) ___ @@ -36,7 +36,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L85) +[packages/sdk/contractkit/src/proxy.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L84) ___ @@ -46,7 +46,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:92](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L92) +[packages/sdk/contractkit/src/proxy.ts:91](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L91) ___ @@ -56,7 +56,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:91](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L91) +[packages/sdk/contractkit/src/proxy.ts:90](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L90) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L65) +[packages/sdk/contractkit/src/proxy.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L64) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:49](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L49) +[packages/sdk/contractkit/src/proxy.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L48) ## Functions @@ -88,7 +88,7 @@ ___ | Name | Type | | :------ | :------ | -| `proxyContractName` | ``"AccountsProxy"`` \| ``"AttestationsProxy"`` \| ``"BlockchainParametersProxy"`` \| ``"DoubleSigningSlasherProxy"`` \| ``"DowntimeSlasherProxy"`` \| ``"ElectionProxy"`` \| ``"EpochRewardsProxy"`` \| ``"EscrowProxy"`` \| ``"ExchangeProxy"`` \| ``"ExchangeEURProxy"`` \| ``"ExchangeBRLProxy"`` \| ``"FederatedAttestationsProxy"`` \| ``"FeeCurrencyWhitelistProxy"`` \| ``"FeeHandlerProxy"`` \| ``"FreezerProxy"`` \| ``"GasPriceMinimumProxy"`` \| ``"GoldTokenProxy"`` \| ``"GovernanceProxy"`` \| ``"LockedGoldProxy"`` \| ``"MentoFeeHandlerSellerProxy"`` \| ``"UniswapFeeHandlerSellerProxy"`` \| ``"MultiSigProxy"`` \| ``"OdisPaymentsProxy"`` \| ``"RandomProxy"`` \| ``"RegistryProxy"`` \| ``"ReserveProxy"`` \| ``"SortedOraclesProxy"`` \| ``"StableTokenProxy"`` \| ``"StableTokenEURProxy"`` \| ``"StableTokenBRLProxy"`` \| ``"ValidatorsProxy"`` \| ``"ProxyProxy"`` | +| `proxyContractName` | ``"AccountsProxy"`` \| ``"AttestationsProxy"`` \| ``"BlockchainParametersProxy"`` \| ``"DoubleSigningSlasherProxy"`` \| ``"DowntimeSlasherProxy"`` \| ``"ElectionProxy"`` \| ``"EpochRewardsProxy"`` \| ``"EscrowProxy"`` \| ``"FederatedAttestationsProxy"`` \| ``"FeeCurrencyWhitelistProxy"`` \| ``"FeeHandlerProxy"`` \| ``"FreezerProxy"`` \| ``"GasPriceMinimumProxy"`` \| ``"GoldTokenProxy"`` \| ``"GovernanceProxy"`` \| ``"LockedGoldProxy"`` \| ``"MentoFeeHandlerSellerProxy"`` \| ``"UniswapFeeHandlerSellerProxy"`` \| ``"MultiSigProxy"`` \| ``"OdisPaymentsProxy"`` \| ``"RandomProxy"`` \| ``"RegistryProxy"`` \| ``"ReserveProxy"`` \| ``"SortedOraclesProxy"`` \| ``"StableTokenProxy"`` \| ``"StableTokenEURProxy"`` \| ``"StableTokenBRLProxy"`` \| ``"ValidatorsProxy"`` \| ``"ProxyProxy"`` | #### Returns @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:132](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L132) +[packages/sdk/contractkit/src/proxy.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L128) ___ @@ -117,4 +117,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/proxy.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L142) +[packages/sdk/contractkit/src/proxy.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/proxy.ts#L138) diff --git a/packages/docs/sdk/docs/contractkit/modules/web3_contract_cache.md b/packages/docs/sdk/docs/contractkit/modules/web3_contract_cache.md index c755b382f..8796172be 100644 --- a/packages/docs/sdk/docs/contractkit/modules/web3_contract_cache.md +++ b/packages/docs/sdk/docs/contractkit/modules/web3_contract_cache.md @@ -24,7 +24,7 @@ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:88](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L88) +[packages/sdk/contractkit/src/web3-contract-cache.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L76) ## Variables @@ -45,9 +45,6 @@ | `Election` | (`web3`: `default`, `address`: `string`) => `Election` | | `EpochRewards` | (`web3`: `default`, `address`: `string`) => `EpochRewards` | | `Escrow` | (`web3`: `default`, `address`: `string`) => `Escrow` | -| `Exchange` | (`web3`: `default`, `address`: `string`) => `Exchange` | -| `ExchangeBRL` | (`web3`: `default`, `address`: `string`) => `ExchangeBRL` | -| `ExchangeEUR` | (`web3`: `default`, `address`: `string`) => `ExchangeEUR` | | `FederatedAttestations` | (`web3`: `default`, `address`: `string`) => `FederatedAttestations` | | `FeeCurrencyWhitelist` | (`web3`: `default`, `address`: `string`) => `FeeCurrencyWhitelist` | | `FeeHandler` | (`web3`: `default`, `address`: `string`) => `FeeHandler` | @@ -71,4 +68,4 @@ #### Defined in -[packages/sdk/contractkit/src/web3-contract-cache.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L41) +[packages/sdk/contractkit/src/web3-contract-cache.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/web3-contract-cache.ts#L38) diff --git a/packages/docs/sdk/docs/contractkit/modules/wrappers_Exchange.md b/packages/docs/sdk/docs/contractkit/modules/wrappers_Exchange.md deleted file mode 100644 index bde3546de..000000000 --- a/packages/docs/sdk/docs/contractkit/modules/wrappers_Exchange.md +++ /dev/null @@ -1,27 +0,0 @@ -[@celo/contractkit](../README.md) / [Exports](../modules.md) / wrappers/Exchange - -# Module: wrappers/Exchange - -## Table of contents - -### Classes - -- [ExchangeWrapper](../classes/wrappers_Exchange.ExchangeWrapper.md) - -### Interfaces - -- [ExchangeConfig](../interfaces/wrappers_Exchange.ExchangeConfig.md) - -### Type Aliases - -- [ExchangeWrapperType](wrappers_Exchange.md#exchangewrappertype) - -## Type Aliases - -### ExchangeWrapperType - -Ƭ **ExchangeWrapperType**: [`ExchangeWrapper`](../classes/wrappers_Exchange.ExchangeWrapper.md) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/Exchange.ts:346](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Exchange.ts#L346)