From dd846b8857d8698c0923cd28488416a8f1ce23ed Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Mon, 18 Mar 2024 19:16:24 +0300 Subject: [PATCH 1/9] start beta --- .changeset/pre.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .changeset/pre.json diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 000000000..a6380f1fe --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,29 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "@celo/celocli": "4.2.0", + "@celo/base": "6.0.0", + "@celo/connect": "5.2.0", + "@celo/contractkit": "7.2.0", + "@celo/cryptographic-utils": "5.0.7", + "@celo/explorer": "5.0.9", + "@celo/governance": "5.1.0", + "@celo/keystores": "5.0.8", + "@celo/network-utils": "5.0.5", + "@celo/phone-utils": "6.0.1", + "@celo/transactions-uri": "5.0.8", + "@celo/utils": "6.0.0", + "@celo/wallet-base": "5.1.3", + "@celo/wallet-hsm": "5.1.3", + "@celo/wallet-hsm-aws": "5.1.3", + "@celo/wallet-hsm-azure": "5.1.3", + "@celo/wallet-hsm-gcp": "5.1.3", + "@celo/wallet-ledger": "5.1.3", + "@celo/wallet-local": "5.1.3", + "@celo/wallet-remote": "5.1.3", + "@celo/wallet-rpc": "5.1.3", + "@celo/typescript": "0.0.1" + }, + "changesets": [] +} From a3179725c4c38274b8e664a0f2853a709911949c Mon Sep 17 00:00:00 2001 From: Aaron DeRuvo Date: Mon, 18 Mar 2024 19:17:26 +0300 Subject: [PATCH 2/9] Remove stable token Inflation related methods and configs (#186) * remove inflation methods from stabletokenwrapper as they no longer exist * better console message if there is an error found * remove stable token infos from network config. * sort keys for consistent, nice output --- .changeset/pretty-taxis-juggle.md | 12 ++ .changeset/slimy-trainers-develop.md | 5 + packages/cli/src/base.ts | 3 + .../src/commands/network/parameters.test.ts | 104 +++++++++++++ packages/cli/src/test-utils/cliUtils.ts | 4 + packages/cli/src/utils/cli.ts | 1 + .../docs/command-line-interface/validator.md | 8 - .../classes/celo_tokens.CeloTokens.md | 4 +- .../contractkit/classes/kit.ContractKit.md | 40 ++--- ...s_StableTokenWrapper.StableTokenWrapper.md | 142 ++---------------- ..._StableTokenWrapper.InflationParameters.md | 54 ------- ...rs_StableTokenWrapper.StableTokenConfig.md | 17 +-- .../modules/wrappers_StableTokenWrapper.md | 3 +- packages/sdk/contractkit/package.json | 6 +- packages/sdk/contractkit/src/kit.ts | 1 - .../src/wrappers/StableTokenWrapper.ts | 81 +--------- 16 files changed, 170 insertions(+), 315 deletions(-) create mode 100644 .changeset/pretty-taxis-juggle.md create mode 100644 .changeset/slimy-trainers-develop.md create mode 100644 packages/cli/src/commands/network/parameters.test.ts delete mode 100644 packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.InflationParameters.md diff --git a/.changeset/pretty-taxis-juggle.md b/.changeset/pretty-taxis-juggle.md new file mode 100644 index 000000000..9cbd77211 --- /dev/null +++ b/.changeset/pretty-taxis-juggle.md @@ -0,0 +1,12 @@ +--- +'@celo/contractkit': major +--- + +Removes stable token infos from the kit.getNetworkConfig() + + +Removes from StableTokenWrapper all InflationParameters including, valueToUnits(), unitsToValues(), setInflationParameters(), + +Removes the inflation params from StableTokenWrapper.getConfig + + diff --git a/.changeset/slimy-trainers-develop.md b/.changeset/slimy-trainers-develop.md new file mode 100644 index 000000000..e0635e3ee --- /dev/null +++ b/.changeset/slimy-trainers-develop.md @@ -0,0 +1,5 @@ +--- +'@celo/celocli': patch +--- + +celocli nework:parameters no longer includes info on stable tokens diff --git a/packages/cli/src/base.ts b/packages/cli/src/base.ts index 0c677bdc9..ac7044cd3 100644 --- a/packages/cli/src/base.ts +++ b/packages/cli/src/base.ts @@ -229,6 +229,9 @@ export abstract class BaseCommand extends Command { async finally(arg: Error | undefined): Promise { try { + if (arg) { + console.error('received error while cleaning up', arg) + } const kit = await this.getKit() kit.connection.stop() } catch (error) { diff --git a/packages/cli/src/commands/network/parameters.test.ts b/packages/cli/src/commands/network/parameters.test.ts new file mode 100644 index 000000000..1ea69e74a --- /dev/null +++ b/packages/cli/src/commands/network/parameters.test.ts @@ -0,0 +1,104 @@ +import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' +import { stripAnsiCodesFromNestedArray, testLocally } from '../../test-utils/cliUtils' +import Parameters from './parameters' +process.env.NO_SYNCCHECK = 'true' + +testWithGanache('network:parameters', () => { + test('runs', async () => { + const spy = jest.spyOn(console, 'log') + await testLocally(Parameters, []) + expect(stripAnsiCodesFromNestedArray(spy.mock.calls)).toMatchInlineSnapshot(` + [ + [ + "Attestations: + attestationExpiry: 1 hour + attestationRequestFees: + 0: + address: 0x04B5dAdd2c0D6a261bfafBc964E0cAc48585dEF3 + fee: 0 + 1: + address: 0x5315e44798395d4a952530d131249fE00f554565 + fee: 50000000000000000 (~5.000e+16) + 2: + address: 0xdD66C23e07b4D6925b6089b5Fe6fc9E62941aFE8 + fee: 0 + 3: + address: 0x965D352283a3C8A016b9BBbC9bf6306665d495E7 + fee: 0 + BlockchainParameters: + blockGasLimit: 20000000 (~2.000e+7) + intrinsicGasForAlternativeFeeCurrency: 50000 (~5.000e+4) + DowntimeSlasher: + slashableDowntime: 5 minutes + slashingIncentives: + penalty: 100000000000000000000 (~1.000e+20) + reward: 10000000000000000000 (~1.000e+19) + Election: + currentThreshold: 0 + electabilityThreshold: 0.001 + electableValidators: + max: 100 + min: 10 + maxNumGroupsVotedFor: 10 + totalVotes: 0 + EpochRewards: + carbonOffsetting: + factor: 0.001 + partner: 0x0000000000000000000000000000000000000000 + communityReward: 0.25 + rewardsMultiplier: + max: 2 + overspendAdjustment: 5 + underspendAdjustment: 0.5 + targetValidatorEpochPayment: 205479452054794520547 (~2.055e+20) + targetVotingYield: + adjustment: 0 + max: 0.0005 + target: 0 + GasPriceMinimum: + adjustmentSpeed: 0.5 + gasPriceMinimum: 100000000 (~1.000e+8) + targetDensity: 0.5 + Governance: + concurrentProposals: 5 + dequeueFrequency: 30 seconds + minDeposit: 1000000000000000000 (~1.000e+18) + participationParameters: + baseline: 0.005 + baselineFloor: 0.01 + baselineQuorumFactor: 1 + baselineUpdateFactor: 0.2 + queueExpiry: 16 minutes, 40 seconds + stageDurations: + Execution: 1 minute, 40 seconds + Referendum: 1 minute, 40 seconds + LockedGold: + totalLockedGold: 0 + unlockingPeriod: 3 days + Reserve: + frozenReserveGoldDays: 0 + frozenReserveGoldStartBalance: 0 + frozenReserveGoldStartDay: 19787 (~1.979e+4) + otherReserveAddresses: + 0: 0x91c987bf62D25945dB517BDAa840A6c661374402 + 1: 0x298FbD6dad2Fc2cB56d7E37d8aCad8Bf07324f67 + tobinTaxStalenessThreshold: 3153600000 (~3.154e+9) + SortedOracles: + reportExpiry: 5 minutes + Validators: + commissionUpdateDelay: 15 seconds + downtimeGracePeriod: 0 + groupLockedGoldRequirements: + duration: 6 months + value: 10000000000000000000000 (~1.000e+22) + maxGroupSize: 5 + membershipHistoryLength: 60 + slashingMultiplierResetPeriod: 1 month + validatorLockedGoldRequirements: + duration: 2 months + value: 10000000000000000000000 (~1.000e+22)", + ], + ] + `) + }) +}) diff --git a/packages/cli/src/test-utils/cliUtils.ts b/packages/cli/src/test-utils/cliUtils.ts index cfbd974da..7c1bf99b9 100644 --- a/packages/cli/src/test-utils/cliUtils.ts +++ b/packages/cli/src/test-utils/cliUtils.ts @@ -20,5 +20,9 @@ export const stripAnsiCodes = (text: string): string => { return text.replace(/\u001b\[.*?m/g, '') } +export function stripAnsiCodesFromNestedArray(arrays: Array) { + return arrays.map((level0) => level0.map((level1) => stripAnsiCodes(level1))) +} + export const LONG_TIMEOUT_MS = 10 * 1000 export const EXTRA_LONG_TIMEOUT_MS = 20 * 1000 diff --git a/packages/cli/src/utils/cli.ts b/packages/cli/src/utils/cli.ts index 0b3bd40ff..5670f1e4b 100644 --- a/packages/cli/src/utils/cli.ts +++ b/packages/cli/src/utils/cli.ts @@ -116,6 +116,7 @@ function toStringValueMapRecursive(valueMap: Record, prefix: string return chalk`${v}` } return Object.keys(valueMap) + .sort() .map((key) => prefix + chalk.yellowBright.bold(`${key}: `) + printValue(valueMap[key])) .join('\n') } diff --git a/packages/docs/command-line-interface/validator.md b/packages/docs/command-line-interface/validator.md index a6d43efab..4595a8f24 100644 --- a/packages/docs/command-line-interface/validator.md +++ b/packages/docs/command-line-interface/validator.md @@ -5,7 +5,6 @@ View and manage Validators * [`celocli validator:affiliate ARG1`](#celocli-validatoraffiliate-arg1) * [`celocli validator:deaffiliate`](#celocli-validatordeaffiliate) -* [`celocli validator:demo`](#celocli-validatordemo) * [`celocli validator:deregister`](#celocli-validatorderegister) * [`celocli validator:downtime-slash`](#celocli-validatordowntime-slash) * [`celocli validator:force-deaffiliate`](#celocli-validatorforce-deaffiliate) @@ -70,13 +69,6 @@ EXAMPLES _See code: [src/commands/validator/deaffiliate.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/validator/deaffiliate.ts)_ -## `celocli validator:demo` - -``` -USAGE - $ celocli validator:demo -``` - ## `celocli validator:deregister` Deregister a Validator. Approximately 60 days after the validator is no longer part of any group, it will be possible to deregister the validator and start unlocking the CELO. If you wish to deregister your validator, you must first remove it from it's group, such as by deaffiliating it, then wait the required 60 days before running this command. 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 3f1da1a77..8d6d4830c 100644 --- a/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md +++ b/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md @@ -283,7 +283,7 @@ ___ ### getStablesConfigs -▸ **getStablesConfigs**(`humanReadable?`): `Promise`\<[`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`StableTokenConfig`](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md) \| \{ `decimals`: `number` ; `inflationParameters`: \{ `factor`: `BigNumber` ; `factorLastUpdated`: `string` ; `rate`: `BigNumber` ; `updatePeriod`: `string` } ; `name`: `string` ; `symbol`: `string` }\>\> +▸ **getStablesConfigs**(`humanReadable?`): `Promise`\<[`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`StableTokenConfig`](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md)\>\> #### Parameters @@ -293,7 +293,7 @@ ___ #### Returns -`Promise`\<[`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`StableTokenConfig`](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md) \| \{ `decimals`: `number` ; `inflationParameters`: \{ `factor`: `BigNumber` ; `factorLastUpdated`: `string` ; `rate`: `BigNumber` ; `updatePeriod`: `string` } ; `name`: `string` ; `symbol`: `string` }\>\> +`Promise`\<[`EachCeloToken`](../modules/celo_tokens.md#eachcelotoken)\<[`StableTokenConfig`](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md)\>\> #### Defined in diff --git a/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md b/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md index 17c6cb7b1..b118bed61 100644 --- a/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md +++ b/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md @@ -149,7 +149,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:233](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L233) +[packages/sdk/contractkit/src/kit.ts:232](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L232) • `set` **defaultAccount**(`address`): `void` @@ -165,7 +165,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:229](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L229) +[packages/sdk/contractkit/src/kit.ts:228](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L228) ___ @@ -179,7 +179,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:249](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L249) +[packages/sdk/contractkit/src/kit.ts:248](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L248) • `set` **defaultFeeCurrency**(`address`): `void` @@ -195,7 +195,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:245](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L245) +[packages/sdk/contractkit/src/kit.ts:244](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L244) ___ @@ -209,7 +209,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:241](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L241) +[packages/sdk/contractkit/src/kit.ts:240](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L240) • `set` **gasInflationFactor**(`factor`): `void` @@ -225,7 +225,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:237](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L237) +[packages/sdk/contractkit/src/kit.ts:236](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L236) ___ @@ -239,7 +239,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:280](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L280) +[packages/sdk/contractkit/src/kit.ts:279](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L279) ## Methods @@ -259,7 +259,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:225](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L225) +[packages/sdk/contractkit/src/kit.ts:224](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L224) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:216](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L216) +[packages/sdk/contractkit/src/kit.ts:215](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L215) ___ @@ -293,7 +293,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:201](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L201) +[packages/sdk/contractkit/src/kit.ts:200](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L200) ___ @@ -313,7 +313,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:206](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L206) +[packages/sdk/contractkit/src/kit.ts:205](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L205) ___ @@ -327,7 +327,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:187](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L187) +[packages/sdk/contractkit/src/kit.ts:186](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L186) ___ @@ -347,7 +347,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:211](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L211) +[packages/sdk/contractkit/src/kit.ts:210](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L210) ___ @@ -415,7 +415,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:253](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L253) +[packages/sdk/contractkit/src/kit.ts:252](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L252) ___ @@ -429,7 +429,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:257](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L257) +[packages/sdk/contractkit/src/kit.ts:256](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L256) ___ @@ -449,7 +449,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:261](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L261) +[packages/sdk/contractkit/src/kit.ts:260](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L260) ___ @@ -470,7 +470,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:265](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L265) +[packages/sdk/contractkit/src/kit.ts:264](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L264) ___ @@ -492,7 +492,7 @@ Set CeloToken to use to pay for gas fees #### Defined in -[packages/sdk/contractkit/src/kit.ts:193](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L193) +[packages/sdk/contractkit/src/kit.ts:192](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L192) ___ @@ -513,7 +513,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:272](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L272) +[packages/sdk/contractkit/src/kit.ts:271](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L271) ___ @@ -527,4 +527,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:276](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L276) +[packages/sdk/contractkit/src/kit.ts:275](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L275) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md index 5c1706858..35b770011 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md @@ -33,14 +33,11 @@ Stable token with variable supply - [mint](wrappers_StableTokenWrapper.StableTokenWrapper.md#mint) - [name](wrappers_StableTokenWrapper.StableTokenWrapper.md#name) - [owner](wrappers_StableTokenWrapper.StableTokenWrapper.md#owner) -- [setInflationParameters](wrappers_StableTokenWrapper.StableTokenWrapper.md#setinflationparameters) - [symbol](wrappers_StableTokenWrapper.StableTokenWrapper.md#symbol) - [totalSupply](wrappers_StableTokenWrapper.StableTokenWrapper.md#totalsupply) - [transfer](wrappers_StableTokenWrapper.StableTokenWrapper.md#transfer) - [transferFrom](wrappers_StableTokenWrapper.StableTokenWrapper.md#transferfrom) - [transferWithComment](wrappers_StableTokenWrapper.StableTokenWrapper.md#transferwithcomment) -- [unitsToValue](wrappers_StableTokenWrapper.StableTokenWrapper.md#unitstovalue) -- [valueToUnits](wrappers_StableTokenWrapper.StableTokenWrapper.md#valuetounits) ### Accessors @@ -50,7 +47,6 @@ Stable token with variable supply - [getConfig](wrappers_StableTokenWrapper.StableTokenWrapper.md#getconfig) - [getHumanReadableConfig](wrappers_StableTokenWrapper.StableTokenWrapper.md#gethumanreadableconfig) -- [getInflationParameters](wrappers_StableTokenWrapper.StableTokenWrapper.md#getinflationparameters) - [getPastEvents](wrappers_StableTokenWrapper.StableTokenWrapper.md#getpastevents) - [version](wrappers_StableTokenWrapper.StableTokenWrapper.md#version) @@ -223,7 +219,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:83](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L83) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:40](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L40) ___ @@ -295,7 +291,7 @@ true if success. #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:81](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L81) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L38) ___ @@ -374,7 +370,7 @@ true if success. #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L70) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L27) ___ @@ -412,7 +408,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:82](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L82) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:39](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L39) ___ @@ -476,31 +472,7 @@ the address of the owner of the contract. #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L38) - -___ - -### setInflationParameters - -• **setInflationParameters**: (...`args`: [rate: string \| number, updatePeriod: string \| number]) => `CeloTransactionObject`\<`void`\> - -#### Type declaration - -▸ (`...args`): `CeloTransactionObject`\<`void`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `...args` | [rate: string \| number, updatePeriod: string \| number] | - -##### Returns - -`CeloTransactionObject`\<`void`\> - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L85) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L19) ___ @@ -704,84 +676,6 @@ True if the transaction succeeds. [packages/sdk/contractkit/src/wrappers/CeloTokenWrapper.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/CeloTokenWrapper.ts#L38) -___ - -### unitsToValue - -• **unitsToValue**: (`units`: `Value`) => `Promise`\<`BigNumber`\> - -Returns the value of a given number of units given the current inflation factor. - -**`Param`** - -The units to convert to value. - -#### Type declaration - -▸ (`units`): `Promise`\<`BigNumber`\> - -Returns the value of a given number of units given the current inflation factor. - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `units` | `Value` | The units to convert to value. | - -##### Returns - -`Promise`\<`BigNumber`\> - -The value corresponding to `units` given the current inflation factor. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L58) - -___ - -### valueToUnits - -• **valueToUnits**: (`value`: `Value`) => `Promise`\<`BigNumber`\> - -Returns the units for a given value given the current inflation factor. - -**`Param`** - -The value to convert to units. - -**`Dev`** - -We don't compute the updated inflationFactor here because -we assume any function calling this will have updated the inflation factor. - -#### Type declaration - -▸ (`value`): `Promise`\<`BigNumber`\> - -Returns the units for a given value given the current inflation factor. - -##### Parameters - -| Name | Type | Description | -| :------ | :------ | :------ | -| `value` | `Value` | The value to convert to units. | - -##### Returns - -`Promise`\<`BigNumber`\> - -The units corresponding to `value` given the current inflation factor. - -**`Dev`** - -We don't compute the updated inflationFactor here because -we assume any function calling this will have updated the inflation factor. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L47) - ## Accessors ### address @@ -816,17 +710,17 @@ Returns current configuration parameters. #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:104](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L104) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L45) ___ ### getHumanReadableConfig -▸ **getHumanReadableConfig**(): `Promise`\<\{ `decimals`: `number` ; `inflationParameters`: \{ `factor`: `BigNumber` ; `factorLastUpdated`: `string` ; `rate`: `BigNumber` ; `updatePeriod`: `string` } ; `name`: `string` ; `symbol`: `string` }\> +▸ **getHumanReadableConfig**(): `Promise`\<[`StableTokenConfig`](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md)\> #### Returns -`Promise`\<\{ `decimals`: `number` ; `inflationParameters`: \{ `factor`: `BigNumber` ; `factorLastUpdated`: `string` ; `rate`: `BigNumber` ; `updatePeriod`: `string` } ; `name`: `string` ; `symbol`: `string` }\> +`Promise`\<[`StableTokenConfig`](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md)\> StableTokenConfig object @@ -836,25 +730,7 @@ Returns human readable configuration of the stabletoken contract #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L123) - -___ - -### getInflationParameters - -▸ **getInflationParameters**(): `Promise`\<[`InflationParameters`](../interfaces/wrappers_StableTokenWrapper.InflationParameters.md)\> - -Querying the inflation parameters. - -#### Returns - -`Promise`\<[`InflationParameters`](../interfaces/wrappers_StableTokenWrapper.InflationParameters.md)\> - -Inflation rate, inflation factor, inflation update period and the last time factor was updated. - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:91](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L91) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L58) ___ diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.InflationParameters.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.InflationParameters.md deleted file mode 100644 index 605dfe450..000000000 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.InflationParameters.md +++ /dev/null @@ -1,54 +0,0 @@ -[@celo/contractkit](../README.md) / [Exports](../modules.md) / [wrappers/StableTokenWrapper](../modules/wrappers_StableTokenWrapper.md) / InflationParameters - -# Interface: InflationParameters - -[wrappers/StableTokenWrapper](../modules/wrappers_StableTokenWrapper.md).InflationParameters - -## Table of contents - -### Properties - -- [factor](wrappers_StableTokenWrapper.InflationParameters.md#factor) -- [factorLastUpdated](wrappers_StableTokenWrapper.InflationParameters.md#factorlastupdated) -- [rate](wrappers_StableTokenWrapper.InflationParameters.md#rate) -- [updatePeriod](wrappers_StableTokenWrapper.InflationParameters.md#updateperiod) - -## Properties - -### factor - -• **factor**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L18) - -___ - -### factorLastUpdated - -• **factorLastUpdated**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L20) - -___ - -### rate - -• **rate**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L17) - -___ - -### updatePeriod - -• **updatePeriod**: `BigNumber` - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L19) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md index 4c5bed134..4ea190a95 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md @@ -9,7 +9,6 @@ ### Properties - [decimals](wrappers_StableTokenWrapper.StableTokenConfig.md#decimals) -- [inflationParameters](wrappers_StableTokenWrapper.StableTokenConfig.md#inflationparameters) - [name](wrappers_StableTokenWrapper.StableTokenConfig.md#name) - [symbol](wrappers_StableTokenWrapper.StableTokenConfig.md#symbol) @@ -21,17 +20,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:24](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L24) - -___ - -### inflationParameters - -• **inflationParameters**: [`InflationParameters`](wrappers_StableTokenWrapper.InflationParameters.md) - -#### Defined in - -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L27) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:6](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L6) ___ @@ -41,7 +30,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L25) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:7](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L7) ___ @@ -51,4 +40,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L26) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:8](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L8) diff --git a/packages/docs/sdk/docs/contractkit/modules/wrappers_StableTokenWrapper.md b/packages/docs/sdk/docs/contractkit/modules/wrappers_StableTokenWrapper.md index ae442f75d..da2800b9e 100644 --- a/packages/docs/sdk/docs/contractkit/modules/wrappers_StableTokenWrapper.md +++ b/packages/docs/sdk/docs/contractkit/modules/wrappers_StableTokenWrapper.md @@ -10,7 +10,6 @@ ### Interfaces -- [InflationParameters](../interfaces/wrappers_StableTokenWrapper.InflationParameters.md) - [StableTokenConfig](../interfaces/wrappers_StableTokenWrapper.StableTokenConfig.md) ### Type Aliases @@ -25,4 +24,4 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L139) +[packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts#L64) diff --git a/packages/sdk/contractkit/package.json b/packages/sdk/contractkit/package.json index 882d3928d..09f30d788 100644 --- a/packages/sdk/contractkit/package.json +++ b/packages/sdk/contractkit/package.json @@ -15,9 +15,9 @@ "contractkit" ], "scripts": { - "build:ts": "tsc -b .", - "build": "tsc -b .", - "clean": "tsc -b . --clean", + "build:ts": "yarn run --top-level tsc -b .", + "build": "yarn run --top-level tsc -b .", + "clean": "yarn run --top-level tsc -b . --clean", "prepublishOnly": "yarn build", "docs": "yarn run --top-level typedoc", "test": "yarn run --top-level jest --runInBand --forceExit", diff --git a/packages/sdk/contractkit/src/kit.ts b/packages/sdk/contractkit/src/kit.ts index 50df245d5..548117d70 100644 --- a/packages/sdk/contractkit/src/kit.ts +++ b/packages/sdk/contractkit/src/kit.ts @@ -179,7 +179,6 @@ export class ContractKit { configArray.forEach((config, index) => (configMap[configContracts[index]] = config)) return { - stableTokens: await this.celoTokens.getStablesConfigs(humanReadable), ...configMap, } } diff --git a/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts b/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts index bb0a0f76d..f0765d53a 100644 --- a/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts +++ b/packages/sdk/contractkit/src/wrappers/StableTokenWrapper.ts @@ -1,30 +1,11 @@ import { StableToken } from '@celo/abis/web3/mento/StableToken' -import { fromFixed } from '@celo/utils/lib/fixidity' -import BigNumber from 'bignumber.js' -import { - proxyCall, - proxySend, - secondsToDurationString, - stringIdentity, - tupleParser, - unixSecondsTimestampToDateString, - valueToBigNumber, - valueToString, -} from './BaseWrapper' +import { proxyCall, proxySend, stringIdentity, tupleParser, valueToString } from './BaseWrapper' import { CeloTokenWrapper } from './CeloTokenWrapper' -export interface InflationParameters { - rate: BigNumber - factor: BigNumber - updatePeriod: BigNumber - factorLastUpdated: BigNumber -} - export interface StableTokenConfig { decimals: number name: string symbol: string - inflationParameters: InflationParameters } /** @@ -37,30 +18,6 @@ export class StableTokenWrapper extends CeloTokenWrapper { */ owner = proxyCall(this.contract.methods.owner) - /** - * Returns the units for a given value given the current inflation factor. - * @param value The value to convert to units. - * @return The units corresponding to `value` given the current inflation factor. - * @dev We don't compute the updated inflationFactor here because - * we assume any function calling this will have updated the inflation factor. - */ - valueToUnits: (value: BigNumber.Value) => Promise = proxyCall( - this.contract.methods.valueToUnits, - tupleParser(valueToString), - valueToBigNumber - ) - - /** - * Returns the value of a given number of units given the current inflation factor. - * @param units The units to convert to value. - * @return The value corresponding to `units` given the current inflation factor. - */ - unitsToValue: (units: BigNumber.Value) => Promise = proxyCall( - this.contract.methods.unitsToValue, - tupleParser(valueToString), - valueToBigNumber - ) - /** * Increases the allowance of another user. * @param spender The address which is being approved to spend StableToken. @@ -82,37 +39,15 @@ export class StableTokenWrapper extends CeloTokenWrapper { mint = proxySend(this.connection, this.contract.methods.mint) burn = proxySend(this.connection, this.contract.methods.burn) - setInflationParameters = proxySend(this.connection, this.contract.methods.setInflationParameters) - - /** - * Querying the inflation parameters. - * @returns Inflation rate, inflation factor, inflation update period and the last time factor was updated. - */ - async getInflationParameters(): Promise { - const res = await this.contract.methods.getInflationParameters().call() - return { - rate: fromFixed(valueToBigNumber(res[0])), - factor: fromFixed(valueToBigNumber(res[1])), - updatePeriod: valueToBigNumber(res[2]), - factorLastUpdated: valueToBigNumber(res[3]), - } - } - /** * Returns current configuration parameters. */ async getConfig(): Promise { - const res = await Promise.all([ - this.name(), - this.symbol(), - this.decimals(), - this.getInflationParameters(), - ]) + const res = await Promise.all([this.name(), this.symbol(), this.decimals()]) return { name: res[0], symbol: res[1], decimals: res[2], - inflationParameters: res[3], } } @@ -122,17 +57,7 @@ export class StableTokenWrapper extends CeloTokenWrapper { */ async getHumanReadableConfig() { const config = await this.getConfig() - const inflationParameters = { - ...config.inflationParameters, - updatePeriod: secondsToDurationString(config.inflationParameters.updatePeriod), - factorLastUpdated: unixSecondsTimestampToDateString( - config.inflationParameters.factorLastUpdated - ), - } - return { - ...config, - inflationParameters, - } + return config } } From 08b0d6a18b73b01c162f6ba4f97d73f3e3708160 Mon Sep 17 00:00:00 2001 From: Arthur Gousset <46296830+arthurgousset@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:04:15 +0000 Subject: [PATCH 3/9] USDC related changes (#151) * chore(connection): updates docstring for `defaultFeeCurrency` ERC20 address should be whitelisted, but this is not checked or enforced. * refactor(kit): updates `setFeeCurrency` - becomes synchronous call - accepts `string` instead of `CeloTokenContract` * chore(setFeeCurrency): adds hex type and address validation Does NOT validate it's a whitelisted fee currency, but asserts it's a valid hexadecimal address. * nit(connect): adds feeCurrency type todo * chore(kit): adds error handling in `setFeeCurrency` I checked how errors are handled in other places. For example: https://github.com/celo-org/developer-tooling/blob/319d00d54569b421dc994cb7848b7c96c1b524bf/packages/sdk/base/src/contacts.ts#L15 * nit(contrackit): adds TODO in README code example * chore(kit): adds `throws` docstring in `setFeeCurrency` For better developer experience * nit(contrackit): adds another TODO in README code example * nit(cli): adds TODO related to `setFeeCurrency` * nit(connect): adds TODO related to hex address typing * chore(kit): uses `isAddress` instead of `isHexString` - web3js > `isAddress` - @celo/base > `isHexString` * chore(cli): automatic linting * nit(CONTRIBUTING): fixes incorrect hyperlink * chore(cli): adds TODOs re fee currencies * chore(cli): adds pseudo-code to fetch fee currency whitelist on-chain * chore(contractkit): adds TODO in README * chore(cli): implements `getGasOptions` helper function Untested, not sure this works as expected. * chore(cli): adds TODO notes on `gasOptions` * test(cli): adds test for `getGasOptions` helper function * nit(README): fixes title To be consistent with other READMEs, which use the package name as title * test(helpers): fixes bug that caused test to fail Passes as expected now. * chore(cli): adds TODO * chore(helpers): removes `return await` In favour of `return ... as Promise<..>` (which is the same as `return await ...`) Also renames the function for better readability * chore(cli): adds TODOs and updates example * chore(cli): adds incomplete/WIP changes Committing my current work in progress, before handing over to Nico * feat: change feeCurrency to be a StrongAddress is most places * chore: regenerate docs * chore: upgrade celo abis cr11 * fix: only throw if the flag has been passed and the value is undefined * fix: celocli tests * fix: add feecurency whitelisted currencies * test: add wrong feeCurrency test * test: add failing tests * fix: gas estimation when submitting a tx * fix: test * fix: proper gas/value check * refactor: test displays the faulty value * chore: regenerate docs * fix: rollback to celo-legacy tx * chore: regenerate docs * fix: revert some unwanted chaanges * fix: remove CELO from the whitelisted currencies * refactor: Address->StrongAddress * fix: tests failing due to StrongAddress typings * feat(BREAKING): change default behaviour of transfer commands to defaults to eip1559 if no --gasCurrency flag was passed * fix: StrongAddress * fix: type * chore: regenerate docs * fix: getting gas balance * fix: ElectionActivate tests * chore: regenerate docs * feat: add FeeCurrencyWhitelist wrapper and refactor kit and cli to use it * await registerAccount() to pass all checks for "shows no pending votes" election:activate test * chore: remove pasted comments * chore: regenerate docs * fix: gasCurrency fallback * chore: remove comment * feat: handle adapted token in the whitelist * fix: prevent unecessary network call for every command * fix: ts-expect-error directive * chore: regenerate docs * chore: add changeset * fix: handle feeCurrency capitalization * fix: handle compatibility issues with config and gasCurrency * refactor: some PR review feedback addressed * fix: handle CELO as a gasCurrency * chore: add one changeset per package changed * test: test adapted tokens too * fix: handle CELO capitalization --------- Co-authored-by: Nicolas Brugneaux Co-authored-by: Leszek Stachowski Co-authored-by: Leszek Stachowski --- .changeset/chatty-planets-trade.md | 9 + .changeset/khaki-lies-wait.md | 9 + .changeset/proud-days-hunt.md | 7 + .changeset/rude-hornets-smell.md | 7 + .changeset/seven-carrots-cross.md | 7 + CONTRIBUTING.md | 2 +- packages/cli/README.md | 7 +- packages/cli/src/base.ts | 68 ++--- .../cli/src/commands/account/set-wallet.ts | 2 +- packages/cli/src/commands/config/set.ts | 28 +- .../src/commands/election/activate.test.ts | 16 +- .../cli/src/commands/election/activate.ts | 4 +- .../cli/src/commands/election/list.test.ts | 4 +- packages/cli/src/commands/election/list.ts | 4 +- .../src/commands/governance/approve.test.ts | 6 +- .../src/commands/governance/propose.test.ts | 6 +- .../src/commands/governance/upvote.test.ts | 6 +- .../cli/src/commands/governance/vote.test.ts | 6 +- .../commands/governance/votePartially.test.ts | 6 +- .../src/commands/governance/withdraw.test.ts | 6 +- .../src/commands/identity/get-attestations.ts | 3 +- .../cli/src/commands/lockedgold/delegate.ts | 9 +- packages/cli/src/commands/lockedgold/lock.ts | 6 +- .../commands/lockedgold/revoke-delegate.ts | 9 +- .../lockedgold/update-delegated-amount.ts | 10 +- .../src/commands/network/whitelist.test.ts | 51 ++++ .../cli/src/commands/network/whitelist.ts | 27 ++ .../src/commands/releasecelo/admin-revoke.ts | 3 +- .../releasecelo/transfer-dollars.test.ts | 4 - .../src/commands/releasecelo/withdraw.test.ts | 2 +- .../src/commands/reserve/transfergold.test.ts | 6 +- .../cli/src/commands/transfer/celo.test.ts | 74 ++++- packages/cli/src/commands/transfer/celo.ts | 4 +- .../cli/src/commands/transfer/dollars.test.ts | 4 - packages/cli/src/commands/transfer/erc20.ts | 4 +- .../cli/src/commands/transfer/euros.test.ts | 4 - .../reset-slashing-multiplier.ts | 3 +- packages/cli/src/transfer-stable-base.ts | 66 ++++- packages/cli/src/utils/command.ts | 22 +- packages/cli/src/utils/config.test.ts | 129 +++++++++ packages/cli/src/utils/config.ts | 84 +++++- .../docs/sdk/docs/base/modules/address.md | 24 +- .../classes/celo_provider.CeloProvider.md | 22 +- .../connect/classes/connection.Connection.md | 114 ++++---- .../connection.ConnectionOptions.md | 10 +- .../interfaces/types.CIP42TXProperties.md | 32 +-- .../interfaces/types.CIP64TXProperties.md | 28 +- .../connect/interfaces/types.CeloParams.md | 8 +- .../connect/interfaces/types.CeloTxObject.md | 12 +- .../interfaces/types.EIP1559TXProperties.md | 26 +- .../interfaces/types.EncodedTransaction.md | 4 +- .../docs/connect/interfaces/types.Error.md | 6 +- .../interfaces/types.FormattedCeloTx.md | 30 +- .../connect/interfaces/types.HttpProvider.md | 2 +- .../interfaces/types.JsonRpcPayload.md | 8 +- .../interfaces/types.JsonRpcResponse.md | 8 +- .../interfaces/types.LegacyTXProperties.md | 28 +- .../docs/connect/interfaces/types.Provider.md | 2 +- .../connect/interfaces/types.RLPEncodedTx.md | 6 +- .../sdk/docs/connect/modules/celo_provider.md | 2 +- .../sdk/docs/connect/modules/connection.md | 2 +- .../docs/sdk/docs/connect/modules/types.md | 20 +- packages/docs/sdk/docs/contractkit/README.md | 46 +-- .../address_registry.AddressRegistry.md | 8 +- .../classes/celo_tokens.CeloTokens.md | 8 +- .../classes/contract_cache.WrapperCache.md | 69 +++-- .../contractkit/classes/kit.ContractKit.md | 84 +++--- .../wrappers_Accounts.AccountsWrapper.md | 110 +++---- ...appers_Attestations.AttestationsWrapper.md | 4 +- .../wrappers_BaseSlasher.BaseSlasher.md | 4 +- .../wrappers_BaseWrapper.BaseWrapper.md | 6 +- ...perForGoverning.BaseWrapperForGoverning.md | 4 +- ...nParameters.BlockchainParametersWrapper.md | 4 +- ...ppers_CeloTokenWrapper.CeloTokenWrapper.md | 4 +- ...ningSlasher.DoubleSigningSlasherWrapper.md | 4 +- ..._DowntimeSlasher.DowntimeSlasherWrapper.md | 4 +- .../wrappers_Election.ElectionWrapper.md | 82 +++--- ...appers_EpochRewards.EpochRewardsWrapper.md | 4 +- .../wrappers_Erc20Wrapper.Erc20Wrapper.md | 4 +- .../classes/wrappers_Escrow.EscrowWrapper.md | 4 +- ...testations.FederatedAttestationsWrapper.md | 4 +- ...listWrapper.FeeCurrencyWhitelistWrapper.md | 271 ++++++++++++++++++ .../wrappers_FeeHandler.FeeHandlerWrapper.md | 4 +- .../wrappers_Freezer.FreezerWrapper.md | 4 +- ..._GasPriceMinimum.GasPriceMinimumWrapper.md | 4 +- ...ppers_GoldTokenWrapper.GoldTokenWrapper.md | 4 +- .../wrappers_Governance.GovernanceWrapper.md | 136 ++++----- .../wrappers_LockedGold.LockedGoldWrapper.md | 4 +- .../wrappers_MultiSig.MultiSigWrapper.md | 4 +- ...appers_OdisPayments.OdisPaymentsWrapper.md | 4 +- ...wrappers_ReleaseGold.ReleaseGoldWrapper.md | 132 ++++----- .../wrappers_Reserve.ReserveWrapper.md | 4 +- ...pers_SortedOracles.SortedOraclesWrapper.md | 4 +- ...s_StableTokenWrapper.StableTokenWrapper.md | 4 +- .../wrappers_Validators.ValidatorsWrapper.md | 16 +- .../wrappers_Governance.ProposalStage.md | 12 +- .../enums/wrappers_Governance.VoteValue.md | 8 +- .../interfaces/kit.NetworkConfig.md | 22 +- .../wrappers_Election.ElectableValidators.md | 4 +- .../wrappers_Election.ElectionConfig.md | 10 +- .../interfaces/wrappers_Election.GroupVote.md | 6 +- .../wrappers_Election.GroupVoterReward.md | 6 +- .../wrappers_Election.ValidatorGroupVote.md | 10 +- .../interfaces/wrappers_Election.Voter.md | 4 +- .../wrappers_Election.VoterReward.md | 8 +- .../wrappers_Governance.GovernanceConfig.md | 12 +- .../wrappers_Governance.HotfixRecord.md | 6 +- ...pers_Governance.ParticipationParameters.md | 8 +- .../wrappers_Governance.ProposalMetadata.md | 10 +- .../wrappers_Governance.ProposalRecord.md | 16 +- .../wrappers_Governance.UpvoteRecord.md | 4 +- .../wrappers_Governance.VoteRecord.md | 12 +- .../interfaces/wrappers_Governance.Voter.md | 6 +- .../interfaces/wrappers_Governance.Votes.md | 6 +- packages/docs/sdk/docs/contractkit/modules.md | 1 + .../contractkit/modules/contract_cache.md | 2 +- .../docs/sdk/docs/contractkit/modules/kit.md | 6 +- .../contractkit/modules/wrappers_Accounts.md | 2 +- .../contractkit/modules/wrappers_Election.md | 2 +- .../wrappers_FeeCurrencyWhitelistWrapper.md | 23 ++ .../modules/wrappers_Governance.md | 14 +- .../docs/keystores/modules/test_constants.md | 4 +- .../docs/sdk/docs/utils/modules/address.md | 24 +- packages/sdk/base/src/address.ts | 3 +- packages/sdk/connect/src/celo-provider.ts | 3 +- packages/sdk/connect/src/connection.ts | 31 +- packages/sdk/connect/src/types.ts | 3 +- .../sdk/connect/src/utils/formatter.test.ts | 8 +- .../src/utils/tx-params-normalizer.test.ts | 4 +- packages/sdk/contractkit/README.md | 50 ++-- .../sdk/contractkit/src/address-registry.ts | 8 +- .../sdk/contractkit/src/contract-cache.ts | 8 +- packages/sdk/contractkit/src/kit.test.ts | 76 ++++- packages/sdk/contractkit/src/kit.ts | 32 +-- .../contractkit/src/wrappers/Accounts.test.ts | 3 +- .../sdk/contractkit/src/wrappers/Accounts.ts | 31 +- .../src/wrappers/Attestations.test.ts | 5 +- .../contractkit/src/wrappers/BaseWrapper.ts | 6 +- .../sdk/contractkit/src/wrappers/Election.ts | 26 +- .../contractkit/src/wrappers/Escrow.test.ts | 5 +- .../wrappers/FederatedAttestations.test.ts | 9 +- .../wrappers/FeeCurrencyWhitelistWrapper.ts | 81 ++++++ .../src/wrappers/GoldToken.test.ts | 5 +- .../src/wrappers/Governance.test.ts | 8 +- .../contractkit/src/wrappers/Governance.ts | 5 +- .../src/wrappers/LockedGold.test.ts | 5 +- .../src/wrappers/OdisPayments.test.ts | 6 +- .../contractkit/src/wrappers/ReleaseGold.ts | 20 +- .../contractkit/src/wrappers/Reserve.test.ts | 9 +- .../contractkit/src/wrappers/SortedOracles.ts | 4 +- .../src/wrappers/StableToken.test.ts | 5 +- packages/sdk/utils/src/address.ts | 12 +- .../wallet-base/src/signing-utils.test.ts | 6 +- .../wallet-hsm-aws/src/aws-hsm-wallet.test.ts | 2 +- .../src/azure-hsm-wallet.test.ts | 4 +- .../wallet-hsm-gcp/src/gcp-hsm-wallet.test.ts | 2 +- .../wallet-ledger/src/ledger-wallet.test.ts | 13 +- .../wallet-local/src/local-wallet.test.ts | 6 +- .../wallets/wallet-rpc/src/rpc-wallet.test.ts | 2 +- 159 files changed, 1949 insertions(+), 985 deletions(-) create mode 100644 .changeset/chatty-planets-trade.md create mode 100644 .changeset/khaki-lies-wait.md create mode 100644 .changeset/proud-days-hunt.md create mode 100644 .changeset/rude-hornets-smell.md create mode 100644 .changeset/seven-carrots-cross.md create mode 100644 packages/cli/src/commands/network/whitelist.test.ts create mode 100644 packages/cli/src/commands/network/whitelist.ts create mode 100644 packages/cli/src/utils/config.test.ts create mode 100644 packages/docs/sdk/docs/contractkit/classes/wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md create mode 100644 packages/docs/sdk/docs/contractkit/modules/wrappers_FeeCurrencyWhitelistWrapper.md create mode 100644 packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts diff --git a/.changeset/chatty-planets-trade.md b/.changeset/chatty-planets-trade.md new file mode 100644 index 000000000..450740a26 --- /dev/null +++ b/.changeset/chatty-planets-trade.md @@ -0,0 +1,9 @@ +--- +'@celo/contractkit': major +--- + +The following changes are related to adding support for more fee currencies in the @celo packages. + +(BREAKING): `setFeeCurrency` changed to accept an address instead of previously accepting a StableToken +(CHANGED): all places referring to gasCurrencies have been changed from `string` to `StrongAddress` for safer types. This shouldn't impact you as you already should have been giving `0x${string}` in these places +(CHANGED): reinforced the types of most contract wrappers to use `StrongAddress` where appropriate diff --git a/.changeset/khaki-lies-wait.md b/.changeset/khaki-lies-wait.md new file mode 100644 index 000000000..1a62f853f --- /dev/null +++ b/.changeset/khaki-lies-wait.md @@ -0,0 +1,9 @@ +--- +'@celo/celocli': major +--- + +The following changes are related to adding support for more fee currencies in the @celo packages. + +(BREAKING): `--gasCurrency` changed to accept only whitelisted addresses or the string `CELO` instead of previously accepting a StableToken or 'auto' +(ADDED): `celocli network:whitelist` prints the whitelisted feeCurrencies +(ADDED): the cli will automagically convert the previous gasCurrency such as cEUR, cUSD, cREAL, CELO into its address if necessary diff --git a/.changeset/proud-days-hunt.md b/.changeset/proud-days-hunt.md new file mode 100644 index 000000000..06e24166a --- /dev/null +++ b/.changeset/proud-days-hunt.md @@ -0,0 +1,7 @@ +--- +'@celo/utils': patch +--- + +The following changes are related to adding support for more fee currencies in the @celo packages. + +(CHANGED): all places referring to gasCurrencies have been changed from `string` to `StrongAddress` for safer types. This shouldn't impact you as you already should have been giving `0x${string}` in these places diff --git a/.changeset/rude-hornets-smell.md b/.changeset/rude-hornets-smell.md new file mode 100644 index 000000000..05e744c8a --- /dev/null +++ b/.changeset/rude-hornets-smell.md @@ -0,0 +1,7 @@ +--- +'@celo/connect': patch +--- + +The following changes are related to adding support for more fee currencies in the @celo packages. + +(CHANGED): all places referring to gasCurrencies have been changed from `string` to `StrongAddress` for safer types. This shouldn't impact you as you already should have been giving `0x${string}` in these places diff --git a/.changeset/seven-carrots-cross.md b/.changeset/seven-carrots-cross.md new file mode 100644 index 000000000..0be5f15d6 --- /dev/null +++ b/.changeset/seven-carrots-cross.md @@ -0,0 +1,7 @@ +--- +'@celo/base': patch +--- + +The following changes are related to adding support for more fee currencies in the @celo packages. + +(CHANGED): all places referring to gasCurrencies have been changed from `string` to `StrongAddress` for safer types. This shouldn't impact you as you already should have been giving `0x${string}` in these places diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04d43d292..7f9cbc7a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ $ cd developer-tooling ### Installing Node.js We use [Node.js](https://nodejs.org/en/) to run the project locally. -You need to install the **Node.js version** specified in [.nvmrc](../.nvmrc). To do so, run: +You need to install the **Node.js version** specified in [.nvmrc](/.nvmrc). To do so, run: ```sh $ nvm install diff --git a/packages/cli/README.md b/packages/cli/README.md index 16dab7cbb..c0350c266 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1,4 +1,4 @@ -# celocli +# @celo/celocli Tool for interacting with the Celo Protocol. @@ -34,6 +34,11 @@ Please use GitHub to: > Please avoid messaging us via Slack, Telegram, or email. We are more likely to respond to you on > GitHub than if you message us anywhere else. We actively monitor GitHub, and will get back to you shortly 🌟 +### Documentation + +[Head to the documentation](https://docs.celo.org/) to read and learn more about the Celo +CLI. + ### Plugins Additional plugins can be installed which make the CLI experience smoother. Currently, `celocli` only supports installing plugins published on NPM within the `@celo/*` and `@clabs/*` scopes. diff --git a/packages/cli/src/base.ts b/packages/cli/src/base.ts index ac7044cd3..728bd5e28 100644 --- a/packages/cli/src/base.ts +++ b/packages/cli/src/base.ts @@ -1,6 +1,6 @@ +import { StrongAddress } from '@celo/base' import { ReadOnlyWallet } from '@celo/connect' -import { ContractKit, newKitFromWeb3, StableToken, Token } from '@celo/contractkit' -import { stableTokenInfos } from '@celo/contractkit/lib/celo-tokens' +import { ContractKit, newKitFromWeb3 } from '@celo/contractkit' import { AzureHSMWallet } from '@celo/wallet-hsm-azure' import { AddressValidation, newLedgerWalletWithSetup } from '@celo/wallet-ledger' import { LocalWallet } from '@celo/wallet-local' @@ -9,14 +9,9 @@ import { Command, Flags } from '@oclif/core' import chalk from 'chalk' import net from 'net' import Web3 from 'web3' +import { CustomFlags } from './utils/command' import { getGasCurrency, getNodeUrl } from './utils/config' -import { enumEntriesDupWithLowercase, requireNodeIsSynced } from './utils/helpers' -export const gasOptions = { - auto: 'auto', - Auto: 'auto', - ...enumEntriesDupWithLowercase(Object.entries(Token)), - ...enumEntriesDupWithLowercase(Object.entries(StableToken)), -} +import { requireNodeIsSynced } from './utils/helpers' export abstract class BaseCommand extends Command { static flags = { @@ -46,12 +41,11 @@ export abstract class BaseCommand extends Command { } }, }), - gasCurrency: Flags.option({ - options: Object.keys(gasOptions), + gasCurrency: CustomFlags.gasCurrency({ description: - "Use a specific gas currency for transaction fees (defaults to 'auto' which uses whatever feeCurrency is available)", + 'Use a specific gas currency for transaction fees (defaults to CELO if no gas currency is supplied)', hidden: true, - })(), + }), useLedger: Flags.boolean({ default: false, hidden: true, @@ -201,28 +195,34 @@ export abstract class BaseCommand extends Command { kit.defaultAccount = res.flags.from } - const gasCurrencyConfig = res.flags.gasCurrency - ? (gasOptions as any)[res.flags.gasCurrency] - : getGasCurrency(this.config.configDir) + const gasCurrencyFlag = (res.flags.gasCurrency ?? + (await getGasCurrency(this.config.configDir, kit))) as StrongAddress | 'CELO' | undefined + + if (gasCurrencyFlag && gasCurrencyFlag !== 'CELO') { + const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyWhitelist() + const validFeeCurrencies = await feeCurrencyWhitelist.getWhitelist() + + if ( + validFeeCurrencies.map((x) => x.toLocaleLowerCase()).includes(gasCurrencyFlag.toLowerCase()) + ) { + kit.setFeeCurrency(gasCurrencyFlag) + } else { + const pairs = ( + await feeCurrencyWhitelist.getFeeCurrencyInformation( + validFeeCurrencies as StrongAddress[] + ) + ).map( + ({ name, symbol, address, adaptedToken }) => + `${address} - ${name || 'unknown name'} (${symbol || 'N/A'})${ + adaptedToken ? ` (adapted token: ${adaptedToken})` : '' + }` + ) - const setStableTokenGas = async (stable: StableToken) => { - await kit.setFeeCurrency(stableTokenInfos[stable].contract) - } - if (Object.keys(StableToken).includes(gasCurrencyConfig)) { - await setStableTokenGas(StableToken[gasCurrencyConfig as keyof typeof StableToken]) - } else if (gasCurrencyConfig === gasOptions.auto && kit.defaultAccount) { - const balances = await kit.getTotalBalance(kit.defaultAccount) - if (balances.CELO!.isZero()) { - const stables = Object.entries(StableToken) - for (const stable of stables) { - const stableName = stable[0] - const stableToken = stable[1] - // has balance - if ((balances as any)[stableName] && !(balances as any)[stableName].isZero()) { - await setStableTokenGas(stableToken) - break - } - } + throw new Error( + `${gasCurrencyFlag} is not a valid fee currency. Available currencies:\n${pairs.join( + '\n' + )}` + ) } } } diff --git a/packages/cli/src/commands/account/set-wallet.ts b/packages/cli/src/commands/account/set-wallet.ts index 5cf4e3d6f..a5735d9ca 100644 --- a/packages/cli/src/commands/account/set-wallet.ts +++ b/packages/cli/src/commands/account/set-wallet.ts @@ -17,7 +17,7 @@ export default class SetWallet extends BaseCommand { }), signer: CustomFlags.address({ required: false, - default: '', + default: undefined, description: 'Address of the signer key to verify proof of possession.', }), } diff --git a/packages/cli/src/commands/config/set.ts b/packages/cli/src/commands/config/set.ts index 25217be10..25291b5e9 100644 --- a/packages/cli/src/commands/config/set.ts +++ b/packages/cli/src/commands/config/set.ts @@ -1,5 +1,5 @@ -import { BaseCommand, gasOptions } from '../../base' -import { readConfig, writeConfig } from '../../utils/config' +import { BaseCommand } from '../../base' +import { CeloConfig, readConfig, writeConfig } from '../../utils/config' export default class Set extends BaseCommand { static description = 'Configure running node information for propogating transactions to network' @@ -9,17 +9,12 @@ export default class Set extends BaseCommand { ...BaseCommand.flags.node, hidden: false, }, - gasCurrency: { - ...BaseCommand.flags.gasCurrency, - hidden: false, - }, } static examples = [ 'set --node ws://localhost:2500', 'set --node /geth.ipc', - 'set --gasCurrency cUSD', - 'set --gasCurrency CELO', + 'set --gasCurrency 0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1', ] requireSynced = false @@ -28,12 +23,15 @@ export default class Set extends BaseCommand { const res = await this.parse(Set) const curr = readConfig(this.config.configDir) const node = res.flags.node ?? curr.node - const gasCurrency = res.flags.gasCurrency - ? (gasOptions as any)[res.flags.gasCurrency as string] - : curr.gasCurrency - writeConfig(this.config.configDir, { - node, - gasCurrency, - }) + const gasCurrency = res.flags.gasCurrency ?? curr.gasCurrency + + await writeConfig( + this.config.configDir, + { + node, + gasCurrency, + } as CeloConfig, + await this.getKit() + ) } } diff --git a/packages/cli/src/commands/election/activate.test.ts b/packages/cli/src/commands/election/activate.test.ts index f42acb505..5c7aea697 100644 --- a/packages/cli/src/commands/election/activate.test.ts +++ b/packages/cli/src/commands/election/activate.test.ts @@ -11,7 +11,7 @@ import { voteForGroupFrom, } from '../../test-utils/chain-setup' import { stripAnsiCodes, testLocally } from '../../test-utils/cliUtils' -import Activate from './activate' +import ElectionActivate from './activate' process.env.NO_SYNCCHECK = 'true' @@ -21,7 +21,7 @@ testWithGanache('election:activate', (web3: Web3) => { }) it('fails when no flags are provided', async () => { - await expect(testLocally(Activate, [])).rejects.toThrow('Missing required flag from') + await expect(testLocally(ElectionActivate, [])).rejects.toThrow('Missing required flag from') }) it('shows no pending votes', async () => { @@ -29,9 +29,9 @@ testWithGanache('election:activate', (web3: Web3) => { const [userAddress] = await web3.eth.getAccounts() const writeMock = jest.spyOn(ux.write, 'stdout') - registerAccount(kit, userAddress) + await registerAccount(kit, userAddress) - await testLocally(Activate, ['--from', userAddress]) + await testLocally(ElectionActivate, ['--from', userAddress]) expect(writeMock.mock.calls).toMatchInlineSnapshot(` [ @@ -53,7 +53,7 @@ testWithGanache('election:activate', (web3: Web3) => { await registerAccountWithLockedGold(kit, userAddress) await voteForGroupFrom(kit, userAddress, groupAddress, new BigNumber(10)) - await testLocally(Activate, ['--from', userAddress]) + await testLocally(ElectionActivate, ['--from', userAddress]) expect(writeMock.mock.calls).toMatchInlineSnapshot(` [ @@ -83,7 +83,7 @@ testWithGanache('election:activate', (web3: Web3) => { new BigNumber(0) ) - await testLocally(Activate, ['--from', userAddress]) + await testLocally(ElectionActivate, ['--from', userAddress]) expect(writeMock.mock.calls).toMatchInlineSnapshot(`[]`) expect((await election.getVotesForGroupByAccount(userAddress, groupAddress)).active).toEqual( @@ -109,7 +109,7 @@ testWithGanache('election:activate', (web3: Web3) => { ) await Promise.all([ - testLocally(Activate, ['--from', userAddress, '--wait']), + testLocally(ElectionActivate, ['--from', userAddress, '--wait']), new Promise((resolve) => { // at least the amount the --wait flag waits in the check setTimeout(async () => { @@ -166,7 +166,7 @@ testWithGanache('election:activate', (web3: Web3) => { (await election.getVotesForGroupByAccount(otherUserAddress, groupAddress)).active ).toEqual(new BigNumber(0)) - await testLocally(Activate, ['--from', otherUserAddress, '--for', userAddress]) + await testLocally(ElectionActivate, ['--from', otherUserAddress, '--for', userAddress]) expect(writeMock.mock.calls).toMatchInlineSnapshot(`[]`) expect((await election.getVotesForGroupByAccount(userAddress, groupAddress)).active).toEqual( diff --git a/packages/cli/src/commands/election/activate.ts b/packages/cli/src/commands/election/activate.ts index 2d4d42304..8505a16f6 100644 --- a/packages/cli/src/commands/election/activate.ts +++ b/packages/cli/src/commands/election/activate.ts @@ -6,7 +6,7 @@ import { newCheckBuilder } from '../../utils/checks' import { displaySendTx } from '../../utils/cli' import { CustomFlags } from '../../utils/command' -export default class ElectionVote extends BaseCommand { +export default class ElectionActivate extends BaseCommand { static description = 'Activate pending votes in validator elections to begin earning rewards. To earn rewards as a voter, it is required to activate your pending votes at some point after the end of the epoch in which they were made.' @@ -31,7 +31,7 @@ export default class ElectionVote extends BaseCommand { async run() { const kit = await this.getKit() - const res = await this.parse(ElectionVote) + const res = await this.parse(ElectionActivate) const forAccount = res.flags.for ?? res.flags.from await newCheckBuilder(this, forAccount).isSignerOrAccount().runChecks() diff --git a/packages/cli/src/commands/election/list.test.ts b/packages/cli/src/commands/election/list.test.ts index 027c5c5b6..137fc0402 100644 --- a/packages/cli/src/commands/election/list.test.ts +++ b/packages/cli/src/commands/election/list.test.ts @@ -2,7 +2,7 @@ import { ElectionWrapper, ValidatorGroupVote } from '@celo/contractkit/lib/wrapp import { ux } from '@oclif/core' import BigNumber from 'bignumber.js' import { testLocally } from '../../test-utils/cliUtils' -import List from './list' +import ElectionList from './list' process.env.NO_SYNCCHECK = 'true' @@ -33,7 +33,7 @@ describe('election:list cmd', () => { const writeMock = jest.spyOn(ux.write, 'stdout') - await testLocally(List, ['--csv']) + await testLocally(ElectionList, ['--csv']) expect(getValidatorGroupsVotesMock).toHaveBeenCalled() expect(writeMock.mock.calls).toMatchInlineSnapshot(` diff --git a/packages/cli/src/commands/election/list.ts b/packages/cli/src/commands/election/list.ts index 89e3df770..2e21a33f9 100644 --- a/packages/cli/src/commands/election/list.ts +++ b/packages/cli/src/commands/election/list.ts @@ -2,7 +2,7 @@ import { ux } from '@oclif/core' import { BaseCommand } from '../../base' -export default class List extends BaseCommand { +export default class ElectionList extends BaseCommand { static description = 'Prints the list of validator groups, the number of votes they have received, the number of additional votes they are able to receive, and whether or not they are eligible to elect validators.' @@ -15,7 +15,7 @@ export default class List extends BaseCommand { async run() { const kit = await this.getKit() - const res = await this.parse(List) + const res = await this.parse(ElectionList) ux.action.start('Fetching validator group vote totals') const election = await kit.contracts.getElection() const groupVotes = await election.getValidatorGroupsVotes() diff --git a/packages/cli/src/commands/governance/approve.test.ts b/packages/cli/src/commands/governance/approve.test.ts index 18bc7e9a7..60fc52c73 100644 --- a/packages/cli/src/commands/governance/approve.test.ts +++ b/packages/cli/src/commands/governance/approve.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GovernanceWrapper } from '@celo/contractkit/lib/wrappers/Governance' import { NetworkConfig, testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' @@ -15,11 +15,11 @@ testWithGanache('governance:approve cmd', (web3: Web3) => { const kit = newKitFromWeb3(web3) const proposalID = '1' - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let governance: GovernanceWrapper beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() await governance diff --git a/packages/cli/src/commands/governance/propose.test.ts b/packages/cli/src/commands/governance/propose.test.ts index 43bc850d1..9300027e1 100644 --- a/packages/cli/src/commands/governance/propose.test.ts +++ b/packages/cli/src/commands/governance/propose.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GoldTokenWrapper } from '@celo/contractkit/lib/wrappers/GoldTokenWrapper' import { GovernanceWrapper } from '@celo/contractkit/lib/wrappers/Governance' @@ -144,10 +144,10 @@ testWithGanache('governance:propose cmd', (web3: Web3) => { const minDeposit = web3.utils.toWei(expConfig.minDeposit.toString(), 'ether') const kit = newKitFromWeb3(web3) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() goldToken = await kit.contracts.getGoldToken() diff --git a/packages/cli/src/commands/governance/upvote.test.ts b/packages/cli/src/commands/governance/upvote.test.ts index 758a05ed7..5ec8076a6 100644 --- a/packages/cli/src/commands/governance/upvote.test.ts +++ b/packages/cli/src/commands/governance/upvote.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GovernanceWrapper } from '@celo/contractkit/lib/wrappers/Governance' import { NetworkConfig, testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' @@ -25,11 +25,11 @@ testWithGanache('governance:upvote cmd', (web3: Web3) => { const proposalID6 = new BigNumber(6) const proposalID7 = new BigNumber(7) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let governance: GovernanceWrapper beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() const dequeueFrequency = (await governance.dequeueFrequency()).toNumber() diff --git a/packages/cli/src/commands/governance/vote.test.ts b/packages/cli/src/commands/governance/vote.test.ts index 7451a05f4..cc0f6cb41 100644 --- a/packages/cli/src/commands/governance/vote.test.ts +++ b/packages/cli/src/commands/governance/vote.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GovernanceWrapper } from '@celo/contractkit/lib/wrappers/Governance' import { NetworkConfig, testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' @@ -20,11 +20,11 @@ testWithGanache('governance:vote cmd', (web3: Web3) => { const kit = newKitFromWeb3(web3) const proposalID = new BigNumber(1) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let governance: GovernanceWrapper beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() await governance diff --git a/packages/cli/src/commands/governance/votePartially.test.ts b/packages/cli/src/commands/governance/votePartially.test.ts index ea5eda62e..d74ed9026 100644 --- a/packages/cli/src/commands/governance/votePartially.test.ts +++ b/packages/cli/src/commands/governance/votePartially.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GovernanceWrapper } from '@celo/contractkit/lib/wrappers/Governance' import { NetworkConfig, testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' @@ -20,11 +20,11 @@ testWithGanache('governance:vote-partially cmd', (web3: Web3) => { const kit = newKitFromWeb3(web3) const proposalID = new BigNumber(1) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let governance: GovernanceWrapper beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() await governance diff --git a/packages/cli/src/commands/governance/withdraw.test.ts b/packages/cli/src/commands/governance/withdraw.test.ts index c427bd93b..87ae714d0 100644 --- a/packages/cli/src/commands/governance/withdraw.test.ts +++ b/packages/cli/src/commands/governance/withdraw.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GovernanceWrapper, Proposal } from '@celo/contractkit/lib/wrappers/Governance' import { NetworkConfig, testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' @@ -16,11 +16,11 @@ testWithGanache('governance:withdraw', (web3: Web3) => { const minDeposit = web3.utils.toWei(expConfig.minDeposit.toString(), 'ether') const kit = newKitFromWeb3(web3) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let governance: GovernanceWrapper beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() console.log((await governance.lastDequeue()).toNumber()) diff --git a/packages/cli/src/commands/identity/get-attestations.ts b/packages/cli/src/commands/identity/get-attestations.ts index 9ab58aefb..223b752c0 100644 --- a/packages/cli/src/commands/identity/get-attestations.ts +++ b/packages/cli/src/commands/identity/get-attestations.ts @@ -3,6 +3,7 @@ import { OdisUtils } from '@celo/identity' import { AuthSigner, OdisContextName } from '@celo/identity/lib/odis/query' import { Flags } from '@oclif/core' import { BaseCommand } from '../../base' +import { CustomFlags } from '../../utils/command' export default class GetAttestations extends BaseCommand { static description = @@ -14,7 +15,7 @@ export default class GetAttestations extends BaseCommand { required: false, description: 'Phone number to check attestations for', }), - from: Flags.string({ + from: CustomFlags.address({ required: false, description: 'Account whose balance to use for querying ODIS for the pepper lookup', }), diff --git a/packages/cli/src/commands/lockedgold/delegate.ts b/packages/cli/src/commands/lockedgold/delegate.ts index ca7d4ac93..cdd7c2778 100644 --- a/packages/cli/src/commands/lockedgold/delegate.ts +++ b/packages/cli/src/commands/lockedgold/delegate.ts @@ -1,4 +1,3 @@ -import { Address } from '@celo/connect' import { toFixed } from '@celo/utils/lib/fixidity' import { Flags } from '@oclif/core' import BigNumber from 'bignumber.js' @@ -13,8 +12,8 @@ export default class Delegate extends BaseCommand { static flags = { ...BaseCommand.flags, - from: Flags.string({ ...CustomFlags.address, required: true }), - to: Flags.string({ ...CustomFlags.address, required: true }), + from: CustomFlags.address({ required: true }), + to: CustomFlags.address({ required: true }), percent: Flags.string({ ...LockedGoldArgs.valueArg, required: true, @@ -31,8 +30,8 @@ export default class Delegate extends BaseCommand { async run() { const kit = await this.getKit() const res = await this.parse(Delegate) - const address: Address = res.flags.from - const to: Address = res.flags.to + const address = res.flags.from + const to = res.flags.to kit.defaultAccount = address const percent = new BigNumber(res.flags.percent).div(100) diff --git a/packages/cli/src/commands/lockedgold/lock.ts b/packages/cli/src/commands/lockedgold/lock.ts index 049bf447d..bc6102db3 100644 --- a/packages/cli/src/commands/lockedgold/lock.ts +++ b/packages/cli/src/commands/lockedgold/lock.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { Flags } from '@oclif/core' import BigNumber from 'bignumber.js' import { BaseCommand } from '../../base' @@ -12,7 +12,7 @@ export default class Lock extends BaseCommand { static flags = { ...BaseCommand.flags, - from: Flags.string({ ...CustomFlags.address, required: true }), + from: CustomFlags.address({ required: true }), value: Flags.string({ ...LockedGoldArgs.valueArg, required: true }), } @@ -25,7 +25,7 @@ export default class Lock extends BaseCommand { async run() { const kit = await this.getKit() const res = await this.parse(Lock) - const address: Address = res.flags.from + const address = res.flags.from as StrongAddress kit.defaultAccount = address const value = new BigNumber(res.flags.value) diff --git a/packages/cli/src/commands/lockedgold/revoke-delegate.ts b/packages/cli/src/commands/lockedgold/revoke-delegate.ts index 15253cee7..bfb3c16ce 100644 --- a/packages/cli/src/commands/lockedgold/revoke-delegate.ts +++ b/packages/cli/src/commands/lockedgold/revoke-delegate.ts @@ -1,4 +1,3 @@ -import { Address } from '@celo/connect' import { toFixed } from '@celo/utils/lib/fixidity' import { Flags } from '@oclif/core' import BigNumber from 'bignumber.js' @@ -13,8 +12,8 @@ export default class RevokeDelegate extends BaseCommand { static flags = { ...BaseCommand.flags, - from: Flags.string({ ...CustomFlags.address, required: true }), - to: Flags.string({ ...CustomFlags.address, required: true }), + from: CustomFlags.address({ required: true }), + to: CustomFlags.address({ required: true }), percent: Flags.string({ ...LockedGoldArgs.valueArg, required: true, @@ -31,8 +30,8 @@ export default class RevokeDelegate extends BaseCommand { async run() { const kit = await this.getKit() const res = await this.parse(RevokeDelegate) - const address: Address = res.flags.from - const to: Address = res.flags.to + const address = res.flags.from + const to = res.flags.to kit.defaultAccount = address const percent = new BigNumber(res.flags.percent).div(100) diff --git a/packages/cli/src/commands/lockedgold/update-delegated-amount.ts b/packages/cli/src/commands/lockedgold/update-delegated-amount.ts index 6ad4c7e62..5c951350f 100644 --- a/packages/cli/src/commands/lockedgold/update-delegated-amount.ts +++ b/packages/cli/src/commands/lockedgold/update-delegated-amount.ts @@ -1,5 +1,3 @@ -import { Address } from '@celo/connect' -import { Flags } from '@oclif/core' import { BaseCommand } from '../../base' import { newCheckBuilder } from '../../utils/checks' import { displaySendTx } from '../../utils/cli' @@ -11,8 +9,8 @@ export default class UpdateDelegatedAmount extends BaseCommand { static flags = { ...BaseCommand.flags, - from: Flags.string({ ...CustomFlags.address, required: true }), - to: Flags.string({ ...CustomFlags.address, required: true }), + from: CustomFlags.address({ required: true }), + to: CustomFlags.address({ required: true }), } static args = {} @@ -24,8 +22,8 @@ export default class UpdateDelegatedAmount extends BaseCommand { async run() { const kit = await this.getKit() const res = await this.parse(UpdateDelegatedAmount) - const address: Address = res.flags.from - const to: Address = res.flags.to + const address = res.flags.from + const to = res.flags.to kit.defaultAccount = address diff --git a/packages/cli/src/commands/network/whitelist.test.ts b/packages/cli/src/commands/network/whitelist.test.ts new file mode 100644 index 000000000..4416a1fc6 --- /dev/null +++ b/packages/cli/src/commands/network/whitelist.test.ts @@ -0,0 +1,51 @@ +import { FeeCurrencyWhitelistWrapper } from '@celo/contractkit/lib/wrappers/FeeCurrencyWhitelistWrapper' +import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' +import { testLocally } from '../../test-utils/cliUtils' +import Whitelist from './whitelist' + +process.env.NO_SYNCCHECK = 'true' + +// Lots of commands, sometimes times out +jest.setTimeout(15000) + +const spy = jest.spyOn(console, 'log') + +beforeEach(() => { + spy.mockClear() +}) + +testWithGanache('network:whitelist cmd', () => { + test('can print the whitelist', async () => { + await testLocally(Whitelist, []) + expect(spy.mock.calls[0][0]).toMatchInlineSnapshot(` + "Available currencies: + 0x5315e44798395d4a952530d131249fE00f554565 - Celo Dollar (cUSD) + 0x965D352283a3C8A016b9BBbC9bf6306665d495E7 - Celo Brazilian Real (cREAL) + 0xdD66C23e07b4D6925b6089b5Fe6fc9E62941aFE8 - Celo Euro (cEUR)" + `) + }) + + test('handles adapted tokens too', async () => { + const mock = jest + .spyOn(FeeCurrencyWhitelistWrapper.prototype, 'getFeeCurrencyInformation') + .mockImplementation(() => + Promise.resolve([ + { + name: 'mock token', + symbol: 'MCK', + address: '0x123', + adaptedToken: '0x456', + }, + ]) + ) + + await testLocally(Whitelist, []) + + expect(spy.mock.calls[0][0]).toMatchInlineSnapshot(` + "Available currencies: + 0x123 - mock token (MCK) (adapted token: 0x456)" + `) + + mock.mockClear() + }) +}) diff --git a/packages/cli/src/commands/network/whitelist.ts b/packages/cli/src/commands/network/whitelist.ts new file mode 100644 index 000000000..6aa1349d5 --- /dev/null +++ b/packages/cli/src/commands/network/whitelist.ts @@ -0,0 +1,27 @@ +import { BaseCommand } from '../../base' + +export default class Whitelist extends BaseCommand { + static description = 'List the whitelisted fee currencies' + + static flags = { + ...BaseCommand.flags, + } + + static args = {} + + static examples = ['whitelist'] + + async run() { + const kit = await this.getKit() + + const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyWhitelist() + const validFeeCurrencies = await feeCurrencyWhitelist.getWhitelist() + const pairs = (await feeCurrencyWhitelist.getFeeCurrencyInformation(validFeeCurrencies)).map( + ({ name, symbol, address, adaptedToken }) => + `${address} - ${name || 'unknown name'} (${symbol || 'N/A'})${ + adaptedToken ? ` (adapted token: ${adaptedToken})` : '' + }` + ) + console.log(`Available currencies:\n${pairs.join('\n')}`) + } +} diff --git a/packages/cli/src/commands/releasecelo/admin-revoke.ts b/packages/cli/src/commands/releasecelo/admin-revoke.ts index feeba6511..e39d02ae3 100644 --- a/packages/cli/src/commands/releasecelo/admin-revoke.ts +++ b/packages/cli/src/commands/releasecelo/admin-revoke.ts @@ -1,5 +1,6 @@ import { Flags } from '@oclif/core' +import { StrongAddress } from '@celo/base' import prompts from 'prompts' import { displaySendTx, printValueMap } from '../../utils/cli' import { ReleaseGoldBaseCommand } from '../../utils/release-gold-base' @@ -55,7 +56,7 @@ export default class AdminRevoke extends ReleaseGoldBaseCommand { let voteSigner = await accounts.getVoteSigner(contractAddress) if (voteSigner !== contractAddress) { const password = 'bad_password' - voteSigner = await web3.eth.personal.newAccount(password) + voteSigner = (await web3.eth.personal.newAccount(password)) as StrongAddress await web3.eth.personal.unlockAccount(voteSigner, password, 1000) const pop = await accounts.generateProofOfKeyPossession(contractAddress, voteSigner) await displaySendTx( diff --git a/packages/cli/src/commands/releasecelo/transfer-dollars.test.ts b/packages/cli/src/commands/releasecelo/transfer-dollars.test.ts index 560101ce2..e2e554a60 100644 --- a/packages/cli/src/commands/releasecelo/transfer-dollars.test.ts +++ b/packages/cli/src/commands/releasecelo/transfer-dollars.test.ts @@ -40,8 +40,6 @@ testWithGanache('releasegold:transfer-dollars cmd', (web3: Web3) => { contractAddress, '--value', cUSDToTransfer, - '--gasCurrency', - 'CELO', ]) // RG cUSD balance should match the amount sent const contractBalance = await kit.getTotalBalance(contractAddress) @@ -54,8 +52,6 @@ testWithGanache('releasegold:transfer-dollars cmd', (web3: Web3) => { accounts[0], '--value', cUSDToTransfer, - '--gasCurrency', - 'CELO', ]) const balanceAfter = await kit.getTotalBalance(accounts[0]) expect(balanceBefore.cUSD).toEqual(balanceAfter.cUSD) diff --git a/packages/cli/src/commands/releasecelo/withdraw.test.ts b/packages/cli/src/commands/releasecelo/withdraw.test.ts index b25967cc9..f6d78e909 100644 --- a/packages/cli/src/commands/releasecelo/withdraw.test.ts +++ b/packages/cli/src/commands/releasecelo/withdraw.test.ts @@ -41,7 +41,7 @@ testWithGanache('releasegold:withdraw cmd', (web3: Web3) => { await testLocally(Withdraw, ['--contract', contractAddress, '--value', withdrawalAmount]) const balanceAfter = (await kit.getTotalBalance(beneficiary)).CELO! const difference = balanceAfter.minus(balanceBefore) - expect(difference).toEqBigNumber(new BigNumber(withdrawalAmount)) + expect(difference.toFixed()).toEqual(new BigNumber(withdrawalAmount).toFixed()) }) test("can't withdraw the whole balance if there is a cUSD balance", async () => { diff --git a/packages/cli/src/commands/reserve/transfergold.test.ts b/packages/cli/src/commands/reserve/transfergold.test.ts index 761488ffe..78179837e 100644 --- a/packages/cli/src/commands/reserve/transfergold.test.ts +++ b/packages/cli/src/commands/reserve/transfergold.test.ts @@ -1,4 +1,4 @@ -import { Address } from '@celo/connect' +import { StrongAddress } from '@celo/base' import { newKitFromWeb3 } from '@celo/contractkit' import { GoldTokenWrapper } from '@celo/contractkit/lib/wrappers/GoldTokenWrapper' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' @@ -13,11 +13,11 @@ testWithGanache('reserve:transfergold cmd', (web3: Web3) => { const transferAmt = new BigNumber(100000) const kit = newKitFromWeb3(web3) - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let goldToken: GoldTokenWrapper beforeEach(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] goldToken = await kit.contracts.getGoldToken() }) test('transferGold fails if spender not passed in', async () => { diff --git a/packages/cli/src/commands/transfer/celo.test.ts b/packages/cli/src/commands/transfer/celo.test.ts index 9731c79f4..218b6f9ee 100644 --- a/packages/cli/src/commands/transfer/celo.test.ts +++ b/packages/cli/src/commands/transfer/celo.test.ts @@ -1,5 +1,5 @@ import { COMPLIANT_ERROR_RESPONSE, SANCTIONED_ADDRESSES } from '@celo/compliance' -import { ContractKit, newKitFromWeb3 } from '@celo/contractkit' +import { ContractKit, StableToken, newKitFromWeb3 } from '@celo/contractkit' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import Web3 from 'web3' import { testLocally } from '../../test-utils/cliUtils' @@ -32,7 +32,7 @@ testWithGanache('transfer:celo cmd', (web3: Web3) => { '--value', amountToTransfer, '--gasCurrency', - 'cusd', + (await kit.contracts.getStableToken(StableToken.cUSD)).address, ]) // RG cUSD balance should match the amount sent const receiverBalance = await kit.getTotalBalance(accounts[1]) @@ -48,7 +48,7 @@ testWithGanache('transfer:celo cmd', (web3: Web3) => { '--value', amountToTransfer, '--gasCurrency', - 'cusd', + (await kit.contracts.getStableToken(StableToken.cUSD)).address, ]) const balanceAfter = await kit.getTotalBalance(accounts[0]) expect(balanceBefore.CELO).toEqual(balanceAfter.CELO) @@ -82,4 +82,72 @@ testWithGanache('transfer:celo cmd', (web3: Web3) => { ).rejects.toThrow() expect(spy).toHaveBeenCalledWith(expect.stringContaining(COMPLIANT_ERROR_RESPONSE)) }) + + test("should fail if the feeCurrency isn't correctly formatted", async () => { + const wrongFee = '0x123' + await expect( + testLocally(TransferCelo, [ + '--from', + accounts[0], + '--to', + accounts[1], + '--value', + '1', + '--gasCurrency', + wrongFee, + ]) + ).rejects.toThrowErrorMatchingInlineSnapshot(` + "Parsing --gasCurrency + 0x123 is not a valid address + See more help with --help" + `) + }) + + test("should NOT fail if the feeCurrency isn't the same capitalization as in the whitelist", async () => { + const balanceBefore = await kit.getTotalBalance(accounts[0]) + const receiverBalanceBefore = await kit.getTotalBalance(accounts[1]) + const amountToTransfer = '1' + await expect( + testLocally(TransferCelo, [ + '--from', + accounts[0], + '--to', + accounts[1], + '--value', + amountToTransfer, + '--gasCurrency', + (await kit.contracts.getStableToken(StableToken.cUSD)).address.toUpperCase(), + ]) + ).resolves.toBeUndefined() + + const balanceAfter = await kit.getTotalBalance(accounts[0]) + const receiverBalanceAfter = await kit.getTotalBalance(accounts[1]) + expect(receiverBalanceAfter.CELO!.toFixed()).toEqual( + receiverBalanceBefore.CELO!.plus(amountToTransfer).toFixed() + ) + expect(balanceAfter.CELO!.toFixed()).toEqual( + balanceBefore.CELO!.minus(amountToTransfer).toFixed() + ) + }) + + test("should fail if the feeCurrency isn't whitelisted", async () => { + const wrongFee = '0x1234567890123456789012345678901234567890' + await expect( + testLocally(TransferCelo, [ + '--from', + accounts[0], + '--to', + accounts[1], + '--value', + '1', + '--gasCurrency', + wrongFee, + ]) + ).rejects.toThrowErrorMatchingInlineSnapshot(` + "0x1234567890123456789012345678901234567890 is not a valid fee currency. Available currencies: + 0x5315e44798395d4a952530d131249fE00f554565 - Celo Dollar (cUSD) + 0x965D352283a3C8A016b9BBbC9bf6306665d495E7 - Celo Brazilian Real (cREAL) + 0xdD66C23e07b4D6925b6089b5Fe6fc9E62941aFE8 - Celo Euro (cEUR)" + `) + }) }) diff --git a/packages/cli/src/commands/transfer/celo.ts b/packages/cli/src/commands/transfer/celo.ts index 8b8d2ecd7..d2550032d 100644 --- a/packages/cli/src/commands/transfer/celo.ts +++ b/packages/cli/src/commands/transfer/celo.ts @@ -25,8 +25,8 @@ export default class TransferCelo extends BaseCommand { const kit = await this.getKit() const res = await this.parse(TransferCelo) - const from: string = res.flags.from - const to: string = res.flags.to + const from = res.flags.from + const to = res.flags.to const value = new BigNumber(res.flags.value) kit.defaultAccount = from diff --git a/packages/cli/src/commands/transfer/dollars.test.ts b/packages/cli/src/commands/transfer/dollars.test.ts index 552f6d80b..b80cccff7 100644 --- a/packages/cli/src/commands/transfer/dollars.test.ts +++ b/packages/cli/src/commands/transfer/dollars.test.ts @@ -31,8 +31,6 @@ testWithGanache('transfer:dollars cmd', (web3: Web3) => { accounts[1], '--value', amountToTransfer, - '--gasCurrency', - 'CELO', ]) // RG cUSD balance should match the amount sent const receiverBalance = await kit.getTotalBalance(accounts[1]) @@ -47,8 +45,6 @@ testWithGanache('transfer:dollars cmd', (web3: Web3) => { accounts[0], '--value', amountToTransfer, - '--gasCurrency', - 'CELO', ]) const balanceAfter = await kit.getTotalBalance(accounts[0]) expect(balanceBefore.cUSD).toEqual(balanceAfter.cUSD) diff --git a/packages/cli/src/commands/transfer/erc20.ts b/packages/cli/src/commands/transfer/erc20.ts index 95d98748f..efa322506 100644 --- a/packages/cli/src/commands/transfer/erc20.ts +++ b/packages/cli/src/commands/transfer/erc20.ts @@ -37,8 +37,8 @@ export default class TransferErc20 extends BaseCommand { const kit = await this.getKit() const res = await this.parse(TransferErc20) - const from: string = res.flags.from - const to: string = res.flags.to + const from = res.flags.from + const to = res.flags.to const value = new BigNumber(res.flags.value) kit.defaultAccount = from diff --git a/packages/cli/src/commands/transfer/euros.test.ts b/packages/cli/src/commands/transfer/euros.test.ts index f1090fb3a..e5beabd02 100644 --- a/packages/cli/src/commands/transfer/euros.test.ts +++ b/packages/cli/src/commands/transfer/euros.test.ts @@ -31,8 +31,6 @@ testWithGanache('transfer:euros cmd', (web3: Web3) => { accounts[1], '--value', amountToTransfer, - '--gasCurrency', - 'CELO', ]) // RG cEUR balance should match the amount sent const receiverBalance = await kit.getTotalBalance(accounts[1]) @@ -47,8 +45,6 @@ testWithGanache('transfer:euros cmd', (web3: Web3) => { accounts[0], '--value', amountToTransfer, - '--gasCurrency', - 'CELO', ]) const balanceAfter = await kit.getTotalBalance(accounts[0]) expect(balanceBefore.cEUR).toEqual(balanceAfter.cEUR) diff --git a/packages/cli/src/commands/validatorgroup/reset-slashing-multiplier.ts b/packages/cli/src/commands/validatorgroup/reset-slashing-multiplier.ts index 277959ab3..7f3697a12 100644 --- a/packages/cli/src/commands/validatorgroup/reset-slashing-multiplier.ts +++ b/packages/cli/src/commands/validatorgroup/reset-slashing-multiplier.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { BaseCommand } from '../../base' import { newCheckBuilder } from '../../utils/checks' import { displaySendTx } from '../../utils/cli' @@ -19,7 +20,7 @@ export default class ResetSlashingMultiplier extends BaseCommand { async run() { const kit = await this.getKit() const { args } = await this.parse(ResetSlashingMultiplier) - const address = args.arg1 as string + const address = args.arg1 as StrongAddress const validators = await kit.contracts.getValidators() kit.defaultAccount = address diff --git a/packages/cli/src/transfer-stable-base.ts b/packages/cli/src/transfer-stable-base.ts index 345e7c078..f15d4458f 100644 --- a/packages/cli/src/transfer-stable-base.ts +++ b/packages/cli/src/transfer-stable-base.ts @@ -1,5 +1,4 @@ import { StableToken } from '@celo/contractkit' -import { stableTokenInfos } from '@celo/contractkit/lib/celo-tokens' import { StableTokenWrapper } from '@celo/contractkit/lib/wrappers/StableTokenWrapper' import { Flags } from '@oclif/core' import BigNumber from 'bignumber.js' @@ -8,6 +7,28 @@ import { newCheckBuilder } from './utils/checks' import { displaySendTx, failWith } from './utils/cli' import { CustomFlags } from './utils/command' +const ERC20_MOCK_ABI = [ + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] as const + export abstract class TransferStableBase extends BaseCommand { static flags = { ...BaseCommand.flags, @@ -36,35 +57,54 @@ export abstract class TransferStableBase extends BaseCommand { } catch { failWith(`The ${this._stableCurrency} token was not deployed yet`) } - // If gasCurrency is not set, use the transferring token - if (!res.flags.gasCurrency) { - await kit.setFeeCurrency(stableTokenInfos[this._stableCurrency].contract) + + if (res.flags.gasCurrency) { + kit.connection.defaultFeeCurrency = res.flags.gasCurrency } + // If gasCurrency is not set, defaults to eip1559 tx + const params = res.flags.feeCurrency ? { feeCurrency: kit.connection.defaultFeeCurrency } : {} const tx = res.flags.comment ? stableToken.transferWithComment(to, value.toFixed(), res.flags.comment) : stableToken.transfer(to, value.toFixed()) + let gas: number + let gasPrice: string + let gasBalance: BigNumber + let valueBalance: BigNumber await newCheckBuilder(this) .hasEnoughStable(from, value, this._stableCurrency) .isNotSanctioned(from) .isNotSanctioned(to) - .addConditionalCheck( - `Account can afford transfer and gas paid in ${this._stableCurrency}`, - kit.connection.defaultFeeCurrency === stableToken.address, + .addCheck( + `Account can afford transfer in ${this._stableCurrency} and gas paid in ${ + res.flags.gasCurrency || 'CELO' + }`, async () => { - const [gas, gasPrice, balance] = await Promise.all([ - tx.txo.estimateGas({ feeCurrency: stableToken.address }), - kit.connection.gasPrice(stableToken.address), - stableToken.balanceOf(from), + ;[gas, gasPrice, gasBalance, valueBalance] = await Promise.all([ + tx.txo.estimateGas(params), + kit.connection.gasPrice(kit.connection.defaultFeeCurrency), + res.flags.gasCurrency + ? // @ts-expect-error abi typing is not 100% correct but works + new kit.web3.eth.Contract(ERC20_MOCK_ABI, res.flags.gasCurrency).methods + .balanceOf(from) + .call() + .then((x: string) => new BigNumber(x)) + : kit.contracts.getGoldToken().then((celo) => celo.balanceOf(from)), + kit.contracts + .getStableToken(this._stableCurrency!) + .then((token) => token.balanceOf(from)), ]) const gasValue = new BigNumber(gas).times(gasPrice as string) - return balance.gte(value.plus(gasValue)) + if (res.flags.gasCurrency) { + return gasBalance.gte(gasValue) && valueBalance.gte(value) + } + return valueBalance.gte(value.plus(gasValue)) }, `Cannot afford transfer with ${this._stableCurrency} gasCurrency; try reducing value slightly or using gasCurrency=CELO` ) .runChecks() - await displaySendTx(res.flags.comment ? 'transferWithComment' : 'transfer', tx) + await displaySendTx(res.flags.comment ? 'transferWithComment' : 'transfer', tx, params) } } diff --git a/packages/cli/src/utils/command.ts b/packages/cli/src/utils/command.ts index 74fbc0027..8bf3a75a2 100644 --- a/packages/cli/src/utils/command.ts +++ b/packages/cli/src/utils/command.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { URL_REGEX } from '@celo/base/lib/io' import { CeloContract, RegisteredContracts } from '@celo/contractkit' import { Interval } from '@celo/contractkit/lib/wrappers/DowntimeSlasher' @@ -40,9 +41,19 @@ const parseBlsProofOfPossession: ParseFn = async (input) => { const parseProofOfPossession: ParseFn = async (input) => { return parseBytes(input, POP_SIZE, `${input} is not a proof-of-possession`) } -const parseAddress: ParseFn = async (input) => { +const parseAddress: ParseFn = async (input) => { if (Web3.utils.isAddress(input)) { - return input + return input as StrongAddress + } else { + throw new CLIError(`${input} is not a valid address`) + } +} +const parseGasCurrency: ParseFn = async (input) => { + if (input.toUpperCase() === 'CELO') { + return 'CELO' + } + if (Web3.utils.isAddress(input)) { + return input as StrongAddress } else { throw new CLIError(`${input} is not a valid address`) } @@ -150,11 +161,16 @@ export const CustomFlags = { helpValue: '\'["0xb7ef0985bdb4f19460A29d9829aA1514B181C4CD", "0x47e172f6cfb6c7d01c1574fa3e2be7cc73269d95"]\'', }), - address: Flags.custom({ + address: Flags.custom({ parse: parseAddress, description: 'Account Address', helpValue: '0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d', }), + gasCurrency: Flags.custom({ + parse: parseGasCurrency, + description: 'A whitelisted feeCurrency or CELO to use native eip1559 transactions', + helpValue: '0', + }), ecdsaPublicKey: Flags.custom({ parse: parseEcdsaPublicKey, description: 'ECDSA Public Key', diff --git a/packages/cli/src/utils/config.test.ts b/packages/cli/src/utils/config.test.ts new file mode 100644 index 000000000..ce2e87bd4 --- /dev/null +++ b/packages/cli/src/utils/config.test.ts @@ -0,0 +1,129 @@ +import { StableToken, StrongAddress } from '@celo/base' +import { newKitFromWeb3 } from '@celo/contractkit' +import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' +import * as fs from 'fs-extra' +import { tmpdir } from 'os' +import { join } from 'path' +import { CeloConfig, LegacyCeloConfig, getGasCurrency, writeConfig } from './config' + +// NOTE: for some reason if I don't mock the whole module, jest fails +// to spy on outputJSONSync +jest.mock('fs-extra', () => ({ __esModule: true, ...jest.requireActual('fs-extra') })) + +const PATH = tmpdir() +const spy = jest.spyOn(fs, 'outputJSONSync') + +beforeEach(() => { + spy.mockClear() +}) + +testWithGanache('config', (web3) => { + const kit = newKitFromWeb3(web3) + describe('writeConfig', () => { + test('empty config', async () => { + writeConfig(PATH, {} as CeloConfig, kit) + + expect(spy).toHaveBeenCalledTimes(1) + expect(spy.mock.calls[0]).toHaveLength(2) + expect(spy.mock.calls[0][0]).toEqual(join(PATH, 'config.json')) + expect(spy.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "node": "http://localhost:8545", + } + `) + }) + test('node', async () => { + await writeConfig(PATH, { node: 'SOME_URL' }, kit) + expect(spy.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "node": "SOME_URL", + } + `) + }) + test('gasCurrency auto (legacy)', async () => { + await writeConfig(PATH, { gasCurrency: 'auto' } as LegacyCeloConfig, kit) + expect(spy.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "node": "http://localhost:8545", + } + `) + }) + test('gasCurrency StableToken (legacy)', async () => { + await writeConfig(PATH, { gasCurrency: 'cUSD' } as LegacyCeloConfig, kit) + expect(spy.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "gasCurrency": "0x5315e44798395d4a952530d131249fE00f554565", + "node": "http://localhost:8545", + } + `) + }) + test('gasCurrency CELO', async () => { + await writeConfig(PATH, { gasCurrency: 'CELO' } as LegacyCeloConfig, kit) + expect(spy.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "node": "http://localhost:8545", + } + `) + }) + test('gasCurrency badly formatted address', async () => { + await expect( + writeConfig(PATH, { gasCurrency: '0x123' as StrongAddress } as CeloConfig, kit) + ).rejects.toMatchInlineSnapshot(`[Error: Invalid address 0x123]`) + }) + test('gasCurrency wrong address', async () => { + await expect( + writeConfig( + PATH, + { + gasCurrency: '0x0000000000000000000000000000000000000000' as StrongAddress, + } as CeloConfig, + kit + ) + ).rejects.toMatchInlineSnapshot(` + [Error: 0x0000000000000000000000000000000000000000 is not a valid fee currency. Available currencies: + 0x5315e44798395d4a952530d131249fE00f554565 - Celo Dollar (cUSD) + 0x965D352283a3C8A016b9BBbC9bf6306665d495E7 - Celo Brazilian Real (cREAL) + 0xdD66C23e07b4D6925b6089b5Fe6fc9E62941aFE8 - Celo Euro (cEUR)] + `) + }) + + test('gasCurrency address', async () => { + await writeConfig( + PATH, + { + gasCurrency: (await kit.contracts.getStableToken(StableToken.cEUR)).address, + } as CeloConfig, + kit + ) + expect(spy.mock.calls[0][1]).toMatchInlineSnapshot(` + { + "gasCurrency": "0xdD66C23e07b4D6925b6089b5Fe6fc9E62941aFE8", + "node": "http://localhost:8545", + } + `) + }) + }) + + describe('getGasCurrency', () => { + test('empty', async () => { + fs.outputJSONSync(join(PATH, 'config.json'), {}) + expect(await getGasCurrency(PATH, kit)).toBe(undefined) + }) + test('CELO', async () => { + fs.outputJSONSync(join(PATH, 'config.json'), { getGasCurrency: 'CELO' }) + expect(await getGasCurrency(PATH, kit)).toBe(undefined) + }) + test('address', async () => { + fs.outputJSONSync(join(PATH, 'config.json'), { + gasCurrency: '0x0000000000000000000000000000000000000000', + }) + expect(await getGasCurrency(PATH, kit)).toBe('0x0000000000000000000000000000000000000000') + }) + test('legacy', async () => { + fs.outputJSONSync(join(PATH, 'config.json'), { gasCurrency: 'cEUR' }) + expect(await getGasCurrency(PATH, kit)).toBe( + (await kit.contracts.getStableToken(StableToken.cEUR)).address + ) + }) + }) +}) diff --git a/packages/cli/src/utils/config.ts b/packages/cli/src/utils/config.ts index da284cf73..74808f265 100644 --- a/packages/cli/src/utils/config.ts +++ b/packages/cli/src/utils/config.ts @@ -1,15 +1,23 @@ +import { StableToken, StrongAddress, Token } from '@celo/base' +import { ContractKit } from '@celo/contractkit' +import { isValidAddress } from '@celo/utils/lib/address' import * as fs from 'fs-extra' import * as path from 'path' -import { gasOptions } from '../base' export interface CeloConfig { node: string - gasCurrency: string + gasCurrency?: StrongAddress +} + +// This interface handles compatibility with previous version of the CLI where +// gas currency was passed differently +export interface LegacyCeloConfig { + node: string + gasCurrency?: StableToken | Token | 'auto' } export const defaultConfig: CeloConfig = { node: 'http://localhost:8545', - gasCurrency: 'auto', } const configFile = 'config.json' @@ -35,13 +43,71 @@ export function getNodeUrl(configDir: string): string { return readConfig(configDir).node } -export function getGasCurrency(configDir: string): string { - return readConfig(configDir).gasCurrency +export async function getGasCurrency( + configDir: string, + kit: ContractKit +): Promise { + const config = readConfig(configDir) as CeloConfig | LegacyCeloConfig + const { gasCurrency } = config + + if (!gasCurrency) return + if (isValidAddress(gasCurrency)) return gasCurrency + + // Force rewriting the config with Token->Address conversion + await writeConfig(configDir, config, kit) + + return getGasCurrency(configDir, kit) } -export function writeConfig(configDir: string, configObj: CeloConfig) { - if (!Object.keys(gasOptions).includes(configObj.gasCurrency)) { - throw new Error('Invalid gas option') +export async function writeConfig( + configDir: string, + configObj: CeloConfig | LegacyCeloConfig, + kit: ContractKit +) { + const config = { ...defaultConfig, ...configObj } + const { gasCurrency } = config + + if (gasCurrency) { + if (gasCurrency.startsWith('0x')) { + if (isValidAddress(gasCurrency)) { + const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyWhitelist() + const validFeeCurrencies = await feeCurrencyWhitelist.getWhitelist() + + if (!validFeeCurrencies.includes(gasCurrency)) { + const pairs = ( + await feeCurrencyWhitelist.getFeeCurrencyInformation(validFeeCurrencies) + ).map( + ({ name, symbol, address, adaptedToken }) => + `${address} - ${name || 'unknown name'} (${symbol || 'N/A'})${ + adaptedToken ? ` (adapted token: ${adaptedToken})` : '' + }` + ) + throw new Error( + `${config.gasCurrency} is not a valid fee currency. Available currencies:\n${pairs.join( + '\n' + )}` + ) + } + } else { + throw new Error(`Invalid address ${gasCurrency}`) + } + } else { + // NOTE: This handles a legacy version of celocli where the gasCurrency + // was passed as cEUR, cUSD, or cREAL + switch (gasCurrency) { + case 'auto': + case Token.CELO: + delete config.gasCurrency + break + case StableToken.cEUR: + case StableToken.cUSD: + case StableToken.cREAL: + const { address } = await kit.contracts.getStableToken(gasCurrency as StableToken) + ;(config as CeloConfig).gasCurrency = address + break + } + } } - fs.outputJSONSync(configPath(configDir), configObj) + + fs.outputJSONSync(configPath(configDir), config) } diff --git a/packages/docs/sdk/docs/base/modules/address.md b/packages/docs/sdk/docs/base/modules/address.md index ec98cd90a..7f2ae4adc 100644 --- a/packages/docs/sdk/docs/base/modules/address.md +++ b/packages/docs/sdk/docs/base/modules/address.md @@ -57,7 +57,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:31](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L31) +[packages/sdk/base/src/address.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L32) ## Functions @@ -77,7 +77,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L29) +[packages/sdk/base/src/address.ts:30](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L30) ___ @@ -97,7 +97,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L17) +[packages/sdk/base/src/address.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L18) ___ @@ -139,7 +139,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L33) +[packages/sdk/base/src/address.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L34) ___ @@ -159,7 +159,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L22) +[packages/sdk/base/src/address.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L23) ___ @@ -179,7 +179,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L27) +[packages/sdk/base/src/address.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L28) ___ @@ -199,7 +199,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L25) +[packages/sdk/base/src/address.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L26) ___ @@ -248,7 +248,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L70) +[packages/sdk/base/src/address.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L71) ___ @@ -269,7 +269,7 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:37](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L37) +[packages/sdk/base/src/address.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L38) ___ @@ -295,7 +295,7 @@ ___ ### normalizeAddressWith0x -▸ **normalizeAddressWith0x**(`a`): `string` +▸ **normalizeAddressWith0x**(`a`): \`0x$\{string}\` #### Parameters @@ -305,7 +305,7 @@ ___ #### Returns -`string` +\`0x$\{string}\` #### Defined in @@ -329,4 +329,4 @@ ___ #### Defined in -[packages/sdk/base/src/address.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L15) +[packages/sdk/base/src/address.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L16) diff --git a/packages/docs/sdk/docs/connect/classes/celo_provider.CeloProvider.md b/packages/docs/sdk/docs/connect/classes/celo_provider.CeloProvider.md index 6dbe9417f..2f313f62a 100644 --- a/packages/docs/sdk/docs/connect/classes/celo_provider.CeloProvider.md +++ b/packages/docs/sdk/docs/connect/classes/celo_provider.CeloProvider.md @@ -52,7 +52,7 @@ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L53) +[packages/sdk/connect/src/celo-provider.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L54) ## Properties @@ -62,7 +62,7 @@ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L53) +[packages/sdk/connect/src/celo-provider.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L54) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L53) +[packages/sdk/connect/src/celo-provider.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L54) ## Accessors @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:260](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L260) +[packages/sdk/connect/src/celo-provider.ts:261](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L261) ## Methods @@ -106,7 +106,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L58) +[packages/sdk/connect/src/celo-provider.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L59) ___ @@ -120,7 +120,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L68) +[packages/sdk/connect/src/celo-provider.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L69) ___ @@ -140,7 +140,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L72) +[packages/sdk/connect/src/celo-provider.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L73) ___ @@ -160,7 +160,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L63) +[packages/sdk/connect/src/celo-provider.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L64) ___ @@ -187,7 +187,7 @@ Send method as expected by web3.js #### Defined in -[packages/sdk/connect/src/celo-provider.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L79) +[packages/sdk/connect/src/celo-provider.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L80) ___ @@ -201,7 +201,7 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L158) +[packages/sdk/connect/src/celo-provider.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L159) ___ @@ -215,4 +215,4 @@ ___ #### Defined in -[packages/sdk/connect/src/celo-provider.ts:264](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L264) +[packages/sdk/connect/src/celo-provider.ts:265](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L265) diff --git a/packages/docs/sdk/docs/connect/classes/connection.Connection.md b/packages/docs/sdk/docs/connect/classes/connection.Connection.md index d603d2346..b9f05701c 100644 --- a/packages/docs/sdk/docs/connect/classes/connection.Connection.md +++ b/packages/docs/sdk/docs/connect/classes/connection.Connection.md @@ -92,7 +92,7 @@ handleRevert sets handleRevert on the web3.eth instance passed in #### Defined in -[packages/sdk/connect/src/connection.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L62) +[packages/sdk/connect/src/connection.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L63) ## Properties @@ -102,7 +102,7 @@ handleRevert sets handleRevert on the web3.eth instance passed in #### Defined in -[packages/sdk/connect/src/connection.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L59) +[packages/sdk/connect/src/connection.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L60) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L60) +[packages/sdk/connect/src/connection.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L61) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L62) +[packages/sdk/connect/src/connection.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L63) ___ @@ -132,23 +132,23 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L62) +[packages/sdk/connect/src/connection.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L63) ## Accessors ### defaultAccount -• `get` **defaultAccount**(): `undefined` \| `string` +• `get` **defaultAccount**(): `undefined` \| \`0x$\{string}\` Default account for generated transactions (eg. tx.from) #### Returns -`undefined` \| `string` +`undefined` \| \`0x$\{string}\` #### Defined in -[packages/sdk/connect/src/connection.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L114) +[packages/sdk/connect/src/connection.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L115) • `set` **defaultAccount**(`address`): `void` @@ -158,7 +158,7 @@ Set default account for generated transactions (eg. tx.from ) | Name | Type | | :------ | :------ | -| `address` | `undefined` \| `string` | +| `address` | `undefined` \| \`0x$\{string}\` | #### Returns @@ -166,26 +166,26 @@ Set default account for generated transactions (eg. tx.from ) #### Defined in -[packages/sdk/connect/src/connection.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L106) +[packages/sdk/connect/src/connection.ts:107](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L107) ___ ### defaultFeeCurrency -• `get` **defaultFeeCurrency**(): `undefined` \| `string` +• `get` **defaultFeeCurrency**(): `undefined` \| \`0x$\{string}\` #### Returns -`undefined` \| `string` +`undefined` \| \`0x$\{string}\` #### Defined in -[packages/sdk/connect/src/connection.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L138) +[packages/sdk/connect/src/connection.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L139) • `set` **defaultFeeCurrency**(`address`): `void` Set the ERC20 address for the token to use to pay for transaction fees. -The ERC20 must be whitelisted for gas. +The ERC20 address SHOULD be whitelisted for gas, but this is not checked or enforced. Set to `null` to use CELO @@ -193,7 +193,7 @@ Set to `null` to use CELO | Name | Type | Description | | :------ | :------ | :------ | -| `address` | `undefined` \| `string` | ERC20 address | +| `address` | `undefined` \| \`0x$\{string}\` | ERC20 address | #### Returns @@ -201,7 +201,7 @@ Set to `null` to use CELO #### Defined in -[packages/sdk/connect/src/connection.ts:134](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L134) +[packages/sdk/connect/src/connection.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L135) ___ @@ -215,7 +215,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L122) +[packages/sdk/connect/src/connection.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L123) • `set` **defaultGasInflationFactor**(`factor`): `void` @@ -231,7 +231,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L118) +[packages/sdk/connect/src/connection.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L119) ## Methods @@ -251,7 +251,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:146](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L146) +[packages/sdk/connect/src/connection.ts:147](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L147) ___ @@ -265,7 +265,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:404](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L404) +[packages/sdk/connect/src/connection.ts:407](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L407) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:426](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L426) +[packages/sdk/connect/src/connection.ts:429](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L429) ___ @@ -301,7 +301,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:356](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L356) +[packages/sdk/connect/src/connection.ts:359](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L359) ___ @@ -323,7 +323,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:387](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L387) +[packages/sdk/connect/src/connection.ts:390](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L390) ___ @@ -343,7 +343,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:432](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L432) +[packages/sdk/connect/src/connection.ts:435](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L435) ___ @@ -357,21 +357,21 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:383](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L383) +[packages/sdk/connect/src/connection.ts:386](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L386) ___ ### getAccounts -▸ **getAccounts**(): `Promise`\<`string`[]\> +▸ **getAccounts**(): `Promise`\<\`0x$\{string}\`[]\> #### Returns -`Promise`\<`string`[]\> +`Promise`\<\`0x$\{string}\`[]\> #### Defined in -[packages/sdk/connect/src/connection.ts:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L179) +[packages/sdk/connect/src/connection.ts:182](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L182) ___ @@ -392,7 +392,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:475](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L475) +[packages/sdk/connect/src/connection.ts:478](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L478) ___ @@ -413,7 +413,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:450](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L450) +[packages/sdk/connect/src/connection.ts:453](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L453) ___ @@ -433,7 +433,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:463](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L463) +[packages/sdk/connect/src/connection.ts:466](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L466) ___ @@ -447,35 +447,35 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:441](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L441) +[packages/sdk/connect/src/connection.ts:444](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L444) ___ ### getLocalAccounts -▸ **getLocalAccounts**(): `string`[] +▸ **getLocalAccounts**(): \`0x$\{string}\`[] #### Returns -`string`[] +\`0x$\{string}\`[] #### Defined in -[packages/sdk/connect/src/connection.ts:175](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L175) +[packages/sdk/connect/src/connection.ts:176](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L176) ___ ### getNodeAccounts -▸ **getNodeAccounts**(): `Promise`\<`string`[]\> +▸ **getNodeAccounts**(): `Promise`\<\`0x$\{string}\`[]\> #### Returns -`Promise`\<`string`[]\> +`Promise`\<\`0x$\{string}\`[]\> #### Defined in -[packages/sdk/connect/src/connection.ts:170](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L170) +[packages/sdk/connect/src/connection.ts:171](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L171) ___ @@ -495,7 +495,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:484](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L484) +[packages/sdk/connect/src/connection.ts:487](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L487) ___ @@ -515,7 +515,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:415](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L415) +[packages/sdk/connect/src/connection.ts:418](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L418) ___ @@ -535,7 +535,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:492](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L492) +[packages/sdk/connect/src/connection.ts:495](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L495) ___ @@ -555,7 +555,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L99) +[packages/sdk/connect/src/connection.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L100) ___ @@ -569,7 +569,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:187](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L187) +[packages/sdk/connect/src/connection.ts:190](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L190) ___ @@ -581,7 +581,7 @@ ___ | Name | Type | | :------ | :------ | -| `address?` | `string` | +| `address?` | \`0x$\{string}\` | #### Returns @@ -589,7 +589,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L142) +[packages/sdk/connect/src/connection.ts:143](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L143) ___ @@ -603,7 +603,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:191](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L191) +[packages/sdk/connect/src/connection.ts:194](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L194) ___ @@ -623,7 +623,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L95) +[packages/sdk/connect/src/connection.ts:96](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L96) ___ @@ -643,7 +643,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:422](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L422) +[packages/sdk/connect/src/connection.ts:425](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L425) ___ @@ -663,7 +663,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L158) +[packages/sdk/connect/src/connection.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L159) ___ @@ -683,7 +683,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:329](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L329) +[packages/sdk/connect/src/connection.ts:332](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L332) ___ @@ -710,7 +710,7 @@ Similar to `web3.eth.sendTransaction()` but with following differences: #### Defined in -[packages/sdk/connect/src/connection.ts:215](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L215) +[packages/sdk/connect/src/connection.ts:218](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L218) ___ @@ -731,7 +731,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:231](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L231) +[packages/sdk/connect/src/connection.ts:234](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L234) ___ @@ -751,7 +751,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:333](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L333) +[packages/sdk/connect/src/connection.ts:336](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L336) ___ @@ -771,7 +771,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L77) +[packages/sdk/connect/src/connection.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L78) ___ @@ -792,7 +792,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:302](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L302) +[packages/sdk/connect/src/connection.ts:305](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L305) ___ @@ -814,7 +814,7 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:263](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L263) +[packages/sdk/connect/src/connection.ts:266](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L266) ___ @@ -828,4 +828,4 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:517](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L517) +[packages/sdk/connect/src/connection.ts:520](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L520) diff --git a/packages/docs/sdk/docs/connect/interfaces/connection.ConnectionOptions.md b/packages/docs/sdk/docs/connect/interfaces/connection.ConnectionOptions.md index 66448bcee..0d0b35df1 100644 --- a/packages/docs/sdk/docs/connect/interfaces/connection.ConnectionOptions.md +++ b/packages/docs/sdk/docs/connect/interfaces/connection.ConnectionOptions.md @@ -16,21 +16,21 @@ ### feeCurrency -• `Optional` **feeCurrency**: `string` +• `Optional` **feeCurrency**: \`0x$\{string}\` #### Defined in -[packages/sdk/connect/src/connection.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L46) +[packages/sdk/connect/src/connection.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L47) ___ ### from -• `Optional` **from**: `string` +• `Optional` **from**: \`0x$\{string}\` #### Defined in -[packages/sdk/connect/src/connection.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L47) +[packages/sdk/connect/src/connection.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L48) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/connect/src/connection.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L45) +[packages/sdk/connect/src/connection.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L46) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.CIP42TXProperties.md b/packages/docs/sdk/docs/connect/interfaces/types.CIP42TXProperties.md index ea266a1da..18a9b2cfc 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.CIP42TXProperties.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.CIP42TXProperties.md @@ -43,7 +43,7 @@ FeeMarketAndAccessListTXProperties.accessList #### Defined in -[packages/sdk/connect/src/types.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L86) +[packages/sdk/connect/src/types.ts:87](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L87) ___ @@ -53,7 +53,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L99) +[packages/sdk/connect/src/types.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L100) ___ @@ -67,7 +67,7 @@ FeeMarketAndAccessListTXProperties.gas #### Defined in -[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) +[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L101) +[packages/sdk/connect/src/types.ts:102](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L102) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L100) +[packages/sdk/connect/src/types.ts:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L101) ___ @@ -101,7 +101,7 @@ FeeMarketAndAccessListTXProperties.hash #### Defined in -[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) +[packages/sdk/connect/src/types.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L80) ___ @@ -115,7 +115,7 @@ FeeMarketAndAccessListTXProperties.input #### Defined in -[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) +[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) ___ @@ -129,7 +129,7 @@ FeeMarketAndAccessListTXProperties.maxFeePerGas #### Defined in -[packages/sdk/connect/src/types.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L84) +[packages/sdk/connect/src/types.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L85) ___ @@ -143,7 +143,7 @@ FeeMarketAndAccessListTXProperties.maxPriorityFeePerGas #### Defined in -[packages/sdk/connect/src/types.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L85) +[packages/sdk/connect/src/types.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L86) ___ @@ -157,7 +157,7 @@ FeeMarketAndAccessListTXProperties.nonce #### Defined in -[packages/sdk/connect/src/types.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L71) +[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) ___ @@ -171,7 +171,7 @@ FeeMarketAndAccessListTXProperties.r #### Defined in -[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) +[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) ___ @@ -185,7 +185,7 @@ FeeMarketAndAccessListTXProperties.s #### Defined in -[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) +[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) ___ @@ -199,7 +199,7 @@ FeeMarketAndAccessListTXProperties.to #### Defined in -[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) +[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) ___ @@ -213,7 +213,7 @@ FeeMarketAndAccessListTXProperties.type #### Defined in -[packages/sdk/connect/src/types.ts:102](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L102) +[packages/sdk/connect/src/types.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L103) ___ @@ -227,7 +227,7 @@ FeeMarketAndAccessListTXProperties.v #### Defined in -[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) +[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) ___ @@ -241,4 +241,4 @@ FeeMarketAndAccessListTXProperties.value #### Defined in -[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) +[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.CIP64TXProperties.md b/packages/docs/sdk/docs/connect/interfaces/types.CIP64TXProperties.md index 3efc3a520..6fb2dca39 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.CIP64TXProperties.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.CIP64TXProperties.md @@ -41,7 +41,7 @@ FeeMarketAndAccessListTXProperties.accessList #### Defined in -[packages/sdk/connect/src/types.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L86) +[packages/sdk/connect/src/types.ts:87](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L87) ___ @@ -51,7 +51,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:94](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L94) +[packages/sdk/connect/src/types.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L95) ___ @@ -65,7 +65,7 @@ FeeMarketAndAccessListTXProperties.gas #### Defined in -[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) +[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) ___ @@ -79,7 +79,7 @@ FeeMarketAndAccessListTXProperties.hash #### Defined in -[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) +[packages/sdk/connect/src/types.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L80) ___ @@ -93,7 +93,7 @@ FeeMarketAndAccessListTXProperties.input #### Defined in -[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) +[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) ___ @@ -107,7 +107,7 @@ FeeMarketAndAccessListTXProperties.maxFeePerGas #### Defined in -[packages/sdk/connect/src/types.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L84) +[packages/sdk/connect/src/types.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L85) ___ @@ -121,7 +121,7 @@ FeeMarketAndAccessListTXProperties.maxPriorityFeePerGas #### Defined in -[packages/sdk/connect/src/types.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L85) +[packages/sdk/connect/src/types.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L86) ___ @@ -135,7 +135,7 @@ FeeMarketAndAccessListTXProperties.nonce #### Defined in -[packages/sdk/connect/src/types.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L71) +[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) ___ @@ -149,7 +149,7 @@ FeeMarketAndAccessListTXProperties.r #### Defined in -[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) +[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) ___ @@ -163,7 +163,7 @@ FeeMarketAndAccessListTXProperties.s #### Defined in -[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) +[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) ___ @@ -177,7 +177,7 @@ FeeMarketAndAccessListTXProperties.to #### Defined in -[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) +[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) ___ @@ -191,7 +191,7 @@ FeeMarketAndAccessListTXProperties.type #### Defined in -[packages/sdk/connect/src/types.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L95) +[packages/sdk/connect/src/types.ts:96](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L96) ___ @@ -205,7 +205,7 @@ FeeMarketAndAccessListTXProperties.v #### Defined in -[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) +[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) ___ @@ -219,4 +219,4 @@ FeeMarketAndAccessListTXProperties.value #### Defined in -[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) +[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.CeloParams.md b/packages/docs/sdk/docs/connect/interfaces/types.CeloParams.md index ef8d35834..5a3c8477f 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.CeloParams.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.CeloParams.md @@ -16,11 +16,11 @@ ### feeCurrency -• **feeCurrency**: `string` +• **feeCurrency**: \`0x$\{string}\` #### Defined in -[packages/sdk/connect/src/types.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L13) +[packages/sdk/connect/src/types.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L14) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:21](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L21) +[packages/sdk/connect/src/types.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L22) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L17) +[packages/sdk/connect/src/types.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L18) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.CeloTxObject.md b/packages/docs/sdk/docs/connect/interfaces/types.CeloTxObject.md index c3175acf0..1b7d83f0f 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.CeloTxObject.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.CeloTxObject.md @@ -32,7 +32,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L61) +[packages/sdk/connect/src/types.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L62) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:56](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L56) +[packages/sdk/connect/src/types.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L57) ## Methods @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L57) +[packages/sdk/connect/src/types.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L58) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L60) +[packages/sdk/connect/src/types.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L61) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L59) +[packages/sdk/connect/src/types.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L60) ___ @@ -116,4 +116,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L58) +[packages/sdk/connect/src/types.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L59) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.EIP1559TXProperties.md b/packages/docs/sdk/docs/connect/interfaces/types.EIP1559TXProperties.md index b72816d4c..f739c580d 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.EIP1559TXProperties.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.EIP1559TXProperties.md @@ -40,7 +40,7 @@ FeeMarketAndAccessListTXProperties.accessList #### Defined in -[packages/sdk/connect/src/types.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L86) +[packages/sdk/connect/src/types.ts:87](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L87) ___ @@ -54,7 +54,7 @@ FeeMarketAndAccessListTXProperties.gas #### Defined in -[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) +[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) ___ @@ -68,7 +68,7 @@ FeeMarketAndAccessListTXProperties.hash #### Defined in -[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) +[packages/sdk/connect/src/types.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L80) ___ @@ -82,7 +82,7 @@ FeeMarketAndAccessListTXProperties.input #### Defined in -[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) +[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) ___ @@ -96,7 +96,7 @@ FeeMarketAndAccessListTXProperties.maxFeePerGas #### Defined in -[packages/sdk/connect/src/types.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L84) +[packages/sdk/connect/src/types.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L85) ___ @@ -110,7 +110,7 @@ FeeMarketAndAccessListTXProperties.maxPriorityFeePerGas #### Defined in -[packages/sdk/connect/src/types.ts:85](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L85) +[packages/sdk/connect/src/types.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L86) ___ @@ -124,7 +124,7 @@ FeeMarketAndAccessListTXProperties.nonce #### Defined in -[packages/sdk/connect/src/types.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L71) +[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) ___ @@ -138,7 +138,7 @@ FeeMarketAndAccessListTXProperties.r #### Defined in -[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) +[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) ___ @@ -152,7 +152,7 @@ FeeMarketAndAccessListTXProperties.s #### Defined in -[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) +[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) ___ @@ -166,7 +166,7 @@ FeeMarketAndAccessListTXProperties.to #### Defined in -[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) +[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) ___ @@ -180,7 +180,7 @@ FeeMarketAndAccessListTXProperties.type #### Defined in -[packages/sdk/connect/src/types.ts:90](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L90) +[packages/sdk/connect/src/types.ts:91](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L91) ___ @@ -194,7 +194,7 @@ FeeMarketAndAccessListTXProperties.v #### Defined in -[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) +[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) ___ @@ -208,4 +208,4 @@ FeeMarketAndAccessListTXProperties.value #### Defined in -[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) +[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md b/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md index bcbd38c4a..6a937aded 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md @@ -19,7 +19,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:117](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L117) +[packages/sdk/connect/src/types.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L118) ___ @@ -29,4 +29,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L118) +[packages/sdk/connect/src/types.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L119) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.Error.md b/packages/docs/sdk/docs/connect/interfaces/types.Error.md index 86b3b52cc..8261af374 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.Error.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.Error.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:152](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L152) +[packages/sdk/connect/src/types.ts:153](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L153) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:153](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L153) +[packages/sdk/connect/src/types.ts:154](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L154) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:154](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L154) +[packages/sdk/connect/src/types.ts:155](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L155) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.FormattedCeloTx.md b/packages/docs/sdk/docs/connect/interfaces/types.FormattedCeloTx.md index ca79f3afd..7bfe46be4 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.FormattedCeloTx.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.FormattedCeloTx.md @@ -32,7 +32,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L47) +[packages/sdk/connect/src/types.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L48) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L28) +[packages/sdk/connect/src/types.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L29) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:31](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L31) +[packages/sdk/connect/src/types.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L32) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L33) +[packages/sdk/connect/src/types.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L34) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L29) +[packages/sdk/connect/src/types.ts:30](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L30) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:42](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L42) +[packages/sdk/connect/src/types.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L43) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L43) +[packages/sdk/connect/src/types.ts:44](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L44) ___ @@ -102,7 +102,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L41) +[packages/sdk/connect/src/types.ts:42](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L42) ___ @@ -112,7 +112,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:37](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L37) +[packages/sdk/connect/src/types.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L38) ___ @@ -122,7 +122,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:44](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L44) +[packages/sdk/connect/src/types.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L45) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L45) +[packages/sdk/connect/src/types.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L46) ___ @@ -142,7 +142,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L46) +[packages/sdk/connect/src/types.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L47) ___ @@ -152,7 +152,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:30](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L30) +[packages/sdk/connect/src/types.ts:31](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L31) ___ @@ -162,7 +162,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L48) +[packages/sdk/connect/src/types.ts:49](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L49) ___ @@ -172,4 +172,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L32) +[packages/sdk/connect/src/types.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L33) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md b/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md index f84175001..02e6089c3 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md @@ -29,4 +29,4 @@ #### Defined in -[packages/sdk/connect/src/types.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L158) +[packages/sdk/connect/src/types.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L159) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md index a5863d33a..1300c1607 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md @@ -21,7 +21,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L141) +[packages/sdk/connect/src/types.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L142) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L138) +[packages/sdk/connect/src/types.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L139) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L139) +[packages/sdk/connect/src/types.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L140) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L140) +[packages/sdk/connect/src/types.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L141) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md index 39cc97dce..c9239e0f2 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md @@ -29,7 +29,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L130) +[packages/sdk/connect/src/types.ts:131](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L131) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L128) +[packages/sdk/connect/src/types.ts:129](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L129) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:127](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L127) +[packages/sdk/connect/src/types.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L128) ___ @@ -59,4 +59,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:129](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L129) +[packages/sdk/connect/src/types.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L130) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.LegacyTXProperties.md b/packages/docs/sdk/docs/connect/interfaces/types.LegacyTXProperties.md index 493563c70..3aab3f0af 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.LegacyTXProperties.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.LegacyTXProperties.md @@ -37,7 +37,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:110](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L110) +[packages/sdk/connect/src/types.ts:111](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L111) ___ @@ -51,7 +51,7 @@ CommonTXProperties.gas #### Defined in -[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) +[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) ___ @@ -61,7 +61,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L109) +[packages/sdk/connect/src/types.ts:110](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L110) ___ @@ -71,7 +71,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L112) +[packages/sdk/connect/src/types.ts:113](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L113) ___ @@ -81,7 +81,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:111](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L111) +[packages/sdk/connect/src/types.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L112) ___ @@ -95,7 +95,7 @@ CommonTXProperties.hash #### Defined in -[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) +[packages/sdk/connect/src/types.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L80) ___ @@ -109,7 +109,7 @@ CommonTXProperties.input #### Defined in -[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) +[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) ___ @@ -123,7 +123,7 @@ CommonTXProperties.nonce #### Defined in -[packages/sdk/connect/src/types.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L71) +[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) ___ @@ -137,7 +137,7 @@ CommonTXProperties.r #### Defined in -[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) +[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) ___ @@ -151,7 +151,7 @@ CommonTXProperties.s #### Defined in -[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) +[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) ___ @@ -165,7 +165,7 @@ CommonTXProperties.to #### Defined in -[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) +[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) ___ @@ -179,7 +179,7 @@ CommonTXProperties.type #### Defined in -[packages/sdk/connect/src/types.ts:113](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L113) +[packages/sdk/connect/src/types.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L114) ___ @@ -193,7 +193,7 @@ CommonTXProperties.v #### Defined in -[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) +[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) ___ @@ -207,4 +207,4 @@ CommonTXProperties.value #### Defined in -[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) +[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.Provider.md b/packages/docs/sdk/docs/connect/interfaces/types.Provider.md index 301a3e052..d6c741b42 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.Provider.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.Provider.md @@ -33,4 +33,4 @@ #### Defined in -[packages/sdk/connect/src/types.ts:145](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L145) +[packages/sdk/connect/src/types.ts:146](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L146) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md b/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md index a5a6d9981..2ca2d140e 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L166) +[packages/sdk/connect/src/types.ts:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L167) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:165](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L165) +[packages/sdk/connect/src/types.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L166) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L167) +[packages/sdk/connect/src/types.ts:168](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L168) diff --git a/packages/docs/sdk/docs/connect/modules/celo_provider.md b/packages/docs/sdk/docs/connect/modules/celo_provider.md index 889917acb..e10e08a1f 100644 --- a/packages/docs/sdk/docs/connect/modules/celo_provider.md +++ b/packages/docs/sdk/docs/connect/modules/celo_provider.md @@ -30,4 +30,4 @@ asserts provider is CeloProvider #### Defined in -[packages/sdk/connect/src/celo-provider.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L34) +[packages/sdk/connect/src/celo-provider.ts:35](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/celo-provider.ts#L35) diff --git a/packages/docs/sdk/docs/connect/modules/connection.md b/packages/docs/sdk/docs/connect/modules/connection.md index 82b3f2703..3dbb4438e 100644 --- a/packages/docs/sdk/docs/connect/modules/connection.md +++ b/packages/docs/sdk/docs/connect/modules/connection.md @@ -34,4 +34,4 @@ #### Defined in -[packages/sdk/connect/src/connection.ts:534](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L534) +[packages/sdk/connect/src/connection.ts:537](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/connection.ts#L537) diff --git a/packages/docs/sdk/docs/connect/modules/types.md b/packages/docs/sdk/docs/connect/modules/types.md index a3441c4b7..db0109746 100644 --- a/packages/docs/sdk/docs/connect/modules/types.md +++ b/packages/docs/sdk/docs/connect/modules/types.md @@ -122,7 +122,7 @@ Re-exports [Syncing](../interfaces/index.Syncing.md) #### Defined in -[packages/sdk/connect/src/types.ts:24](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L24) +[packages/sdk/connect/src/types.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L25) ___ @@ -132,7 +132,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:9](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L9) +[packages/sdk/connect/src/types.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L10) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:124](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L124) +[packages/sdk/connect/src/types.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L125) ___ @@ -173,7 +173,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L51) +[packages/sdk/connect/src/types.ts:52](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L52) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L121) +[packages/sdk/connect/src/types.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L122) ___ @@ -193,7 +193,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L122) +[packages/sdk/connect/src/types.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L123) ___ @@ -203,7 +203,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L54) +[packages/sdk/connect/src/types.ts:55](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L55) ___ @@ -213,7 +213,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L11) +[packages/sdk/connect/src/types.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L12) ___ @@ -223,7 +223,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L26) +[packages/sdk/connect/src/types.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L27) ___ @@ -233,4 +233,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L68) +[packages/sdk/connect/src/types.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L69) diff --git a/packages/docs/sdk/docs/contractkit/README.md b/packages/docs/sdk/docs/contractkit/README.md index 151d8ccde..761b42a03 100644 --- a/packages/docs/sdk/docs/contractkit/README.md +++ b/packages/docs/sdk/docs/contractkit/README.md @@ -23,7 +23,7 @@ You might not need the full ContractKit. Consider using `@celo/connect` which po ## How we work -We are a GitHub-first team, which means we have a strong preference for communicating via GitHub. +We are a GitHub-first team, which means we have a strong preference for communicating via GitHub. Please use GitHub to: 🐞 [File a bug report](https://github.com/celo-org/developer-tooling/issues/new/choose) @@ -37,8 +37,8 @@ Please use GitHub to: 🚔 [Report a security vulnerability](https://github.com/celo-org/developer-tooling/issues/new/choose) > [!TIP] -> -> Please avoid messaging us via Slack, Telegram, or email. We are more likely to respond to you on +> +> Please avoid messaging us via Slack, Telegram, or email. We are more likely to respond to you on > GitHub than if you message us anywhere else. We actively monitor GitHub, and will get back to you shortly 🌟 ### Getting Started @@ -71,16 +71,14 @@ const balances = await kit.getTotalBalance() // returns an object with {cUSD, cEUR, cREAL} const balances = await miniKit.getTotalBalance() - ``` If you don't need the balances of all tokens use the balanceOf method -```ts +```ts const stableTokenWrapper = await kit.getStableToken(StableToken.cREAL) const cRealBalance = stableTokenWrapper.balanceOf(accountAddress) - ``` ### Setting Default Tx Options @@ -100,7 +98,7 @@ async function getKit(myAddress: string, privateKey: string) { kit.connection.addAccount(privateKey) // paid gas in celo dollars - await kit.setFeeCurrency(CeloContract.StableToken) + await kit.setFeeCurrency('0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1') return kit } @@ -127,7 +125,7 @@ To send funds: ```ts const oneGold = kit.connection.web3.utils.toWei('1', 'ether') const tx = await goldToken.transfer(someAddress, oneGold).send({ - from: myAddress + from: myAddress, }) const hash = await tx.getHash() @@ -137,8 +135,7 @@ const receipt = await tx.waitReceipt() If you would like to pay fees in cUSD, (or other cStables like cEUR, cUSD). ```ts - -kit.setFeeCurrency(CeloContract.StableToken) // Default to paying fees in cUSD +kit.setFeeCurrency('0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1') // Default to paying fees in cUSD const stableTokenContract = kit.contracts.getStableToken() @@ -149,7 +146,6 @@ const tx = await stableTokenContract const hash = await tx.getHash() const receipt = await tx.waitReceipt() - ``` ### Interacting with Core Contracts @@ -182,7 +178,7 @@ When using the `kit` you can access core contracts like `kit.contracts.get{ContractName}` -E.G. `kit.contracts.getAccounts()`, `kit.contracts.getValidators()` +E.G. `kit.contracts.getAccounts()`, `kit.contracts.getValidators()` #### Stand Alone Wrappers @@ -191,11 +187,11 @@ You can also initialize contracts wrappers directly. They require a `Connection` ```typescript // MiniContractKit only gives access to a limited set of Contracts, so we import Multisig -import { newKit } from "@celo/contractkit/lib/mini-kit" +import { newKit } from '@celo/contractkit/lib/mini-kit' import { MultiSigWrapper } from '@celo/contractkit/lib/wrappers/MultiSig' import { newMultiSig } from '@celo/abis/web3/MultiSig' -const miniKit = newKit("https://alfajores-forno.celo-testnet.org/") +const miniKit = newKit('https://alfajores-forno.celo-testnet.org/') // Alternatively import { Connection } from '@celo/connect' // const connection = new Connection(web3) @@ -207,14 +203,14 @@ const multisigWrapper = new MultiSigWrapper(miniKit.connection, contract) ### Accessing web3 contract wrappers -`MiniContractKit` *does not provide access to the web3 contracts* +`MiniContractKit` _does not provide access to the web3 contracts_ Some user might want to access web3 native contract wrappers. To do so, you can: ```ts -const feeCurrencyWhitelist = await kit._web3Contracts.getFeeCurrencyWhitelist() +const feeCurrencyWhitelist = await kit._web3Contracts.getContract(CeloContract.FeeCurrencyWhitelist) ``` We expose native wrappers for all Celo core contracts. @@ -223,20 +219,36 @@ The complete list of Celo Core contracts is: - Accounts - Attestations -- LockedGold +- BlockchainParameters +- DoubleSigningSlasher +- DowntimeSlasher +- Election +- EpochRewards +- ERC20 - Escrow +- FederatedAttestations - FeeCurrencyWhitelist +- FeeHandler +- Freezer - GasPriceMinimum - GoldToken - Governance +- LockedGold +- MentoFeeHandlerSeller +- UniswapFeeHandlerSeller - MultiSig +- OdisPayments - Random - Registry - Reserve - SortedOracles - StableToken +- StableTokenEUR +- StableTokenBRL - Validators +This can also be found in `packages/sdk/contractkit/src/base.ts` + ### A Note About Contract Addresses Celo Core Contracts addresses, can be obtained by looking at the `Registry` contract. diff --git a/packages/docs/sdk/docs/contractkit/classes/address_registry.AddressRegistry.md b/packages/docs/sdk/docs/contractkit/classes/address_registry.AddressRegistry.md index 68c369171..ac2226c86 100644 --- a/packages/docs/sdk/docs/contractkit/classes/address_registry.AddressRegistry.md +++ b/packages/docs/sdk/docs/contractkit/classes/address_registry.AddressRegistry.md @@ -59,7 +59,7 @@ Celo Core Contract's Address Registry ### addressFor -▸ **addressFor**(`contract`): `Promise`\<`string`\> +▸ **addressFor**(`contract`): `Promise`\<\`0x$\{string}\`\> Get the address for a `CeloContract` @@ -71,7 +71,7 @@ Get the address for a `CeloContract` #### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> #### Defined in @@ -81,13 +81,13 @@ ___ ### addressMapping -▸ **addressMapping**(): `Promise`\<`Map`\<[`CeloContract`](../enums/base.CeloContract.md), `string`\>\> +▸ **addressMapping**(): `Promise`\<`Map`\<[`CeloContract`](../enums/base.CeloContract.md), \`0x$\{string}\`\>\> Get the address mapping for known registered contracts #### Returns -`Promise`\<`Map`\<[`CeloContract`](../enums/base.CeloContract.md), `string`\>\> +`Promise`\<`Map`\<[`CeloContract`](../enums/base.CeloContract.md), \`0x$\{string}\`\>\> #### Defined in 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 8d6d4830c..526a37421 100644 --- a/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md +++ b/packages/docs/sdk/docs/contractkit/classes/celo_tokens.CeloTokens.md @@ -192,7 +192,7 @@ ___ ### getAddress -▸ **getAddress**(`token`): `Promise`\<`string`\> +▸ **getAddress**(`token`): `Promise`\<\`0x$\{string}\`\> Gets the address of the contract for the provided token. @@ -204,7 +204,7 @@ Gets the address of the contract for the provided token. #### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> A promise resolving to the address of the token's contract @@ -258,7 +258,7 @@ ___ ### getFeeCurrencyAddress -▸ **getFeeCurrencyAddress**(`token`): `undefined` \| `Promise`\<`string`\> +▸ **getFeeCurrencyAddress**(`token`): `undefined` \| `Promise`\<\`0x$\{string}\`\> Gets the address to use as the feeCurrency when paying for gas with the provided token. @@ -271,7 +271,7 @@ Gets the address to use as the feeCurrency when paying for gas with the #### Returns -`undefined` \| `Promise`\<`string`\> +`undefined` \| `Promise`\<\`0x$\{string}\`\> If not CELO, the address of the token's contract. If CELO, undefined. 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 650940c97..8a07a4b7c 100644 --- a/packages/docs/sdk/docs/contractkit/classes/contract_cache.WrapperCache.md +++ b/packages/docs/sdk/docs/contractkit/classes/contract_cache.WrapperCache.md @@ -42,6 +42,7 @@ Consider Using MiniWrapperCache, building your own, or if you only need one Wrap - [getErc20](contract_cache.WrapperCache.md#geterc20) - [getEscrow](contract_cache.WrapperCache.md#getescrow) - [getFederatedAttestations](contract_cache.WrapperCache.md#getfederatedattestations) +- [getFeeCurrencyWhitelist](contract_cache.WrapperCache.md#getfeecurrencywhitelist) - [getFreezer](contract_cache.WrapperCache.md#getfreezer) - [getGasPriceMinimum](contract_cache.WrapperCache.md#getgaspriceminimum) - [getGoldToken](contract_cache.WrapperCache.md#getgoldtoken) @@ -75,7 +76,7 @@ Consider Using MiniWrapperCache, building your own, or if you only need one Wrap #### Defined in -[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) +[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) ## Properties @@ -85,7 +86,7 @@ Consider Using MiniWrapperCache, building your own, or if you only need one Wrap #### Defined in -[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) +[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) ___ @@ -95,7 +96,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -105,7 +106,7 @@ ___ #### Defined in -[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) +[packages/sdk/contractkit/src/contract-cache.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L121) ## Methods @@ -123,7 +124,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -137,7 +138,7 @@ ___ #### 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:127](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L127) ___ @@ -151,7 +152,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -184,7 +185,7 @@ Get Contract wrapper #### Defined in -[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) +[packages/sdk/contractkit/src/contract-cache.ts:195](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L195) ___ @@ -198,7 +199,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -212,7 +213,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -226,7 +227,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -240,7 +241,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -260,7 +261,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -274,7 +275,7 @@ ___ #### Defined in -[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) +[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) ___ @@ -288,7 +289,21 @@ ___ #### 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) +[packages/sdk/contractkit/src/contract-cache.ts:155](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L155) + +___ + +### getFeeCurrencyWhitelist + +▸ **getFeeCurrencyWhitelist**(): `Promise`\<[`FeeCurrencyWhitelistWrapper`](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md)\> + +#### Returns + +`Promise`\<[`FeeCurrencyWhitelistWrapper`](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md)\> + +#### Defined in + +[packages/sdk/contractkit/src/contract-cache.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L158) ___ @@ -302,7 +317,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:152](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L152) ___ @@ -316,7 +331,7 @@ ___ #### 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:161](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L161) ___ @@ -334,7 +349,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:164](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L164) ___ @@ -348,7 +363,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:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L167) ___ @@ -362,7 +377,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:170](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L170) ___ @@ -382,7 +397,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:173](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L173) ___ @@ -396,7 +411,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:176](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L176) ___ @@ -410,7 +425,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:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L179) ___ @@ -424,7 +439,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:182](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L182) ___ @@ -448,7 +463,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:185](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L185) ___ @@ -462,7 +477,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:188](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L188) ___ @@ -488,4 +503,4 @@ ___ #### Defined in -[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) +[packages/sdk/contractkit/src/contract-cache.ts:219](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L219) diff --git a/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md b/packages/docs/sdk/docs/contractkit/classes/kit.ContractKit.md index b118bed61..236790c20 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:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L112) +[packages/sdk/contractkit/src/kit.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L106) ## Properties @@ -75,7 +75,7 @@ factory for core contract's native web3 wrappers #### 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:97](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L97) ___ @@ -87,7 +87,7 @@ helper for interacting with CELO & stable tokens #### 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:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L101) ___ @@ -97,7 +97,7 @@ ___ #### 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:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L106) ___ @@ -109,7 +109,7 @@ factory for core contract's kit 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:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L99) ___ @@ -123,7 +123,7 @@ no longer needed since gasPrice is available on node rpc #### Defined in -[packages/sdk/contractkit/src/kit.ts:110](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L110) +[packages/sdk/contractkit/src/kit.ts:104](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L104) ___ @@ -135,21 +135,21 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L101) +[packages/sdk/contractkit/src/kit.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L95) ## Accessors ### defaultAccount -• `get` **defaultAccount**(): `undefined` \| `string` +• `get` **defaultAccount**(): `undefined` \| \`0x$\{string}\` #### Returns -`undefined` \| `string` +`undefined` \| \`0x$\{string}\` #### 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:226](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L226) • `set` **defaultAccount**(`address`): `void` @@ -157,7 +157,7 @@ core contract's address registry | Name | Type | | :------ | :------ | -| `address` | `undefined` \| `string` | +| `address` | `undefined` \| \`0x$\{string}\` | #### Returns @@ -165,21 +165,21 @@ core contract's address registry #### 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:222](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L222) ___ ### defaultFeeCurrency -• `get` **defaultFeeCurrency**(): `undefined` \| `string` +• `get` **defaultFeeCurrency**(): `undefined` \| \`0x$\{string}\` #### Returns -`undefined` \| `string` +`undefined` \| \`0x$\{string}\` #### 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:242](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L242) • `set` **defaultFeeCurrency**(`address`): `void` @@ -187,7 +187,7 @@ ___ | Name | Type | | :------ | :------ | -| `address` | `undefined` \| `string` | +| `address` | `undefined` \| \`0x$\{string}\` | #### Returns @@ -195,7 +195,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:238](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L238) ___ @@ -209,7 +209,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:234](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L234) • `set` **gasInflationFactor**(`factor`): `void` @@ -225,7 +225,7 @@ ___ #### 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:230](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L230) ___ @@ -239,7 +239,7 @@ ___ #### 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:273](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L273) ## Methods @@ -259,7 +259,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:224](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L224) +[packages/sdk/contractkit/src/kit.ts:218](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L218) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:215](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L215) +[packages/sdk/contractkit/src/kit.ts:209](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L209) ___ @@ -293,7 +293,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:200](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L200) +[packages/sdk/contractkit/src/kit.ts:194](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L194) ___ @@ -313,7 +313,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:205](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L205) +[packages/sdk/contractkit/src/kit.ts:199](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L199) ___ @@ -327,7 +327,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:186](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L186) +[packages/sdk/contractkit/src/kit.ts:180](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L180) ___ @@ -347,7 +347,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:210](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L210) +[packages/sdk/contractkit/src/kit.ts:204](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L204) ___ @@ -367,7 +367,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L140) +[packages/sdk/contractkit/src/kit.ts:134](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L134) ___ @@ -387,7 +387,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L123) +[packages/sdk/contractkit/src/kit.ts:117](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L117) ___ @@ -401,7 +401,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L119) +[packages/sdk/contractkit/src/kit.ts:113](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L113) ___ @@ -415,7 +415,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:246](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L246) ___ @@ -429,7 +429,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:250](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L250) ___ @@ -449,7 +449,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:254](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L254) ___ @@ -470,29 +470,33 @@ ___ #### 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:258](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L258) ___ ### setFeeCurrency -▸ **setFeeCurrency**(`tokenContract`): `Promise`\<`void`\> +▸ **setFeeCurrency**(`address`): `void` -Set CeloToken to use to pay for gas fees +Set an addressed to use to pay for gas fees #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `tokenContract` | [`CeloTokenContract`](../modules/base.md#celotokencontract) | CELO (GoldToken) or a supported StableToken contract | +| `address` | \`0x$\{string}\` | any hexadecimal address | #### Returns -`Promise`\<`void`\> +`void` + +**`Dev`** + +Throws if supplied address is not a valid hexadecimal address #### Defined in -[packages/sdk/contractkit/src/kit.ts:192](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L192) +[packages/sdk/contractkit/src/kit.ts:187](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L187) ___ @@ -513,7 +517,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:271](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L271) +[packages/sdk/contractkit/src/kit.ts:265](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L265) ___ @@ -527,4 +531,4 @@ ___ #### 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:269](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L269) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Accounts.AccountsWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Accounts.AccountsWrapper.md index 9f3ad233c..fe2b1a444 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Accounts.AccountsWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Accounts.AccountsWrapper.md @@ -119,7 +119,7 @@ Creates an account. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:44](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L44) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L45) ___ @@ -149,7 +149,7 @@ fraction to 0. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:456](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L456) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:459](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L459) ___ @@ -215,7 +215,7 @@ ___ ### getAttestationSigner -• **getAttestationSigner**: (`account`: `string`) => `Promise`\<`string`\> +• **getAttestationSigner**: (`account`: `string`) => `Promise`\<\`0x$\{string}\`\> Returns the attestation signer for the specified account. @@ -225,7 +225,7 @@ The address of the account. #### Type declaration -▸ (`account`): `Promise`\<`string`\> +▸ (`account`): `Promise`\<\`0x$\{string}\`\> Returns the attestation signer for the specified account. @@ -237,13 +237,13 @@ Returns the attestation signer for the specified account. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The address with which the account can vote. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L51) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:52](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L52) ___ @@ -275,7 +275,7 @@ Returns the set data encryption key for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:362](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L362) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:365](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L365) ___ @@ -307,7 +307,7 @@ Returns the metadataURL for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:376](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L376) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:379](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L379) ___ @@ -341,13 +341,13 @@ Beneficiary address and fraction of payment delegated. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:466](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L466) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:469](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L469) ___ ### getValidatorSigner -• **getValidatorSigner**: (`account`: `string`) => `Promise`\<`string`\> +• **getValidatorSigner**: (`account`: `string`) => `Promise`\<\`0x$\{string}\`\> Returns the validator signer for the specified account. @@ -357,7 +357,7 @@ The address of the account. #### Type declaration -▸ (`account`): `Promise`\<`string`\> +▸ (`account`): `Promise`\<\`0x$\{string}\`\> Returns the validator signer for the specified account. @@ -369,19 +369,19 @@ Returns the validator signer for the specified account. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The address with which the account can register a validator or group. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L77) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L78) ___ ### getVoteSigner -• **getVoteSigner**: (`account`: `string`) => `Promise`\<`string`\> +• **getVoteSigner**: (`account`: `string`) => `Promise`\<\`0x$\{string}\`\> Returns the vote signer for the specified account. @@ -391,7 +391,7 @@ The address of the account. #### Type declaration -▸ (`account`): `Promise`\<`string`\> +▸ (`account`): `Promise`\<\`0x$\{string}\`\> Returns the vote signer for the specified account. @@ -403,13 +403,13 @@ Returns the vote signer for the specified account. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The address with which the account can vote. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L69) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L70) ___ @@ -441,7 +441,7 @@ Returns the set wallet address for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:370](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L370) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:373](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L373) ___ @@ -475,7 +475,7 @@ If the account has authorized an attestation signer #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L60) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L61) ___ @@ -509,7 +509,7 @@ Returns `true` if account exists. Returns `false` otherwise. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L114) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:117](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L117) ___ @@ -543,7 +543,7 @@ Returns `true` if account exists. Returns `false` otherwise. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L121) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:124](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L124) ___ @@ -589,7 +589,7 @@ Sets the data encryption of the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:382](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L382) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:385](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L385) ___ @@ -621,7 +621,7 @@ Sets the metadataURL for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:439](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L439) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:442](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L442) ___ @@ -653,7 +653,7 @@ Sets the name for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:433](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L433) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:436](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L436) ___ @@ -700,13 +700,13 @@ Use `deletePaymentDelegation` to unset the payment delegation. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:450](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L450) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:453](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L453) ___ ### signerToAccount -• **signerToAccount**: (`signer`: `string`) => `Promise`\<`string`\> +• **signerToAccount**: (`signer`: `string`) => `Promise`\<\`0x$\{string}\`\> Returns the account associated with `signer`. @@ -720,7 +720,7 @@ Fails if the `signer` is not an account or previously authorized signer. #### Type declaration -▸ (`signer`): `Promise`\<`string`\> +▸ (`signer`): `Promise`\<\`0x$\{string}\`\> Returns the account associated with `signer`. @@ -732,7 +732,7 @@ Returns the account associated with `signer`. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The associated account. @@ -742,13 +742,13 @@ Fails if the `signer` is not an account or previously authorized signer. #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:105](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L105) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:108](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L108) ___ ### validatorSignerToAccount -• **validatorSignerToAccount**: (`signer`: `string`) => `Promise`\<`string`\> +• **validatorSignerToAccount**: (`signer`: `string`) => `Promise`\<\`0x$\{string}\`\> Returns the account address given the signer for validating @@ -758,7 +758,7 @@ Address that is authorized to sign the tx as validator #### Type declaration -▸ (`signer`): `Promise`\<`string`\> +▸ (`signer`): `Promise`\<\`0x$\{string}\`\> Returns the account address given the signer for validating @@ -770,19 +770,19 @@ Returns the account address given the signer for validating ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The Account address #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L95) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:96](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L96) ___ ### voteSignerToAccount -• **voteSignerToAccount**: (`signer`: `string`) => `Promise`\<`string`\> +• **voteSignerToAccount**: (`signer`: `string`) => `Promise`\<\`0x$\{string}\`\> Returns the account address given the signer for voting @@ -792,7 +792,7 @@ Address that is authorized to sign the tx as voter #### Type declaration -▸ (`signer`): `Promise`\<`string`\> +▸ (`signer`): `Promise`\<\`0x$\{string}\`\> Returns the account address given the signer for voting @@ -804,25 +804,25 @@ Returns the account address given the signer for voting ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The Account address #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L86) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:87](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L87) ## Accessors ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from @@ -855,7 +855,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:163](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L163) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L166) ___ @@ -876,7 +876,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:287](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L287) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:290](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L290) ___ @@ -903,7 +903,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:204](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L204) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:207](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L207) ___ @@ -930,7 +930,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:255](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L255) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:258](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L258) ___ @@ -955,7 +955,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:183](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L183) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:186](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L186) ___ @@ -976,7 +976,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:320](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L320) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:323](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L323) ___ @@ -997,7 +997,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:336](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L336) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:339](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L339) ___ @@ -1019,7 +1019,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:344](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L344) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:347](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L347) ___ @@ -1039,7 +1039,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:133](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L133) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L136) ___ @@ -1059,7 +1059,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L125) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L128) ___ @@ -1082,7 +1082,7 @@ Returns the set name for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:353](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L353) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:356](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L356) ___ @@ -1137,7 +1137,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:494](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L494) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:497](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L497) ___ @@ -1155,7 +1155,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:332](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L332) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:335](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L335) ___ @@ -1180,7 +1180,7 @@ Convenience Setter for the dataEncryptionKey and wallet address for an account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:394](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L394) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:397](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L397) ___ @@ -1203,7 +1203,7 @@ Sets the wallet address for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:472](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L472) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:475](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L475) ___ @@ -1224,7 +1224,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:312](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L312) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:315](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L315) ___ diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Attestations.AttestationsWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Attestations.AttestationsWrapper.md index fca19f91b..4ab0b5819 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Attestations.AttestationsWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Attestations.AttestationsWrapper.md @@ -481,13 +481,13 @@ Allows issuers to withdraw accumulated attestation rewards ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md index 8ee33a5e3..bbf5617ff 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md @@ -150,13 +150,13 @@ Rewards and penalties for slashing. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from 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 708956a3d..dd73dad27 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapper.BaseWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapper.BaseWrapper.md @@ -32,6 +32,8 @@ ↳ [`FederatedAttestationsWrapper`](wrappers_FederatedAttestations.FederatedAttestationsWrapper.md) + ↳ [`FeeCurrencyWhitelistWrapper`](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md) + ↳ [`FeeHandlerWrapper`](wrappers_FeeHandler.FeeHandlerWrapper.md) ↳ [`FreezerWrapper`](wrappers_Freezer.FreezerWrapper.md) @@ -128,13 +130,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Defined in diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md index c9c75568e..770106d68 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md @@ -127,13 +127,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_BlockchainParameters.BlockchainParametersWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_BlockchainParameters.BlockchainParametersWrapper.md index 6b9fbd632..490a0c792 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_BlockchainParameters.BlockchainParametersWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_BlockchainParameters.BlockchainParametersWrapper.md @@ -343,13 +343,13 @@ Setting the uptime lookback window. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_CeloTokenWrapper.CeloTokenWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_CeloTokenWrapper.CeloTokenWrapper.md index 7430d1052..4d753c32c 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_CeloTokenWrapper.CeloTokenWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_CeloTokenWrapper.CeloTokenWrapper.md @@ -506,13 +506,13 @@ True if the transaction succeeds. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md index 871340db1..be189007c 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md @@ -153,13 +153,13 @@ Rewards and penalties for slashing. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md index 626ba0ecd..2fde6f0ca 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md @@ -356,13 +356,13 @@ Rewards and penalties for slashing. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Election.ElectionWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Election.ElectionWrapper.md index 901f696fd..8ee37aee6 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Election.ElectionWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Election.ElectionWrapper.md @@ -120,7 +120,7 @@ Election threshold. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:86](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L86) +[packages/sdk/contractkit/src/wrappers/Election.ts:93](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L93) ___ @@ -191,7 +191,7 @@ List of current validator signers. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L142) +[packages/sdk/contractkit/src/wrappers/Election.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L158) ___ @@ -225,7 +225,7 @@ The groups that `account` has voted for. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:215](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L215) +[packages/sdk/contractkit/src/wrappers/Election.ts:231](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L231) ___ @@ -255,7 +255,7 @@ The total votes received across all groups. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L136) +[packages/sdk/contractkit/src/wrappers/Election.ts:152](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L152) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:253](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L253) +[packages/sdk/contractkit/src/wrappers/Election.ts:269](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L269) ___ @@ -317,7 +317,7 @@ The total votes for `group` made by `account`. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:193](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L193) +[packages/sdk/contractkit/src/wrappers/Election.ts:209](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L209) ___ @@ -361,7 +361,7 @@ Size of the current elected validator set. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:126](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L126) +[packages/sdk/contractkit/src/wrappers/Election.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L142) ___ @@ -395,13 +395,13 @@ Size of the validator set. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:116](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L116) +[packages/sdk/contractkit/src/wrappers/Election.ts:132](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L132) ___ ### validatorSignerAddressFromCurrentSet -• **validatorSignerAddressFromCurrentSet**: (`index`: `number`) => `Promise`\<`string`\> +• **validatorSignerAddressFromCurrentSet**: (`index`: `number`) => `Promise`\<\`0x$\{string}\`\> Gets a validator address from the current validator set. @@ -411,7 +411,7 @@ Index of requested validator in the validator set. #### Type declaration -▸ (`index`): `Promise`\<`string`\> +▸ (`index`): `Promise`\<\`0x$\{string}\`\> Gets a validator address from the current validator set. @@ -423,19 +423,19 @@ Gets a validator address from the current validator set. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> Address of validator at the requested index. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L106) +[packages/sdk/contractkit/src/wrappers/Election.ts:120](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L120) ___ ### validatorSignerAddressFromSet -• **validatorSignerAddressFromSet**: (`signerIndex`: `number`, `blockNumber`: `number`) => `Promise`\<`string`\> +• **validatorSignerAddressFromSet**: (`signerIndex`: `number`, `blockNumber`: `number`) => `Promise`\<\`0x$\{string}\`\> Gets a validator address from the validator set at the given block number. @@ -449,7 +449,7 @@ Block number to retrieve the validator set from. #### Type declaration -▸ (`signerIndex`, `blockNumber`): `Promise`\<`string`\> +▸ (`signerIndex`, `blockNumber`): `Promise`\<\`0x$\{string}\`\> Gets a validator address from the validator set at the given block number. @@ -462,25 +462,25 @@ Gets a validator address from the validator set at the given block number. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> Address of validator at the requested index. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:98](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L98) +[packages/sdk/contractkit/src/wrappers/Election.ts:105](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L105) ## Accessors ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from @@ -511,7 +511,7 @@ Activates any activatable pending votes. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:334](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L334) +[packages/sdk/contractkit/src/wrappers/Election.ts:350](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L350) ___ @@ -540,7 +540,7 @@ See https://en.wikipedia.org/wiki/D%27Hondt_method#Allocation for more informati #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:163](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L163) +[packages/sdk/contractkit/src/wrappers/Election.ts:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L179) ___ @@ -558,7 +558,7 @@ The minimum and maximum number of validators that can be elected. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L77) +[packages/sdk/contractkit/src/wrappers/Election.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L84) ___ @@ -579,7 +579,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:451](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L451) +[packages/sdk/contractkit/src/wrappers/Election.ts:467](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L467) ___ @@ -604,7 +604,7 @@ The active votes for `group`. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:204](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L204) +[packages/sdk/contractkit/src/wrappers/Election.ts:220](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L220) ___ @@ -620,7 +620,7 @@ Returns current configuration parameters. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:287](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L287) +[packages/sdk/contractkit/src/wrappers/Election.ts:303](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L303) ___ @@ -642,7 +642,7 @@ Retrieves the set of validatorsparticipating in BFT at epochNumber. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:480](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L480) +[packages/sdk/contractkit/src/wrappers/Election.ts:496](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L496) ___ @@ -658,7 +658,7 @@ Returns the current eligible validator groups and their total votes. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:436](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L436) +[packages/sdk/contractkit/src/wrappers/Election.ts:452](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L452) ___ @@ -681,7 +681,7 @@ Retrieves GroupVoterRewards at epochNumber. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:492](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L492) +[packages/sdk/contractkit/src/wrappers/Election.ts:508](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L508) ___ @@ -733,7 +733,7 @@ The total votes for `group`. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:181](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L181) +[packages/sdk/contractkit/src/wrappers/Election.ts:197](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L197) ___ @@ -753,7 +753,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:303](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L303) +[packages/sdk/contractkit/src/wrappers/Election.ts:319](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L319) ___ @@ -769,7 +769,7 @@ Returns the current registered validator groups and their total votes and eligib #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:320](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L320) +[packages/sdk/contractkit/src/wrappers/Election.ts:336](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L336) ___ @@ -793,7 +793,7 @@ Address of each signer in the validator set. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:151](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L151) +[packages/sdk/contractkit/src/wrappers/Election.ts:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L167) ___ @@ -814,7 +814,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:241](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L241) +[packages/sdk/contractkit/src/wrappers/Election.ts:257](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L257) ___ @@ -839,7 +839,7 @@ Retrieves VoterRewards for address at epochNumber. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:526](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L526) +[packages/sdk/contractkit/src/wrappers/Election.ts:542](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L542) ___ @@ -862,7 +862,7 @@ Retrieves a voter's share of active votes. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:560](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L560) +[packages/sdk/contractkit/src/wrappers/Election.ts:576](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L576) ___ @@ -884,7 +884,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:219](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L219) +[packages/sdk/contractkit/src/wrappers/Election.ts:235](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L235) ___ @@ -904,7 +904,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:276](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L276) +[packages/sdk/contractkit/src/wrappers/Election.ts:292](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L292) ___ @@ -928,7 +928,7 @@ The groups that `account` has voted for. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:264](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L264) +[packages/sdk/contractkit/src/wrappers/Election.ts:280](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L280) ___ @@ -950,7 +950,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:397](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L397) +[packages/sdk/contractkit/src/wrappers/Election.ts:413](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L413) ___ @@ -980,7 +980,7 @@ Must pass both `lesserAfterVote` and `greaterAfterVote` or neither. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:372](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L372) +[packages/sdk/contractkit/src/wrappers/Election.ts:388](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L388) ___ @@ -1002,7 +1002,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:348](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L348) +[packages/sdk/contractkit/src/wrappers/Election.ts:364](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L364) ___ @@ -1043,4 +1043,4 @@ Increments the number of total and pending votes for `group`. #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:424](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L424) +[packages/sdk/contractkit/src/wrappers/Election.ts:440](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L440) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_EpochRewards.EpochRewardsWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_EpochRewards.EpochRewardsWrapper.md index 08e96701f..e2af130b8 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_EpochRewards.EpochRewardsWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_EpochRewards.EpochRewardsWrapper.md @@ -222,13 +222,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Erc20Wrapper.Erc20Wrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Erc20Wrapper.Erc20Wrapper.md index 0809c20b0..a855047c2 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Erc20Wrapper.Erc20Wrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Erc20Wrapper.Erc20Wrapper.md @@ -344,13 +344,13 @@ True if the transaction succeeds. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Escrow.EscrowWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Escrow.EscrowWrapper.md index 7140c394b..d794dda7c 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Escrow.EscrowWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Escrow.EscrowWrapper.md @@ -653,13 +653,13 @@ Throws if msg.sender does not prove ownership of the withdraw key. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_FederatedAttestations.FederatedAttestationsWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_FederatedAttestations.FederatedAttestationsWrapper.md index 5b35f6c5b..365822bd5 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_FederatedAttestations.FederatedAttestationsWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_FederatedAttestations.FederatedAttestationsWrapper.md @@ -557,13 +557,13 @@ Throws if signer is not an authorized AttestationSigner of the issuer ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md new file mode 100644 index 000000000..475c88fe8 --- /dev/null +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md @@ -0,0 +1,271 @@ +[@celo/contractkit](../README.md) / [Exports](../modules.md) / [wrappers/FeeCurrencyWhitelistWrapper](../modules/wrappers_FeeCurrencyWhitelistWrapper.md) / FeeCurrencyWhitelistWrapper + +# Class: FeeCurrencyWhitelistWrapper + +[wrappers/FeeCurrencyWhitelistWrapper](../modules/wrappers_FeeCurrencyWhitelistWrapper.md).FeeCurrencyWhitelistWrapper + +FeeCurrencyWhitelist contract listing available currencies usable to pay fees + +## Hierarchy + +- [`BaseWrapper`](wrappers_BaseWrapper.BaseWrapper.md)\<`FeeCurrencyWhitelist`\> + + ↳ **`FeeCurrencyWhitelistWrapper`** + +## Table of contents + +### Constructors + +- [constructor](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#constructor) + +### Properties + +- [addToken](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#addtoken) +- [eventTypes](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#eventtypes) +- [events](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#events) +- [getWhitelist](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#getwhitelist) +- [methodIds](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#methodids) +- [removeToken](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#removetoken) + +### Accessors + +- [address](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#address) + +### Methods + +- [getFeeCurrencyInformation](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#getfeecurrencyinformation) +- [getPastEvents](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#getpastevents) +- [version](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md#version) + +## Constructors + +### constructor + +• **new FeeCurrencyWhitelistWrapper**(`connection`, `contract`): [`FeeCurrencyWhitelistWrapper`](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `connection` | `Connection` | +| `contract` | `FeeCurrencyWhitelist` | + +#### Returns + +[`FeeCurrencyWhitelistWrapper`](wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.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 + +### addToken + +• **addToken**: (...`args`: [tokenAddress: string]) => `Promise`\<`void`\> + +#### Type declaration + +▸ (`...args`): `Promise`\<`void`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | [tokenAddress: string] | + +##### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts#L78) + +___ + +### eventTypes + +• **eventTypes**: `EventsEnum`\<`FeeCurrencyWhitelist`\> + +#### 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 | +| :------ | :------ | +| `FeeCurrencyWhitelistRemoved` | `ContractEvent`\<`string`\> | +| `FeeCurrencyWhitelisted` | `ContractEvent`\<`string`\> | +| `OwnershipTransferred` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `newOwner`: `string` ; `previousOwner`: `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) + +___ + +### getWhitelist + +• **getWhitelist**: (...`args`: []) => `Promise`\<\`0x$\{string}\`[]\> + +#### Type declaration + +▸ (`...args`): `Promise`\<\`0x$\{string}\`[]\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | [] | + +##### Returns + +`Promise`\<\`0x$\{string}\`[]\> + +#### Defined in + +[packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts#L34) + +___ + +### methodIds + +• **methodIds**: `Record`\<``"initialized"`` \| ``"isOwner"`` \| ``"owner"`` \| ``"renounceOwnership"`` \| ``"transferOwnership"`` \| ``"getVersionNumber"`` \| ``"initialize"`` \| ``"addToken"`` \| ``"removeToken"`` \| ``"whitelist"`` \| ``"getWhitelist"``, `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) + +___ + +### removeToken + +• **removeToken**: (...`args`: [tokenAddress: string, index: string \| number]) => `Promise`\<`void`\> + +#### Type declaration + +▸ (`...args`): `Promise`\<`void`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | [tokenAddress: string, index: string \| number] | + +##### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts#L77) + +## Accessors + +### address + +• `get` **address**(): \`0x$\{string}\` + +Contract address + +#### Returns + +\`0x$\{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 + +### getFeeCurrencyInformation + +▸ **getFeeCurrencyInformation**(`whitelist?`): `Promise`\<\{ `adaptedToken`: `undefined` \| \`0x$\{string}\` ; `address`: \`0x$\{string}\` ; `name`: `undefined` \| `string` ; `symbol`: `undefined` \| `string` }[]\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `whitelist?` | \`0x$\{string}\`[] | + +#### Returns + +`Promise`\<\{ `adaptedToken`: `undefined` \| \`0x$\{string}\` ; `address`: \`0x$\{string}\` ; `name`: `undefined` \| `string` ; `symbol`: `undefined` \| `string` }[]\> + +#### Defined in + +[packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts:40](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts#L40) + +___ + +### getPastEvents + +▸ **getPastEvents**(`event`, `options`): `Promise`\<`EventLog`[]\> + +Contract getPastEvents + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `event` | ``"OwnershipTransferred"`` \| ``"allEvents"`` \| ``"FeeCurrencyWhitelistRemoved"`` \| ``"FeeCurrencyWhitelisted"`` | +| `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) + +___ + +### 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 a0493482a..a3971d6d4 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeHandler.FeeHandlerWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_FeeHandler.FeeHandlerWrapper.md @@ -199,13 +199,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Freezer.FreezerWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Freezer.FreezerWrapper.md index 612fa98c9..4c551e2bf 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Freezer.FreezerWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Freezer.FreezerWrapper.md @@ -186,13 +186,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md index 0ae41bbec..211393344 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_GasPriceMinimum.GasPriceMinimumWrapper.md @@ -242,13 +242,13 @@ the current block density targeted by the gas price minimum algorithm. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md index e372431ee..d4a7d8aa8 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md @@ -557,13 +557,13 @@ True if the transaction succeeds. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Governance.GovernanceWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Governance.GovernanceWrapper.md index 02c763b66..36cc28db2 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Governance.GovernanceWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Governance.GovernanceWrapper.md @@ -160,7 +160,7 @@ Only the `approver` address will succeed in sending this transaction #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:934](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L934) +[packages/sdk/contractkit/src/wrappers/Governance.ts:935](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L935) ___ @@ -190,7 +190,7 @@ Current number of possible concurrent proposals. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L159) +[packages/sdk/contractkit/src/wrappers/Governance.ts:160](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L160) ___ @@ -220,7 +220,7 @@ Current proposal dequeue frequency in seconds. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:173](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L173) +[packages/sdk/contractkit/src/wrappers/Governance.ts:174](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L174) ___ @@ -248,7 +248,7 @@ Dequeues any queued proposals if `dequeueFrequency` seconds have elapsed since t #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:685](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L685) +[packages/sdk/contractkit/src/wrappers/Governance.ts:686](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L686) ___ @@ -355,19 +355,19 @@ keccak256 hash of abi encoded transactions computed on-chain #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:956](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L956) +[packages/sdk/contractkit/src/wrappers/Governance.ts:957](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L957) ___ ### getApprover -• **getApprover**: (...`args`: []) => `Promise`\<`string`\> +• **getApprover**: (...`args`: []) => `Promise`\<\`0x$\{string}\`\> Returns the approver address for proposals and hotfixes. #### Type declaration -▸ (`...args`): `Promise`\<`string`\> +▸ (`...args`): `Promise`\<\`0x$\{string}\`\> Returns the approver address for proposals and hotfixes. @@ -379,11 +379,11 @@ Returns the approver address for proposals and hotfixes. ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:394](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L394) +[packages/sdk/contractkit/src/wrappers/Governance.ts:395](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L395) ___ @@ -415,7 +415,7 @@ Returns the metadata associated with a given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:322](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L322) +[packages/sdk/contractkit/src/wrappers/Governance.ts:323](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L323) ___ @@ -452,7 +452,7 @@ Returns the transaction at the given index associated with a given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:351](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L351) +[packages/sdk/contractkit/src/wrappers/Governance.ts:352](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L352) ___ @@ -480,7 +480,7 @@ Returns the proposal queue as list of upvote records. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:631](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L631) +[packages/sdk/contractkit/src/wrappers/Governance.ts:632](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L632) ___ @@ -512,7 +512,7 @@ Returns the value of proposal deposits that have been refunded. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:598](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L598) +[packages/sdk/contractkit/src/wrappers/Governance.ts:599](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L599) ___ @@ -544,7 +544,7 @@ Returns the current upvoted governance proposal ID and applied vote weight (zero #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:546](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L546) +[packages/sdk/contractkit/src/wrappers/Governance.ts:547](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L547) ___ @@ -568,7 +568,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:608](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L608) +[packages/sdk/contractkit/src/wrappers/Governance.ts:609](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L609) ___ @@ -600,7 +600,7 @@ Returns the yes, no, and abstain votes applied to a given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:618](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L618) +[packages/sdk/contractkit/src/wrappers/Governance.ts:619](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L619) ___ @@ -632,7 +632,7 @@ Returns the number of validators that whitelisted the hotfix #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:914](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L914) +[packages/sdk/contractkit/src/wrappers/Governance.ts:915](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L915) ___ @@ -664,7 +664,7 @@ Returns whether a given proposal is approved. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:368](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L368) +[packages/sdk/contractkit/src/wrappers/Governance.ts:369](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L369) ___ @@ -696,7 +696,7 @@ Returns whether a dequeued proposal is expired. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:377](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L377) +[packages/sdk/contractkit/src/wrappers/Governance.ts:378](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L378) ___ @@ -728,7 +728,7 @@ Returns whether a given hotfix can be passed. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:899](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L899) +[packages/sdk/contractkit/src/wrappers/Governance.ts:900](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L900) ___ @@ -764,7 +764,7 @@ Returns whether a given hotfix has been whitelisted by a given address. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:890](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L890) +[packages/sdk/contractkit/src/wrappers/Governance.ts:891](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L891) ___ @@ -796,7 +796,7 @@ Returns whether a given proposal is passing relative to the constitution's thres #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:519](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L519) +[packages/sdk/contractkit/src/wrappers/Governance.ts:520](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L520) ___ @@ -828,7 +828,7 @@ Returns whether a given proposal is queued. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:592](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L592) +[packages/sdk/contractkit/src/wrappers/Governance.ts:593](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L593) ___ @@ -860,7 +860,7 @@ Returns whether a dequeued proposal is expired. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:386](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L386) +[packages/sdk/contractkit/src/wrappers/Governance.ts:387](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L387) ___ @@ -894,7 +894,7 @@ Whether or not the account is voting on proposals. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:272](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L272) +[packages/sdk/contractkit/src/wrappers/Governance.ts:273](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L273) ___ @@ -924,7 +924,7 @@ Time of last dequeue #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:168](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L168) +[packages/sdk/contractkit/src/wrappers/Governance.ts:169](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L169) ___ @@ -968,7 +968,7 @@ Current minimum deposit. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:178](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L178) +[packages/sdk/contractkit/src/wrappers/Governance.ts:179](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L179) ___ @@ -996,7 +996,7 @@ Returns the number of validators required to reach a Byzantine quorum #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:904](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L904) +[packages/sdk/contractkit/src/wrappers/Governance.ts:905](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L905) ___ @@ -1028,7 +1028,7 @@ Marks the given hotfix prepared for current epoch if quorum of validators have w #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:944](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L944) +[packages/sdk/contractkit/src/wrappers/Governance.ts:945](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L945) ___ @@ -1060,7 +1060,7 @@ Returns whether a governance proposal exists with the given ID. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:537](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L537) +[packages/sdk/contractkit/src/wrappers/Governance.ts:538](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L538) ___ @@ -1096,7 +1096,7 @@ Submits a new governance proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:531](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L531) +[packages/sdk/contractkit/src/wrappers/Governance.ts:532](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L532) ___ @@ -1126,7 +1126,7 @@ The number of seconds a proposal can stay in the queue before expiring. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:183](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L183) +[packages/sdk/contractkit/src/wrappers/Governance.ts:184](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L184) ___ @@ -1150,7 +1150,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:858](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L858) +[packages/sdk/contractkit/src/wrappers/Governance.ts:859](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L859) ___ @@ -1182,7 +1182,7 @@ Marks the given hotfix whitelisted by `sender`. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:923](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L923) +[packages/sdk/contractkit/src/wrappers/Governance.ts:924](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L924) ___ @@ -1210,19 +1210,19 @@ Withdraws refunded proposal deposits. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:524](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L524) +[packages/sdk/contractkit/src/wrappers/Governance.ts:525](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L525) ## Accessors ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from @@ -1256,7 +1256,7 @@ Only the `approver` address will succeed in sending this transaction #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:810](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L810) +[packages/sdk/contractkit/src/wrappers/Governance.ts:811](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L811) ___ @@ -1278,7 +1278,7 @@ Executes a given proposal's associated transactions. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:864](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L864) +[packages/sdk/contractkit/src/wrappers/Governance.ts:865](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L865) ___ @@ -1298,7 +1298,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:459](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L459) +[packages/sdk/contractkit/src/wrappers/Governance.ts:460](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L460) ___ @@ -1314,7 +1314,7 @@ Returns the approver multisig contract for proposals and hotfixes. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:399](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L399) +[packages/sdk/contractkit/src/wrappers/Governance.ts:400](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L400) ___ @@ -1330,7 +1330,7 @@ Returns current configuration parameters. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:277](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L277) +[packages/sdk/contractkit/src/wrappers/Governance.ts:278](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L278) ___ @@ -1352,7 +1352,7 @@ Returns the required ratio of yes:no votes needed to exceed in order to pass the #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:213](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L213) +[packages/sdk/contractkit/src/wrappers/Governance.ts:214](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L214) ___ @@ -1374,7 +1374,7 @@ Returns the (existing) proposal dequeue as list of proposal IDs. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:645](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L645) +[packages/sdk/contractkit/src/wrappers/Governance.ts:646](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L646) ___ @@ -1396,7 +1396,7 @@ Returns approved, executed, and prepared status associated with a given hotfix. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:876](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L876) +[packages/sdk/contractkit/src/wrappers/Governance.ts:877](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L877) ___ @@ -1416,7 +1416,7 @@ Returns human readable configuration of the governance contract #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:300](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L300) +[packages/sdk/contractkit/src/wrappers/Governance.ts:301](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L301) ___ @@ -1438,7 +1438,7 @@ Returns the human readable metadata associated with a given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:338](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L338) +[packages/sdk/contractkit/src/wrappers/Governance.ts:339](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L339) ___ @@ -1456,7 +1456,7 @@ The participation parameters. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:228](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L228) +[packages/sdk/contractkit/src/wrappers/Governance.ts:229](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L229) ___ @@ -1505,7 +1505,7 @@ Returns the proposal associated with a given id. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:453](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L453) +[packages/sdk/contractkit/src/wrappers/Governance.ts:454](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L454) ___ @@ -1527,7 +1527,7 @@ Returns the stage, metadata, upvotes, votes, and transactions associated with a #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:483](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L483) +[packages/sdk/contractkit/src/wrappers/Governance.ts:484](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L484) ___ @@ -1547,7 +1547,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:402](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L402) +[packages/sdk/contractkit/src/wrappers/Governance.ts:403](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L403) ___ @@ -1567,7 +1567,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:247](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L247) +[packages/sdk/contractkit/src/wrappers/Governance.ts:248](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L248) ___ @@ -1588,7 +1588,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:240](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L240) +[packages/sdk/contractkit/src/wrappers/Governance.ts:241](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L241) ___ @@ -1610,7 +1610,7 @@ Returns the required ratio of yes:no votes needed to exceed in order to pass the #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:200](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L200) +[packages/sdk/contractkit/src/wrappers/Governance.ts:201](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L201) ___ @@ -1633,7 +1633,7 @@ Returns the corresponding vote record #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:569](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L569) +[packages/sdk/contractkit/src/wrappers/Governance.ts:570](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L570) ___ @@ -1653,7 +1653,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:655](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L655) +[packages/sdk/contractkit/src/wrappers/Governance.ts:656](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L656) ___ @@ -1675,7 +1675,7 @@ Returns the number of votes that will be applied to a proposal for a given voter #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:694](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L694) +[packages/sdk/contractkit/src/wrappers/Governance.ts:695](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L695) ___ @@ -1695,7 +1695,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:669](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L669) +[packages/sdk/contractkit/src/wrappers/Governance.ts:670](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L670) ___ @@ -1715,7 +1715,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:439](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L439) +[packages/sdk/contractkit/src/wrappers/Governance.ts:440](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L440) ___ @@ -1735,7 +1735,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:555](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L555) +[packages/sdk/contractkit/src/wrappers/Governance.ts:556](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L556) ___ @@ -1755,7 +1755,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:661](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L661) +[packages/sdk/contractkit/src/wrappers/Governance.ts:662](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L662) ___ @@ -1775,7 +1775,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:414](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L414) +[packages/sdk/contractkit/src/wrappers/Governance.ts:415](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L415) ___ @@ -1797,7 +1797,7 @@ Revokes provided upvoter's upvote. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:797](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L797) +[packages/sdk/contractkit/src/wrappers/Governance.ts:798](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L798) ___ @@ -1817,7 +1817,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:735](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L735) +[packages/sdk/contractkit/src/wrappers/Governance.ts:736](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L736) ___ @@ -1835,7 +1835,7 @@ Durations for approval, referendum and execution stages in seconds. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:188](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L188) +[packages/sdk/contractkit/src/wrappers/Governance.ts:189](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L189) ___ @@ -1858,7 +1858,7 @@ Applies provided upvoter's upvote to given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:781](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L781) +[packages/sdk/contractkit/src/wrappers/Governance.ts:782](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L782) ___ @@ -1899,7 +1899,7 @@ Applies `sender`'s vote choice to a given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:823](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L823) +[packages/sdk/contractkit/src/wrappers/Governance.ts:824](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L824) ___ @@ -1924,4 +1924,4 @@ Applies `sender`'s vote choice to a given proposal. #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:839](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L839) +[packages/sdk/contractkit/src/wrappers/Governance.ts:840](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L840) diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md index 832908497..ede641a23 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md @@ -490,13 +490,13 @@ Withdraws a gold that has been unlocked after the unlocking period has passed. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_MultiSig.MultiSigWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_MultiSig.MultiSigWrapper.md index 139b55b2f..d9883b7b5 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_MultiSig.MultiSigWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_MultiSig.MultiSigWrapper.md @@ -301,13 +301,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_OdisPayments.OdisPaymentsWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_OdisPayments.OdisPaymentsWrapper.md index af6217ead..2aaa0649a 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_OdisPayments.OdisPaymentsWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_OdisPayments.OdisPaymentsWrapper.md @@ -199,13 +199,13 @@ Fetches total amount sent (all-time) for given account to odisPayments ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md index bff806823..fc322f757 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md @@ -149,7 +149,7 @@ Relocks gold that has been unlocked but not withdrawn. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:378](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L378) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:386](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L386) ___ @@ -177,7 +177,7 @@ Beneficiary creates an account on behalf of the ReleaseGold contract. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:407](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L407) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:415](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L415) ___ @@ -226,19 +226,19 @@ ___ ### getBeneficiary -• **getBeneficiary**: () => `Promise`\<`string`\> +• **getBeneficiary**: () => `Promise`\<\`0x$\{string}\`\> Returns the beneficiary of the ReleaseGold contract #### Type declaration -▸ (): `Promise`\<`string`\> +▸ (): `Promise`\<\`0x$\{string}\`\> Returns the beneficiary of the ReleaseGold contract ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The address of the beneficiary. @@ -268,7 +268,7 @@ If the contract can validate #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L135) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:143](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L143) ___ @@ -292,7 +292,7 @@ If the contract can vote #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L141) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:149](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L149) ___ @@ -316,7 +316,7 @@ The already released gold amount up to the point of call #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:267](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L267) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:275](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L275) ___ @@ -340,7 +340,7 @@ If the liquidity provision is met. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:127](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L127) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L135) ___ @@ -366,79 +366,79 @@ The max amount of gold currently withdrawable. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:158](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L158) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L166) ___ ### getOwner -• **getOwner**: () => `Promise`\<`string`\> +• **getOwner**: () => `Promise`\<\`0x$\{string}\`\> Returns the owner's address of the ReleaseGold contract #### Type declaration -▸ (): `Promise`\<`string`\> +▸ (): `Promise`\<\`0x$\{string}\`\> Returns the owner's address of the ReleaseGold contract ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The owner's address. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L121) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:127](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L127) ___ ### getRefundAddress -• **getRefundAddress**: () => `Promise`\<`string`\> +• **getRefundAddress**: () => `Promise`\<\`0x$\{string}\`\> Returns the refund address of the ReleaseGold contract #### Type declaration -▸ (): `Promise`\<`string`\> +▸ (): `Promise`\<\`0x$\{string}\`\> Returns the refund address of the ReleaseGold contract ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The refundAddress. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L115) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L119) ___ ### getReleaseOwner -• **getReleaseOwner**: () => `Promise`\<`string`\> +• **getReleaseOwner**: () => `Promise`\<\`0x$\{string}\`\> Returns the releaseOwner address of the ReleaseGold contract #### Type declaration -▸ (): `Promise`\<`string`\> +▸ (): `Promise`\<\`0x$\{string}\`\> Returns the releaseOwner address of the ReleaseGold contract ##### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The address of the releaseOwner. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L109) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:111](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L111) ___ @@ -462,7 +462,7 @@ The remaining locked ReleaseGold instance gold balance #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:257](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L257) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:265](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L265) ___ @@ -486,7 +486,7 @@ The remaining total ReleaseGold instance balance #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:237](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L237) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:245](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L245) ___ @@ -510,7 +510,7 @@ The available unlocked ReleaseGold instance gold balance #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:247](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L247) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:255](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L255) ___ @@ -534,7 +534,7 @@ The total ReleaseGold instance balance #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:227](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L227) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:235](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L235) ___ @@ -558,7 +558,7 @@ The total withdrawn amount from the ReleaseGold contract #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:147](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L147) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:155](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L155) ___ @@ -582,7 +582,7 @@ The amount that can be yet withdrawn #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:277](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L277) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:285](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L285) ___ @@ -606,7 +606,7 @@ A boolean indicating revoked releasing (true) or non-revoked(false). #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:203](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L203) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:211](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L211) ___ @@ -638,7 +638,7 @@ Locks gold to be used for voting. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:311](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L311) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:319](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L319) ___ @@ -676,7 +676,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:302](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L302) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:310](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L310) ___ @@ -700,7 +700,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:296](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L296) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:304](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L304) ___ @@ -724,7 +724,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:287](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L287) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:295](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L295) ___ @@ -764,7 +764,7 @@ Beneficiary creates an account on behalf of the ReleaseGold contract. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:415](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L415) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:423](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L423) ___ @@ -796,7 +796,7 @@ Sets the data encryption of the account #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:442](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L442) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:450](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L450) ___ @@ -828,7 +828,7 @@ Sets the metadataURL for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:427](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L427) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:435](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L435) ___ @@ -860,7 +860,7 @@ Sets the name for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:421](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L421) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:429](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L429) ___ @@ -892,7 +892,7 @@ Sets the wallet address for the account #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:433](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L433) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:441](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L441) ___ @@ -920,7 +920,7 @@ Sets the contract's beneficiary #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:466](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L466) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:474](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L474) ___ @@ -952,7 +952,7 @@ Sets the contract's `canExpire` field to `_canExpire` #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:456](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L456) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:464](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L464) ___ @@ -980,7 +980,7 @@ Sets the contract's liquidity provision to true #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:450](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L450) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:458](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L458) ___ @@ -1008,7 +1008,7 @@ Sets the contract's max distribution #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:461](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L461) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:469](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L469) ___ @@ -1033,7 +1033,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:317](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L317) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:325](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L325) ___ @@ -1065,7 +1065,7 @@ Unlocks gold that becomes withdrawable after the unlocking period. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:327](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L327) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:335](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L335) ___ @@ -1097,7 +1097,7 @@ Transfer released gold from the ReleaseGold instance back to beneficiary. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:398](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L398) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:406](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L406) ___ @@ -1129,19 +1129,19 @@ Withdraw gold in the ReleaseGold instance that has been unlocked but not withdra #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:388](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L388) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:396](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L396) ## Accessors ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from @@ -1174,7 +1174,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:584](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L584) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:592](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L592) ___ @@ -1199,7 +1199,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:495](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L495) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:503](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L503) ___ @@ -1226,7 +1226,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:546](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L546) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:554](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L554) ___ @@ -1251,7 +1251,7 @@ A CeloTransactionObject #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:474](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L474) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:482](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L482) ___ @@ -1332,7 +1332,7 @@ The balance at revocation time. 0 can also indicate not revoked. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:218](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L218) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:226](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L226) ___ @@ -1350,7 +1350,7 @@ A RevocationInfo struct. #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:168](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L168) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:176](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L176) ___ @@ -1368,7 +1368,7 @@ The timestamp of the release schedule revocation #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:209](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L209) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:217](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L217) ___ @@ -1386,7 +1386,7 @@ A boolean indicating revocable releasing (true) or non-revocable(false). #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:194](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L194) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:202](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L202) ___ @@ -1408,7 +1408,7 @@ Relocks gold in the ReleaseGold instance that has been unlocked but not withdraw #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:344](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L344) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:352](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L352) ___ @@ -1436,7 +1436,7 @@ prefer revokeValueFromVotes #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:674](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L674) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:682](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L682) ___ @@ -1464,7 +1464,7 @@ Prefer revokeActiveVotes #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:640](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L640) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:648](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L648) ___ @@ -1487,7 +1487,7 @@ Revokes active votes #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:664](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L664) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:672](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L672) ___ @@ -1501,7 +1501,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:722](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L722) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:730](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L730) ___ @@ -1521,7 +1521,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:704](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L704) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:712](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L712) ___ @@ -1549,7 +1549,7 @@ prefer revokePendingVotes #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:606](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L606) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:614](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L614) ___ @@ -1572,7 +1572,7 @@ Revokes pending votes #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:630](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L630) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:638](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L638) ___ @@ -1595,7 +1595,7 @@ Revokes value from pending/active aggregate #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:701](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L701) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:709](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L709) ___ @@ -1609,7 +1609,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:333](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L333) +[packages/sdk/contractkit/src/wrappers/ReleaseGold.ts:341](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts#L341) ___ diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Reserve.ReserveWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Reserve.ReserveWrapper.md index c62d83937..07aeb61a4 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Reserve.ReserveWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Reserve.ReserveWrapper.md @@ -598,13 +598,13 @@ ___ ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_SortedOracles.SortedOraclesWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_SortedOracles.SortedOraclesWrapper.md index 00958c4b2..855015fb4 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_SortedOracles.SortedOraclesWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_SortedOracles.SortedOraclesWrapper.md @@ -167,13 +167,13 @@ Current report expiry. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md index 35b770011..46ce717cc 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_StableTokenWrapper.StableTokenWrapper.md @@ -680,13 +680,13 @@ True if the transaction succeeds. ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from diff --git a/packages/docs/sdk/docs/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md b/packages/docs/sdk/docs/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md index 37579e980..8e4816f35 100644 --- a/packages/docs/sdk/docs/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md +++ b/packages/docs/sdk/docs/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md @@ -839,13 +839,13 @@ Updates a validator group's commission based on the previously queued update ### address -• `get` **address**(): `string` +• `get` **address**(): \`0x$\{string}\` Contract address #### Returns -`string` +\`0x$\{string}\` #### Inherited from @@ -899,13 +899,13 @@ ___ ### currentValidatorAccountsSet -▸ **currentValidatorAccountsSet**(): `Promise`\<\{ `account`: `string` ; `signer`: `string` }[]\> +▸ **currentValidatorAccountsSet**(): `Promise`\<\{ `account`: \`0x$\{string}\` ; `signer`: `string` }[]\> Returns the current set of validator signer and account addresses #### Returns -`Promise`\<\{ `account`: `string` ; `signer`: `string` }[]\> +`Promise`\<\{ `account`: \`0x$\{string}\` ; `signer`: `string` }[]\> #### Defined in @@ -1410,7 +1410,7 @@ ___ ### signerToAccount -▸ **signerToAccount**(`signerAddress`): `Promise`\<`string`\> +▸ **signerToAccount**(`signerAddress`): `Promise`\<\`0x$\{string}\`\> Returns the account associated with `signer`. @@ -1422,7 +1422,7 @@ Returns the account associated with `signer`. #### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The associated account. @@ -1438,7 +1438,7 @@ ___ ### validatorSignerToAccount -▸ **validatorSignerToAccount**(`signerAddress`): `Promise`\<`string`\> +▸ **validatorSignerToAccount**(`signerAddress`): `Promise`\<\`0x$\{string}\`\> Returns the account associated with `signer`. @@ -1450,7 +1450,7 @@ Returns the account associated with `signer`. #### Returns -`Promise`\<`string`\> +`Promise`\<\`0x$\{string}\`\> The associated account. diff --git a/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.ProposalStage.md b/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.ProposalStage.md index 8091c67db..b91b21756 100644 --- a/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.ProposalStage.md +++ b/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.ProposalStage.md @@ -23,7 +23,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L33) +[packages/sdk/contractkit/src/wrappers/Governance.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L34) ___ @@ -33,7 +33,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:35](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L35) +[packages/sdk/contractkit/src/wrappers/Governance.ts:36](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L36) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:36](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L36) +[packages/sdk/contractkit/src/wrappers/Governance.ts:37](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L37) ___ @@ -53,7 +53,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:31](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L31) +[packages/sdk/contractkit/src/wrappers/Governance.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L32) ___ @@ -63,7 +63,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L32) +[packages/sdk/contractkit/src/wrappers/Governance.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L33) ___ @@ -73,4 +73,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L34) +[packages/sdk/contractkit/src/wrappers/Governance.ts:35](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L35) diff --git a/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.VoteValue.md b/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.VoteValue.md index 48d2eeea1..e033833ab 100644 --- a/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.VoteValue.md +++ b/packages/docs/sdk/docs/contractkit/enums/wrappers_Governance.VoteValue.md @@ -21,7 +21,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:111](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L111) +[packages/sdk/contractkit/src/wrappers/Governance.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L112) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L112) +[packages/sdk/contractkit/src/wrappers/Governance.ts:113](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L113) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:110](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L110) +[packages/sdk/contractkit/src/wrappers/Governance.ts:111](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L111) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:113](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L113) +[packages/sdk/contractkit/src/wrappers/Governance.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L114) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md b/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md index 5e353d413..139fda0f5 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/kit.NetworkConfig.md @@ -28,7 +28,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:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L66) ___ @@ -38,7 +38,7 @@ ___ #### 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:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L74) ___ @@ -48,7 +48,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:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L73) ___ @@ -58,7 +58,7 @@ ___ #### 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) +[packages/sdk/contractkit/src/kit.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L65) ___ @@ -68,7 +68,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:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L70) ___ @@ -78,7 +78,7 @@ ___ #### 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) +[packages/sdk/contractkit/src/kit.ts:67](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L67) ___ @@ -88,7 +88,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:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L68) ___ @@ -98,7 +98,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:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L71) ___ @@ -108,7 +108,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:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L69) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L70) +[packages/sdk/contractkit/src/kit.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L64) ___ @@ -128,4 +128,4 @@ ___ #### 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:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L72) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectableValidators.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectableValidators.md index 0ff4890b6..c8691d2af 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectableValidators.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectableValidators.md @@ -19,7 +19,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L58) +[packages/sdk/contractkit/src/wrappers/Election.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L65) ___ @@ -29,4 +29,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L57) +[packages/sdk/contractkit/src/wrappers/Election.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L64) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectionConfig.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectionConfig.md index e61734176..0fe36e5d0 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectionConfig.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ElectionConfig.md @@ -22,7 +22,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L66) +[packages/sdk/contractkit/src/wrappers/Election.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L73) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L63) +[packages/sdk/contractkit/src/wrappers/Election.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L70) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L62) +[packages/sdk/contractkit/src/wrappers/Election.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L69) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L64) +[packages/sdk/contractkit/src/wrappers/Election.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L71) ___ @@ -62,4 +62,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L65) +[packages/sdk/contractkit/src/wrappers/Election.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L72) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVote.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVote.md index edb87d82a..b9787de40 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVote.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVote.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L47) +[packages/sdk/contractkit/src/wrappers/Election.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L54) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L45) +[packages/sdk/contractkit/src/wrappers/Election.ts:52](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L52) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L46) +[packages/sdk/contractkit/src/wrappers/Election.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L53) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVoterReward.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVoterReward.md index 5266670fd..72f6c39c5 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVoterReward.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.GroupVoterReward.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L53) +[packages/sdk/contractkit/src/wrappers/Election.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L60) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L51) +[packages/sdk/contractkit/src/wrappers/Election.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L58) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:52](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L52) +[packages/sdk/contractkit/src/wrappers/Election.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L59) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ValidatorGroupVote.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ValidatorGroupVote.md index dfa5f5ce4..5b7348422 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ValidatorGroupVote.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.ValidatorGroupVote.md @@ -22,7 +22,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L25) +[packages/sdk/contractkit/src/wrappers/Election.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L32) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L28) +[packages/sdk/contractkit/src/wrappers/Election.ts:35](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L35) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L29) +[packages/sdk/contractkit/src/wrappers/Election.ts:36](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L36) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L26) +[packages/sdk/contractkit/src/wrappers/Election.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L33) ___ @@ -62,4 +62,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L27) +[packages/sdk/contractkit/src/wrappers/Election.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L34) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.Voter.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.Voter.md index 0b6133ded..c3c016795 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.Voter.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.Voter.md @@ -19,7 +19,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L33) +[packages/sdk/contractkit/src/wrappers/Election.ts:40](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L40) ___ @@ -29,4 +29,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L34) +[packages/sdk/contractkit/src/wrappers/Election.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L41) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.VoterReward.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.VoterReward.md index 804225de6..ca8b2f5c9 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.VoterReward.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Election.VoterReward.md @@ -21,7 +21,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L38) +[packages/sdk/contractkit/src/wrappers/Election.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L45) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:39](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L39) +[packages/sdk/contractkit/src/wrappers/Election.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L46) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L41) +[packages/sdk/contractkit/src/wrappers/Election.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L48) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:40](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L40) +[packages/sdk/contractkit/src/wrappers/Election.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L47) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.GovernanceConfig.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.GovernanceConfig.md index 9d68f100f..aa7f86f8d 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.GovernanceConfig.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.GovernanceConfig.md @@ -23,7 +23,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:56](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L56) +[packages/sdk/contractkit/src/wrappers/Governance.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L57) ___ @@ -33,7 +33,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:57](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L57) +[packages/sdk/contractkit/src/wrappers/Governance.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L58) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:58](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L58) +[packages/sdk/contractkit/src/wrappers/Governance.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L59) ___ @@ -53,7 +53,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L61) +[packages/sdk/contractkit/src/wrappers/Governance.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L62) ___ @@ -63,7 +63,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L59) +[packages/sdk/contractkit/src/wrappers/Governance.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L60) ___ @@ -73,4 +73,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L60) +[packages/sdk/contractkit/src/wrappers/Governance.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L61) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.HotfixRecord.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.HotfixRecord.md index a634035fe..a8a524e30 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.HotfixRecord.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.HotfixRecord.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:129](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L129) +[packages/sdk/contractkit/src/wrappers/Governance.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L130) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L130) +[packages/sdk/contractkit/src/wrappers/Governance.ts:131](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L131) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:131](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L131) +[packages/sdk/contractkit/src/wrappers/Governance.ts:132](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L132) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ParticipationParameters.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ParticipationParameters.md index 41d0e2f94..46079347c 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ParticipationParameters.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ParticipationParameters.md @@ -21,7 +21,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:49](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L49) +[packages/sdk/contractkit/src/wrappers/Governance.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L50) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L50) +[packages/sdk/contractkit/src/wrappers/Governance.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L51) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:52](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L52) +[packages/sdk/contractkit/src/wrappers/Governance.ts:53](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L53) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L51) +[packages/sdk/contractkit/src/wrappers/Governance.ts:52](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L52) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalMetadata.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalMetadata.md index 8cc6a44d0..9f643a0db 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalMetadata.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalMetadata.md @@ -22,7 +22,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L66) +[packages/sdk/contractkit/src/wrappers/Governance.ts:67](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L67) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L69) +[packages/sdk/contractkit/src/wrappers/Governance.ts:70](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L70) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L65) +[packages/sdk/contractkit/src/wrappers/Governance.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L66) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:67](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L67) +[packages/sdk/contractkit/src/wrappers/Governance.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L68) ___ @@ -62,4 +62,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L68) +[packages/sdk/contractkit/src/wrappers/Governance.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L69) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalRecord.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalRecord.md index 69ba2912c..047589c3a 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalRecord.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.ProposalRecord.md @@ -25,7 +25,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L100) +[packages/sdk/contractkit/src/wrappers/Governance.ts:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L101) ___ @@ -35,7 +35,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:97](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L97) +[packages/sdk/contractkit/src/wrappers/Governance.ts:98](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L98) ___ @@ -45,7 +45,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:94](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L94) +[packages/sdk/contractkit/src/wrappers/Governance.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L95) ___ @@ -55,7 +55,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:98](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L98) +[packages/sdk/contractkit/src/wrappers/Governance.ts:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L99) ___ @@ -65,7 +65,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:95](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L95) +[packages/sdk/contractkit/src/wrappers/Governance.ts:96](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L96) ___ @@ -75,7 +75,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:96](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L96) +[packages/sdk/contractkit/src/wrappers/Governance.ts:97](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L97) ___ @@ -85,7 +85,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L99) +[packages/sdk/contractkit/src/wrappers/Governance.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L100) ___ @@ -95,4 +95,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:101](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L101) +[packages/sdk/contractkit/src/wrappers/Governance.ts:102](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L102) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.UpvoteRecord.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.UpvoteRecord.md index bec089b05..b61f18211 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.UpvoteRecord.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.UpvoteRecord.md @@ -19,7 +19,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:105](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L105) +[packages/sdk/contractkit/src/wrappers/Governance.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L106) ___ @@ -29,4 +29,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L106) +[packages/sdk/contractkit/src/wrappers/Governance.ts:107](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L107) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.VoteRecord.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.VoteRecord.md index 62f17104d..37ac0eeab 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.VoteRecord.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.VoteRecord.md @@ -23,7 +23,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L140) +[packages/sdk/contractkit/src/wrappers/Governance.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L141) ___ @@ -33,7 +33,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L139) +[packages/sdk/contractkit/src/wrappers/Governance.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L140) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L135) +[packages/sdk/contractkit/src/wrappers/Governance.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L136) ___ @@ -53,7 +53,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:137](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L137) +[packages/sdk/contractkit/src/wrappers/Governance.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L138) ___ @@ -63,7 +63,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:136](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L136) +[packages/sdk/contractkit/src/wrappers/Governance.ts:137](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L137) ___ @@ -73,4 +73,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L138) +[packages/sdk/contractkit/src/wrappers/Governance.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L139) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Voter.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Voter.md index b05fd745b..b53019ccd 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Voter.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Voter.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:146](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L146) +[packages/sdk/contractkit/src/wrappers/Governance.ts:147](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L147) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:144](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L144) +[packages/sdk/contractkit/src/wrappers/Governance.ts:145](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L145) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:145](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L145) +[packages/sdk/contractkit/src/wrappers/Governance.ts:146](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L146) diff --git a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Votes.md b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Votes.md index 8ca978ce0..b118de734 100644 --- a/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Votes.md +++ b/packages/docs/sdk/docs/contractkit/interfaces/wrappers_Governance.Votes.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:117](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L117) +[packages/sdk/contractkit/src/wrappers/Governance.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L118) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L118) +[packages/sdk/contractkit/src/wrappers/Governance.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L119) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L119) +[packages/sdk/contractkit/src/wrappers/Governance.ts:120](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L120) diff --git a/packages/docs/sdk/docs/contractkit/modules.md b/packages/docs/sdk/docs/contractkit/modules.md index 109a4fcb4..c8a73e172 100644 --- a/packages/docs/sdk/docs/contractkit/modules.md +++ b/packages/docs/sdk/docs/contractkit/modules.md @@ -46,6 +46,7 @@ - [wrappers/Erc20Wrapper](modules/wrappers_Erc20Wrapper.md) - [wrappers/Escrow](modules/wrappers_Escrow.md) - [wrappers/FederatedAttestations](modules/wrappers_FederatedAttestations.md) +- [wrappers/FeeCurrencyWhitelistWrapper](modules/wrappers_FeeCurrencyWhitelistWrapper.md) - [wrappers/FeeHandler](modules/wrappers_FeeHandler.md) - [wrappers/Freezer](modules/wrappers_Freezer.md) - [wrappers/GasPriceMinimum](modules/wrappers_GasPriceMinimum.md) diff --git a/packages/docs/sdk/docs/contractkit/modules/contract_cache.md b/packages/docs/sdk/docs/contractkit/modules/contract_cache.md index ecf22dea3..3ed75c3d9 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:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L68) +[packages/sdk/contractkit/src/contract-cache.ts:69](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/contract-cache.ts#L69) diff --git a/packages/docs/sdk/docs/contractkit/modules/kit.md b/packages/docs/sdk/docs/contractkit/modules/kit.md index de273bf72..0aeae8c28 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:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L45) +[packages/sdk/contractkit/src/kit.ts:39](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L39) ___ @@ -88,7 +88,7 @@ Creates a new instance of the `ContractKit` with a web3 instance #### Defined in -[packages/sdk/contractkit/src/kit.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L65) +[packages/sdk/contractkit/src/kit.ts:59](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L59) ___ @@ -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:56](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L56) +[packages/sdk/contractkit/src/kit.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L50) diff --git a/packages/docs/sdk/docs/contractkit/modules/wrappers_Accounts.md b/packages/docs/sdk/docs/contractkit/modules/wrappers_Accounts.md index 11acebc76..9ce782319 100644 --- a/packages/docs/sdk/docs/contractkit/modules/wrappers_Accounts.md +++ b/packages/docs/sdk/docs/contractkit/modules/wrappers_Accounts.md @@ -20,4 +20,4 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Accounts.ts:508](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L508) +[packages/sdk/contractkit/src/wrappers/Accounts.ts:511](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Accounts.ts#L511) diff --git a/packages/docs/sdk/docs/contractkit/modules/wrappers_Election.md b/packages/docs/sdk/docs/contractkit/modules/wrappers_Election.md index 184fbd3f6..b75ad908d 100644 --- a/packages/docs/sdk/docs/contractkit/modules/wrappers_Election.md +++ b/packages/docs/sdk/docs/contractkit/modules/wrappers_Election.md @@ -30,4 +30,4 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Election.ts:576](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L576) +[packages/sdk/contractkit/src/wrappers/Election.ts:592](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Election.ts#L592) diff --git a/packages/docs/sdk/docs/contractkit/modules/wrappers_FeeCurrencyWhitelistWrapper.md b/packages/docs/sdk/docs/contractkit/modules/wrappers_FeeCurrencyWhitelistWrapper.md new file mode 100644 index 000000000..4430ded0f --- /dev/null +++ b/packages/docs/sdk/docs/contractkit/modules/wrappers_FeeCurrencyWhitelistWrapper.md @@ -0,0 +1,23 @@ +[@celo/contractkit](../README.md) / [Exports](../modules.md) / wrappers/FeeCurrencyWhitelistWrapper + +# Module: wrappers/FeeCurrencyWhitelistWrapper + +## Table of contents + +### Classes + +- [FeeCurrencyWhitelistWrapper](../classes/wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md) + +### Type Aliases + +- [GoldTokenWrapperType](wrappers_FeeCurrencyWhitelistWrapper.md#goldtokenwrappertype) + +## Type Aliases + +### GoldTokenWrapperType + +Ƭ **GoldTokenWrapperType**: [`FeeCurrencyWhitelistWrapper`](../classes/wrappers_FeeCurrencyWhitelistWrapper.FeeCurrencyWhitelistWrapper.md) + +#### Defined in + +[packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts:81](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts#L81) diff --git a/packages/docs/sdk/docs/contractkit/modules/wrappers_Governance.md b/packages/docs/sdk/docs/contractkit/modules/wrappers_Governance.md index 9965d08f0..5c1db26ff 100644 --- a/packages/docs/sdk/docs/contractkit/modules/wrappers_Governance.md +++ b/packages/docs/sdk/docs/contractkit/modules/wrappers_Governance.md @@ -46,7 +46,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:959](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L959) +[packages/sdk/contractkit/src/wrappers/Governance.ts:960](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L960) ___ @@ -56,7 +56,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L122) +[packages/sdk/contractkit/src/wrappers/Governance.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L123) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L74) +[packages/sdk/contractkit/src/wrappers/Governance.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L75) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L72) +[packages/sdk/contractkit/src/wrappers/Governance.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L73) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L73) +[packages/sdk/contractkit/src/wrappers/Governance.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L74) ## Functions @@ -107,7 +107,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L123) +[packages/sdk/contractkit/src/wrappers/Governance.ts:124](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L124) ___ @@ -128,4 +128,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/Governance.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L76) +[packages/sdk/contractkit/src/wrappers/Governance.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/Governance.ts#L77) diff --git a/packages/docs/sdk/docs/keystores/modules/test_constants.md b/packages/docs/sdk/docs/keystores/modules/test_constants.md index a3fa738d1..a2d9a2d90 100644 --- a/packages/docs/sdk/docs/keystores/modules/test_constants.md +++ b/packages/docs/sdk/docs/keystores/modules/test_constants.md @@ -21,7 +21,7 @@ ### ADDRESS1 -• `Const` **ADDRESS1**: `string` +• `Const` **ADDRESS1**: \`0x$\{string}\` #### Defined in @@ -31,7 +31,7 @@ ___ ### ADDRESS2 -• `Const` **ADDRESS2**: `string` +• `Const` **ADDRESS2**: \`0x$\{string}\` #### Defined in diff --git a/packages/docs/sdk/docs/utils/modules/address.md b/packages/docs/sdk/docs/utils/modules/address.md index 273197071..5221bdab1 100644 --- a/packages/docs/sdk/docs/utils/modules/address.md +++ b/packages/docs/sdk/docs/utils/modules/address.md @@ -200,7 +200,7 @@ ___ ### isValidAddress -▸ **isValidAddress**(`input`): `boolean` +▸ **isValidAddress**(`input`): input is \`0x$\{string}\` #### Parameters @@ -210,11 +210,11 @@ ___ #### Returns -`boolean` +input is \`0x$\{string}\` #### Defined in -[packages/sdk/utils/src/address.ts:44](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L44) +[packages/sdk/utils/src/address.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L46) ___ @@ -259,7 +259,7 @@ ___ #### Defined in -[packages/sdk/utils/src/address.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L41) +[packages/sdk/utils/src/address.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L43) ___ @@ -335,7 +335,7 @@ ___ ### normalizeAddressWith0x -▸ **normalizeAddressWith0x**(`a`): `string` +▸ **normalizeAddressWith0x**(`a`): \`0x$\{string}\` #### Parameters @@ -345,7 +345,7 @@ ___ #### Returns -`string` +\`0x$\{string}\` #### Defined in @@ -355,7 +355,7 @@ ___ ### privateKeyToAddress -▸ **privateKeyToAddress**(`privateKey`): `string` +▸ **privateKeyToAddress**(`privateKey`): \`0x$\{string}\` #### Parameters @@ -365,7 +365,7 @@ ___ #### Returns -`string` +\`0x$\{string}\` #### Defined in @@ -389,13 +389,13 @@ ___ #### Defined in -[packages/sdk/utils/src/address.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L33) +[packages/sdk/utils/src/address.ts:35](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L35) ___ ### publicKeyToAddress -▸ **publicKeyToAddress**(`publicKey`): `string` +▸ **publicKeyToAddress**(`publicKey`): \`0x$\{string}\` #### Parameters @@ -405,11 +405,11 @@ ___ #### Returns -`string` +\`0x$\{string}\` #### Defined in -[packages/sdk/utils/src/address.ts:36](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L36) +[packages/sdk/utils/src/address.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/utils/src/address.ts#L38) ___ diff --git a/packages/sdk/base/src/address.ts b/packages/sdk/base/src/address.ts index 26c008612..44f640612 100644 --- a/packages/sdk/base/src/address.ts +++ b/packages/sdk/base/src/address.ts @@ -10,7 +10,8 @@ export const normalizeAddress = (a: Address) => trimLeading0x(a).toLowerCase() export const isNullAddress = (a: Address) => normalizeAddress(a) === normalizeAddress(NULL_ADDRESS) -export const normalizeAddressWith0x = (a: Address) => ensureLeading0x(a).toLowerCase() +export const normalizeAddressWith0x = (a: Address) => + ensureLeading0x(a).toLowerCase() as StrongAddress export const trimLeading0x = (input: string) => (input.startsWith('0x') ? input.slice(2) : input) diff --git a/packages/sdk/connect/src/celo-provider.ts b/packages/sdk/connect/src/celo-provider.ts index d17b8d073..fce5b071c 100644 --- a/packages/sdk/connect/src/celo-provider.ts +++ b/packages/sdk/connect/src/celo-provider.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { Lock } from '@celo/base/lib/lock' import debugFactory from 'debug' import { Connection } from './connection' @@ -78,7 +79,7 @@ export class CeloProvider implements Provider { */ send(payload: JsonRpcPayload, callback: Callback): void { let txParams: any - let address: string + let address: StrongAddress debugPayload('%O', payload) diff --git a/packages/sdk/connect/src/connection.ts b/packages/sdk/connect/src/connection.ts index 2fbc48005..2265248cc 100644 --- a/packages/sdk/connect/src/connection.ts +++ b/packages/sdk/connect/src/connection.ts @@ -1,4 +1,5 @@ // tslint:disable: ordered-imports +import { StrongAddress } from '@celo/base' import { ensureLeading0x, toChecksumAddress } from '@celo/utils/lib/address' import { EIP712TypedData, generateTypedDataHash } from '@celo/utils/lib/sign-typed-data-utils' import { Signature, parseSignatureWithoutPrefix } from '@celo/utils/lib/signatureUtils' @@ -43,8 +44,8 @@ const debugGasEstimation = debugFactory('connection:gas-estimation') type BN = ReturnType export interface ConnectionOptions { gasInflationFactor: number - feeCurrency?: Address - from?: Address + feeCurrency?: StrongAddress + from?: StrongAddress } /** @@ -70,7 +71,7 @@ export class Connection { this.setProvider(existingProvider) // TODO: Add this line with the wallets separation completed // this.wallet = _wallet ?? new LocalWallet() - this.config.from = web3.eth.defaultAccount ?? undefined + this.config.from = (web3.eth.defaultAccount as StrongAddress) ?? undefined this.paramsPopulator = new TxParamsNormalizer(this) } @@ -103,7 +104,7 @@ export class Connection { /** * Set default account for generated transactions (eg. tx.from ) */ - set defaultAccount(address: Address | undefined) { + set defaultAccount(address: StrongAddress | undefined) { this.config.from = address this.web3.eth.defaultAccount = address ? address : null } @@ -111,7 +112,7 @@ export class Connection { /** * Default account for generated transactions (eg. tx.from) */ - get defaultAccount(): Address | undefined { + get defaultAccount(): StrongAddress | undefined { return this.config.from } @@ -125,13 +126,13 @@ export class Connection { /** * Set the ERC20 address for the token to use to pay for transaction fees. - * The ERC20 must be whitelisted for gas. + * The ERC20 address SHOULD be whitelisted for gas, but this is not checked or enforced. * * Set to `null` to use CELO * * @param address ERC20 address */ - set defaultFeeCurrency(address: Address | undefined) { + set defaultFeeCurrency(address: StrongAddress | undefined) { this.config.feeCurrency = address } @@ -139,7 +140,7 @@ export class Connection { return this.config.feeCurrency } - isLocalAccount(address?: Address): boolean { + isLocalAccount(address?: StrongAddress): boolean { return this.wallet != null && this.wallet.hasAccount(address) } @@ -167,17 +168,19 @@ export class Connection { } } - async getNodeAccounts(): Promise { + async getNodeAccounts(): Promise { const nodeAccountsResp = await this.rpcCaller.call('eth_accounts', []) - return this.toChecksumAddresses(nodeAccountsResp.result ?? []) + return this.toChecksumAddresses(nodeAccountsResp.result ?? []) as StrongAddress[] } - getLocalAccounts(): string[] { - return this.wallet ? this.toChecksumAddresses(this.wallet.getAccounts()) : [] + getLocalAccounts(): StrongAddress[] { + return this.wallet + ? (this.toChecksumAddresses(this.wallet.getAccounts()) as StrongAddress[]) + : [] } - async getAccounts(): Promise { - return (await this.getNodeAccounts()).concat(this.getLocalAccounts()) + async getAccounts(): Promise { + return (await this.getNodeAccounts()).concat(this.getLocalAccounts()) as StrongAddress[] } private toChecksumAddresses(addresses: string[]) { diff --git a/packages/sdk/connect/src/types.ts b/packages/sdk/connect/src/types.ts index b90cf87f6..5594c3a86 100644 --- a/packages/sdk/connect/src/types.ts +++ b/packages/sdk/connect/src/types.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { AccessList, PromiEvent, @@ -10,7 +11,7 @@ export type Address = string export type Hex = `0x${string}` export interface CeloParams { - feeCurrency: string + feeCurrency: StrongAddress /* @deprecated */ diff --git a/packages/sdk/connect/src/utils/formatter.test.ts b/packages/sdk/connect/src/utils/formatter.test.ts index 0eaeaa92b..1064958c9 100644 --- a/packages/sdk/connect/src/utils/formatter.test.ts +++ b/packages/sdk/connect/src/utils/formatter.test.ts @@ -51,7 +51,7 @@ describe('inputCeloTxFormatter', () => { ...base, gasPrice: '0x3e8', feeCurrency: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', - } + } as const it('formats', () => { expect(inputCeloTxFormatter(legacy)).toMatchInlineSnapshot(` { @@ -73,7 +73,7 @@ describe('inputCeloTxFormatter', () => { maxFeePerGas: '0x3e8', maxPriorityFeePerGas: '0x3e8', feeCurrency: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', - } + } as const it('formats', () => { expect(inputCeloTxFormatter(cip64)).toMatchInlineSnapshot(` { @@ -96,7 +96,7 @@ describe('inputCeloTxFormatter', () => { maxFeePerGas: '0x3e8', maxPriorityFeePerGas: '0x3e8', feeCurrency: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', - } + } as const it('formats', () => { expect(inputCeloTxFormatter(cip42)).toMatchInlineSnapshot(` { @@ -118,7 +118,7 @@ describe('inputCeloTxFormatter', () => { ...base, maxFeePerGas: '0x3e8', maxPriorityFeePerGas: '0x3e8', - } + } as const it('formats', () => { expect(inputCeloTxFormatter(eip1559)).toMatchInlineSnapshot(` { diff --git a/packages/sdk/connect/src/utils/tx-params-normalizer.test.ts b/packages/sdk/connect/src/utils/tx-params-normalizer.test.ts index 826392768..df4c6d487 100644 --- a/packages/sdk/connect/src/utils/tx-params-normalizer.test.ts +++ b/packages/sdk/connect/src/utils/tx-params-normalizer.test.ts @@ -132,11 +132,11 @@ describe('TxParamsNormalizer class', () => { celoTx.gasPrice = undefined celoTx.maxFeePerGas = undefined celoTx.maxPriorityFeePerGas = undefined - celoTx.feeCurrency = 'celoMagic' + celoTx.feeCurrency = '0x1234' const newCeloTx = await populator.populate(celoTx) expect(newCeloTx.maxFeePerGas).toBe('0x2f') expect(newCeloTx.maxPriorityFeePerGas).toBe('0x27') - expect(mockRpcCall.mock.calls[0]).toEqual(['eth_gasPrice', ['celoMagic']]) + expect(mockRpcCall.mock.calls[0]).toEqual(['eth_gasPrice', ['0x1234']]) expect(mockRpcCall.mock.calls[1]).toEqual(['eth_maxPriorityFeePerGas', []]) }) }) diff --git a/packages/sdk/contractkit/README.md b/packages/sdk/contractkit/README.md index 7d599fac7..6e4e26f5d 100644 --- a/packages/sdk/contractkit/README.md +++ b/packages/sdk/contractkit/README.md @@ -21,7 +21,7 @@ You might not need the full ContractKit. Consider using `@celo/connect` which po ## How we work -We are a GitHub-first team, which means we have a strong preference for communicating via GitHub. +We are a GitHub-first team, which means we have a strong preference for communicating via GitHub. Please use GitHub to: 🐞 [File a bug report](https://github.com/celo-org/developer-tooling/issues/new/choose) @@ -35,8 +35,8 @@ Please use GitHub to: 🚔 [Report a security vulnerability](https://github.com/celo-org/developer-tooling/issues/new/choose) > [!TIP] -> -> Please avoid messaging us via Slack, Telegram, or email. We are more likely to respond to you on +> +> Please avoid messaging us via Slack, Telegram, or email. We are more likely to respond to you on > GitHub than if you message us anywhere else. We actively monitor GitHub, and will get back to you shortly 🌟 ### Getting Started @@ -69,20 +69,16 @@ const balances = await kit.getTotalBalance() // returns an object with {cUSD, cEUR, cREAL} const balances = await miniKit.getTotalBalance() - ``` If you don't need the balances of all tokens use the balanceOf method -```ts +```ts const stableTokenWrapper = await kit.getStableToken(StableToken.cREAL) const cRealBalance = stableTokenWrapper.balanceOf(accountAddress) - ``` - - ### Setting Default Tx Options `kit` allows you to set default transaction options: @@ -100,7 +96,7 @@ async function getKit(myAddress: string, privateKey: string) { kit.connection.addAccount(privateKey) // paid gas in celo dollars - await kit.setFeeCurrency(CeloContract.StableToken) + await kit.setFeeCurrency('0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1') return kit } @@ -127,7 +123,7 @@ To send funds: ```ts const oneGold = kit.connection.web3.utils.toWei('1', 'ether') const tx = await goldToken.transfer(someAddress, oneGold).send({ - from: myAddress + from: myAddress, }) const hash = await tx.getHash() @@ -137,8 +133,7 @@ const receipt = await tx.waitReceipt() If you would like to pay fees in cUSD, (or other cStables like cEUR, cUSD). ```ts - -kit.setFeeCurrency(CeloContract.StableToken) // Default to paying fees in cUSD +kit.setFeeCurrency('0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1') // Default to paying fees in cUSD const stableTokenContract = kit.contracts.getStableToken() @@ -149,7 +144,6 @@ const tx = await stableTokenContract const hash = await tx.getHash() const receipt = await tx.waitReceipt() - ``` ### Interacting with Core Contracts @@ -182,8 +176,7 @@ When using the `kit` you can access core contracts like `kit.contracts.get{ContractName}` -E.G. `kit.contracts.getAccounts()`, `kit.contracts.getValidators()` - +E.G. `kit.contracts.getAccounts()`, `kit.contracts.getValidators()` #### Stand Alone Wrappers @@ -192,12 +185,11 @@ You can also initialize contracts wrappers directly. They require a `Connection` ```typescript // MiniContractKit only gives access to a limited set of Contracts, so we import Multisig -import { newKit } from "@celo/contractkit/lib/mini-kit" +import { newKit } from '@celo/contractkit/lib/mini-kit' import { MultiSigWrapper } from '@celo/contractkit/lib/wrappers/MultiSig' import { newMultiSig } from '@celo/abis/web3/MultiSig' - -const miniKit = newKit("https://alfajores-forno.celo-testnet.org/") +const miniKit = newKit('https://alfajores-forno.celo-testnet.org/') // Alternatively import { Connection } from '@celo/connect' // const connection = new Connection(web3) @@ -209,14 +201,14 @@ const multisigWrapper = new MultiSigWrapper(miniKit.connection, contract) ### Accessing web3 contract wrappers -`MiniContractKit` *does not provide access to the web3 contracts* +`MiniContractKit` _does not provide access to the web3 contracts_ Some user might want to access web3 native contract wrappers. To do so, you can: ```ts -const feeCurrencyWhitelist = await kit._web3Contracts.getFeeCurrencyWhitelist() +const feeCurrencyWhitelist = await kit._web3Contracts.getContract(CeloContract.FeeCurrencyWhitelist) ``` We expose native wrappers for all Celo core contracts. @@ -225,20 +217,36 @@ The complete list of Celo Core contracts is: - Accounts - Attestations -- LockedGold +- BlockchainParameters +- DoubleSigningSlasher +- DowntimeSlasher +- Election +- EpochRewards +- ERC20 - Escrow +- FederatedAttestations - FeeCurrencyWhitelist +- FeeHandler +- Freezer - GasPriceMinimum - GoldToken - Governance +- LockedGold +- MentoFeeHandlerSeller +- UniswapFeeHandlerSeller - MultiSig +- OdisPayments - Random - Registry - Reserve - SortedOracles - StableToken +- StableTokenEUR +- StableTokenBRL - Validators +This can also be found in `packages/sdk/contractkit/src/base.ts` + ### A Note About Contract Addresses Celo Core Contracts addresses, can be obtained by looking at the `Registry` contract. diff --git a/packages/sdk/contractkit/src/address-registry.ts b/packages/sdk/contractkit/src/address-registry.ts index 276e03b9e..fa06377a9 100644 --- a/packages/sdk/contractkit/src/address-registry.ts +++ b/packages/sdk/contractkit/src/address-registry.ts @@ -1,6 +1,6 @@ /* eslint max-classes-per-file:off */ import { newRegistry, Registry } from '@celo/abis/web3/Registry' -import { Address, NULL_ADDRESS } from '@celo/base/lib/address' +import { NULL_ADDRESS, StrongAddress } from '@celo/base/lib/address' import { Connection } from '@celo/connect' import debugFactory from 'debug' import { CeloContract, RegisteredContracts, stripProxy } from './base' @@ -23,7 +23,7 @@ export class UnregisteredError extends Error { */ export class AddressRegistry { private readonly registry: Registry - private readonly cache: Map = new Map() + private readonly cache: Map = new Map() constructor(readonly connection: Connection) { this.cache.set(CeloContract.Registry, REGISTRY_CONTRACT_ADDRESS) @@ -33,7 +33,7 @@ export class AddressRegistry { /** * Get the address for a `CeloContract` */ - async addressFor(contract: CeloContract): Promise
{ + async addressFor(contract: CeloContract): Promise { if (!this.cache.has(contract)) { debug('Fetching address from Registry for %s', contract) const address = await this.registry.methods.getAddressForString(stripProxy(contract)).call() @@ -42,7 +42,7 @@ export class AddressRegistry { if (!address || address === NULL_ADDRESS) { throw new UnregisteredError(contract) } - this.cache.set(contract, address) + this.cache.set(contract, address as StrongAddress) } const cachedAddress = this.cache.get(contract)! return cachedAddress diff --git a/packages/sdk/contractkit/src/contract-cache.ts b/packages/sdk/contractkit/src/contract-cache.ts index 898307948..e2daadfb9 100644 --- a/packages/sdk/contractkit/src/contract-cache.ts +++ b/packages/sdk/contractkit/src/contract-cache.ts @@ -15,6 +15,7 @@ import { EpochRewardsWrapper } from './wrappers/EpochRewards' import { Erc20Wrapper } from './wrappers/Erc20Wrapper' import { EscrowWrapper } from './wrappers/Escrow' import { FederatedAttestationsWrapper } from './wrappers/FederatedAttestations' +import { FeeCurrencyWhitelistWrapper } from './wrappers/FeeCurrencyWhitelistWrapper' import { FreezerWrapper } from './wrappers/Freezer' import { GasPriceMinimumWrapper } from './wrappers/GasPriceMinimum' import { GoldTokenWrapper } from './wrappers/GoldTokenWrapper' @@ -34,7 +35,7 @@ const WrapperFactories = { [CeloContract.ERC20]: Erc20Wrapper, [CeloContract.Escrow]: EscrowWrapper, [CeloContract.FederatedAttestations]: FederatedAttestationsWrapper, - // [CeloContract.FeeCurrencyWhitelist]: FeeCurrencyWhitelistWrapper, + [CeloContract.FeeCurrencyWhitelist]: FeeCurrencyWhitelistWrapper, [CeloContract.Freezer]: FreezerWrapper, [CeloContract.GasPriceMinimum]: GasPriceMinimumWrapper, [CeloContract.GoldToken]: GoldTokenWrapper, @@ -83,7 +84,7 @@ interface WrapperCacheMap { [CeloContract.ERC20]?: Erc20Wrapper [CeloContract.Escrow]?: EscrowWrapper [CeloContract.FederatedAttestations]?: FederatedAttestationsWrapper - // [CeloContract.FeeCurrencyWhitelist]?: FeeCurrencyWhitelistWrapper, + [CeloContract.FeeCurrencyWhitelist]?: FeeCurrencyWhitelistWrapper [CeloContract.Freezer]?: FreezerWrapper [CeloContract.GasPriceMinimum]?: GasPriceMinimumWrapper [CeloContract.GoldToken]?: GoldTokenWrapper @@ -154,6 +155,9 @@ export class WrapperCache implements ContractCacheType { getFederatedAttestations() { return this.getContract(CeloContract.FederatedAttestations) } + getFeeCurrencyWhitelist() { + return this.getContract(CeloContract.FeeCurrencyWhitelist) + } getGasPriceMinimum() { return this.getContract(CeloContract.GasPriceMinimum) } diff --git a/packages/sdk/contractkit/src/kit.test.ts b/packages/sdk/contractkit/src/kit.test.ts index f2d769466..2c2caefed 100644 --- a/packages/sdk/contractkit/src/kit.test.ts +++ b/packages/sdk/contractkit/src/kit.test.ts @@ -1,7 +1,14 @@ +import { StrongAddress } from '@celo/base' import { CeloTx, CeloTxObject, CeloTxReceipt, JsonRpcPayload, PromiEvent } from '@celo/connect' +import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import Web3 from 'web3' import { HttpProvider } from 'web3-core' -import { newKitFromWeb3 as newFullKitFromWeb3, newKitWithApiKey } from './kit' +import { + ContractKit, + newKitFromWeb3 as newFullKitFromWeb3, + newKitFromWeb3, + newKitWithApiKey, +} from './kit' import { newKitFromWeb3 as newMiniKitFromWeb3 } from './mini-kit' import { promiEventSpy } from './test-utils/PromiEventStub' @@ -150,3 +157,70 @@ describe('newKitWithApiKey()', () => { expect(fetchSpy).toHaveBeenCalled() }) }) + +testWithGanache('Fetch whitelisted fee currencies', (web3: Web3) => { + let kit: ContractKit + let accounts: string[] + + beforeEach(async () => { + accounts = await web3.eth.getAccounts() + kit = newKitFromWeb3(web3) + }) + + describe('When whitelisted fee currencies are fetched on-chain', () => { + test('Then the result includes addresses', async () => { + const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyWhitelist() + const gasOptions = await feeCurrencyWhitelist.getWhitelist() + for (let i = 0; i < gasOptions.length; i++) { + expect(web3.utils.isAddress(gasOptions[i])).toBeTruthy() + } + }) + + test.failing('Then the resulting addresses are valid fee currencies', async () => { + const celo = await kit.contracts.getGoldToken() + const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyWhitelist() + const gasOptions = await feeCurrencyWhitelist.getWhitelist() + const sender = accounts[0] + const recipient = accounts[1] + const amount = kit.web3.utils.toWei('0.01', 'ether') + + for (let gasOption of gasOptions.filter((x) => x !== celo.address)) { + const recipientBalanceBefore = await kit.getTotalBalance(recipient) + const feeAsErc20 = await kit.contracts.getErc20(gasOption) + // const transactionObject = celo.transfer(recipient, amount) + const feeCurrencyBalanceBefore = await feeAsErc20.balanceOf(sender) + await kit.connection.sendTransaction({ + from: sender, + to: recipient, + value: amount, + feeCurrency: gasOption, + }) + const recipientBalanceAfter = await kit.getTotalBalance(recipient) + const feeCurrencyBalanceAfter = await feeAsErc20.balanceOf(sender) + + expect(recipientBalanceAfter.CELO!.eq(recipientBalanceBefore.CELO!.plus(amount))).toBe(true) + + // This is failing because celo-ganache doesn't support feeCurrency + // https://github.com/celo-org/ganache-cli/tree/master + expect(feeCurrencyBalanceBefore.isGreaterThan(feeCurrencyBalanceAfter)).toBe(true) + } + }) + + test.failing('Then using a wrong address will fail', async () => { + // This is failing because celo-ganache doesn't support feeCurrency + // https://github.com/celo-org/ganache-cli/tree/master + + const sender = accounts[0] + const recipient = accounts[1] + const amount = kit.web3.utils.toWei('0.01', 'ether') + await expect( + kit.connection.sendTransaction({ + from: sender, + to: recipient, + value: amount, + feeCurrency: '0123' as StrongAddress, + }) + ).rejects.toThrowErrorMatchingInlineSnapshot() + }) + }) +}) diff --git a/packages/sdk/contractkit/src/kit.ts b/packages/sdk/contractkit/src/kit.ts index 548117d70..58852b962 100644 --- a/packages/sdk/contractkit/src/kit.ts +++ b/packages/sdk/contractkit/src/kit.ts @@ -1,19 +1,13 @@ // tslint:disable: ordered-imports -import { - Address, - CeloTx, - CeloTxObject, - Connection, - ReadOnlyWallet, - TransactionResult, -} from '@celo/connect' +import { StrongAddress } from '@celo/base' +import { CeloTx, CeloTxObject, Connection, ReadOnlyWallet, TransactionResult } from '@celo/connect' import { EIP712TypedData } from '@celo/utils/lib/sign-typed-data-utils' import { Signature } from '@celo/utils/lib/signatureUtils' import { LocalWallet } from '@celo/wallet-local' import { BigNumber } from 'bignumber.js' import Web3 from 'web3' import { AddressRegistry } from './address-registry' -import { CeloContract, CeloTokenContract } from './base' +import { CeloContract } from './base' import { CeloTokens, EachCeloToken } from './celo-tokens' import { ValidWrappers, WrapperCache } from './contract-cache' import { @@ -186,14 +180,14 @@ export class ContractKit { getHumanReadableNetworkConfig = () => this.getNetworkConfig(true) /** - * Set CeloToken to use to pay for gas fees - * @param tokenContract CELO (GoldToken) or a supported StableToken contract + * Set an addressed to use to pay for gas fees + * @param address any hexadecimal address + * @dev Throws if supplied address is not a valid hexadecimal address */ - async setFeeCurrency(tokenContract: CeloTokenContract): Promise { - const address = - tokenContract === CeloContract.GoldToken - ? undefined - : await this.registry.addressFor(tokenContract) + setFeeCurrency(address: StrongAddress) { + if (!this.web3.utils.isAddress(address)) { + throw new Error('Supplied address is not a valid hexadecimal address.') + } this.connection.defaultFeeCurrency = address } @@ -225,11 +219,11 @@ export class ContractKit { this.connection.addAccount(privateKey) } - set defaultAccount(address: Address | undefined) { + set defaultAccount(address: StrongAddress | undefined) { this.connection.defaultAccount = address } - get defaultAccount(): Address | undefined { + get defaultAccount(): StrongAddress | undefined { return this.connection.defaultAccount } @@ -241,7 +235,7 @@ export class ContractKit { return this.connection.defaultGasInflationFactor } - set defaultFeeCurrency(address: Address | undefined) { + set defaultFeeCurrency(address: StrongAddress | undefined) { this.connection.defaultFeeCurrency = address } diff --git a/packages/sdk/contractkit/src/wrappers/Accounts.test.ts b/packages/sdk/contractkit/src/wrappers/Accounts.test.ts index 6271937b5..54018f111 100644 --- a/packages/sdk/contractkit/src/wrappers/Accounts.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Accounts.test.ts @@ -7,6 +7,7 @@ import { AccountsWrapper } from './Accounts' import { valueToBigNumber, valueToFixidityString } from './BaseWrapper' import { LockedGoldWrapper } from './LockedGold' import { ValidatorsWrapper } from './Validators' +import { StrongAddress } from '@celo/base' jest.setTimeout(10 * 1000) /* @@ -24,7 +25,7 @@ const blsPoP = testWithGanache('Accounts Wrapper', (web3) => { let kit: ContractKit - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let accountsInstance: AccountsWrapper let validators: ValidatorsWrapper let lockedGold: LockedGoldWrapper diff --git a/packages/sdk/contractkit/src/wrappers/Accounts.ts b/packages/sdk/contractkit/src/wrappers/Accounts.ts index a9d2935f1..f0dab0a3e 100644 --- a/packages/sdk/contractkit/src/wrappers/Accounts.ts +++ b/packages/sdk/contractkit/src/wrappers/Accounts.ts @@ -1,9 +1,10 @@ import { Accounts } from '@celo/abis/web3/Accounts' +import { StrongAddress } from '@celo/base' import { NativeSigner, Signature, Signer } from '@celo/base/lib/signatureUtils' -import { Address, CeloTransactionObject, toTransactionObject } from '@celo/connect' +import { Address, CeloTransactionObject, CeloTxObject, toTransactionObject } from '@celo/connect' import { - hashMessageWithPrefix, LocalSigner, + hashMessageWithPrefix, parseSignature, signedMessageToPublicKey, } from '@celo/utils/lib/signatureUtils' @@ -48,8 +49,8 @@ export class AccountsWrapper extends BaseWrapper { * @param account The address of the account. * @return The address with which the account can vote. */ - getAttestationSigner: (account: string) => Promise
= proxyCall( - this.contract.methods.getAttestationSigner + getAttestationSigner: (account: string) => Promise = proxyCall( + this.contract.methods.getAttestationSigner as (account: string) => CeloTxObject ) /** @@ -66,16 +67,16 @@ export class AccountsWrapper extends BaseWrapper { * @param account The address of the account. * @return The address with which the account can vote. */ - getVoteSigner: (account: string) => Promise
= proxyCall( - this.contract.methods.getVoteSigner + getVoteSigner: (account: string) => Promise = proxyCall( + this.contract.methods.getVoteSigner as (account: string) => CeloTxObject ) /** * Returns the validator signer for the specified account. * @param account The address of the account. * @return The address with which the account can register a validator or group. */ - getValidatorSigner: (account: string) => Promise
= proxyCall( - this.contract.methods.getValidatorSigner + getValidatorSigner: (account: string) => Promise = proxyCall( + this.contract.methods.getValidatorSigner as (account: string) => CeloTxObject ) /** @@ -83,8 +84,8 @@ export class AccountsWrapper extends BaseWrapper { * @param signer Address that is authorized to sign the tx as voter * @return The Account address */ - voteSignerToAccount: (signer: Address) => Promise
= proxyCall( - this.contract.methods.voteSignerToAccount + voteSignerToAccount: (signer: Address) => Promise = proxyCall( + this.contract.methods.voteSignerToAccount as (account: string) => CeloTxObject ) /** @@ -92,8 +93,10 @@ export class AccountsWrapper extends BaseWrapper { * @param signer Address that is authorized to sign the tx as validator * @return The Account address */ - validatorSignerToAccount: (signer: Address) => Promise
= proxyCall( - this.contract.methods.validatorSignerToAccount + validatorSignerToAccount: (signer: Address) => Promise = proxyCall( + this.contract.methods.validatorSignerToAccount as ( + account: string + ) => CeloTxObject ) /** @@ -102,8 +105,8 @@ export class AccountsWrapper extends BaseWrapper { * @dev Fails if the `signer` is not an account or previously authorized signer. * @return The associated account. */ - signerToAccount: (signer: Address) => Promise
= proxyCall( - this.contract.methods.signerToAccount + signerToAccount: (signer: Address) => Promise = proxyCall( + this.contract.methods.signerToAccount as (account: string) => CeloTxObject ) /** diff --git a/packages/sdk/contractkit/src/wrappers/Attestations.test.ts b/packages/sdk/contractkit/src/wrappers/Attestations.test.ts index f4cc03e12..32f5df437 100644 --- a/packages/sdk/contractkit/src/wrappers/Attestations.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Attestations.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { getIdentifierHash, IdentifierPrefix } from '@celo/odis-identifiers' import { newKitFromWeb3 } from '../kit' @@ -13,11 +14,11 @@ testWithGanache('Attestations Wrapper', (web3) => { ) const kit = newKitFromWeb3(web3) - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let attestations: AttestationsWrapper beforeAll(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] attestations = await kit.contracts.getAttestations() }) diff --git a/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts b/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts index 5054fd0eb..27ce50a21 100644 --- a/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts +++ b/packages/sdk/contractkit/src/wrappers/BaseWrapper.ts @@ -1,5 +1,5 @@ import { ICeloVersionedContract } from '@celo/abis/web3/ICeloVersionedContract' -import { bufferToHex, ensureLeading0x } from '@celo/base/lib/address' +import { StrongAddress, bufferToHex, ensureLeading0x } from '@celo/base/lib/address' import { zip } from '@celo/base/lib/collections' import { CeloTransactionObject, @@ -34,8 +34,8 @@ export abstract class BaseWrapper { constructor(protected readonly connection: Connection, protected readonly contract: T) {} /** Contract address */ - get address(): string { - return this.contract.options.address + get address(): StrongAddress { + return this.contract.options.address as StrongAddress } async version() { diff --git a/packages/sdk/contractkit/src/wrappers/Election.ts b/packages/sdk/contractkit/src/wrappers/Election.ts index cc7fe2a91..0134c6060 100644 --- a/packages/sdk/contractkit/src/wrappers/Election.ts +++ b/packages/sdk/contractkit/src/wrappers/Election.ts @@ -4,10 +4,17 @@ import { findAddressIndex, normalizeAddressWith0x, NULL_ADDRESS, + StrongAddress, } from '@celo/base/lib/address' import { concurrentMap, concurrentValuesMap } from '@celo/base/lib/async' import { zeroRange, zip } from '@celo/base/lib/collections' -import { Address, CeloTransactionObject, EventLog, toTransactionObject } from '@celo/connect' +import { + Address, + CeloTransactionObject, + CeloTxObject, + EventLog, + toTransactionObject, +} from '@celo/connect' import BigNumber from 'bignumber.js' import { fixidityValueToBigNumber, @@ -95,16 +102,25 @@ export class ElectionWrapper extends BaseWrapperForGoverning { * @param blockNumber Block number to retrieve the validator set from. * @return Address of validator at the requested index. */ - validatorSignerAddressFromSet: (signerIndex: number, blockNumber: number) => Promise
= - proxyCall(this.contract.methods.validatorSignerAddressFromSet) + validatorSignerAddressFromSet: ( + signerIndex: number, + blockNumber: number + ) => Promise = proxyCall( + this.contract.methods.validatorSignerAddressFromSet as ( + signerIndex: number, + blockNumber: number + ) => CeloTxObject + ) /** * Gets a validator address from the current validator set. * @param index Index of requested validator in the validator set. * @return Address of validator at the requested index. */ - validatorSignerAddressFromCurrentSet: (index: number) => Promise
= proxyCall( - this.contract.methods.validatorSignerAddressFromCurrentSet, + validatorSignerAddressFromCurrentSet: (index: number) => Promise = proxyCall( + this.contract.methods.validatorSignerAddressFromCurrentSet as ( + signerIndex: number + ) => CeloTxObject, tupleParser(identity) ) diff --git a/packages/sdk/contractkit/src/wrappers/Escrow.test.ts b/packages/sdk/contractkit/src/wrappers/Escrow.test.ts index 2a850c828..78ef10aac 100644 --- a/packages/sdk/contractkit/src/wrappers/Escrow.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Escrow.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { newKitFromWeb3 } from '../kit' import { getParsedSignatureOfAddress } from '../utils/getParsedSignatureOfAddress' @@ -19,7 +20,7 @@ testWithGanache('Escrow Wrapper', (web3) => { ) } - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let escrow: EscrowWrapper let federatedAttestations: FederatedAttestationsWrapper let stableTokenContract: StableTokenWrapper @@ -30,7 +31,7 @@ testWithGanache('Escrow Wrapper', (web3) => { stableTokenContract = await kit.contracts.getStableToken() federatedAttestations = await kit.contracts.getFederatedAttestations() - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] identifier = kit.web3.utils.soliditySha3({ diff --git a/packages/sdk/contractkit/src/wrappers/FederatedAttestations.test.ts b/packages/sdk/contractkit/src/wrappers/FederatedAttestations.test.ts index f6d707990..74c7559df 100644 --- a/packages/sdk/contractkit/src/wrappers/FederatedAttestations.test.ts +++ b/packages/sdk/contractkit/src/wrappers/FederatedAttestations.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { newKitFromWeb3 } from '../kit' import { FederatedAttestationsWrapper } from './FederatedAttestations' @@ -5,17 +6,17 @@ import { FederatedAttestationsWrapper } from './FederatedAttestations' testWithGanache('FederatedAttestations Wrapper', (web3) => { const kit = newKitFromWeb3(web3) const TIME_STAMP = 1665080820 - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let federatedAttestations: FederatedAttestationsWrapper let testIdentifierBytes32: string let plainTextIdentifier: string - let testAccountAddress: string + let testAccountAddress: StrongAddress beforeAll(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] federatedAttestations = await kit.contracts.getFederatedAttestations() - testAccountAddress = kit.web3.eth.accounts.create().address + testAccountAddress = kit.web3.eth.accounts.create().address as StrongAddress plainTextIdentifier = '221B Baker St., London' testIdentifierBytes32 = kit.web3.utils.soliditySha3({ t: 'bytes32', diff --git a/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts b/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts new file mode 100644 index 000000000..ab2f8c160 --- /dev/null +++ b/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.ts @@ -0,0 +1,81 @@ +import { FeeCurrencyWhitelist } from '@celo/abis/web3/FeeCurrencyWhitelist' +import { StrongAddress } from '@celo/base' +import 'bignumber.js' +import { BaseWrapper, proxyCall } from './BaseWrapper' + +const MINIMAL_TOKEN_INFO_ABI = [ + { + type: 'function' as const, + stateMutability: 'view', + outputs: [{ type: 'string', name: '', internalType: 'string' }], + name: 'symbol', + inputs: [], + }, + { + type: 'function' as const, + stateMutability: 'view', + outputs: [{ type: 'string', name: '', internalType: 'string' }], + name: 'name', + inputs: [], + }, + { + type: 'function' as const, + stateMutability: 'view', + inputs: [], + outputs: [{ type: 'address', name: '', internalType: 'address' }], + name: 'adaptedToken', + }, +] as const + +/** + * FeeCurrencyWhitelist contract listing available currencies usable to pay fees + */ +export class FeeCurrencyWhitelistWrapper extends BaseWrapper { + getWhitelist = proxyCall( + this.contract.methods.getWhitelist, + undefined, + (addresses) => [...new Set(addresses)].sort() as StrongAddress[] + ) + + async getFeeCurrencyInformation(whitelist?: StrongAddress[]) { + const feeCurrencies = whitelist ?? (await this.getWhitelist()) + + return Promise.all( + feeCurrencies.map(async (address) => { + // @ts-expect-error abi typing is not 100% correct but works + let contract = new this.connection.web3.eth.Contract(MINIMAL_TOKEN_INFO_ABI, address) + + const adaptedToken = (await contract.methods + .adaptedToken() + .call() + .catch(() => undefined)) as StrongAddress | undefined + + if (adaptedToken) { + // @ts-expect-error abi typing is not 100% correct but works + contract = new this.connection.web3.eth.Contract(MINIMAL_TOKEN_INFO_ABI, adaptedToken) + } + + return Promise.all([ + contract.methods + .name() + .call() + .catch(() => undefined) as Promise, + contract.methods + .symbol() + .call() + .catch(() => undefined) as Promise, + ]).then(([name, symbol]) => ({ + name, + symbol, + address, + adaptedToken, + })) + }) + ) + } + + removeToken = proxyCall(this.contract.methods.removeToken) + addToken = proxyCall(this.contract.methods.addToken) +} + +export type GoldTokenWrapperType = FeeCurrencyWhitelistWrapper diff --git a/packages/sdk/contractkit/src/wrappers/GoldToken.test.ts b/packages/sdk/contractkit/src/wrappers/GoldToken.test.ts index 00a6b35e9..829487cfb 100644 --- a/packages/sdk/contractkit/src/wrappers/GoldToken.test.ts +++ b/packages/sdk/contractkit/src/wrappers/GoldToken.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { newKitFromWeb3 } from '../kit' import { GoldTokenWrapper } from './GoldTokenWrapper' @@ -6,11 +7,11 @@ testWithGanache('GoldToken Wrapper', (web3) => { const ONE_GOLD = web3.utils.toWei('1', 'ether') const kit = newKitFromWeb3(web3) - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let goldToken: GoldTokenWrapper beforeAll(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] goldToken = await kit.contracts.getGoldToken() }) diff --git a/packages/sdk/contractkit/src/wrappers/Governance.test.ts b/packages/sdk/contractkit/src/wrappers/Governance.test.ts index fc45bcbd0..615a86e21 100644 --- a/packages/sdk/contractkit/src/wrappers/Governance.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Governance.test.ts @@ -1,10 +1,10 @@ -import { Address } from '@celo/base/lib/address' +import { Registry } from '@celo/abis/web3/Registry' +import { Address, StrongAddress } from '@celo/base/lib/address' import { concurrentMap } from '@celo/base/lib/async' import { NetworkConfig, testWithGanache, timeTravel } from '@celo/dev-utils/lib/ganache-test' import BigNumber from 'bignumber.js' import Web3 from 'web3' import { CeloContract } from '..' -import { Registry } from '@celo/abis/web3/Registry' import { newKitFromWeb3 } from '../kit' import { AccountsWrapper } from './Accounts' import { GovernanceWrapper, Proposal, ProposalTransaction, VoteValue } from './Governance' @@ -19,7 +19,7 @@ testWithGanache('Governance Wrapper', (web3: Web3) => { const minDeposit = web3.utils.toWei(expConfig.minDeposit.toString(), 'ether') const ONE_CGLD = web3.utils.toWei('1', 'ether') - let accounts: Address[] = [] + let accounts: StrongAddress[] = [] let governance: GovernanceWrapper let governanceApproverMultiSig: MultiSigWrapper let lockedGold: LockedGoldWrapper @@ -27,7 +27,7 @@ testWithGanache('Governance Wrapper', (web3: Web3) => { let registry: Registry beforeAll(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] governance = await kit.contracts.getGovernance() governanceApproverMultiSig = await kit.contracts.getMultiSig(await governance.getApprover()) diff --git a/packages/sdk/contractkit/src/wrappers/Governance.ts b/packages/sdk/contractkit/src/wrappers/Governance.ts index 50dcde8b5..933342bb4 100644 --- a/packages/sdk/contractkit/src/wrappers/Governance.ts +++ b/packages/sdk/contractkit/src/wrappers/Governance.ts @@ -4,11 +4,12 @@ import { ensureLeading0x, hexToBuffer, NULL_ADDRESS, + StrongAddress, trimLeading0x, } from '@celo/base/lib/address' import { concurrentMap } from '@celo/base/lib/async' import { zeroRange, zip } from '@celo/base/lib/collections' -import { Address, CeloTxPending, toTransactionObject } from '@celo/connect' +import { Address, CeloTxObject, CeloTxPending, toTransactionObject } from '@celo/connect' import { fromFixed } from '@celo/utils/lib/fixidity' import BigNumber from 'bignumber.js' import { @@ -391,7 +392,7 @@ export class GovernanceWrapper extends BaseWrapperForGoverning { /** * Returns the approver address for proposals and hotfixes. */ - getApprover = proxyCall(this.contract.methods.approver) + getApprover = proxyCall(this.contract.methods.approver as () => CeloTxObject) /** * Returns the approver multisig contract for proposals and hotfixes. diff --git a/packages/sdk/contractkit/src/wrappers/LockedGold.test.ts b/packages/sdk/contractkit/src/wrappers/LockedGold.test.ts index 65f89578b..8e815a8f8 100644 --- a/packages/sdk/contractkit/src/wrappers/LockedGold.test.ts +++ b/packages/sdk/contractkit/src/wrappers/LockedGold.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { newKitFromWeb3 } from '../kit' import { AccountsWrapper } from './Accounts' @@ -10,9 +11,9 @@ testWithGanache('LockedGold Wrapper', (web3) => { // Arbitrary value. const value = 120938732980 - let account: string + let account: StrongAddress beforeAll(async () => { - account = (await web3.eth.getAccounts())[0] + account = (await web3.eth.getAccounts())[0] as StrongAddress kit.defaultAccount = account lockedGold = await kit.contracts.getLockedGold() accounts = await kit.contracts.getAccounts() diff --git a/packages/sdk/contractkit/src/wrappers/OdisPayments.test.ts b/packages/sdk/contractkit/src/wrappers/OdisPayments.test.ts index efe7f85c9..ce744e98d 100644 --- a/packages/sdk/contractkit/src/wrappers/OdisPayments.test.ts +++ b/packages/sdk/contractkit/src/wrappers/OdisPayments.test.ts @@ -1,4 +1,4 @@ -import { StableToken } from '@celo/base' +import { StableToken, StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { newKitFromWeb3 } from '../kit' import { OdisPaymentsWrapper } from './OdisPayments' @@ -6,12 +6,12 @@ import { StableTokenWrapper } from './StableTokenWrapper' testWithGanache('OdisPayments Wrapper', (web3) => { const kit = newKitFromWeb3(web3) - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let odisPayments: OdisPaymentsWrapper let stableToken: StableTokenWrapper beforeAll(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] odisPayments = await kit.contracts.getOdisPayments() stableToken = await kit.contracts.getStableToken(StableToken.cUSD) diff --git a/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts b/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts index 694917e93..c62f61ef5 100644 --- a/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts +++ b/packages/sdk/contractkit/src/wrappers/ReleaseGold.ts @@ -1,8 +1,8 @@ import { ReleaseGold } from '@celo/abis/web3/ReleaseGold' import { concurrentMap } from '@celo/base' -import { findAddressIndex } from '@celo/base/lib/address' +import { StrongAddress, findAddressIndex } from '@celo/base/lib/address' import { Signature } from '@celo/base/lib/signatureUtils' -import { Address, CeloTransactionObject, toTransactionObject } from '@celo/connect' +import { Address, CeloTransactionObject, CeloTxObject, toTransactionObject } from '@celo/connect' import { hashMessageWithPrefix, signedMessageToPublicKey } from '@celo/utils/lib/signatureUtils' import BigNumber from 'bignumber.js' import { flatten } from 'fp-ts/lib/Array' @@ -100,25 +100,33 @@ export class ReleaseGoldWrapper extends BaseWrapperForGoverning { * Returns the beneficiary of the ReleaseGold contract * @return The address of the beneficiary. */ - getBeneficiary: () => Promise
= proxyCall(this.contract.methods.beneficiary) + getBeneficiary: () => Promise = proxyCall( + this.contract.methods.beneficiary as () => CeloTxObject + ) /** * Returns the releaseOwner address of the ReleaseGold contract * @return The address of the releaseOwner. */ - getReleaseOwner: () => Promise
= proxyCall(this.contract.methods.releaseOwner) + getReleaseOwner: () => Promise = proxyCall( + this.contract.methods.releaseOwner as () => CeloTxObject + ) /** * Returns the refund address of the ReleaseGold contract * @return The refundAddress. */ - getRefundAddress: () => Promise
= proxyCall(this.contract.methods.refundAddress) + getRefundAddress: () => Promise = proxyCall( + this.contract.methods.refundAddress as () => CeloTxObject + ) /** * Returns the owner's address of the ReleaseGold contract * @return The owner's address. */ - getOwner: () => Promise
= proxyCall(this.contract.methods.owner) + getOwner: () => Promise = proxyCall( + this.contract.methods.owner as () => CeloTxObject + ) /** * Returns true if the liquidity provision has been met for this contract diff --git a/packages/sdk/contractkit/src/wrappers/Reserve.test.ts b/packages/sdk/contractkit/src/wrappers/Reserve.test.ts index aad8eba69..908fb75fd 100644 --- a/packages/sdk/contractkit/src/wrappers/Reserve.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Reserve.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import BigNumber from 'bignumber.js' import { newKitFromWeb3 } from '../kit' @@ -6,13 +7,13 @@ import { ReserveWrapper } from './Reserve' testWithGanache('Reserve Wrapper', (web3) => { const kit = newKitFromWeb3(web3) - let accounts: string[] = [] + let accounts: StrongAddress[] = [] let reserve: ReserveWrapper let reserveSpenderMultiSig: MultiSigWrapper - let otherReserveAddress: string - let otherSpender: string + let otherReserveAddress: StrongAddress + let otherSpender: StrongAddress beforeAll(async () => { - accounts = await web3.eth.getAccounts() + accounts = (await web3.eth.getAccounts()) as StrongAddress[] kit.defaultAccount = accounts[0] otherReserveAddress = accounts[9] otherSpender = accounts[7] diff --git a/packages/sdk/contractkit/src/wrappers/SortedOracles.ts b/packages/sdk/contractkit/src/wrappers/SortedOracles.ts index af14060b3..c81b12211 100644 --- a/packages/sdk/contractkit/src/wrappers/SortedOracles.ts +++ b/packages/sdk/contractkit/src/wrappers/SortedOracles.ts @@ -1,5 +1,5 @@ import { SortedOracles } from '@celo/abis/web3/SortedOracles' -import { eqAddress, NULL_ADDRESS } from '@celo/base/lib/address' +import { eqAddress, NULL_ADDRESS, StrongAddress } from '@celo/base/lib/address' import { Address, CeloTransactionObject, Connection, toTransactionObject } from '@celo/connect' import { isValidAddress } from '@celo/utils/lib/address' import { fromFixed, toFixed } from '@celo/utils/lib/fixidity' @@ -304,7 +304,7 @@ export class SortedOraclesWrapper extends BaseWrapper { return { lesserKey, greaterKey } } - private async toCurrencyPairIdentifier(target: ReportTarget): Promise
{ + private async toCurrencyPairIdentifier(target: ReportTarget): Promise { if (isStableTokenContract(target as CeloContract)) { return this.registry.addressFor(target as StableTokenContract) } else if (isValidAddress(target)) { diff --git a/packages/sdk/contractkit/src/wrappers/StableToken.test.ts b/packages/sdk/contractkit/src/wrappers/StableToken.test.ts index 6393503af..c81b3aace 100644 --- a/packages/sdk/contractkit/src/wrappers/StableToken.test.ts +++ b/packages/sdk/contractkit/src/wrappers/StableToken.test.ts @@ -1,3 +1,4 @@ +import { StrongAddress } from '@celo/base' import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' import { StableToken } from '../celo-tokens' import { ContractKit, newKitFromWeb3 } from '../kit' @@ -57,8 +58,8 @@ export function testStableToken( let stableToken: StableTokenWrapper beforeAll(async () => { - accounts = await web3.eth.getAccounts() - kit.defaultAccount = accounts[0] + accounts = (await web3.eth.getAccounts()) as StrongAddress[] + kit.defaultAccount = accounts[0] as StrongAddress stableToken = await kit.contracts.getStableToken(stableTokenName) }) diff --git a/packages/sdk/utils/src/address.ts b/packages/sdk/utils/src/address.ts index 7f001df3b..4cf79afe6 100644 --- a/packages/sdk/utils/src/address.ts +++ b/packages/sdk/utils/src/address.ts @@ -1,4 +1,4 @@ -import { ensureLeading0x, hexToBuffer } from '@celo/base/lib/address' +import { StrongAddress, ensureLeading0x, hexToBuffer } from '@celo/base/lib/address' import { isValidPrivate, privateToAddress, @@ -11,6 +11,7 @@ import { // here for backwards compatibility export { Address, + NULL_ADDRESS, bufferToHex, ensureLeading0x, eqAddress, @@ -22,13 +23,14 @@ export { mapAddressListOnto, normalizeAddress, normalizeAddressWith0x, - NULL_ADDRESS, trimLeading0x, } from '@celo/base/lib/address' export { isValidChecksumAddress, toChecksumAddress } from '@ethereumjs/util' export const privateKeyToAddress = (privateKey: string) => - toChecksumAddress(ensureLeading0x(privateToAddress(hexToBuffer(privateKey)).toString('hex'))) + toChecksumAddress( + ensureLeading0x(privateToAddress(hexToBuffer(privateKey)).toString('hex')) + ) as StrongAddress export const privateKeyToPublicKey = (privateKey: string) => toChecksumAddress(ensureLeading0x(privateToPublic(hexToBuffer(privateKey)).toString('hex'))) @@ -36,12 +38,12 @@ export const privateKeyToPublicKey = (privateKey: string) => export const publicKeyToAddress = (publicKey: string) => toChecksumAddress( ensureLeading0x(pubToAddress(toBuffer(ensureLeading0x(publicKey)), true).toString('hex')) - ) + ) as StrongAddress export const isValidPrivateKey = (privateKey: string) => privateKey.startsWith('0x') && isValidPrivate(hexToBuffer(privateKey)) -export const isValidAddress = (input: string): boolean => { +export const isValidAddress = (input: string): input is StrongAddress => { if ('string' !== typeof input) { return false } diff --git a/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts b/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts index 679eb0bd5..2c2a22d76 100644 --- a/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts +++ b/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts @@ -27,7 +27,7 @@ describe('rlpEncodedTx', () => { gas: '1500000000', gasPrice: '9900000000', data: '0xabcdef', - } + } as const it('convert CeloTx into RLP', () => { const transaction = { ...legacyTransaction, @@ -61,7 +61,7 @@ describe('rlpEncodedTx', () => { const transaction = { ...legacyTransaction, chainId: -1, - } + } as const expect(() => rlpEncodedTx(transaction)).toThrowErrorMatchingInlineSnapshot( `"Gas, nonce or chainId is less than than 0"` ) @@ -143,7 +143,7 @@ describe('rlpEncodedTx', () => { const CIP64Transaction = { ...eip1559Transaction, feeCurrency: '0x5409ED021D9299bf6814279A6A1411A7e866A631', - } + } as const const result = rlpEncodedTx(CIP64Transaction) expect(result).toMatchInlineSnapshot(` { diff --git a/packages/sdk/wallets/wallet-hsm-aws/src/aws-hsm-wallet.test.ts b/packages/sdk/wallets/wallet-hsm-aws/src/aws-hsm-wallet.test.ts index 205329077..518a761e7 100644 --- a/packages/sdk/wallets/wallet-hsm-aws/src/aws-hsm-wallet.test.ts +++ b/packages/sdk/wallets/wallet-hsm-aws/src/aws-hsm-wallet.test.ts @@ -269,7 +269,7 @@ describe('AwsHsmWallet class', () => { nonce: 65, gas: '10', gasPrice: '99', - feeCurrency: '0x', + feeCurrency: '0x' as const, gatewayFeeRecipient: ACCOUNT_ADDRESS_NEVER, gatewayFee: '0x5678', data: '0xabcdef', diff --git a/packages/sdk/wallets/wallet-hsm-azure/src/azure-hsm-wallet.test.ts b/packages/sdk/wallets/wallet-hsm-azure/src/azure-hsm-wallet.test.ts index 36c39eaa0..a34cba583 100644 --- a/packages/sdk/wallets/wallet-hsm-azure/src/azure-hsm-wallet.test.ts +++ b/packages/sdk/wallets/wallet-hsm-azure/src/azure-hsm-wallet.test.ts @@ -8,7 +8,7 @@ import { } from '@celo/utils/lib/address' import { verifySignature } from '@celo/utils/lib/signatureUtils' import { recoverTransaction, verifyEIP712TypedDataSigner } from '@celo/wallet-base' -import { publicKeyPrefix, Signature } from '@celo/wallet-hsm' +import { Signature, publicKeyPrefix } from '@celo/wallet-hsm' import * as ethUtil from '@ethereumjs/util' import { BigNumber } from 'bignumber.js' import Web3 from 'web3' @@ -265,7 +265,7 @@ describe('AzureHSMWallet class', () => { nonce: 65, gas: '10', gasPrice: '99', - feeCurrency: '0x', + feeCurrency: '0x' as const, gatewayFeeRecipient: ACCOUNT_ADDRESS_NEVER, gatewayFee: '0x5678', data: '0xabcdef', diff --git a/packages/sdk/wallets/wallet-hsm-gcp/src/gcp-hsm-wallet.test.ts b/packages/sdk/wallets/wallet-hsm-gcp/src/gcp-hsm-wallet.test.ts index 8e4459a6e..901d2aff4 100644 --- a/packages/sdk/wallets/wallet-hsm-gcp/src/gcp-hsm-wallet.test.ts +++ b/packages/sdk/wallets/wallet-hsm-gcp/src/gcp-hsm-wallet.test.ts @@ -256,7 +256,7 @@ describe('GcpHsmWallet class', () => { nonce: 65, gas: '10', gasPrice: '99', - feeCurrency: '0x', + feeCurrency: '0x' as const, gatewayFeeRecipient: ACCOUNT_ADDRESS_NEVER, gatewayFee: '0x5678', data: '0xabcdef', diff --git a/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts b/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts index 9bd6b4aee..4764ee164 100644 --- a/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts +++ b/packages/sdk/wallets/wallet-ledger/src/ledger-wallet.test.ts @@ -1,4 +1,9 @@ -import { ensureLeading0x, normalizeAddressWith0x, trimLeading0x } from '@celo/base/lib/address' +import { + StrongAddress, + ensureLeading0x, + normalizeAddressWith0x, + trimLeading0x, +} from '@celo/base/lib/address' import { CeloTx, EncodedTransaction } from '@celo/connect' import { privateKeyToAddress } from '@celo/utils/lib/address' import { verifySignature } from '@celo/utils/lib/signatureUtils' @@ -252,8 +257,8 @@ describe('LedgerWallet class', () => { } await wallet.init() if (USE_PHYSICAL_LEDGER) { - knownAddress = wallet.getAccounts()[0] - otherAddress = wallet.getAccounts()[1] + knownAddress = wallet.getAccounts()[0] as StrongAddress + otherAddress = wallet.getAccounts()[1] as StrongAddress } }, TEST_TIMEOUT_IN_MS) @@ -364,7 +369,7 @@ describe('LedgerWallet class', () => { nonce: 65, gas: '10', gasPrice: '99', - feeCurrency: '0x', + feeCurrency: '0x' as const, gatewayFeeRecipient: ACCOUNT_ADDRESS_NEVER, gatewayFee: '0x5678', data: '0xabcdef', diff --git a/packages/sdk/wallets/wallet-local/src/local-wallet.test.ts b/packages/sdk/wallets/wallet-local/src/local-wallet.test.ts index aad292376..04afdc383 100644 --- a/packages/sdk/wallets/wallet-local/src/local-wallet.test.ts +++ b/packages/sdk/wallets/wallet-local/src/local-wallet.test.ts @@ -282,7 +282,7 @@ describe('Local wallet class', () => { maxFeePerGas: '99', maxPriorityFeePerGas: '99', feeCurrency: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', - } + } as const await expect(wallet.signTransaction(recoverTransactionCIP64)).resolves .toMatchInlineSnapshot(` { @@ -311,7 +311,7 @@ describe('Local wallet class', () => { maxPriorityFeePerGas: '99', gatewayFee: '0x5678', feeCurrency: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', - } + } as const await expect(wallet.signTransaction(transaction42)).resolves.toMatchInlineSnapshot(` { "raw": "0x7cf89a82ad5a8063630a94cd2a3d9f938e13cd947ec05abc7fe734df8dd826941be31a94361a391bbafb2a4ccd704f57dc04d4bb82567894588e4b68193001e4d10928660ab4165b813717c0880de0b6b3a764000083abcdefc080a0c610507b2ac3cff80dd7017419021196807d605efce0970c18cde48db33c27d1a01799477e0f601f554f0ee6f7ac21490602124801e9f7a99d9605249b90f03112", @@ -362,7 +362,7 @@ describe('Local wallet class', () => { gatewayFeeRecipient: FEE_ADDRESS, gatewayFee: '0x5678', data: '0xabcdef', - } + } as const const signedTx: EncodedTransaction = await wallet.signTransaction( celoTransactionZeroPrefix diff --git a/packages/sdk/wallets/wallet-rpc/src/rpc-wallet.test.ts b/packages/sdk/wallets/wallet-rpc/src/rpc-wallet.test.ts index 0ef25eabe..57a7efcaa 100644 --- a/packages/sdk/wallets/wallet-rpc/src/rpc-wallet.test.ts +++ b/packages/sdk/wallets/wallet-rpc/src/rpc-wallet.test.ts @@ -218,7 +218,7 @@ testWithGanache('rpc-wallet', (web3) => { nonce: 65, gas: '10', gasPrice: '99', - feeCurrency: '0x', + feeCurrency: '0x' as const, gatewayFeeRecipient: '0x1234', gatewayFee: '0x5678', data: '0xabcdef', From 5335af5808a892c95245624e676cd1952a0cfb42 Mon Sep 17 00:00:00 2001 From: Valentin Rodygin Date: Thu, 21 Mar 2024 09:07:00 +0100 Subject: [PATCH 4/9] Add Ethereum-compatible legacy TXs support (#182) * Added Ethereum-compatible legacy Type 0 TXs support --------- Co-authored-by: Aaron DeRuvo --- .changeset/quick-tips-happen.md | 6 + .../interfaces/types.EncodedTransaction.md | 6 +- .../docs/connect/interfaces/types.Error.md | 6 +- .../types.EthereumLegacyTXProperties.md | 177 ++++++++++++++++++ .../connect/interfaces/types.HttpProvider.md | 2 +- .../interfaces/types.JsonRpcPayload.md | 8 +- .../interfaces/types.JsonRpcResponse.md | 8 +- .../docs/connect/interfaces/types.Provider.md | 2 +- .../connect/interfaces/types.RLPEncodedTx.md | 6 +- .../docs/sdk/docs/connect/modules/index.md | 7 + .../docs/sdk/docs/connect/modules/types.md | 9 +- .../classes/wallet_base.WalletBase.md | 8 +- .../docs/wallet-base/modules/signing_utils.md | 18 +- packages/sdk/connect/src/types.ts | 14 +- .../wallet-base/src/signing-utils.test.ts | 60 +++++- .../wallets/wallet-base/src/signing-utils.ts | 149 +++++++++++---- .../wallets/wallet-base/src/wallet-base.ts | 4 +- 17 files changed, 413 insertions(+), 77 deletions(-) create mode 100644 .changeset/quick-tips-happen.md create mode 100644 packages/docs/sdk/docs/connect/interfaces/types.EthereumLegacyTXProperties.md diff --git a/.changeset/quick-tips-happen.md b/.changeset/quick-tips-happen.md new file mode 100644 index 000000000..ba80c94b7 --- /dev/null +++ b/.changeset/quick-tips-happen.md @@ -0,0 +1,6 @@ +--- +"@celo/connect": minor +"@celo/wallet-base": minor +--- + +Add support Type 0 Ethereum-compatible legacy TXs diff --git a/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md b/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md index 6a937aded..65ff818a9 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.EncodedTransaction.md @@ -19,14 +19,14 @@ #### Defined in -[packages/sdk/connect/src/types.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L118) +[packages/sdk/connect/src/types.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L123) ___ ### tx -• **tx**: [`EIP1559TXProperties`](types.EIP1559TXProperties.md) \| [`CIP64TXProperties`](types.CIP64TXProperties.md) \| [`CIP42TXProperties`](types.CIP42TXProperties.md) \| [`LegacyTXProperties`](types.LegacyTXProperties.md) +• **tx**: [`EIP1559TXProperties`](types.EIP1559TXProperties.md) \| [`CIP64TXProperties`](types.CIP64TXProperties.md) \| [`CIP42TXProperties`](types.CIP42TXProperties.md) \| [`LegacyTXProperties`](types.LegacyTXProperties.md) \| [`EthereumLegacyTXProperties`](types.EthereumLegacyTXProperties.md) #### Defined in -[packages/sdk/connect/src/types.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L119) +[packages/sdk/connect/src/types.ts:124](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L124) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.Error.md b/packages/docs/sdk/docs/connect/interfaces/types.Error.md index 8261af374..f102652fe 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.Error.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.Error.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:153](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L153) +[packages/sdk/connect/src/types.ts:163](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L163) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:154](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L154) +[packages/sdk/connect/src/types.ts:164](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L164) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:155](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L155) +[packages/sdk/connect/src/types.ts:165](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L165) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.EthereumLegacyTXProperties.md b/packages/docs/sdk/docs/connect/interfaces/types.EthereumLegacyTXProperties.md new file mode 100644 index 000000000..59888e8e6 --- /dev/null +++ b/packages/docs/sdk/docs/connect/interfaces/types.EthereumLegacyTXProperties.md @@ -0,0 +1,177 @@ +[@celo/connect](../README.md) / [Exports](../modules.md) / [types](../modules/types.md) / EthereumLegacyTXProperties + +# Interface: EthereumLegacyTXProperties + +[types](../modules/types.md).EthereumLegacyTXProperties + +## Hierarchy + +- `CommonTXProperties` + + ↳ **`EthereumLegacyTXProperties`** + +## Table of contents + +### Properties + +- [gas](types.EthereumLegacyTXProperties.md#gas) +- [gasPrice](types.EthereumLegacyTXProperties.md#gasprice) +- [hash](types.EthereumLegacyTXProperties.md#hash) +- [input](types.EthereumLegacyTXProperties.md#input) +- [nonce](types.EthereumLegacyTXProperties.md#nonce) +- [r](types.EthereumLegacyTXProperties.md#r) +- [s](types.EthereumLegacyTXProperties.md#s) +- [to](types.EthereumLegacyTXProperties.md#to) +- [type](types.EthereumLegacyTXProperties.md#type) +- [v](types.EthereumLegacyTXProperties.md#v) +- [value](types.EthereumLegacyTXProperties.md#value) + +## Properties + +### gas + +• **gas**: `string` + +#### Inherited from + +CommonTXProperties.gas + +#### Defined in + +[packages/sdk/connect/src/types.ts:73](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L73) + +___ + +### gasPrice + +• **gasPrice**: `string` + +#### Defined in + +[packages/sdk/connect/src/types.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L118) + +___ + +### hash + +• **hash**: `string` + +#### Inherited from + +CommonTXProperties.hash + +#### Defined in + +[packages/sdk/connect/src/types.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L80) + +___ + +### input + +• **input**: `string` + +#### Inherited from + +CommonTXProperties.input + +#### Defined in + +[packages/sdk/connect/src/types.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L76) + +___ + +### nonce + +• **nonce**: `string` + +#### Inherited from + +CommonTXProperties.nonce + +#### Defined in + +[packages/sdk/connect/src/types.ts:72](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L72) + +___ + +### r + +• **r**: `string` + +#### Inherited from + +CommonTXProperties.r + +#### Defined in + +[packages/sdk/connect/src/types.ts:77](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L77) + +___ + +### s + +• **s**: `string` + +#### Inherited from + +CommonTXProperties.s + +#### Defined in + +[packages/sdk/connect/src/types.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L78) + +___ + +### to + +• **to**: `string` + +#### Inherited from + +CommonTXProperties.to + +#### Defined in + +[packages/sdk/connect/src/types.ts:74](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L74) + +___ + +### type + +• **type**: ``"ethereum-legacy"`` + +#### Overrides + +CommonTXProperties.type + +#### Defined in + +[packages/sdk/connect/src/types.ts:119](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L119) + +___ + +### v + +• **v**: `string` + +#### Inherited from + +CommonTXProperties.v + +#### Defined in + +[packages/sdk/connect/src/types.ts:79](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L79) + +___ + +### value + +• **value**: `string` + +#### Inherited from + +CommonTXProperties.value + +#### Defined in + +[packages/sdk/connect/src/types.ts:75](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L75) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md b/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md index 02e6089c3..f86143f67 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.HttpProvider.md @@ -29,4 +29,4 @@ #### Defined in -[packages/sdk/connect/src/types.ts:159](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L159) +[packages/sdk/connect/src/types.ts:169](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L169) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md index 1300c1607..9a24e5599 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcPayload.md @@ -21,7 +21,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L142) +[packages/sdk/connect/src/types.ts:152](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L152) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L139) +[packages/sdk/connect/src/types.ts:149](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L149) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L140) +[packages/sdk/connect/src/types.ts:150](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L150) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L141) +[packages/sdk/connect/src/types.ts:151](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L151) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md index c9239e0f2..652c409f9 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.JsonRpcResponse.md @@ -29,7 +29,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:131](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L131) +[packages/sdk/connect/src/types.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L141) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:129](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L129) +[packages/sdk/connect/src/types.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L139) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L128) +[packages/sdk/connect/src/types.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L138) ___ @@ -59,4 +59,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L130) +[packages/sdk/connect/src/types.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L140) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.Provider.md b/packages/docs/sdk/docs/connect/interfaces/types.Provider.md index d6c741b42..3180d38c8 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.Provider.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.Provider.md @@ -33,4 +33,4 @@ #### Defined in -[packages/sdk/connect/src/types.ts:146](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L146) +[packages/sdk/connect/src/types.ts:156](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L156) diff --git a/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md b/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md index 2ca2d140e..cff733224 100644 --- a/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md +++ b/packages/docs/sdk/docs/connect/interfaces/types.RLPEncodedTx.md @@ -20,7 +20,7 @@ #### Defined in -[packages/sdk/connect/src/types.ts:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L167) +[packages/sdk/connect/src/types.ts:177](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L177) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:166](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L166) +[packages/sdk/connect/src/types.ts:176](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L176) ___ @@ -40,4 +40,4 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:168](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L168) +[packages/sdk/connect/src/types.ts:178](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L178) diff --git a/packages/docs/sdk/docs/connect/modules/index.md b/packages/docs/sdk/docs/connect/modules/index.md index 2929d52d4..2fd441869 100644 --- a/packages/docs/sdk/docs/connect/modules/index.md +++ b/packages/docs/sdk/docs/connect/modules/index.md @@ -32,6 +32,7 @@ - [EIP1559TXProperties](index.md#eip1559txproperties) - [EncodedTransaction](index.md#encodedtransaction) - [Error](index.md#error) +- [EthereumLegacyTXProperties](index.md#ethereumlegacytxproperties) - [FormattedCeloTx](index.md#formattedcelotx) - [Hex](index.md#hex) - [HexOrMissing](index.md#hexormissing) @@ -235,6 +236,12 @@ Re-exports [Error](../interfaces/types.Error.md) ___ +### EthereumLegacyTXProperties + +Re-exports [EthereumLegacyTXProperties](../interfaces/types.EthereumLegacyTXProperties.md) + +___ + ### FormattedCeloTx Re-exports [FormattedCeloTx](../interfaces/types.FormattedCeloTx.md) diff --git a/packages/docs/sdk/docs/connect/modules/types.md b/packages/docs/sdk/docs/connect/modules/types.md index db0109746..6341015d1 100644 --- a/packages/docs/sdk/docs/connect/modules/types.md +++ b/packages/docs/sdk/docs/connect/modules/types.md @@ -27,6 +27,7 @@ - [EIP1559TXProperties](../interfaces/types.EIP1559TXProperties.md) - [EncodedTransaction](../interfaces/types.EncodedTransaction.md) - [Error](../interfaces/types.Error.md) +- [EthereumLegacyTXProperties](../interfaces/types.EthereumLegacyTXProperties.md) - [FormattedCeloTx](../interfaces/types.FormattedCeloTx.md) - [HttpProvider](../interfaces/types.HttpProvider.md) - [JsonRpcPayload](../interfaces/types.JsonRpcPayload.md) @@ -163,7 +164,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L125) +[packages/sdk/connect/src/types.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L135) ___ @@ -183,7 +184,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L122) +[packages/sdk/connect/src/types.ts:132](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L132) ___ @@ -193,7 +194,7 @@ ___ #### Defined in -[packages/sdk/connect/src/types.ts:123](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L123) +[packages/sdk/connect/src/types.ts:133](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/connect/src/types.ts#L133) ___ @@ -229,7 +230,7 @@ ___ ### TransactionTypes -Ƭ **TransactionTypes**: ``"eip1559"`` \| ``"celo-legacy"`` \| ``"cip42"`` \| ``"cip64"`` +Ƭ **TransactionTypes**: ``"ethereum-legacy"`` \| ``"eip1559"`` \| ``"celo-legacy"`` \| ``"cip42"`` \| ``"cip64"`` #### Defined in diff --git a/packages/docs/sdk/docs/wallet-base/classes/wallet_base.WalletBase.md b/packages/docs/sdk/docs/wallet-base/classes/wallet_base.WalletBase.md index 2088fb3b9..ad304a930 100644 --- a/packages/docs/sdk/docs/wallet-base/classes/wallet_base.WalletBase.md +++ b/packages/docs/sdk/docs/wallet-base/classes/wallet_base.WalletBase.md @@ -72,7 +72,7 @@ ReadOnlyWallet.computeSharedSecret #### Defined in -[wallets/wallet-base/src/wallet-base.ts:141](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L141) +[wallets/wallet-base/src/wallet-base.ts:143](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L143) ___ @@ -97,7 +97,7 @@ ReadOnlyWallet.decrypt #### Defined in -[wallets/wallet-base/src/wallet-base.ts:133](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L133) +[wallets/wallet-base/src/wallet-base.ts:135](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L135) ___ @@ -198,7 +198,7 @@ ReadOnlyWallet.signPersonalMessage #### Defined in -[wallets/wallet-base/src/wallet-base.ts:97](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L97) +[wallets/wallet-base/src/wallet-base.ts:99](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L99) ___ @@ -253,4 +253,4 @@ ReadOnlyWallet.signTypedData #### Defined in -[wallets/wallet-base/src/wallet-base.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L114) +[wallets/wallet-base/src/wallet-base.ts:116](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/wallet-base.ts#L116) diff --git a/packages/docs/sdk/docs/wallet-base/modules/signing_utils.md b/packages/docs/sdk/docs/wallet-base/modules/signing_utils.md index 79e6817ab..d1d08af50 100644 --- a/packages/docs/sdk/docs/wallet-base/modules/signing_utils.md +++ b/packages/docs/sdk/docs/wallet-base/modules/signing_utils.md @@ -100,7 +100,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:697](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L697) +[wallets/wallet-base/src/signing-utils.ts:774](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L774) ___ @@ -124,7 +124,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:322](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L322) +[wallets/wallet-base/src/signing-utils.ts:348](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L348) ___ @@ -150,7 +150,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:405](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L405) +[wallets/wallet-base/src/signing-utils.ts:445](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L445) ___ @@ -190,7 +190,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:500](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L500) +[wallets/wallet-base/src/signing-utils.ts:518](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L518) ___ @@ -210,7 +210,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:271](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L271) +[wallets/wallet-base/src/signing-utils.ts:290](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L290) ___ @@ -231,7 +231,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:665](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L665) +[wallets/wallet-base/src/signing-utils.ts:742](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L742) ___ @@ -251,7 +251,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:439](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L439) +[wallets/wallet-base/src/signing-utils.ts:479](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L479) ___ @@ -313,7 +313,7 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:675](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L675) +[wallets/wallet-base/src/signing-utils.ts:752](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L752) ___ @@ -335,4 +335,4 @@ ___ #### Defined in -[wallets/wallet-base/src/signing-utils.ts:684](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L684) +[wallets/wallet-base/src/signing-utils.ts:761](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/wallets/wallet-base/src/signing-utils.ts#L761) diff --git a/packages/sdk/connect/src/types.ts b/packages/sdk/connect/src/types.ts index 5594c3a86..34bbdc098 100644 --- a/packages/sdk/connect/src/types.ts +++ b/packages/sdk/connect/src/types.ts @@ -66,7 +66,7 @@ export { BlockNumber, EventLog, Log, PromiEvent, Sign } from 'web3-core' export { Block, BlockHeader, Syncing } from 'web3-eth' export { Contract, ContractSendMethod, PastEventOptions } from 'web3-eth-contract' -export type TransactionTypes = 'eip1559' | 'celo-legacy' | 'cip42' | 'cip64' +export type TransactionTypes = 'ethereum-legacy' | 'eip1559' | 'celo-legacy' | 'cip42' | 'cip64' interface CommonTXProperties { nonce: string @@ -114,9 +114,19 @@ export interface LegacyTXProperties extends CommonTXProperties { type: 'celo-legacy' } +export interface EthereumLegacyTXProperties extends CommonTXProperties { + gasPrice: string + type: 'ethereum-legacy' +} + export interface EncodedTransaction { raw: Hex - tx: LegacyTXProperties | CIP42TXProperties | EIP1559TXProperties | CIP64TXProperties + tx: + | EthereumLegacyTXProperties + | LegacyTXProperties + | CIP42TXProperties + | EIP1559TXProperties + | CIP64TXProperties } export type CeloTxPending = Transaction & Partial diff --git a/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts b/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts index 2c2a22d76..998c99c0a 100644 --- a/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts +++ b/packages/sdk/wallets/wallet-base/src/signing-utils.test.ts @@ -16,7 +16,7 @@ const PRIVATE_KEY1 = '0x1234567890abcdef1234567890abcdef1234567890abcdef12345678 const ACCOUNT_ADDRESS1 = normalizeAddressWith0x(privateKeyToAddress(PRIVATE_KEY1)) as `0x${string}` describe('rlpEncodedTx', () => { - describe('legacy', () => { + describe('Celo legacy', () => { const legacyTransaction = { feeCurrency: '0x5409ED021D9299bf6814279A6A1411A7e866A631', from: ACCOUNT_ADDRESS1, @@ -102,6 +102,43 @@ describe('rlpEncodedTx', () => { }) }) + describe('Ethereum legacy', () => { + const legacyTransaction = { + from: '0x1daf825EB5C0D9d9FeC33C444e413452A08e04A6', + to: '0x43d72ff17701b2da814620735c39c620ce0ea4a1', + chainId: 42220, + value: Web3.utils.toWei('0', 'ether'), + nonce: 619, + gas: '504830', + gasPrice: '5000000000', + data: '0x4e71d92d', + } + it('convert CeloTx into RLP', () => { + const transaction = { + ...legacyTransaction, + } + const result = rlpEncodedTx(transaction) + expect(result).toMatchInlineSnapshot(` + { + "rlpEncode": "0xed82026b85012a05f2008307b3fe9443d72ff17701b2da814620735c39c620ce0ea4a180844e71d92d82a4ec8080", + "transaction": { + "chainId": 42220, + "data": "0x4e71d92d", + "from": "0x1daf825eb5c0d9d9fec33c444e413452a08e04a6", + "gas": "0x07b3fe", + "gasPrice": "0x012a05f200", + "maxFeePerGas": "0x", + "maxPriorityFeePerGas": "0x", + "nonce": 619, + "to": "0x43d72ff17701b2da814620735c39c620ce0ea4a1", + "value": "0x", + }, + "type": "ethereum-legacy", + } + `) + }) + }) + describe('EIP1559 / CIP42', () => { const eip1559Transaction: CeloTx = { from: ACCOUNT_ADDRESS1, @@ -369,6 +406,25 @@ describe('recoverTransaction', () => { ] `) }) + it('handles ethereum-legacy transactions', () => { + const ethereumLegacyTx = + '0xf86e82026b85012a05f2008307b3fe9443d72ff17701b2da814620735c39c620ce0ea4a180844e71d92d830149fba0f616cf0a105a0b117b178f6aaa5dc79b9b2aa3898811f99a8f48fb70cece8a33a032a158ab09e32747044e62bd3facd9abd746df23df306dbc31305668da2c7937' + expect(recoverTransaction(ethereumLegacyTx)).toMatchInlineSnapshot(` + [ + { + "chainId": "0xa4ec", + "data": "0x4e71d92d", + "gas": 504830, + "gasPrice": 5000000000, + "nonce": 619, + "to": "0x43d72ff17701b2da814620735c39c620ce0ea4a1", + "type": "ethereum-legacy", + "value": "0x", + }, + "0x1daf825EB5C0D9d9FeC33C444e413452A08e04A6", + ] + `) + }) it('handles cip64 transactions', () => { const cip64TX = '0x7bf88282ad5a8063630a94588e4b68193001e4d10928660ab4165b813717c0880de0b6b3a764000083abcdefc094cd2a3d9f938e13cd947ec05abc7fe734df8dd82680a091b5504a59e529e7efa42dbb97fbc3311a91d035c873a94ab0789441fc989f84a02e8254d6b3101b63417e5d496833bc84f4832d4a8bf8a2b83e291d8f38c0f62d' @@ -567,7 +623,7 @@ describe('extractSignature', () => { }) it('fails when length is wrong', () => { expect(() => extractSignature('0x')).toThrowErrorMatchingInlineSnapshot( - `"@extractSignature: provided transaction has 0 elements but celo-legacy txs with a signature have 12 []"` + `"@extractSignature: provided transaction has 0 elements but ethereum-legacy txs with a signature have 9 []"` ) }) }) diff --git a/packages/sdk/wallets/wallet-base/src/signing-utils.ts b/packages/sdk/wallets/wallet-base/src/signing-utils.ts index 1bd8eaa90..705a37d5d 100644 --- a/packages/sdk/wallets/wallet-base/src/signing-utils.ts +++ b/packages/sdk/wallets/wallet-base/src/signing-utils.ts @@ -84,7 +84,7 @@ function signatureFormatter( s: string } { let v = signature.v - if (type !== 'celo-legacy') { + if (type !== 'celo-legacy' && type !== 'ethereum-legacy') { v = signature.v === Y_PARITY_EIP_2098 ? 0 : 1 } return { @@ -193,7 +193,7 @@ export function rlpEncodedTx(tx: CeloTx): RLPEncodedTx { rlpEncode: concatHex([TxTypeToPrefix.eip1559, rlpEncode]), type: 'eip1559', } - } else { + } else if (isCeloLegacy(tx)) { // This order should match the order in Geth. // https://github.com/celo-org/celo-blockchain/blob/027dba2e4584936cc5a8e8993e4e27d28d5247b8/core/types/transaction.go#L65 rlpEncode = RLP.encode([ @@ -211,10 +211,29 @@ export function rlpEncodedTx(tx: CeloTx): RLPEncodedTx { '0x', ]) return { transaction, rlpEncode, type: 'celo-legacy' } + } else { + // https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md + // rlp([nonce, gasprice, gaslimit, recipient, amount, data, v, r, s]) + rlpEncode = RLP.encode([ + stringNumberToHex(transaction.nonce), + transaction.gasPrice, + transaction.gas, + transaction.to, + transaction.value, + transaction.data, + stringNumberToHex(transaction.chainId), + '0x', + '0x', + ]) + delete transaction.feeCurrency + delete transaction.gatewayFee + delete transaction.gatewayFeeRecipient + return { transaction, rlpEncode, type: 'ethereum-legacy' } } } enum TxTypeToPrefix { + 'ethereum-legacy' = '', 'celo-legacy' = '', cip42 = '0x7c', cip64 = '0x7b', @@ -290,7 +309,7 @@ function isCIP64(tx: CeloTx) { return ( isEIP1559(tx) && isPresent(tx.feeCurrency) && - !isPresent(tx.gatewayFeeRecipient) && + !isPresent(tx.gatewayFee) && !isPresent(tx.gatewayFeeRecipient) ) } @@ -302,6 +321,13 @@ function isCIP42(tx: CeloTx): boolean { ) } +function isCeloLegacy(tx: CeloTx): boolean { + return ( + !isEIP1559(tx) && + (isPresent(tx.feeCurrency) || isPresent(tx.gatewayFeeRecipient) || isPresent(tx.gatewayFee)) + ) +} + function concatHex(values: string[]): Hex { return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}` } @@ -328,12 +354,19 @@ export async function encodeTransaction( const r = sanitizedSignature.r const s = sanitizedSignature.s const decodedTX = prefixAwareRLPDecode(rlpEncoded.rlpEncode, rlpEncoded.type) + + let decodedFields: string[] + // for legacy tx we need to slice but for new ones we do not want to do that - const rawTx = (rlpEncoded.type === 'celo-legacy' ? decodedTX.slice(0, 9) : decodedTX).concat([ - v, - r, - s, - ]) + if (rlpEncoded.type == 'celo-legacy') { + decodedFields = decodedTX.slice(0, 9) + } else if (rlpEncoded.type == 'ethereum-legacy') { + decodedFields = decodedTX.slice(0, 6) + } else { + decodedFields = decodedTX + } + + const rawTx = decodedFields.concat([v, r, s]) // After signing, the transaction is encoded again and type prefix added const rawTransaction = concatTypePrefixHex(RLP.encode(rawTx), rlpEncoded.type) @@ -369,7 +402,7 @@ export async function encodeTransaction( gatewayFee: rlpEncoded.transaction.gatewayFee!.toString(), } } - if (rlpEncoded.type === 'celo-legacy') { + if (rlpEncoded.type === 'celo-legacy' || rlpEncoded.type === 'ethereum-legacy') { tx = { ...tx, // @ts-expect-error -- just a matter of how this tx is built @@ -386,7 +419,11 @@ export async function encodeTransaction( } // new types have prefix but legacy does not function prefixAwareRLPDecode(rlpEncode: string, type: TransactionTypes): string[] { - return type === 'celo-legacy' ? RLP.decode(rlpEncode) : RLP.decode(`0x${rlpEncode.slice(4)}`) + if (type === 'celo-legacy' || type === 'ethereum-legacy') { + return RLP.decode(rlpEncode) + } + + return RLP.decode(`0x${rlpEncode.slice(4)}`) } function correctLengthOf(type: TransactionTypes, includeSig: boolean = true) { @@ -396,11 +433,14 @@ function correctLengthOf(type: TransactionTypes, includeSig: boolean = true) { } case 'cip42': return includeSig ? 15 : 12 + case 'ethereum-legacy': + return 9 case 'celo-legacy': case 'eip1559': return 12 } } + // Based on the return type of ensureLeading0x this was not a Buffer export function extractSignature(rawTx: string) { const type = determineTXType(rawTx) @@ -448,32 +488,10 @@ export function recoverTransaction(rawTx: string): [CeloTx, string] { return recoverTransactionCIP42(rawTx as Hex) case 'eip1559': return recoverTransactionEIP1559(rawTx as Hex) + case 'celo-legacy': + return recoverCeloLegacy(rawTx as Hex) default: - const rawValues = RLP.decode(rawTx) - debug('signing-utils@recoverTransaction: values are %s', rawValues) - const recovery = Bytes.toNumber(rawValues[9]) - // eslint-disable-next-line no-bitwise - const chainId = Bytes.fromNumber((recovery - 35) >> 1) - const celoTx: CeloTx = { - type: 'celo-legacy', - nonce: rawValues[0].toLowerCase() === '0x' ? 0 : parseInt(rawValues[0], 16), - gasPrice: rawValues[1].toLowerCase() === '0x' ? 0 : parseInt(rawValues[1], 16), - gas: rawValues[2].toLowerCase() === '0x' ? 0 : parseInt(rawValues[2], 16), - feeCurrency: rawValues[3], - gatewayFeeRecipient: rawValues[4], - gatewayFee: rawValues[5], - to: rawValues[6], - value: rawValues[7], - data: rawValues[8], - chainId, - } - const { r, v, s } = extractSignatureFromDecoded(rawValues) - const signature = Account.encodeSignature([v, r, s]) - const extraData = recovery < 35 ? [] : [chainId, '0x', '0x'] - const signingData = rawValues.slice(0, 9).concat(extraData) - const signingDataHex = RLP.encode(signingData) - const signer = Account.recover(getHashFromEncoded(signingDataHex), signature) - return [celoTx, signer] + return recoverEthereumLegacy(rawTx as Hex) } } @@ -516,7 +534,13 @@ function determineTXType(serializedTransaction: string): TransactionTypes { } else if (prefix === TxTypeToPrefix.cip64) { return 'cip64' } - return 'celo-legacy' + + // it is one of the legacy types (Celo or Ethereum), to differentiate between + // legacy tx types we have to check the numberof fields + const rawValues = RLP.decode(serializedTransaction) + const length = rawValues.length + + return correctLengthOf('celo-legacy') === length ? 'celo-legacy' : 'ethereum-legacy' } function vrsForRecovery(vRaw: string, r: string, s: string) { @@ -662,6 +686,59 @@ function recoverTransactionEIP1559(serializedTransaction: Hex): [CeloTxWithSig, return [celoTx, signer] } +function recoverCeloLegacy(serializedTransaction: Hex): [CeloTx, string] { + const rawValues = RLP.decode(serializedTransaction) + debug('signing-utils@recoverTransaction: values are %s', rawValues) + const recovery = Bytes.toNumber(rawValues[9]) + // eslint-disable-next-line no-bitwise + const chainId = Bytes.fromNumber((recovery - 35) >> 1) + const celoTx: CeloTx = { + type: 'celo-legacy', + nonce: rawValues[0].toLowerCase() === '0x' ? 0 : parseInt(rawValues[0], 16), + gasPrice: rawValues[1].toLowerCase() === '0x' ? 0 : parseInt(rawValues[1], 16), + gas: rawValues[2].toLowerCase() === '0x' ? 0 : parseInt(rawValues[2], 16), + feeCurrency: rawValues[3], + gatewayFeeRecipient: rawValues[4], + gatewayFee: rawValues[5], + to: rawValues[6], + value: rawValues[7], + data: rawValues[8], + chainId, + } + const { r, v, s } = extractSignatureFromDecoded(rawValues) + const signature = Account.encodeSignature([v, r, s]) + const extraData = recovery < 35 ? [] : [chainId, '0x', '0x'] + const signingData = rawValues.slice(0, 9).concat(extraData) + const signingDataHex = RLP.encode(signingData) + const signer = Account.recover(getHashFromEncoded(signingDataHex), signature) + return [celoTx, signer] +} + +function recoverEthereumLegacy(serializedTransaction: Hex): [CeloTx, string] { + const rawValues = RLP.decode(serializedTransaction) + debug('signing-utils@recoverTransaction: values are %s', rawValues) + const recovery = Bytes.toNumber(rawValues[6]) + // eslint-disable-next-line no-bitwise + const chainId = Bytes.fromNumber((recovery - 35) >> 1) + const celoTx: CeloTx = { + type: 'ethereum-legacy', + nonce: rawValues[0].toLowerCase() === '0x' ? 0 : parseInt(rawValues[0], 16), + gasPrice: rawValues[1].toLowerCase() === '0x' ? 0 : parseInt(rawValues[1], 16), + gas: rawValues[2].toLowerCase() === '0x' ? 0 : parseInt(rawValues[2], 16), + to: rawValues[3], + value: rawValues[4], + data: rawValues[5], + chainId, + } + const { r, v, s } = extractSignatureFromDecoded(rawValues) + const signature = Account.encodeSignature([v, r, s]) + const extraData = recovery < 35 ? [] : [chainId, '0x', '0x'] + const signingData = rawValues.slice(0, 6).concat(extraData) + const signingDataHex = RLP.encode(signingData) + const signer = Account.recover(getHashFromEncoded(signingDataHex), signature) + return [celoTx, signer] +} + export function recoverMessageSigner(signingDataHex: string, signedData: string): string { const dataBuff = toBuffer(signingDataHex) const msgHashBuff = hashPersonalMessage(dataBuff) diff --git a/packages/sdk/wallets/wallet-base/src/wallet-base.ts b/packages/sdk/wallets/wallet-base/src/wallet-base.ts index acab8d7fa..c86bd23a0 100644 --- a/packages/sdk/wallets/wallet-base/src/wallet-base.ts +++ b/packages/sdk/wallets/wallet-base/src/wallet-base.ts @@ -78,7 +78,9 @@ export abstract class WalletBase implements ReadOnlyWall } const rlpEncoded = rlpEncodedTx(txParams) const addToV = - rlpEncoded.type === 'celo-legacy' ? chainIdTransformationForSigning(txParams.chainId!) : 27 + rlpEncoded.type === 'celo-legacy' || rlpEncoded.type === 'ethereum-legacy' + ? chainIdTransformationForSigning(txParams.chainId!) + : 27 // Get the signer from the 'from' field const fromAddress = txParams.from!.toString() From c42682d8a7e582f0adaa63c833a4c83a0a649f20 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:02:43 +0300 Subject: [PATCH 5/9] Update dependency cross-fetch to v3.1.5 [SECURITY] (#168) * move dev-utils from monorepo back into this repo. it makes more sense here after all fix not being able to run yarn build from local packages * upgrade to final 1.x web3 release ever * its highly recommended to use example.com for examples and tests as is reserved by IANA exactly for that * Update dependency cross-fetch to v3.1.5 [SECURITY] Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * test failing but good progress * ge vs code debugger working again * move dev-utils from monorepo back into this repo. it makes more sense here after all --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Aaron DeRuvo --- .changeset/brave-spies-own.md | 5 + .changeset/friendly-penguins-happen.md | 8 + .changeset/lemon-doors-rescue.md | 19 + .gitignore | 1 - .vscode/launch.json | 36 +- packages/cli/package.json | 13 +- .../src/commands/account/authorize.test.ts | 1 - .../cli/src/commands/account/claim-domain.ts | 2 +- .../cli/src/commands/account/claim-storage.ts | 2 +- .../cli/src/commands/account/claims.test.ts | 12 +- .../src/commands/releasecelo/set-account.ts | 2 +- packages/dev-utils/.eslintrc.js | 3 + packages/dev-utils/.gitignore | 1 + packages/dev-utils/README.md | 3 + packages/dev-utils/eslint.tsconfig.json | 3 + packages/dev-utils/package.json | 39 ++ packages/dev-utils/src/describeEach.ts | 9 + packages/dev-utils/src/ganache-setup.ts | 131 +++++ packages/dev-utils/src/ganache-teardown.ts | 10 + packages/dev-utils/src/ganache-test.ts | 114 ++++ packages/dev-utils/src/matchers.ts | 45 ++ .../dev-utils/src/migration-override.json | 127 +++++ packages/dev-utils/src/network.ts | 32 ++ packages/dev-utils/tsconfig.json | 16 + .../docs/command-line-interface/exchange.md | 34 -- .../docs/connect/interfaces/index.Block.md | 40 +- .../connect/interfaces/index.BlockHeader.md | 30 +- .../docs/connect/interfaces/index.Syncing.md | 10 +- .../classes/rpc_signer.RpcSigner.md | 22 +- .../classes/rpc_wallet.RpcWallet.md | 30 +- .../enums/rpc_wallet.RpcWalletErrors.md | 4 +- .../modules/test_utils_ganache_setup.md | 2 +- .../modules/test_utils_ganache_teardown.md | 2 +- packages/sdk/base/package.json | 6 +- packages/sdk/connect/package.json | 22 +- packages/sdk/contractkit/package.json | 8 +- .../src/identity/claims/account.test.ts | 2 +- .../src/identity/claims/domain.test.ts | 10 +- packages/sdk/contractkit/src/kit.test.ts | 34 +- packages/sdk/cryptographic-utils/package.json | 4 +- packages/sdk/explorer/package.json | 8 +- packages/sdk/governance/package.json | 4 +- packages/sdk/keystores/package.json | 4 +- packages/sdk/network-utils/package.json | 8 +- packages/sdk/phone-utils/package.json | 4 +- packages/sdk/transactions-uri/package.json | 8 +- packages/sdk/utils/package.json | 8 +- packages/sdk/wallets/wallet-base/package.json | 8 +- .../sdk/wallets/wallet-hsm-aws/package.json | 6 +- .../sdk/wallets/wallet-hsm-azure/package.json | 2 +- .../sdk/wallets/wallet-hsm-gcp/package.json | 6 +- packages/sdk/wallets/wallet-hsm/package.json | 4 +- .../sdk/wallets/wallet-ledger/package.json | 6 +- .../sdk/wallets/wallet-local/package.json | 6 +- .../sdk/wallets/wallet-remote/package.json | 6 +- packages/sdk/wallets/wallet-rpc/package.json | 8 +- yarn.lock | 512 ++++++++++-------- 57 files changed, 1012 insertions(+), 490 deletions(-) create mode 100644 .changeset/brave-spies-own.md create mode 100644 .changeset/friendly-penguins-happen.md create mode 100644 .changeset/lemon-doors-rescue.md create mode 100644 packages/dev-utils/.eslintrc.js create mode 100644 packages/dev-utils/.gitignore create mode 100644 packages/dev-utils/README.md create mode 100644 packages/dev-utils/eslint.tsconfig.json create mode 100644 packages/dev-utils/package.json create mode 100644 packages/dev-utils/src/describeEach.ts create mode 100644 packages/dev-utils/src/ganache-setup.ts create mode 100644 packages/dev-utils/src/ganache-teardown.ts create mode 100644 packages/dev-utils/src/ganache-test.ts create mode 100644 packages/dev-utils/src/matchers.ts create mode 100644 packages/dev-utils/src/migration-override.json create mode 100644 packages/dev-utils/src/network.ts create mode 100644 packages/dev-utils/tsconfig.json diff --git a/.changeset/brave-spies-own.md b/.changeset/brave-spies-own.md new file mode 100644 index 000000000..36d7f4a36 --- /dev/null +++ b/.changeset/brave-spies-own.md @@ -0,0 +1,5 @@ +--- +'@celo/dev-utils': patch +--- + +Bump web3 to 1.10.4 diff --git a/.changeset/friendly-penguins-happen.md b/.changeset/friendly-penguins-happen.md new file mode 100644 index 000000000..18af2ee23 --- /dev/null +++ b/.changeset/friendly-penguins-happen.md @@ -0,0 +1,8 @@ +--- +'@celo/network-utils': patch +'@celo/contractkit': patch +'@celo/explorer': patch +'@celo/celocli': patch +--- + +Bump Cross Fetch to fix security vulnerability diff --git a/.changeset/lemon-doors-rescue.md b/.changeset/lemon-doors-rescue.md new file mode 100644 index 000000000..76e89b111 --- /dev/null +++ b/.changeset/lemon-doors-rescue.md @@ -0,0 +1,19 @@ +--- +'@celo/wallet-hsm-azure': patch +'@celo/wallet-hsm-aws': patch +'@celo/wallet-hsm-gcp': patch +'@celo/wallet-ledger': patch +'@celo/wallet-remote': patch +'@celo/wallet-local': patch +'@celo/wallet-base': patch +'@celo/wallet-hsm': patch +'@celo/wallet-rpc': patch +'@celo/transactions-uri': patch +'@celo/network-utils': patch +'@celo/contractkit': patch +'@celo/connect': patch +'@celo/utils': patch +'@celo/celocli': patch +--- + +Bump web3-\* to 1.10.4 -- Some consumers may be forced to upgrade their web3 instance to the same version diff --git a/.gitignore b/.gitignore index 9b32745dc..11d572ad7 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,6 @@ packages/sdk/identity/* packages/sdk/encrypted-backup/* packages/protocol/* packages/celotool/* -packages/dev-utils/* packages/metadata-crawler/* packages/helm-charts/* # temp json file for deploy-sdks script diff --git a/.vscode/launch.json b/.vscode/launch.json index 79c6a7e4a..2dcffcacd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,38 +1,6 @@ { "version": "0.2.0", "configurations": [ - { - "name": "Debug PhoneNumberPrivacy Combiner Tests", - "type": "node", - "request": "launch", - "runtimeArgs": [ - "--inspect-brk", - "${workspaceRoot}/node_modules/.bin/jest", - "--rootDir", - "${workspaceFolder}/packages/phone-number-privacy", - "--runInBand", - "${workspaceFolder}/packages/phone-number-privacy/combiner/test/**", - ], - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", - "port": 9229 - }, - { - "name": "Debug PhoneNumberPrivacy Signer Tests", - "type": "node", - "request": "launch", - "runtimeArgs": [ - "--inspect-brk", - "${workspaceRoot}/node_modules/.bin/jest", - "--rootDir", - "${workspaceFolder}/packages/phone-number-privacy/signer", - "--runInBand", - "${workspaceFolder}/packages/phone-number-privacy/signer/test/**", - ], - "console": "integratedTerminal", - "internalConsoleOptions": "neverOpen", - "port": 9229 - }, { "name": "Debug ContractKit Tests", "type": "node", @@ -41,9 +9,9 @@ "--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--rootDir", - "${workspaceFolder}/packages/contractkit", + "${workspaceFolder}/packages/sdk/contractkit", "--runInBand", - "${workspaceFolder}/packages/contractkit/src/**/*.test.ts", + "${workspaceFolder}/packages/sdk/contractkit/src/**/*.test.ts", ], "console": "integratedTerminal", "internalConsoleOptions": "neverOpen", diff --git a/packages/cli/package.json b/packages/cli/package.json index 3cb3392bd..8e86066f7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -22,9 +22,9 @@ "node": ">=16" }, "scripts": { - "clean": "tsc -b . --clean", + "clean": "yarn run --top-level tsc -b . --clean", "dev": "yarn build && ts-node ./bin/dev.js", - "build": "tsc -b .", + "build": "yarn run --top-level tsc -b .", "docs": "./generate_docs.sh", "lint": "yarn run --top-level eslint -c .eslintrc.js ", "prepublish": "", @@ -61,7 +61,7 @@ "bip32": "3.1.0", "chalk": "^2.4.2", "command-exists": "^1.2.9", - "cross-fetch": "3.0.6", + "cross-fetch": "3.1.5", "debug": "^4.1.1", "ethers": "5", "fs-extra": "^8.1.0", @@ -69,12 +69,12 @@ "path": "^0.12.7", "prompts": "^2.0.1", "randombytes": "^2.0.1", - "web3": "1.10.0", - "web3-utils": "^1.10.0" + "web3": "1.10.4", + "web3-utils": "^1.10.4" }, "devDependencies": { "@celo/celo-devchain": "^7.0.0", - "@celo/dev-utils": "0.0.1-beta.1", + "@celo/dev-utils": "0.0.2", "@celo/typescript": "workspace:^", "@types/debug": "^4.1.4", "@types/fs-extra": "^8.0.0", @@ -83,7 +83,6 @@ "@types/ledgerhq__hw-transport-node-hid": "^4.22.2", "@types/node": "^18.7.16", "@types/prompts": "^1.1.1", - "@types/web3": "^1.0.18", "jest": "^29.0.2", "oclif": "^4.3.4", "prettier": "1.19.1", diff --git a/packages/cli/src/commands/account/authorize.test.ts b/packages/cli/src/commands/account/authorize.test.ts index d7a419f06..3c5bb899b 100644 --- a/packages/cli/src/commands/account/authorize.test.ts +++ b/packages/cli/src/commands/account/authorize.test.ts @@ -8,7 +8,6 @@ import Authorize from './authorize' import Register from './register' process.env.NO_SYNCCHECK = 'true' - testWithGanache('account:authorize cmd', (web3: Web3) => { test('can authorize vote signer', async () => { const accounts = await web3.eth.getAccounts() diff --git a/packages/cli/src/commands/account/claim-domain.ts b/packages/cli/src/commands/account/claim-domain.ts index 206fd850c..78098db38 100644 --- a/packages/cli/src/commands/account/claim-domain.ts +++ b/packages/cli/src/commands/account/claim-domain.ts @@ -12,7 +12,7 @@ export default class ClaimDomain extends ClaimCommand { } static args = ClaimCommand.args static examples = [ - 'claim-domain ~/metadata.json --domain test.com --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95', + 'claim-domain ~/metadata.json --domain example.com --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95', ] self = ClaimDomain async run() { diff --git a/packages/cli/src/commands/account/claim-storage.ts b/packages/cli/src/commands/account/claim-storage.ts index 7425eb96c..32fcffcf0 100644 --- a/packages/cli/src/commands/account/claim-storage.ts +++ b/packages/cli/src/commands/account/claim-storage.ts @@ -12,7 +12,7 @@ export default class ClaimStorage extends ClaimCommand { } static args = ClaimCommand.args static examples = [ - 'claim-storage ~/metadata.json --url http://test.com/myurl --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95', + 'claim-storage ~/metadata.json --url http://example.com/myurl --from 0x47e172F6CfB6c7D01C1574fa3E2Be7CC73269D95', ] self = ClaimStorage diff --git a/packages/cli/src/commands/account/claims.test.ts b/packages/cli/src/commands/account/claims.test.ts index 721b8c7ee..efe7ba8c8 100644 --- a/packages/cli/src/commands/account/claims.test.ts +++ b/packages/cli/src/commands/account/claims.test.ts @@ -52,7 +52,7 @@ testWithGanache('account metadata cmds', (web3: Web3) => { test('account:claim-domain cmd', async () => { generateEmptyMetadataFile() - const domain = 'test.com' + const domain = 'example.com' await testLocally(ClaimDomain, ['--from', account, '--domain', domain, emptyFilePath]) const metadata = await readFile() const claim = metadata.findClaim(ClaimTypes.DOMAIN) @@ -84,7 +84,7 @@ testWithGanache('account metadata cmds', (web3: Web3) => { '--from', account, '--url', - 'https://test.com', + 'https://example.com', ]) }) @@ -97,7 +97,13 @@ testWithGanache('account metadata cmds', (web3: Web3) => { it('cannot register metadata', async () => { await expect( - testLocally(RegisterMetadata, ['--force', '--from', account, '--url', 'https://test.com']) + testLocally(RegisterMetadata, [ + '--force', + '--from', + account, + '--url', + 'https://example.com', + ]) ).rejects.toThrow("Some checks didn't pass!") }) }) diff --git a/packages/cli/src/commands/releasecelo/set-account.ts b/packages/cli/src/commands/releasecelo/set-account.ts index a02f7579b..17c450f38 100644 --- a/packages/cli/src/commands/releasecelo/set-account.ts +++ b/packages/cli/src/commands/releasecelo/set-account.ts @@ -26,7 +26,7 @@ export default class SetAccount extends ReleaseGoldBaseCommand { static examples = [ 'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property name --value mywallet', 'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property dataEncryptionKey --value 0x041bb96e35f9f4b71ca8de561fff55a249ddf9d13ab582bdd09a09e75da68ae4cd0ab7038030f41b237498b4d76387ae878dc8d98fd6f6db2c15362d1a3bf11216', - 'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property metaURL --value www.test.com', + 'set-account --contract 0x5719118266779B58D0f9519383A4A27aA7b829E5 --property metaURL --value www.example.com', ] async run() { diff --git a/packages/dev-utils/.eslintrc.js b/packages/dev-utils/.eslintrc.js new file mode 100644 index 000000000..bfd2057be --- /dev/null +++ b/packages/dev-utils/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: '../../.eslintrc.js', +} diff --git a/packages/dev-utils/.gitignore b/packages/dev-utils/.gitignore new file mode 100644 index 000000000..7951405f8 --- /dev/null +++ b/packages/dev-utils/.gitignore @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md new file mode 100644 index 000000000..e61ba036a --- /dev/null +++ b/packages/dev-utils/README.md @@ -0,0 +1,3 @@ +# packages/dev-utils + +This is a `utils` package that is meant to be used as a devDependency. It's primary use case is to reuse the ganache setup currently present in `cli` and `contractkit`. Due to the way jest uses globalSetup, depending packages will still need to define their own setup/teardown files. diff --git a/packages/dev-utils/eslint.tsconfig.json b/packages/dev-utils/eslint.tsconfig.json new file mode 100644 index 000000000..fc8520e73 --- /dev/null +++ b/packages/dev-utils/eslint.tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./tsconfig.json" +} diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json new file mode 100644 index 000000000..49c3903eb --- /dev/null +++ b/packages/dev-utils/package.json @@ -0,0 +1,39 @@ +{ + "name": "@celo/dev-utils", + "version": "0.0.2", + "description": "util package for celo packages that should only be a devDependency", + "main": "./lib/index.js", + "types": "./lib/index.d.ts", + "author": "Celo", + "license": "Apache-2.0", + "homepage": "https://github.com/celo-org/celo-monorepo/tree/master/packages/dev-utils", + "repository": "https://github.com/celo-org/celo-monorepo/tree/master/packages/dev-utils", + "keywords": [ + "celo" + ], + "files": [ + "lib/*" + ], + "scripts": { + "build": "yarn run --top-level tsc -b .", + "lint": "yarn run --top-level eslint -c .eslintrc.js ", + "prepack": "yarn build" + }, + "dependencies": { + "bignumber.js": "^9.0.0", + "fs-extra": "^8.1.0", + "ganache": "npm:@celo/ganache@7.8.0-unofficial.0", + "targz": "^1.0.1", + "tmp": "^0.1.0", + "web3": "1.10.4", + "web3-core-helpers": "1.10.4" + }, + "devDependencies": { + "@tsconfig/recommended": "^1.0.3", + "@types/fs-extra": "^8.1.0", + "@types/targz": "1.0.0" + }, + "engines": { + "node": ">=18.14.2" + } +} diff --git a/packages/dev-utils/src/describeEach.ts b/packages/dev-utils/src/describeEach.ts new file mode 100644 index 000000000..301ce4d18 --- /dev/null +++ b/packages/dev-utils/src/describeEach.ts @@ -0,0 +1,9 @@ +export interface TestCase { + label: string +} + +export function describeEach(testCases: T[], fn: (testCase: T) => void) { + for (const testCase of testCases) { + describe(testCase.label, () => fn(testCase)) + } +} diff --git a/packages/dev-utils/src/ganache-setup.ts b/packages/dev-utils/src/ganache-setup.ts new file mode 100644 index 000000000..c97afaf04 --- /dev/null +++ b/packages/dev-utils/src/ganache-setup.ts @@ -0,0 +1,131 @@ +import * as fs from 'fs-extra' +import * as ganache from 'ganache' +import * as path from 'path' +import * as targz from 'targz' + +/* eslint no-console: 0 */ // --> OFF +const MNEMONIC = 'concert load couple harbor equip island argue ramp clarify fence smart topic' +export const ACCOUNT_PRIVATE_KEYS = [ + '0xf2f48ee19680706196e2e339e5da3491186e0c4c5030670656b0e0164837257d', + '0x5d862464fe9303452126c8bc94274b8c5f9874cbd219789b3eb2128075a76f72', + '0xdf02719c4df8b9b8ac7f551fcb5d9ef48fa27eef7a66453879f4d8fdc6e78fb1', + '0xff12e391b79415e941a94de3bf3a9aee577aed0731e297d5cfa0b8a1e02fa1d0', + '0x752dd9cf65e68cfaba7d60225cbdbc1f4729dd5e5507def72815ed0d8abc6249', + '0xefb595a0178eb79a8df953f87c5148402a224cdf725e88c0146727c6aceadccd', + '0x83c6d2cc5ddcf9711a6d59b417dc20eb48afd58d45290099e5987e3d768f328f', + '0xbb2d3f7c9583780a7d3904a2f55d792707c345f21de1bacb2d389934d82796b2', + '0xb2fd4d29c1390b71b8795ae81196bfd60293adf99f9d32a0aff06288fcdac55f', + '0x23cb7121166b9a2f93ae0b7c05bde02eae50d64449b2cbb42bc84e9d38d6cc89', +] +export const ACCOUNT_ADDRESSES = [ + '0x5409ED021D9299bf6814279A6A1411A7e866A631', + '0x6Ecbe1DB9EF729CBe972C83Fb886247691Fb6beb', + '0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84', + '0xE834EC434DABA538cd1b9Fe1582052B880BD7e63', + '0x78dc5D2D739606d31509C31d654056A45185ECb6', + '0xA8dDa8d7F5310E4A9E24F8eBA77E091Ac264f872', + '0x06cEf8E666768cC40Cc78CF93d9611019dDcB628', + '0x4404ac8bd8F9618D27Ad2f1485AA1B2cFD82482D', + '0x7457d5E02197480Db681D3fdF256c7acA21bDc12', + '0x91c987bf62D25945dB517BDAa840A6c661374402', +] + +export async function startGanache( + filePath: string, + datafile: string, + opts: { verbose?: boolean; from_targz?: boolean } = {} +) { + const chainCopyBase = process.env.GANACHE_CHAIN_DATA_PATH || path.resolve(filePath) + const chainCopy: string = path.resolve(path.join(chainCopyBase, 'tmp/copychain')) + console.info(chainCopy) + console.info(filePath, datafile) + const filenameWithPath: string = path.resolve(path.join(filePath, datafile)) + + // erases tmp chain + if (fs.existsSync(chainCopy)) { + console.info(`Removing old chain tmp folder: ${chainCopy}`) + fs.removeSync(chainCopy) + } + console.info(`Creating chain tmp folder: ${chainCopy}`) + fs.mkdirsSync(chainCopy) + + if (opts.from_targz) { + await decompressChain(filenameWithPath, chainCopy) + } else { + fs.copySync(filenameWithPath, chainCopy) + } + + return launchServer(opts, chainCopy) +} + +function launchServer(opts: { verbose?: boolean; from_targz?: boolean }, chain?: string) { + const logFn = opts.verbose + ? // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + (...args: any[]) => console.info(...args) + : () => { + /* nothing */ + } + + const server = ganache.server({ + wallet: { mnemonic: MNEMONIC, defaultBalance: 1000000 }, + logging: { logger: { log: logFn } }, + database: { dbPath: chain }, + miner: { blockGasLimit: 20000000, defaultGasPrice: 0 }, + chain: { networkId: 1101, chainId: 1, allowUnlimitedContractSize: true, hardfork: 'istanbul' }, + }) + + server.listen(8545, (err: any) => { + if (err) { + throw err + } + }) + + async function stopGanache() { + return server.close() + } + + return { stopGanache } +} + +function decompressChain(tarPath: string, copyChainPath: string): Promise { + console.info('Decompressing chain') + return new Promise((resolve, reject) => { + targz.decompress({ src: tarPath, dest: copyChainPath }, (err) => { + if (err) { + console.error(err) + reject(err) + } else { + console.info('Chain decompressed') + resolve() + } + }) + }) +} + +export default function setup( + filePath: string, + datafile: string, + opts: { verbose?: boolean; from_targz?: boolean } = {} +) { + return startGanache(filePath, datafile, opts) + .then(({ stopGanache }) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + ;(global as any).stopGanache = stopGanache + }) + .catch((err) => { + console.error('Error starting ganache') + console.error(err) + process.exit(1) + }) +} + +export function emptySetup(opts: { verbose?: boolean; from_targz?: boolean } = {}) { + try { + const { stopGanache } = launchServer(opts) + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + ;(global as any).stopGanache = stopGanache + } catch (err) { + console.error(err) + process.exit(1) + } +} diff --git a/packages/dev-utils/src/ganache-teardown.ts b/packages/dev-utils/src/ganache-teardown.ts new file mode 100644 index 000000000..c0660ea14 --- /dev/null +++ b/packages/dev-utils/src/ganache-teardown.ts @@ -0,0 +1,10 @@ +export default function tearDown() { + try { + console.info('Stopping ganache') + // eslint-disable-next-line + return (global as any).stopGanache() + } catch (err) { + console.error('error stopping ganache') + console.error(err) + } +} diff --git a/packages/dev-utils/src/ganache-test.ts b/packages/dev-utils/src/ganache-test.ts new file mode 100644 index 000000000..673c02357 --- /dev/null +++ b/packages/dev-utils/src/ganache-test.ts @@ -0,0 +1,114 @@ +import Web3 from 'web3' +import { JsonRpcResponse } from 'web3-core-helpers' +import migrationOverride from './migration-override.json' + +export const NetworkConfig = migrationOverride + +export function jsonRpcCall(web3: Web3, method: string, params: any[]): Promise { + return new Promise((resolve, reject) => { + if (web3.currentProvider && typeof web3.currentProvider !== 'string') { + web3.currentProvider.send( + { + id: new Date().getTime(), + jsonrpc: '2.0', + method, + params, + }, + (err: Error | null, res?: JsonRpcResponse) => { + if (err) { + reject(err) + } else if (!res) { + reject(new Error('no response')) + } else if (res.error) { + reject( + new Error( + `Failed JsonRpcResponse: method: ${method} params: ${JSON.stringify( + params + )} error: ${JSON.stringify(res.error)}` + ) + ) + } else { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + resolve(res.result) + } + } + ) + } else { + reject(new Error('Invalid provider')) + } + }) +} + +export async function timeTravel(seconds: number, web3: Web3) { + await jsonRpcCall(web3, 'evm_increaseTime', [seconds]) + await jsonRpcCall(web3, 'evm_mine', []) +} + +export async function mineBlocks(blocks: number, web3: Web3) { + for (let i = 0; i < blocks; i++) { + await jsonRpcCall(web3, 'evm_mine', []) + } +} + +export function evmRevert(web3: Web3, snapId: string): Promise { + return jsonRpcCall(web3, 'evm_revert', [snapId]) +} + +export function evmSnapshot(web3: Web3) { + return jsonRpcCall(web3, 'evm_snapshot', []) +} + +export function testWithGanache(name: string, fn: (web3: Web3) => void) { + const web3 = new Web3('http://localhost:8545') + + describe(name, () => { + let snapId: string | null = null + + beforeEach(async () => { + if (snapId != null) { + await evmRevert(web3, snapId) + } + snapId = await evmSnapshot(web3) + }) + + afterAll(async () => { + if (snapId != null) { + await evmRevert(web3, snapId) + } + }) + + fn(web3) + }) +} + +/** + * Gets a contract address by parsing blocks and matching event signatures against the given event. + */ +export async function getContractFromEvent( + eventSignature: string, + web3: Web3, + filter?: { + expectedData?: string + index?: number + } +): Promise { + const logs = await web3.eth.getPastLogs({ + topics: [web3.utils.sha3(eventSignature)], + fromBlock: 'earliest', + toBlock: 'latest', + }) + if (logs.length === 0) { + throw Error(`Error: contract could not be found matching signature ${eventSignature}`) + } + const logIndex = filter?.index ?? 0 + if (!filter?.expectedData) { + return logs[logIndex].address + } + const filteredLogs = logs.filter((log) => log.data === filter.expectedData) + if (filteredLogs.length === 0) { + throw Error( + `Error: contract could not be found matching signature ${eventSignature} with data ${filter.expectedData}` + ) + } + return filteredLogs[logIndex ?? 0].address +} diff --git a/packages/dev-utils/src/matchers.ts b/packages/dev-utils/src/matchers.ts new file mode 100644 index 000000000..066e6a538 --- /dev/null +++ b/packages/dev-utils/src/matchers.ts @@ -0,0 +1,45 @@ +import BigNumber from 'bignumber.js' + +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace jest { + interface Matchers { + toBeBigNumber(): R + toEqBigNumber(expected: BigNumber | string | number): R + } + } +} +jest.setTimeout(10000) + +expect.extend({ + toBeBigNumber(received: any) { + const pass = BigNumber.isBigNumber(received) + if (pass) { + return { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + message: () => `expected ${received.toJSON()} not to be BigNumber`, + pass: true, + } + } else { + return { + message: () => `expected ${received} to be BigNumber`, + pass: false, + } + } + }, + toEqBigNumber(received: BigNumber, _expected: BigNumber | string | number) { + const expected = new BigNumber(_expected) + const pass = expected.eq(received) + if (pass) { + return { + message: () => `expected ${received.toString()} not to equal ${expected.toString()}`, + pass: true, + } + } else { + return { + message: () => `expected ${received.toString()} to equal ${expected.toString()}`, + pass: false, + } + } + }, +}) diff --git a/packages/dev-utils/src/migration-override.json b/packages/dev-utils/src/migration-override.json new file mode 100644 index 000000000..213756a69 --- /dev/null +++ b/packages/dev-utils/src/migration-override.json @@ -0,0 +1,127 @@ +{ + "downtimeSlasher": { + "slashableDowntime": 60 + }, + "epochRewards": { + "frozen": false + }, + "exchange": { + "frozen": false, + "minimumReports": 1 + }, + "exchangeEUR": { + "frozen": false, + "minimumReports": 1 + }, + "goldToken": { + "frozen": false + }, + "governance": { + "dequeueFrequency": 30, + "queueExpiry": 1000, + "approvalStageDuration": 100, + "referendumStageDuration": 100, + "executionStageDuration": 100, + "minDeposit": 1, + "concurrentProposals": 5, + "skipTransferOwnership": false + }, + "governanceApproverMultiSig": { + "signatories": [ + "0x5409ed021d9299bf6814279a6a1411a7e866a631" + ], + "numRequiredConfirmations": 1 + }, + "grandaMento": { + "approver": "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "spread": 0.01, + "maxApprovalExchangeRateChange": 0.5, + "vetoPeriodSeconds": 10800 + }, + "oracles": { + "reportExpiry": 300 + }, + "reserve": { + "initialBalance": 100000000, + "otherAddresses": ["0x91c987bf62D25945dB517BDAa840A6c661374402"] + }, + "reserveSpenderMultiSig": { + "signatories": ["0x5409ed021d9299bf6814279a6a1411a7e866a631", "0x4404ac8bd8F9618D27Ad2f1485AA1B2cFD82482D"], + "numRequiredConfirmations": 2 + }, + "stableToken": { + "goldPrice": 1, + "initialBalances": { + "addresses": [ + "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "0x6Ecbe1DB9EF729CBe972C83Fb886247691Fb6beb", + "0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84", + "0xE834EC434DABA538cd1b9Fe1582052B880BD7e63" + ], + "values": [ + "50000000000000000000000", + "50000000000000000000000", + "50000000000000000000000", + "50000000000000000000000" + ] + }, + "oracles": [ + "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84", + "0x06cEf8E666768cC40Cc78CF93d9611019dDcB628", + "0x7457d5E02197480Db681D3fdF256c7acA21bDc12" + ], + "frozen": false + }, + "stableTokenEUR": { + "goldPrice": 1, + "initialBalances": { + "addresses": [ + "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "0x6Ecbe1DB9EF729CBe972C83Fb886247691Fb6beb", + "0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84", + "0xE834EC434DABA538cd1b9Fe1582052B880BD7e63" + ], + "values": [ + "50000000000000000000000", + "50000000000000000000000", + "50000000000000000000000", + "50000000000000000000000" + ] + }, + "oracles": [ + "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84", + "0x06cEf8E666768cC40Cc78CF93d9611019dDcB628", + "0x7457d5E02197480Db681D3fdF256c7acA21bDc12" + ], + "frozen": false + }, + "stableTokenBRL": { + "goldPrice": 1, + "initialBalances": { + "addresses": [ + "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "0x6Ecbe1DB9EF729CBe972C83Fb886247691Fb6beb", + "0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84", + "0xE834EC434DABA538cd1b9Fe1582052B880BD7e63" + ], + "values": [ + "50000000000000000000000", + "50000000000000000000000", + "50000000000000000000000", + "50000000000000000000000" + ] + }, + "oracles": [ + "0x5409ED021D9299bf6814279A6A1411A7e866A631", + "0xE36Ea790bc9d7AB70C55260C66D52b1eca985f84", + "0x06cEf8E666768cC40Cc78CF93d9611019dDcB628", + "0x7457d5E02197480Db681D3fdF256c7acA21bDc12" + ], + "frozen": false + }, + "validators": { + "commissionUpdateDelay": 3 + } +} diff --git a/packages/dev-utils/src/network.ts b/packages/dev-utils/src/network.ts new file mode 100644 index 000000000..480b875cd --- /dev/null +++ b/packages/dev-utils/src/network.ts @@ -0,0 +1,32 @@ +import { spawn, SpawnOptions } from 'child_process' + +export async function waitForPortOpen(host: string, port: number, seconds: number) { + const deadline = Date.now() + seconds * 1000 + do { + if (await isPortOpen(host, port)) { + return true + } + } while (Date.now() < deadline) + return false +} + +export async function isPortOpen(host: string, port: number) { + return (await execCmd('nc', ['-z', host, port.toString()], { silent: true })) === 0 +} + +async function execCmd(cmd: string, args: string[], options?: SpawnOptions & { silent?: boolean }) { + return new Promise((resolve, reject) => { + const { silent, ...spawnOptions } = options || { silent: false } + if (!silent) { + console.debug('$ ' + [cmd].concat(args).join(' ')) + } + const process = spawn(cmd, args, { ...spawnOptions, stdio: silent ? 'ignore' : 'inherit' }) + process.on('close', (code) => { + try { + resolve(code) + } catch (error) { + reject(error) + } + }) + }) +} diff --git a/packages/dev-utils/tsconfig.json b/packages/dev-utils/tsconfig.json new file mode 100644 index 000000000..a11e6de79 --- /dev/null +++ b/packages/dev-utils/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../typescript/tsconfig.library.json", + "compilerOptions": { + "resolveJsonModule": true, + "moduleResolution": "node16", + "declarationMap": true, + "module": "Node16", + "rootDir": "src", + "outDir": "lib", + "esModuleInterop": true, + "target": "es2020", + "strict": false, + "declaration": true, + }, + "include": ["src/**/*", "src/migration-override.json"] +} diff --git a/packages/docs/command-line-interface/exchange.md b/packages/docs/command-line-interface/exchange.md index 0cc2233f2..f44b64b73 100644 --- a/packages/docs/command-line-interface/exchange.md +++ b/packages/docs/command-line-interface/exchange.md @@ -6,7 +6,6 @@ Exchange Celo Dollars and CELO via Mento * [`celocli exchange:celo`](#celocli-exchangecelo) * [`celocli exchange:dollars`](#celocli-exchangedollars) * [`celocli exchange:euros`](#celocli-exchangeeuros) -* [`celocli exchange:gold`](#celocli-exchangegold) * [`celocli exchange:reals`](#celocli-exchangereals) * [`celocli exchange:show`](#celocli-exchangeshow) * [`celocli exchange:stable`](#celocli-exchangestable) @@ -104,39 +103,6 @@ EXAMPLES _See code: [src/commands/exchange/euros.ts](https://github.com/celo-org/developer-tooling/tree/master/packages/cli/src/commands/exchange/euros.ts)_ -## `celocli exchange:gold` - -Exchange CELO for StableTokens via Mento. *DEPRECATION WARNING* Use the "exchange:celo" command instead - -``` -USAGE - $ celocli exchange:gold --from --value [--globalHelp] - [--forAtLeast ] [--stableToken cUSD|cusd|cEUR|ceur|cREAL|creal] - -FLAGS - --forAtLeast=10000000000000000000000 [default: 0] Optional, the minimum - value of StableTokens to receive in - return - --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d (required) The address with CELO to - exchange - --globalHelp View all available global flags - --stableToken=