From d05deabe1c7aa4f14a147573c74191a31c94503b Mon Sep 17 00:00:00 2001 From: Arthur Gousset <46296830+arthurgousset@users.noreply.github.com> Date: Thu, 16 May 2024 10:27:30 +0100 Subject: [PATCH 1/3] Fix @celo/base docs (#240) * chore(sdk/base): fix typo in typedoc output path * docs(sdk/base): re-generates docs at new output path Re-generates docs at `./docs/` ```sh $ yarn workspace @celo/base docs ``` --- docs/sdk/base/README.md | 28 + docs/sdk/base/classes/future.Future.md | 145 ++++ docs/sdk/base/classes/lock.Lock.md | 73 ++ .../sdk/base/classes/result.JSONParseError.md | 203 +++++ docs/sdk/base/classes/result.RootError.md | 210 +++++ .../base/enums/account.MnemonicLanguages.md | 109 +++ .../base/enums/account.MnemonicStrength.md | 32 + .../base/enums/currencies.CURRENCY_ENUM.md | 47 ++ .../base/enums/currencies.SHORT_CURRENCIES.md | 47 ++ docs/sdk/base/enums/currencies.StableToken.md | 43 ++ docs/sdk/base/enums/currencies.Token.md | 21 + .../enums/inputValidation.ValidatorKind.md | 54 ++ docs/sdk/base/interfaces/account.Bip39.md | 115 +++ .../interfaces/collections.AddressListItem.md | 38 + .../interfaces/contacts.ContactPhoneNumber.md | 32 + .../interfaces/contacts.MinimalContact.md | 54 ++ .../interfaces/inputValidation.BaseProps.md | 68 ++ .../phoneNumbers.ParsedPhoneNumber.md | 65 ++ docs/sdk/base/interfaces/result.BaseError.md | 31 + .../sdk/base/interfaces/result.ErrorResult.md | 38 + docs/sdk/base/interfaces/result.OkResult.md | 38 + .../interfaces/signatureUtils.Signature.md | 43 ++ .../base/interfaces/signatureUtils.Signer.md | 35 + .../base/interfaces/task.RepeatTaskContext.md | 43 ++ .../base/interfaces/task.RetryTaskOptions.md | 105 +++ docs/sdk/base/interfaces/task.RunningTask.md | 54 ++ .../interfaces/task.RunningTaskWithValue.md | 83 ++ docs/sdk/base/interfaces/task.TaskOptions.md | 42 + docs/sdk/base/modules/account.md | 57 ++ docs/sdk/base/modules/address.md | 332 ++++++++ docs/sdk/base/modules/async.md | 263 +++++++ docs/sdk/base/modules/collections.md | 254 ++++++ docs/sdk/base/modules/contacts.md | 55 ++ docs/sdk/base/modules/currencies.md | 89 +++ docs/sdk/base/modules/displayFormatting.md | 29 + docs/sdk/base/modules/future.md | 67 ++ docs/sdk/base/modules/index.md | 722 ++++++++++++++++++ docs/sdk/base/modules/inputValidation.md | 59 ++ docs/sdk/base/modules/io.md | 43 ++ docs/sdk/base/modules/lock.md | 9 + docs/sdk/base/modules/logger.md | 100 +++ docs/sdk/base/modules/parsing.md | 53 ++ docs/sdk/base/modules/phoneNumbers.md | 74 ++ docs/sdk/base/modules/result.md | 301 ++++++++ docs/sdk/base/modules/signatureUtils.md | 88 +++ docs/sdk/base/modules/string.md | 72 ++ docs/sdk/base/modules/task.md | 88 +++ docs/sdk/base/modules/types.md | 3 + packages/sdk/base/typedoc.json | 2 +- 49 files changed, 4655 insertions(+), 1 deletion(-) create mode 100644 docs/sdk/base/README.md create mode 100644 docs/sdk/base/classes/future.Future.md create mode 100644 docs/sdk/base/classes/lock.Lock.md create mode 100644 docs/sdk/base/classes/result.JSONParseError.md create mode 100644 docs/sdk/base/classes/result.RootError.md create mode 100644 docs/sdk/base/enums/account.MnemonicLanguages.md create mode 100644 docs/sdk/base/enums/account.MnemonicStrength.md create mode 100644 docs/sdk/base/enums/currencies.CURRENCY_ENUM.md create mode 100644 docs/sdk/base/enums/currencies.SHORT_CURRENCIES.md create mode 100644 docs/sdk/base/enums/currencies.StableToken.md create mode 100644 docs/sdk/base/enums/currencies.Token.md create mode 100644 docs/sdk/base/enums/inputValidation.ValidatorKind.md create mode 100644 docs/sdk/base/interfaces/account.Bip39.md create mode 100644 docs/sdk/base/interfaces/collections.AddressListItem.md create mode 100644 docs/sdk/base/interfaces/contacts.ContactPhoneNumber.md create mode 100644 docs/sdk/base/interfaces/contacts.MinimalContact.md create mode 100644 docs/sdk/base/interfaces/inputValidation.BaseProps.md create mode 100644 docs/sdk/base/interfaces/phoneNumbers.ParsedPhoneNumber.md create mode 100644 docs/sdk/base/interfaces/result.BaseError.md create mode 100644 docs/sdk/base/interfaces/result.ErrorResult.md create mode 100644 docs/sdk/base/interfaces/result.OkResult.md create mode 100644 docs/sdk/base/interfaces/signatureUtils.Signature.md create mode 100644 docs/sdk/base/interfaces/signatureUtils.Signer.md create mode 100644 docs/sdk/base/interfaces/task.RepeatTaskContext.md create mode 100644 docs/sdk/base/interfaces/task.RetryTaskOptions.md create mode 100644 docs/sdk/base/interfaces/task.RunningTask.md create mode 100644 docs/sdk/base/interfaces/task.RunningTaskWithValue.md create mode 100644 docs/sdk/base/interfaces/task.TaskOptions.md create mode 100644 docs/sdk/base/modules/account.md create mode 100644 docs/sdk/base/modules/address.md create mode 100644 docs/sdk/base/modules/async.md create mode 100644 docs/sdk/base/modules/collections.md create mode 100644 docs/sdk/base/modules/contacts.md create mode 100644 docs/sdk/base/modules/currencies.md create mode 100644 docs/sdk/base/modules/displayFormatting.md create mode 100644 docs/sdk/base/modules/future.md create mode 100644 docs/sdk/base/modules/index.md create mode 100644 docs/sdk/base/modules/inputValidation.md create mode 100644 docs/sdk/base/modules/io.md create mode 100644 docs/sdk/base/modules/lock.md create mode 100644 docs/sdk/base/modules/logger.md create mode 100644 docs/sdk/base/modules/parsing.md create mode 100644 docs/sdk/base/modules/phoneNumbers.md create mode 100644 docs/sdk/base/modules/result.md create mode 100644 docs/sdk/base/modules/signatureUtils.md create mode 100644 docs/sdk/base/modules/string.md create mode 100644 docs/sdk/base/modules/task.md create mode 100644 docs/sdk/base/modules/types.md diff --git a/docs/sdk/base/README.md b/docs/sdk/base/README.md new file mode 100644 index 000000000..c6e67fab7 --- /dev/null +++ b/docs/sdk/base/README.md @@ -0,0 +1,28 @@ +@celo/base + +# @celo/base + +## Table of contents + +### Modules + +- [account](modules/account.md) +- [address](modules/address.md) +- [async](modules/async.md) +- [collections](modules/collections.md) +- [contacts](modules/contacts.md) +- [currencies](modules/currencies.md) +- [displayFormatting](modules/displayFormatting.md) +- [future](modules/future.md) +- [index](modules/index.md) +- [inputValidation](modules/inputValidation.md) +- [io](modules/io.md) +- [lock](modules/lock.md) +- [logger](modules/logger.md) +- [parsing](modules/parsing.md) +- [phoneNumbers](modules/phoneNumbers.md) +- [result](modules/result.md) +- [signatureUtils](modules/signatureUtils.md) +- [string](modules/string.md) +- [task](modules/task.md) +- [types](modules/types.md) diff --git a/docs/sdk/base/classes/future.Future.md b/docs/sdk/base/classes/future.Future.md new file mode 100644 index 000000000..83a071188 --- /dev/null +++ b/docs/sdk/base/classes/future.Future.md @@ -0,0 +1,145 @@ +[@celo/base](../README.md) / [future](../modules/future.md) / Future + +# Class: Future\ + +[future](../modules/future.md).Future + +## Type parameters + +| Name | +| :------ | +| `T` | + +## Table of contents + +### Constructors + +- [constructor](future.Future.md#constructor) + +### Accessors + +- [error](future.Future.md#error) +- [finished](future.Future.md#finished) + +### Methods + +- [asPromise](future.Future.md#aspromise) +- [reject](future.Future.md#reject) +- [resolve](future.Future.md#resolve) +- [wait](future.Future.md#wait) + +## Constructors + +### constructor + +• **new Future**\<`T`\>(): [`Future`](future.Future.md)\<`T`\> + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Returns + +[`Future`](future.Future.md)\<`T`\> + +#### Defined in + +[packages/sdk/base/src/future.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L10) + +## Accessors + +### error + +• `get` **error**(): `any` + +#### Returns + +`any` + +#### Defined in + +[packages/sdk/base/src/future.ts:21](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L21) + +___ + +### finished + +• `get` **finished**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/future.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L17) + +## Methods + +### asPromise + +▸ **asPromise**(): `Promise`\<`T`\> + +#### Returns + +`Promise`\<`T`\> + +#### Defined in + +[packages/sdk/base/src/future.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L41) + +___ + +### reject + +▸ **reject**(`error`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `any` | + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/future.ts:31](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L31) + +___ + +### resolve + +▸ **resolve**(`value`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `T` | + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/future.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L25) + +___ + +### wait + +▸ **wait**(): `Promise`\<`T`\> + +#### Returns + +`Promise`\<`T`\> + +#### Defined in + +[packages/sdk/base/src/future.ts:37](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L37) diff --git a/docs/sdk/base/classes/lock.Lock.md b/docs/sdk/base/classes/lock.Lock.md new file mode 100644 index 000000000..602de1d7f --- /dev/null +++ b/docs/sdk/base/classes/lock.Lock.md @@ -0,0 +1,73 @@ +[@celo/base](../README.md) / [lock](../modules/lock.md) / Lock + +# Class: Lock + +[lock](../modules/lock.md).Lock + +## Table of contents + +### Constructors + +- [constructor](lock.Lock.md#constructor) + +### Methods + +- [acquire](lock.Lock.md#acquire) +- [release](lock.Lock.md#release) +- [tryAcquire](lock.Lock.md#tryacquire) + +## Constructors + +### constructor + +• **new Lock**(): [`Lock`](lock.Lock.md) + +#### Returns + +[`Lock`](lock.Lock.md) + +#### Defined in + +[packages/sdk/base/src/lock.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/lock.ts#L14) + +## Methods + +### acquire + +▸ **acquire**(): `Promise`\<`void`\> + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/sdk/base/src/lock.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/lock.ts#L29) + +___ + +### release + +▸ **release**(): `void` + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/lock.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/lock.ts#L54) + +___ + +### tryAcquire + +▸ **tryAcquire**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/lock.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/lock.ts#L20) diff --git a/docs/sdk/base/classes/result.JSONParseError.md b/docs/sdk/base/classes/result.JSONParseError.md new file mode 100644 index 000000000..4f85a25c5 --- /dev/null +++ b/docs/sdk/base/classes/result.JSONParseError.md @@ -0,0 +1,203 @@ +[@celo/base](../README.md) / [result](../modules/result.md) / JSONParseError + +# Class: JSONParseError + +[result](../modules/result.md).JSONParseError + +## Hierarchy + +- [`RootError`](result.RootError.md)\<`string`\> + + ↳ **`JSONParseError`** + +## Table of contents + +### Constructors + +- [constructor](result.JSONParseError.md#constructor) + +### Properties + +- [error](result.JSONParseError.md#error) +- [errorType](result.JSONParseError.md#errortype) +- [message](result.JSONParseError.md#message) +- [name](result.JSONParseError.md#name) +- [stack](result.JSONParseError.md#stack) +- [prepareStackTrace](result.JSONParseError.md#preparestacktrace) +- [stackTraceLimit](result.JSONParseError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](result.JSONParseError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new JSONParseError**(`error`): [`JSONParseError`](result.JSONParseError.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `Error` | + +#### Returns + +[`JSONParseError`](result.JSONParseError.md) + +#### Overrides + +[RootError](result.RootError.md).[constructor](result.RootError.md#constructor) + +#### Defined in + +[packages/sdk/base/src/result.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L80) + +## Properties + +### error + +• `Readonly` **error**: `Error` + +#### Defined in + +[packages/sdk/base/src/result.ts:80](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L80) + +___ + +### errorType + +• `Readonly` **errorType**: `string` + +#### Inherited from + +[RootError](result.RootError.md).[errorType](result.RootError.md#errortype) + +#### Defined in + +[packages/sdk/base/src/result.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L68) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +[RootError](result.RootError.md).[message](result.RootError.md#message) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1076 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +[RootError](result.RootError.md).[name](result.RootError.md#name) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1075 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +[RootError](result.RootError.md).[stack](result.RootError.md#stack) + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1077 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +Optional override for formatting stack traces + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +[RootError](result.RootError.md).[prepareStackTrace](result.RootError.md#preparestacktrace) + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +[RootError](result.RootError.md).[stackTraceLimit](result.RootError.md#stacktracelimit) + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +[RootError](result.RootError.md).[captureStackTrace](result.RootError.md#capturestacktrace) + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/sdk/base/classes/result.RootError.md b/docs/sdk/base/classes/result.RootError.md new file mode 100644 index 000000000..3c5498971 --- /dev/null +++ b/docs/sdk/base/classes/result.RootError.md @@ -0,0 +1,210 @@ +[@celo/base](../README.md) / [result](../modules/result.md) / RootError + +# Class: RootError\ + +[result](../modules/result.md).RootError + +## Type parameters + +| Name | +| :------ | +| `T` | + +## Hierarchy + +- `Error` + + ↳ **`RootError`** + + ↳↳ [`JSONParseError`](result.JSONParseError.md) + +## Implements + +- [`BaseError`](../interfaces/result.BaseError.md)\<`T`\> + +## Table of contents + +### Constructors + +- [constructor](result.RootError.md#constructor) + +### Properties + +- [errorType](result.RootError.md#errortype) +- [message](result.RootError.md#message) +- [name](result.RootError.md#name) +- [stack](result.RootError.md#stack) +- [prepareStackTrace](result.RootError.md#preparestacktrace) +- [stackTraceLimit](result.RootError.md#stacktracelimit) + +### Methods + +- [captureStackTrace](result.RootError.md#capturestacktrace) + +## Constructors + +### constructor + +• **new RootError**\<`T`\>(`errorType`): [`RootError`](result.RootError.md)\<`T`\> + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `errorType` | `T` | + +#### Returns + +[`RootError`](result.RootError.md)\<`T`\> + +#### Overrides + +Error.constructor + +#### Defined in + +[packages/sdk/base/src/result.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L68) + +## Properties + +### errorType + +• `Readonly` **errorType**: `T` + +#### Implementation of + +[BaseError](../interfaces/result.BaseError.md).[errorType](../interfaces/result.BaseError.md#errortype) + +#### Defined in + +[packages/sdk/base/src/result.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L68) + +___ + +### message + +• **message**: `string` + +#### Inherited from + +Error.message + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1076 + +___ + +### name + +• **name**: `string` + +#### Inherited from + +Error.name + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1075 + +___ + +### stack + +• `Optional` **stack**: `string` + +#### Inherited from + +Error.stack + +#### Defined in + +node_modules/typescript/lib/lib.es5.d.ts:1077 + +___ + +### prepareStackTrace + +▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` + +Optional override for formatting stack traces + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Type declaration + +▸ (`err`, `stackTraces`): `any` + +Optional override for formatting stack traces + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `err` | `Error` | +| `stackTraces` | `CallSite`[] | + +##### Returns + +`any` + +**`See`** + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from + +Error.prepareStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: `number` + +#### Inherited from + +Error.stackTraceLimit + +#### Defined in + +node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void` + +Create .stack property on a target object + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `targetObject` | `object` | +| `constructorOpt?` | `Function` | + +#### Returns + +`void` + +#### Inherited from + +Error.captureStackTrace + +#### Defined in + +node_modules/@types/node/globals.d.ts:4 diff --git a/docs/sdk/base/enums/account.MnemonicLanguages.md b/docs/sdk/base/enums/account.MnemonicLanguages.md new file mode 100644 index 000000000..d9c14ec93 --- /dev/null +++ b/docs/sdk/base/enums/account.MnemonicLanguages.md @@ -0,0 +1,109 @@ +[@celo/base](../README.md) / [account](../modules/account.md) / MnemonicLanguages + +# Enumeration: MnemonicLanguages + +[account](../modules/account.md).MnemonicLanguages + +## Table of contents + +### Enumeration Members + +- [chinese\_simplified](account.MnemonicLanguages.md#chinese_simplified) +- [chinese\_traditional](account.MnemonicLanguages.md#chinese_traditional) +- [english](account.MnemonicLanguages.md#english) +- [french](account.MnemonicLanguages.md#french) +- [italian](account.MnemonicLanguages.md#italian) +- [japanese](account.MnemonicLanguages.md#japanese) +- [korean](account.MnemonicLanguages.md#korean) +- [portuguese](account.MnemonicLanguages.md#portuguese) +- [spanish](account.MnemonicLanguages.md#spanish) + +## Enumeration Members + +### chinese\_simplified + +• **chinese\_simplified** = ``0`` + +#### Defined in + +[packages/sdk/base/src/account.ts:9](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L9) + +___ + +### chinese\_traditional + +• **chinese\_traditional** = ``1`` + +#### Defined in + +[packages/sdk/base/src/account.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L10) + +___ + +### english + +• **english** = ``2`` + +#### Defined in + +[packages/sdk/base/src/account.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L11) + +___ + +### french + +• **french** = ``3`` + +#### Defined in + +[packages/sdk/base/src/account.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L12) + +___ + +### italian + +• **italian** = ``4`` + +#### Defined in + +[packages/sdk/base/src/account.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L13) + +___ + +### japanese + +• **japanese** = ``5`` + +#### Defined in + +[packages/sdk/base/src/account.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L14) + +___ + +### korean + +• **korean** = ``6`` + +#### Defined in + +[packages/sdk/base/src/account.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L15) + +___ + +### portuguese + +• **portuguese** = ``8`` + +#### Defined in + +[packages/sdk/base/src/account.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L17) + +___ + +### spanish + +• **spanish** = ``7`` + +#### Defined in + +[packages/sdk/base/src/account.ts:16](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L16) diff --git a/docs/sdk/base/enums/account.MnemonicStrength.md b/docs/sdk/base/enums/account.MnemonicStrength.md new file mode 100644 index 000000000..1e3276dc1 --- /dev/null +++ b/docs/sdk/base/enums/account.MnemonicStrength.md @@ -0,0 +1,32 @@ +[@celo/base](../README.md) / [account](../modules/account.md) / MnemonicStrength + +# Enumeration: MnemonicStrength + +[account](../modules/account.md).MnemonicStrength + +## Table of contents + +### Enumeration Members + +- [s128\_12words](account.MnemonicStrength.md#s128_12words) +- [s256\_24words](account.MnemonicStrength.md#s256_24words) + +## Enumeration Members + +### s128\_12words + +• **s128\_12words** = ``128`` + +#### Defined in + +[packages/sdk/base/src/account.ts:4](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L4) + +___ + +### s256\_24words + +• **s256\_24words** = ``256`` + +#### Defined in + +[packages/sdk/base/src/account.ts:5](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L5) diff --git a/docs/sdk/base/enums/currencies.CURRENCY_ENUM.md b/docs/sdk/base/enums/currencies.CURRENCY_ENUM.md new file mode 100644 index 000000000..f94a1f982 --- /dev/null +++ b/docs/sdk/base/enums/currencies.CURRENCY_ENUM.md @@ -0,0 +1,47 @@ +[@celo/base](../README.md) / [currencies](../modules/currencies.md) / CURRENCY\_ENUM + +# Enumeration: CURRENCY\_ENUM + +[currencies](../modules/currencies.md).CURRENCY_ENUM + +**`Deprecated`** + +use StableToken and Token + +## Table of contents + +### Enumeration Members + +- [DOLLAR](currencies.CURRENCY_ENUM.md#dollar) +- [EURO](currencies.CURRENCY_ENUM.md#euro) +- [GOLD](currencies.CURRENCY_ENUM.md#gold) + +## Enumeration Members + +### DOLLAR + +• **DOLLAR** = ``"Celo Dollar"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:4](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L4) + +___ + +### EURO + +• **EURO** = ``"Celo Euro"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:5](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L5) + +___ + +### GOLD + +• **GOLD** = ``"Celo Gold"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L3) diff --git a/docs/sdk/base/enums/currencies.SHORT_CURRENCIES.md b/docs/sdk/base/enums/currencies.SHORT_CURRENCIES.md new file mode 100644 index 000000000..e2420c530 --- /dev/null +++ b/docs/sdk/base/enums/currencies.SHORT_CURRENCIES.md @@ -0,0 +1,47 @@ +[@celo/base](../README.md) / [currencies](../modules/currencies.md) / SHORT\_CURRENCIES + +# Enumeration: SHORT\_CURRENCIES + +[currencies](../modules/currencies.md).SHORT_CURRENCIES + +**`Deprecated`** + +use StableToken and Token + +## Table of contents + +### Enumeration Members + +- [DOLLAR](currencies.SHORT_CURRENCIES.md#dollar) +- [EURO](currencies.SHORT_CURRENCIES.md#euro) +- [GOLD](currencies.SHORT_CURRENCIES.md#gold) + +## Enumeration Members + +### DOLLAR + +• **DOLLAR** = ``"dollar"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:62](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L62) + +___ + +### EURO + +• **EURO** = ``"euro"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L64) + +___ + +### GOLD + +• **GOLD** = ``"gold"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L63) diff --git a/docs/sdk/base/enums/currencies.StableToken.md b/docs/sdk/base/enums/currencies.StableToken.md new file mode 100644 index 000000000..5f0ad0623 --- /dev/null +++ b/docs/sdk/base/enums/currencies.StableToken.md @@ -0,0 +1,43 @@ +[@celo/base](../README.md) / [currencies](../modules/currencies.md) / StableToken + +# Enumeration: StableToken + +[currencies](../modules/currencies.md).StableToken + +## Table of contents + +### Enumeration Members + +- [cEUR](currencies.StableToken.md#ceur) +- [cREAL](currencies.StableToken.md#creal) +- [cUSD](currencies.StableToken.md#cusd) + +## Enumeration Members + +### cEUR + +• **cEUR** = ``"cEUR"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L10) + +___ + +### cREAL + +• **cREAL** = ``"cREAL"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L11) + +___ + +### cUSD + +• **cUSD** = ``"cUSD"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:9](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L9) diff --git a/docs/sdk/base/enums/currencies.Token.md b/docs/sdk/base/enums/currencies.Token.md new file mode 100644 index 000000000..7b9fe81a3 --- /dev/null +++ b/docs/sdk/base/enums/currencies.Token.md @@ -0,0 +1,21 @@ +[@celo/base](../README.md) / [currencies](../modules/currencies.md) / Token + +# Enumeration: Token + +[currencies](../modules/currencies.md).Token + +## Table of contents + +### Enumeration Members + +- [CELO](currencies.Token.md#celo) + +## Enumeration Members + +### CELO + +• **CELO** = ``"CELO"`` + +#### Defined in + +[packages/sdk/base/src/currencies.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L15) diff --git a/docs/sdk/base/enums/inputValidation.ValidatorKind.md b/docs/sdk/base/enums/inputValidation.ValidatorKind.md new file mode 100644 index 000000000..5b4affee9 --- /dev/null +++ b/docs/sdk/base/enums/inputValidation.ValidatorKind.md @@ -0,0 +1,54 @@ +[@celo/base](../README.md) / [inputValidation](../modules/inputValidation.md) / ValidatorKind + +# Enumeration: ValidatorKind + +[inputValidation](../modules/inputValidation.md).ValidatorKind + +## Table of contents + +### Enumeration Members + +- [Custom](inputValidation.ValidatorKind.md#custom) +- [Decimal](inputValidation.ValidatorKind.md#decimal) +- [Integer](inputValidation.ValidatorKind.md#integer) +- [Phone](inputValidation.ValidatorKind.md#phone) + +## Enumeration Members + +### Custom + +• **Custom** = ``"custom"`` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:2](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L2) + +___ + +### Decimal + +• **Decimal** = ``"decimal"`` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L3) + +___ + +### Integer + +• **Integer** = ``"integer"`` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:4](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L4) + +___ + +### Phone + +• **Phone** = ``"phone"`` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:5](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L5) diff --git a/docs/sdk/base/interfaces/account.Bip39.md b/docs/sdk/base/interfaces/account.Bip39.md new file mode 100644 index 000000000..43b8c908c --- /dev/null +++ b/docs/sdk/base/interfaces/account.Bip39.md @@ -0,0 +1,115 @@ +[@celo/base](../README.md) / [account](../modules/account.md) / Bip39 + +# Interface: Bip39 + +[account](../modules/account.md).Bip39 + +## Table of contents + +### Properties + +- [generateMnemonic](account.Bip39.md#generatemnemonic) +- [mnemonicToSeed](account.Bip39.md#mnemonictoseed) +- [mnemonicToSeedSync](account.Bip39.md#mnemonictoseedsync) +- [validateMnemonic](account.Bip39.md#validatemnemonic) + +## Properties + +### generateMnemonic + +• **generateMnemonic**: (`strength?`: `number`, `rng?`: [`RandomNumberGenerator`](../modules/account.md#randomnumbergenerator), `wordlist?`: `string`[]) => `Promise`\<`string`\> + +#### Type declaration + +▸ (`strength?`, `rng?`, `wordlist?`): `Promise`\<`string`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `strength?` | `number` | +| `rng?` | [`RandomNumberGenerator`](../modules/account.md#randomnumbergenerator) | +| `wordlist?` | `string`[] | + +##### Returns + +`Promise`\<`string`\> + +#### Defined in + +[packages/sdk/base/src/account.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L28) + +___ + +### mnemonicToSeed + +• **mnemonicToSeed**: (`mnemonic`: `string`, `password?`: `string`) => `Promise`\<`Uint8Array`\> + +#### Type declaration + +▸ (`mnemonic`, `password?`): `Promise`\<`Uint8Array`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `mnemonic` | `string` | +| `password?` | `string` | + +##### Returns + +`Promise`\<`Uint8Array`\> + +#### Defined in + +[packages/sdk/base/src/account.ts:27](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L27) + +___ + +### mnemonicToSeedSync + +• **mnemonicToSeedSync**: (`mnemonic`: `string`, `password?`: `string`) => `Uint8Array` + +#### Type declaration + +▸ (`mnemonic`, `password?`): `Uint8Array` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `mnemonic` | `string` | +| `password?` | `string` | + +##### Returns + +`Uint8Array` + +#### Defined in + +[packages/sdk/base/src/account.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L26) + +___ + +### validateMnemonic + +• **validateMnemonic**: (`mnemonic`: `string`, `wordlist?`: `string`[]) => `boolean` + +#### Type declaration + +▸ (`mnemonic`, `wordlist?`): `boolean` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `mnemonic` | `string` | +| `wordlist?` | `string`[] | + +##### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/account.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L33) diff --git a/docs/sdk/base/interfaces/collections.AddressListItem.md b/docs/sdk/base/interfaces/collections.AddressListItem.md new file mode 100644 index 000000000..d422e5278 --- /dev/null +++ b/docs/sdk/base/interfaces/collections.AddressListItem.md @@ -0,0 +1,38 @@ +[@celo/base](../README.md) / [collections](../modules/collections.md) / AddressListItem + +# Interface: AddressListItem\ + +[collections](../modules/collections.md).AddressListItem + +## Type parameters + +| Name | +| :------ | +| `T` | + +## Table of contents + +### Properties + +- [address](collections.AddressListItem.md#address) +- [value](collections.AddressListItem.md#value) + +## Properties + +### address + +• **address**: `string` + +#### Defined in + +[packages/sdk/base/src/collections.ts:54](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L54) + +___ + +### value + +• **value**: `T` + +#### Defined in + +[packages/sdk/base/src/collections.ts:55](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L55) diff --git a/docs/sdk/base/interfaces/contacts.ContactPhoneNumber.md b/docs/sdk/base/interfaces/contacts.ContactPhoneNumber.md new file mode 100644 index 000000000..ca2a19a58 --- /dev/null +++ b/docs/sdk/base/interfaces/contacts.ContactPhoneNumber.md @@ -0,0 +1,32 @@ +[@celo/base](../README.md) / [contacts](../modules/contacts.md) / ContactPhoneNumber + +# Interface: ContactPhoneNumber + +[contacts](../modules/contacts.md).ContactPhoneNumber + +## Table of contents + +### Properties + +- [label](contacts.ContactPhoneNumber.md#label) +- [number](contacts.ContactPhoneNumber.md#number) + +## Properties + +### label + +• `Optional` **label**: `string` + +#### Defined in + +[packages/sdk/base/src/contacts.ts:2](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L2) + +___ + +### number + +• `Optional` **number**: `string` + +#### Defined in + +[packages/sdk/base/src/contacts.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L3) diff --git a/docs/sdk/base/interfaces/contacts.MinimalContact.md b/docs/sdk/base/interfaces/contacts.MinimalContact.md new file mode 100644 index 000000000..ed39fccc1 --- /dev/null +++ b/docs/sdk/base/interfaces/contacts.MinimalContact.md @@ -0,0 +1,54 @@ +[@celo/base](../README.md) / [contacts](../modules/contacts.md) / MinimalContact + +# Interface: MinimalContact + +[contacts](../modules/contacts.md).MinimalContact + +## Table of contents + +### Properties + +- [displayName](contacts.MinimalContact.md#displayname) +- [phoneNumbers](contacts.MinimalContact.md#phonenumbers) +- [recordID](contacts.MinimalContact.md#recordid) +- [thumbnailPath](contacts.MinimalContact.md#thumbnailpath) + +## Properties + +### displayName + +• `Optional` **displayName**: `string` + +#### Defined in + +[packages/sdk/base/src/contacts.ts:8](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L8) + +___ + +### phoneNumbers + +• `Optional` **phoneNumbers**: [`ContactPhoneNumber`](contacts.ContactPhoneNumber.md)[] + +#### Defined in + +[packages/sdk/base/src/contacts.ts:9](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L9) + +___ + +### recordID + +• **recordID**: `string` + +#### Defined in + +[packages/sdk/base/src/contacts.ts:7](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L7) + +___ + +### thumbnailPath + +• `Optional` **thumbnailPath**: `string` + +#### Defined in + +[packages/sdk/base/src/contacts.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L10) diff --git a/docs/sdk/base/interfaces/inputValidation.BaseProps.md b/docs/sdk/base/interfaces/inputValidation.BaseProps.md new file mode 100644 index 000000000..981befcde --- /dev/null +++ b/docs/sdk/base/interfaces/inputValidation.BaseProps.md @@ -0,0 +1,68 @@ +[@celo/base](../README.md) / [inputValidation](../modules/inputValidation.md) / BaseProps + +# Interface: BaseProps + +[inputValidation](../modules/inputValidation.md).BaseProps + +## Table of contents + +### Properties + +- [countryCallingCode](inputValidation.BaseProps.md#countrycallingcode) +- [customValidator](inputValidation.BaseProps.md#customvalidator) +- [decimalSeparator](inputValidation.BaseProps.md#decimalseparator) +- [validator](inputValidation.BaseProps.md#validator) + +## Properties + +### countryCallingCode + +• `Optional` **countryCallingCode**: `string` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L11) + +___ + +### customValidator + +• `Optional` **customValidator**: (`input`: `string`) => `string` + +#### Type declaration + +▸ (`input`): `string` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +##### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L10) + +___ + +### decimalSeparator + +• `Optional` **decimalSeparator**: `string` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:12](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L12) + +___ + +### validator + +• `Optional` **validator**: [`ValidatorKind`](../enums/inputValidation.ValidatorKind.md) + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:9](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L9) diff --git a/docs/sdk/base/interfaces/phoneNumbers.ParsedPhoneNumber.md b/docs/sdk/base/interfaces/phoneNumbers.ParsedPhoneNumber.md new file mode 100644 index 000000000..2915a85d9 --- /dev/null +++ b/docs/sdk/base/interfaces/phoneNumbers.ParsedPhoneNumber.md @@ -0,0 +1,65 @@ +[@celo/base](../README.md) / [phoneNumbers](../modules/phoneNumbers.md) / ParsedPhoneNumber + +# Interface: ParsedPhoneNumber + +[phoneNumbers](../modules/phoneNumbers.md).ParsedPhoneNumber + +## Table of contents + +### Properties + +- [countryCode](phoneNumbers.ParsedPhoneNumber.md#countrycode) +- [displayNumber](phoneNumbers.ParsedPhoneNumber.md#displaynumber) +- [displayNumberInternational](phoneNumbers.ParsedPhoneNumber.md#displaynumberinternational) +- [e164Number](phoneNumbers.ParsedPhoneNumber.md#e164number) +- [regionCode](phoneNumbers.ParsedPhoneNumber.md#regioncode) + +## Properties + +### countryCode + +• `Optional` **countryCode**: `number` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:5](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L5) + +___ + +### displayNumber + +• **displayNumber**: `string` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L3) + +___ + +### displayNumberInternational + +• **displayNumberInternational**: `string` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:4](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L4) + +___ + +### e164Number + +• **e164Number**: `string` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:2](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L2) + +___ + +### regionCode + +• `Optional` **regionCode**: `string` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:6](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L6) diff --git a/docs/sdk/base/interfaces/result.BaseError.md b/docs/sdk/base/interfaces/result.BaseError.md new file mode 100644 index 000000000..5aacc72e1 --- /dev/null +++ b/docs/sdk/base/interfaces/result.BaseError.md @@ -0,0 +1,31 @@ +[@celo/base](../README.md) / [result](../modules/result.md) / BaseError + +# Interface: BaseError\ + +[result](../modules/result.md).BaseError + +## Type parameters + +| Name | +| :------ | +| `T` | + +## Implemented by + +- [`RootError`](../classes/result.RootError.md) + +## Table of contents + +### Properties + +- [errorType](result.BaseError.md#errortype) + +## Properties + +### errorType + +• **errorType**: `T` + +#### Defined in + +[packages/sdk/base/src/result.ts:64](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L64) diff --git a/docs/sdk/base/interfaces/result.ErrorResult.md b/docs/sdk/base/interfaces/result.ErrorResult.md new file mode 100644 index 000000000..42550de47 --- /dev/null +++ b/docs/sdk/base/interfaces/result.ErrorResult.md @@ -0,0 +1,38 @@ +[@celo/base](../README.md) / [result](../modules/result.md) / ErrorResult + +# Interface: ErrorResult\ + +[result](../modules/result.md).ErrorResult + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `TError` | extends `Error` | + +## Table of contents + +### Properties + +- [error](result.ErrorResult.md#error) +- [ok](result.ErrorResult.md#ok) + +## Properties + +### error + +• **error**: `TError` + +#### Defined in + +[packages/sdk/base/src/result.ts:8](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L8) + +___ + +### ok + +• **ok**: ``false`` + +#### Defined in + +[packages/sdk/base/src/result.ts:7](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L7) diff --git a/docs/sdk/base/interfaces/result.OkResult.md b/docs/sdk/base/interfaces/result.OkResult.md new file mode 100644 index 000000000..6a7b9fdd3 --- /dev/null +++ b/docs/sdk/base/interfaces/result.OkResult.md @@ -0,0 +1,38 @@ +[@celo/base](../README.md) / [result](../modules/result.md) / OkResult + +# Interface: OkResult\ + +[result](../modules/result.md).OkResult + +## Type parameters + +| Name | +| :------ | +| `TResult` | + +## Table of contents + +### Properties + +- [ok](result.OkResult.md#ok) +- [result](result.OkResult.md#result) + +## Properties + +### ok + +• **ok**: ``true`` + +#### Defined in + +[packages/sdk/base/src/result.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L3) + +___ + +### result + +• **result**: `TResult` + +#### Defined in + +[packages/sdk/base/src/result.ts:4](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L4) diff --git a/docs/sdk/base/interfaces/signatureUtils.Signature.md b/docs/sdk/base/interfaces/signatureUtils.Signature.md new file mode 100644 index 000000000..d6b245184 --- /dev/null +++ b/docs/sdk/base/interfaces/signatureUtils.Signature.md @@ -0,0 +1,43 @@ +[@celo/base](../README.md) / [signatureUtils](../modules/signatureUtils.md) / Signature + +# Interface: Signature + +[signatureUtils](../modules/signatureUtils.md).Signature + +## Table of contents + +### Properties + +- [r](signatureUtils.Signature.md#r) +- [s](signatureUtils.Signature.md#s) +- [v](signatureUtils.Signature.md#v) + +## Properties + +### r + +• **r**: `string` + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L22) + +___ + +### s + +• **s**: `string` + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L23) + +___ + +### v + +• **v**: `number` + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:21](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L21) diff --git a/docs/sdk/base/interfaces/signatureUtils.Signer.md b/docs/sdk/base/interfaces/signatureUtils.Signer.md new file mode 100644 index 000000000..f714d2a57 --- /dev/null +++ b/docs/sdk/base/interfaces/signatureUtils.Signer.md @@ -0,0 +1,35 @@ +[@celo/base](../README.md) / [signatureUtils](../modules/signatureUtils.md) / Signer + +# Interface: Signer + +[signatureUtils](../modules/signatureUtils.md).Signer + +## Table of contents + +### Properties + +- [sign](signatureUtils.Signer.md#sign) + +## Properties + +### sign + +• **sign**: (`message`: `string`) => `Promise`\<`string`\> + +#### Type declaration + +▸ (`message`): `Promise`\<`string`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `message` | `string` | + +##### Returns + +`Promise`\<`string`\> + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:4](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L4) diff --git a/docs/sdk/base/interfaces/task.RepeatTaskContext.md b/docs/sdk/base/interfaces/task.RepeatTaskContext.md new file mode 100644 index 000000000..fc2e4d9be --- /dev/null +++ b/docs/sdk/base/interfaces/task.RepeatTaskContext.md @@ -0,0 +1,43 @@ +[@celo/base](../README.md) / [task](../modules/task.md) / RepeatTaskContext + +# Interface: RepeatTaskContext + +[task](../modules/task.md).RepeatTaskContext + +## Table of contents + +### Properties + +- [executionNumber](task.RepeatTaskContext.md#executionnumber) + +### Methods + +- [stopTask](task.RepeatTaskContext.md#stoptask) + +## Properties + +### executionNumber + +• **executionNumber**: `number` + +Number of times the task has been executed (starts in 1) + +#### Defined in + +[packages/sdk/base/src/task.ts:41](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L41) + +## Methods + +### stopTask + +▸ **stopTask**(): `void` + +Flag task to be stopped. Might not be inmediate + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/task.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L43) diff --git a/docs/sdk/base/interfaces/task.RetryTaskOptions.md b/docs/sdk/base/interfaces/task.RetryTaskOptions.md new file mode 100644 index 000000000..d0f9f8112 --- /dev/null +++ b/docs/sdk/base/interfaces/task.RetryTaskOptions.md @@ -0,0 +1,105 @@ +[@celo/base](../README.md) / [task](../modules/task.md) / RetryTaskOptions + +# Interface: RetryTaskOptions\ + +[task](../modules/task.md).RetryTaskOptions + +## Type parameters + +| Name | +| :------ | +| `A` | + +## Hierarchy + +- [`TaskOptions`](task.TaskOptions.md) + + ↳ **`RetryTaskOptions`** + +## Table of contents + +### Properties + +- [logger](task.RetryTaskOptions.md#logger) +- [maxAttemps](task.RetryTaskOptions.md#maxattemps) +- [name](task.RetryTaskOptions.md#name) +- [timeInBetweenMS](task.RetryTaskOptions.md#timeinbetweenms) +- [tryGetValue](task.RetryTaskOptions.md#trygetvalue) + +## Properties + +### logger + +• `Optional` **logger**: [`Logger`](../modules/logger.md#logger) + +Logger function + +#### Inherited from + +[TaskOptions](task.TaskOptions.md).[logger](task.TaskOptions.md#logger) + +#### Defined in + +[packages/sdk/base/src/task.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L20) + +___ + +### maxAttemps + +• **maxAttemps**: `number` + +Maximum number of attemps + +#### Defined in + +[packages/sdk/base/src/task.ts:116](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L116) + +___ + +### name + +• **name**: `string` + +Name for the task. To be used in logging messages + +#### Inherited from + +[TaskOptions](task.TaskOptions.md).[name](task.TaskOptions.md#name) + +#### Defined in + +[packages/sdk/base/src/task.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L18) + +___ + +### timeInBetweenMS + +• **timeInBetweenMS**: `number` + +seconds between repetition + +#### Defined in + +[packages/sdk/base/src/task.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L114) + +___ + +### tryGetValue + +• **tryGetValue**: () => `Promise`\<``null`` \| `A`\> + +Function that tries to obtain a value A or returns null + +#### Type declaration + +▸ (): `Promise`\<``null`` \| `A`\> + +Function that tries to obtain a value A or returns null + +##### Returns + +`Promise`\<``null`` \| `A`\> + +#### Defined in + +[packages/sdk/base/src/task.ts:118](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L118) diff --git a/docs/sdk/base/interfaces/task.RunningTask.md b/docs/sdk/base/interfaces/task.RunningTask.md new file mode 100644 index 000000000..668db8f96 --- /dev/null +++ b/docs/sdk/base/interfaces/task.RunningTask.md @@ -0,0 +1,54 @@ +[@celo/base](../README.md) / [task](../modules/task.md) / RunningTask + +# Interface: RunningTask + +[task](../modules/task.md).RunningTask + +Represent a running task that can be stopped + +Examples: A poller, a watcher. + +## Hierarchy + +- **`RunningTask`** + + ↳ [`RunningTaskWithValue`](task.RunningTaskWithValue.md) + +## Table of contents + +### Methods + +- [isRunning](task.RunningTask.md#isrunning) +- [stop](task.RunningTask.md#stop) + +## Methods + +### isRunning + +▸ **isRunning**(): `boolean` + +Indicates wether the task is running + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/task.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L13) + +___ + +### stop + +▸ **stop**(): `void` + +Flag task to be stopped. Might not be inmediate + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/task.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L11) diff --git a/docs/sdk/base/interfaces/task.RunningTaskWithValue.md b/docs/sdk/base/interfaces/task.RunningTaskWithValue.md new file mode 100644 index 000000000..3e9afb874 --- /dev/null +++ b/docs/sdk/base/interfaces/task.RunningTaskWithValue.md @@ -0,0 +1,83 @@ +[@celo/base](../README.md) / [task](../modules/task.md) / RunningTaskWithValue + +# Interface: RunningTaskWithValue\ + +[task](../modules/task.md).RunningTaskWithValue + +Represent a running task that can be stopped + +Examples: A poller, a watcher. + +## Type parameters + +| Name | +| :------ | +| `A` | + +## Hierarchy + +- [`RunningTask`](task.RunningTask.md) + + ↳ **`RunningTaskWithValue`** + +## Table of contents + +### Methods + +- [isRunning](task.RunningTaskWithValue.md#isrunning) +- [onValue](task.RunningTaskWithValue.md#onvalue) +- [stop](task.RunningTaskWithValue.md#stop) + +## Methods + +### isRunning + +▸ **isRunning**(): `boolean` + +Indicates wether the task is running + +#### Returns + +`boolean` + +#### Inherited from + +[RunningTask](task.RunningTask.md).[isRunning](task.RunningTask.md#isrunning) + +#### Defined in + +[packages/sdk/base/src/task.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L13) + +___ + +### onValue + +▸ **onValue**(): `Promise`\<`A`\> + +#### Returns + +`Promise`\<`A`\> + +#### Defined in + +[packages/sdk/base/src/task.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L109) + +___ + +### stop + +▸ **stop**(): `void` + +Flag task to be stopped. Might not be inmediate + +#### Returns + +`void` + +#### Inherited from + +[RunningTask](task.RunningTask.md).[stop](task.RunningTask.md#stop) + +#### Defined in + +[packages/sdk/base/src/task.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L11) diff --git a/docs/sdk/base/interfaces/task.TaskOptions.md b/docs/sdk/base/interfaces/task.TaskOptions.md new file mode 100644 index 000000000..a4e6cab3a --- /dev/null +++ b/docs/sdk/base/interfaces/task.TaskOptions.md @@ -0,0 +1,42 @@ +[@celo/base](../README.md) / [task](../modules/task.md) / TaskOptions + +# Interface: TaskOptions + +[task](../modules/task.md).TaskOptions + +## Hierarchy + +- **`TaskOptions`** + + ↳ [`RetryTaskOptions`](task.RetryTaskOptions.md) + +## Table of contents + +### Properties + +- [logger](task.TaskOptions.md#logger) +- [name](task.TaskOptions.md#name) + +## Properties + +### logger + +• `Optional` **logger**: [`Logger`](../modules/logger.md#logger) + +Logger function + +#### Defined in + +[packages/sdk/base/src/task.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L20) + +___ + +### name + +• **name**: `string` + +Name for the task. To be used in logging messages + +#### Defined in + +[packages/sdk/base/src/task.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L18) diff --git a/docs/sdk/base/modules/account.md b/docs/sdk/base/modules/account.md new file mode 100644 index 000000000..5c002afa0 --- /dev/null +++ b/docs/sdk/base/modules/account.md @@ -0,0 +1,57 @@ +[@celo/base](../README.md) / account + +# Module: account + +## Table of contents + +### Enumerations + +- [MnemonicLanguages](../enums/account.MnemonicLanguages.md) +- [MnemonicStrength](../enums/account.MnemonicStrength.md) + +### Interfaces + +- [Bip39](../interfaces/account.Bip39.md) + +### Type Aliases + +- [RandomNumberGenerator](account.md#randomnumbergenerator) + +### Variables + +- [CELO\_DERIVATION\_PATH\_BASE](account.md#celo_derivation_path_base) + +## Type Aliases + +### RandomNumberGenerator + +Ƭ **RandomNumberGenerator**: (`size`: `number`, `callback`: (`err`: `Error` \| ``null``, `buf`: `Buffer`) => `void`) => `void` + +#### Type declaration + +▸ (`size`, `callback`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `size` | `number` | +| `callback` | (`err`: `Error` \| ``null``, `buf`: `Buffer`) => `void` | + +##### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/account.ts:20](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L20) + +## Variables + +### CELO\_DERIVATION\_PATH\_BASE + +• `Const` **CELO\_DERIVATION\_PATH\_BASE**: ``"m/44'/52752'/0'"`` + +#### Defined in + +[packages/sdk/base/src/account.ts:1](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/account.ts#L1) diff --git a/docs/sdk/base/modules/address.md b/docs/sdk/base/modules/address.md new file mode 100644 index 000000000..7f2ae4adc --- /dev/null +++ b/docs/sdk/base/modules/address.md @@ -0,0 +1,332 @@ +[@celo/base](../README.md) / address + +# Module: address + +## Table of contents + +### Type Aliases + +- [Address](address.md#address) +- [StrongAddress](address.md#strongaddress) + +### Variables + +- [NULL\_ADDRESS](address.md#null_address) + +### Functions + +- [bufferToHex](address.md#buffertohex) +- [ensureLeading0x](address.md#ensureleading0x) +- [eqAddress](address.md#eqaddress) +- [findAddressIndex](address.md#findaddressindex) +- [getAddressChunks](address.md#getaddresschunks) +- [hexToBuffer](address.md#hextobuffer) +- [isHexString](address.md#ishexstring) +- [isNullAddress](address.md#isnulladdress) +- [mapAddressListDataOnto](address.md#mapaddresslistdataonto) +- [mapAddressListOnto](address.md#mapaddresslistonto) +- [normalizeAddress](address.md#normalizeaddress) +- [normalizeAddressWith0x](address.md#normalizeaddresswith0x) +- [trimLeading0x](address.md#trimleading0x) + +## Type Aliases + +### Address + +Ƭ **Address**: `string` + +#### Defined in + +[packages/sdk/base/src/address.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L3) + +___ + +### StrongAddress + +Ƭ **StrongAddress**: \`0x$\{string}\` + +#### Defined in + +[packages/sdk/base/src/address.ts:5](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L5) + +## Variables + +### NULL\_ADDRESS + +• `Const` **NULL\_ADDRESS**: ``"0x0000000000000000000000000000000000000000"`` + +#### Defined in + +[packages/sdk/base/src/address.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L32) + +## Functions + +### bufferToHex + +▸ **bufferToHex**(`buf`): \`0x$\{string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `buf` | `Buffer` | + +#### Returns + +\`0x$\{string}\` + +#### Defined in + +[packages/sdk/base/src/address.ts:30](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L30) + +___ + +### ensureLeading0x + +▸ **ensureLeading0x**(`input`): \`0x$\{string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +#### Returns + +\`0x$\{string}\` + +#### Defined in + +[packages/sdk/base/src/address.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L18) + +___ + +### eqAddress + +▸ **eqAddress**(`a`, `b`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `a` | `string` | +| `b` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/address.ts:7](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L7) + +___ + +### findAddressIndex + +▸ **findAddressIndex**(`address`, `addresses`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `string` | +| `addresses` | `string`[] | + +#### Returns + +`number` + +#### Defined in + +[packages/sdk/base/src/address.ts:34](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L34) + +___ + +### getAddressChunks + +▸ **getAddressChunks**(`input`): `string`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +#### Returns + +`string`[] + +#### Defined in + +[packages/sdk/base/src/address.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L23) + +___ + +### hexToBuffer + +▸ **hexToBuffer**(`input`): `Buffer` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +#### Returns + +`Buffer` + +#### Defined in + +[packages/sdk/base/src/address.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L28) + +___ + +### isHexString + +▸ **isHexString**(`input`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/address.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L26) + +___ + +### isNullAddress + +▸ **isNullAddress**(`a`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `a` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/address.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L11) + +___ + +### mapAddressListDataOnto + +▸ **mapAddressListDataOnto**\<`T`\>(`data`, `oldAddress`, `newAddress`, `initialValue`): `T`[] + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `T`[] | +| `oldAddress` | `string`[] | +| `newAddress` | `string`[] | +| `initialValue` | `T` | + +#### Returns + +`T`[] + +#### Defined in + +[packages/sdk/base/src/address.ts:71](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L71) + +___ + +### mapAddressListOnto + +▸ **mapAddressListOnto**(`oldAddress`, `newAddress`): `any`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `oldAddress` | `string`[] | +| `newAddress` | `string`[] | + +#### Returns + +`any`[] + +#### Defined in + +[packages/sdk/base/src/address.ts:38](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L38) + +___ + +### normalizeAddress + +▸ **normalizeAddress**(`a`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `a` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/address.ts:9](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L9) + +___ + +### normalizeAddressWith0x + +▸ **normalizeAddressWith0x**(`a`): \`0x$\{string}\` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `a` | `string` | + +#### Returns + +\`0x$\{string}\` + +#### Defined in + +[packages/sdk/base/src/address.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/address.ts#L13) + +___ + +### trimLeading0x + +▸ **trimLeading0x**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[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/docs/sdk/base/modules/async.md b/docs/sdk/base/modules/async.md new file mode 100644 index 000000000..395daabf2 --- /dev/null +++ b/docs/sdk/base/modules/async.md @@ -0,0 +1,263 @@ +[@celo/base](../README.md) / async + +# Module: async + +## Table of contents + +### Functions + +- [concurrentMap](async.md#concurrentmap) +- [concurrentValuesMap](async.md#concurrentvaluesmap) +- [retryAsync](async.md#retryasync) +- [retryAsyncWithBackOff](async.md#retryasyncwithbackoff) +- [retryAsyncWithBackOffAndTimeout](async.md#retryasyncwithbackoffandtimeout) +- [selectiveRetryAsyncWithBackOff](async.md#selectiveretryasyncwithbackoff) +- [sleep](async.md#sleep) +- [timeout](async.md#timeout) + +## Functions + +### concurrentMap + +▸ **concurrentMap**\<`A`, `B`\>(`concurrency`, `xs`, `mapFn`): `Promise`\<`B`[]\> + +Map an async function over a list xs with a given concurrency level + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `concurrency` | `number` | number of `mapFn` concurrent executions | +| `xs` | `A`[] | list of value | +| `mapFn` | (`val`: `A`, `idx`: `number`) => `Promise`\<`B`\> | mapping function | + +#### Returns + +`Promise`\<`B`[]\> + +#### Defined in + +[packages/sdk/base/src/async.ts:128](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L128) + +___ + +### concurrentValuesMap + +▸ **concurrentValuesMap**\<`IN`, `OUT`\>(`concurrency`, `x`, `mapFn`): `Promise`\<`Record`\<`string`, `OUT`\>\> + +Map an async function over the values in Object x with a given concurrency level + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `IN` | extends `unknown` | +| `OUT` | extends `unknown` | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `concurrency` | `number` | number of `mapFn` concurrent executions | +| `x` | `Record`\<`string`, `IN`\> | associative array of values | +| `mapFn` | (`val`: `IN`, `key`: `string`) => `Promise`\<`OUT`\> | mapping function | + +#### Returns + +`Promise`\<`Record`\<`string`, `OUT`\>\> + +#### Defined in + +[packages/sdk/base/src/async.ts:150](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L150) + +___ + +### retryAsync + +▸ **retryAsync**\<`T`, `U`\>(`inFunction`, `tries`, `params`, `delay?`, `logger?`): `Promise`\<`U`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `any`[] | +| `U` | `U` | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `inFunction` | `InFunction`\<`T`, `U`\> | `undefined` | +| `tries` | `number` | `undefined` | +| `params` | `T` | `undefined` | +| `delay` | `number` | `100` | +| `logger` | ``null`` \| [`Logger`](logger.md#logger) | `null` | + +#### Returns + +`Promise`\<`U`\> + +#### Defined in + +[packages/sdk/base/src/async.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L14) + +___ + +### retryAsyncWithBackOff + +▸ **retryAsyncWithBackOff**\<`T`, `U`\>(`inFunction`, `tries`, `params`, `delay?`, `factor?`, `logger?`): `Promise`\<`U`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `any`[] | +| `U` | `U` | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `inFunction` | `InFunction`\<`T`, `U`\> | `undefined` | +| `tries` | `number` | `undefined` | +| `params` | `T` | `undefined` | +| `delay` | `number` | `100` | +| `factor` | `number` | `1.5` | +| `logger` | ``null`` \| [`Logger`](logger.md#logger) | `null` | + +#### Returns + +`Promise`\<`U`\> + +#### Defined in + +[packages/sdk/base/src/async.ts:40](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L40) + +___ + +### retryAsyncWithBackOffAndTimeout + +▸ **retryAsyncWithBackOffAndTimeout**\<`T`, `U`\>(`inFunction`, `tries`, `params`, `delayMs?`, `factor?`, `timeoutMs?`, `logger?`): `Promise`\<`U`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `any`[] | +| `U` | `U` | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `inFunction` | `InFunction`\<`T`, `U`\> | `undefined` | +| `tries` | `number` | `undefined` | +| `params` | `T` | `undefined` | +| `delayMs` | `number` | `100` | +| `factor` | `number` | `1.5` | +| `timeoutMs` | `number` | `2000` | +| `logger` | ``null`` \| [`Logger`](logger.md#logger) | `null` | + +#### Returns + +`Promise`\<`U`\> + +#### Defined in + +[packages/sdk/base/src/async.ts:102](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L102) + +___ + +### selectiveRetryAsyncWithBackOff + +▸ **selectiveRetryAsyncWithBackOff**\<`T`, `U`\>(`inFunction`, `tries`, `dontRetry`, `params`, `delay?`, `factor?`, `logger?`): `Promise`\<`U`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `any`[] | +| `U` | `U` | + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `inFunction` | `InFunction`\<`T`, `U`\> | `undefined` | +| `tries` | `number` | `undefined` | +| `dontRetry` | `string`[] | `undefined` | +| `params` | `T` | `undefined` | +| `delay` | `number` | `100` | +| `factor` | `number` | `1.5` | +| `logger` | ``null`` \| [`Logger`](logger.md#logger) | `null` | + +#### Returns + +`Promise`\<`U`\> + +#### Defined in + +[packages/sdk/base/src/async.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L68) + +___ + +### sleep + +▸ **sleep**(`ms`): `Promise`\<`void`\> + +Sleep for a number of milliseconds + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ms` | `number` | + +#### Returns + +`Promise`\<`void`\> + +#### Defined in + +[packages/sdk/base/src/async.ts:6](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L6) + +___ + +### timeout + +▸ **timeout**\<`T`, `U`\>(`inFunction`, `params`, `timeoutMs`, `timeoutError`, `timeoutLogMsg?`, `logger?`): `Promise`\<`Awaited`\<`U`\>\> + +Wraps an async function in a timeout before calling it. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends `any`[] | +| `U` | `U` | + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `inFunction` | `InFunction`\<`T`, `U`\> | `undefined` | The async function to call | +| `params` | `T` | `undefined` | The parameters of the async function | +| `timeoutMs` | `number` | `undefined` | The timeout in milliseconds | +| `timeoutError` | `any` | `undefined` | The value to which the returned Promise should reject to | +| `timeoutLogMsg` | ``null`` \| `string` | `null` | - | +| `logger` | ``null`` \| [`Logger`](logger.md#logger) | `null` | - | + +#### Returns + +`Promise`\<`Awaited`\<`U`\>\> + +#### Defined in + +[packages/sdk/base/src/async.ts:173](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/async.ts#L173) diff --git a/docs/sdk/base/modules/collections.md b/docs/sdk/base/modules/collections.md new file mode 100644 index 000000000..8c86296a4 --- /dev/null +++ b/docs/sdk/base/modules/collections.md @@ -0,0 +1,254 @@ +[@celo/base](../README.md) / collections + +# Module: collections + +## Table of contents + +### Interfaces + +- [AddressListItem](../interfaces/collections.AddressListItem.md) + +### Type Aliases + +- [Comparator](collections.md#comparator) + +### Functions + +- [intersection](collections.md#intersection) +- [linkedListChange](collections.md#linkedlistchange) +- [linkedListChanges](collections.md#linkedlistchanges) +- [notEmpty](collections.md#notempty) +- [zeroRange](collections.md#zerorange) +- [zip](collections.md#zip) +- [zip3](collections.md#zip3) + +## Type Aliases + +### Comparator + +Ƭ **Comparator**\<`T`\>: (`a`: `T`, `b`: `T`) => `boolean` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Type declaration + +▸ (`a`, `b`): `boolean` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `a` | `T` | +| `b` | `T` | + +##### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/collections.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L50) + +## Functions + +### intersection + +▸ **intersection**\<`T`\>(`arrays`): `T`[] + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `arrays` | `T`[][] | + +#### Returns + +`T`[] + +#### Defined in + +[packages/sdk/base/src/collections.ts:32](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L32) + +___ + +### linkedListChange + +▸ **linkedListChange**\<`T`\>(`sortedList`, `change`, `comparator`): `Object` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sortedList` | [`AddressListItem`](../interfaces/collections.AddressListItem.md)\<`T`\>[] | +| `change` | [`AddressListItem`](../interfaces/collections.AddressListItem.md)\<`T`\> | +| `comparator` | [`Comparator`](collections.md#comparator)\<`T`\> | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `greater` | `string` | +| `lesser` | `string` | +| `list` | [`AddressListItem`](../interfaces/collections.AddressListItem.md)\<`T`\>[] | + +#### Defined in + +[packages/sdk/base/src/collections.ts:90](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L90) + +___ + +### linkedListChanges + +▸ **linkedListChanges**\<`T`\>(`sortedList`, `changeList`, `comparator`): `Object` + +#### Type parameters + +| Name | +| :------ | +| `T` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sortedList` | [`AddressListItem`](../interfaces/collections.AddressListItem.md)\<`T`\>[] | +| `changeList` | [`AddressListItem`](../interfaces/collections.AddressListItem.md)\<`T`\>[] | +| `comparator` | [`Comparator`](collections.md#comparator)\<`T`\> | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `greaters` | `string`[] | +| `lessers` | `string`[] | +| `list` | [`AddressListItem`](../interfaces/collections.AddressListItem.md)\<`T`\>[] | + +#### Defined in + +[packages/sdk/base/src/collections.ts:100](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L100) + +___ + +### notEmpty + +▸ **notEmpty**\<`TValue`\>(`value`): value is TValue + +#### Type parameters + +| Name | +| :------ | +| `TValue` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value` | `undefined` \| ``null`` \| `TValue` | + +#### Returns + +value is TValue + +#### Defined in + +[packages/sdk/base/src/collections.ts:28](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L28) + +___ + +### zeroRange + +▸ **zeroRange**(`to`): `number`[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `to` | `number` | + +#### Returns + +`number`[] + +#### Defined in + +[packages/sdk/base/src/collections.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L23) + +___ + +### zip + +▸ **zip**\<`A`, `B`, `C`\>(`fn`, `as`, `bs`): `C`[] + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | +| `C` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `fn` | (`a`: `A`, `b`: `B`) => `C` | +| `as` | `A`[] | +| `bs` | `B`[] | + +#### Returns + +`C`[] + +#### Defined in + +[packages/sdk/base/src/collections.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L3) + +___ + +### zip3 + +▸ **zip3**\<`A`, `B`, `C`\>(`as`, `bs`, `cs`): [`A`, `B`, `C`][] + +#### Type parameters + +| Name | +| :------ | +| `A` | +| `B` | +| `C` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `as` | `A`[] | +| `bs` | `B`[] | +| `cs` | `C`[] | + +#### Returns + +[`A`, `B`, `C`][] + +#### Defined in + +[packages/sdk/base/src/collections.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/collections.ts#L13) diff --git a/docs/sdk/base/modules/contacts.md b/docs/sdk/base/modules/contacts.md new file mode 100644 index 000000000..f1b1a27ee --- /dev/null +++ b/docs/sdk/base/modules/contacts.md @@ -0,0 +1,55 @@ +[@celo/base](../README.md) / contacts + +# Module: contacts + +## Table of contents + +### Interfaces + +- [ContactPhoneNumber](../interfaces/contacts.ContactPhoneNumber.md) +- [MinimalContact](../interfaces/contacts.MinimalContact.md) + +### Functions + +- [getContactPhoneNumber](contacts.md#getcontactphonenumber) +- [isContact](contacts.md#iscontact) + +## Functions + +### getContactPhoneNumber + +▸ **getContactPhoneNumber**(`contact`): `undefined` \| ``null`` \| `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `contact` | [`MinimalContact`](../interfaces/contacts.MinimalContact.md) | + +#### Returns + +`undefined` \| ``null`` \| `string` + +#### Defined in + +[packages/sdk/base/src/contacts.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L13) + +___ + +### isContact + +▸ **isContact**(`contactOrNumber`): contactOrNumber is MinimalContact + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `contactOrNumber` | `any` | + +#### Returns + +contactOrNumber is MinimalContact + +#### Defined in + +[packages/sdk/base/src/contacts.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/contacts.ts#L26) diff --git a/docs/sdk/base/modules/currencies.md b/docs/sdk/base/modules/currencies.md new file mode 100644 index 000000000..cd1492d68 --- /dev/null +++ b/docs/sdk/base/modules/currencies.md @@ -0,0 +1,89 @@ +[@celo/base](../README.md) / currencies + +# Module: currencies + +## Table of contents + +### Enumerations + +- [CURRENCY\_ENUM](../enums/currencies.CURRENCY_ENUM.md) +- [SHORT\_CURRENCIES](../enums/currencies.SHORT_CURRENCIES.md) +- [StableToken](../enums/currencies.StableToken.md) +- [Token](../enums/currencies.Token.md) + +### Type Aliases + +- [CeloTokenType](currencies.md#celotokentype) + +### Variables + +- [CURRENCIES](currencies.md#currencies) +- [currencyToShortMap](currencies.md#currencytoshortmap) + +### Functions + +- [resolveCurrency](currencies.md#resolvecurrency) + +## Type Aliases + +### CeloTokenType + +Ƭ **CeloTokenType**: [`StableToken`](../enums/currencies.StableToken.md) \| [`Token`](../enums/currencies.Token.md) + +#### Defined in + +[packages/sdk/base/src/currencies.ts:18](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L18) + +## Variables + +### CURRENCIES + +• `Const` **CURRENCIES**: `CurrencyObject` + +**`Deprecated`** + +#### Defined in + +[packages/sdk/base/src/currencies.ts:29](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L29) + +___ + +### currencyToShortMap + +• `Const` **currencyToShortMap**: `Object` + +**`Deprecated`** + +use StableToken and Token + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `Celo Dollar` | [`SHORT_CURRENCIES`](../enums/currencies.SHORT_CURRENCIES.md) | +| `Celo Euro` | [`SHORT_CURRENCIES`](../enums/currencies.SHORT_CURRENCIES.md) | +| `Celo Gold` | [`SHORT_CURRENCIES`](../enums/currencies.SHORT_CURRENCIES.md) | + +#### Defined in + +[packages/sdk/base/src/currencies.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L68) + +## Functions + +### resolveCurrency + +▸ **resolveCurrency**(`label`): [`CURRENCY_ENUM`](../enums/currencies.CURRENCY_ENUM.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `label` | `string` | + +#### Returns + +[`CURRENCY_ENUM`](../enums/currencies.CURRENCY_ENUM.md) + +#### Defined in + +[packages/sdk/base/src/currencies.ts:47](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/currencies.ts#L47) diff --git a/docs/sdk/base/modules/displayFormatting.md b/docs/sdk/base/modules/displayFormatting.md new file mode 100644 index 000000000..a93b52739 --- /dev/null +++ b/docs/sdk/base/modules/displayFormatting.md @@ -0,0 +1,29 @@ +[@celo/base](../README.md) / displayFormatting + +# Module: displayFormatting + +## Table of contents + +### Functions + +- [getErrorMessage](displayFormatting.md#geterrormessage) + +## Functions + +### getErrorMessage + +▸ **getErrorMessage**(`error`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `Error` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/displayFormatting.ts:2](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/displayFormatting.ts#L2) diff --git a/docs/sdk/base/modules/future.md b/docs/sdk/base/modules/future.md new file mode 100644 index 000000000..71fbaa290 --- /dev/null +++ b/docs/sdk/base/modules/future.md @@ -0,0 +1,67 @@ +[@celo/base](../README.md) / future + +# Module: future + +## Table of contents + +### Classes + +- [Future](../classes/future.Future.md) + +### Functions + +- [pipeToFuture](future.md#pipetofuture) +- [toFuture](future.md#tofuture) + +## Functions + +### pipeToFuture + +▸ **pipeToFuture**\<`A`\>(`p`, `future`): [`Future`](../classes/future.Future.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `p` | `Promise`\<`A`\> | +| `future` | [`Future`](../classes/future.Future.md)\<`A`\> | + +#### Returns + +[`Future`](../classes/future.Future.md)\<`A`\> + +#### Defined in + +[packages/sdk/base/src/future.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L51) + +___ + +### toFuture + +▸ **toFuture**\<`A`\>(`p`): [`Future`](../classes/future.Future.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `p` | `Promise`\<`A`\> | + +#### Returns + +[`Future`](../classes/future.Future.md)\<`A`\> + +#### Defined in + +[packages/sdk/base/src/future.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/future.ts#L46) diff --git a/docs/sdk/base/modules/index.md b/docs/sdk/base/modules/index.md new file mode 100644 index 000000000..07cba7790 --- /dev/null +++ b/docs/sdk/base/modules/index.md @@ -0,0 +1,722 @@ +[@celo/base](../README.md) / index + +# Module: index + +## Table of contents + +### References + +- [Address](index.md#address) +- [AddressListItem](index.md#addresslistitem) +- [BaseError](index.md#baseerror) +- [BaseProps](index.md#baseprops) +- [Bip39](index.md#bip39) +- [CELO\_DERIVATION\_PATH\_BASE](index.md#celo_derivation_path_base) +- [CURRENCIES](index.md#currencies) +- [CURRENCY\_ENUM](index.md#currency_enum) +- [CeloTokenType](index.md#celotokentype) +- [Comparator](index.md#comparator) +- [ContactPhoneNumber](index.md#contactphonenumber) +- [Err](index.md#err) +- [ErrorResult](index.md#errorresult) +- [Future](index.md#future) +- [JSONParseError](index.md#jsonparseerror) +- [JSONParseErrorType](index.md#jsonparseerrortype) +- [Logger](index.md#logger) +- [MinimalContact](index.md#minimalcontact) +- [MnemonicLanguages](index.md#mnemoniclanguages) +- [MnemonicStrength](index.md#mnemonicstrength) +- [NULL\_ADDRESS](index.md#null_address) +- [NativeSigner](index.md#nativesigner) +- [Ok](index.md#ok) +- [OkResult](index.md#okresult) +- [POP\_SIZE](index.md#pop_size) +- [ParsedPhoneNumber](index.md#parsedphonenumber) +- [PhoneNumberBase](index.md#phonenumberbase) +- [RandomNumberGenerator](index.md#randomnumbergenerator) +- [RepeatTaskContext](index.md#repeattaskcontext) +- [Result](index.md#result) +- [RetryTaskOptions](index.md#retrytaskoptions) +- [RootError](index.md#rooterror) +- [RunningTask](index.md#runningtask) +- [RunningTaskWithValue](index.md#runningtaskwithvalue) +- [SHORT\_CURRENCIES](index.md#short_currencies) +- [Signature](index.md#signature) +- [SignatureBase](index.md#signaturebase) +- [Signer](index.md#signer) +- [StableToken](index.md#stabletoken) +- [StringBase](index.md#stringbase) +- [StrongAddress](index.md#strongaddress) +- [TaskOptions](index.md#taskoptions) +- [Token](index.md#token) +- [URL\_REGEX](index.md#url_regex) +- [ValidatorKind](index.md#validatorkind) +- [anonymizedPhone](index.md#anonymizedphone) +- [appendPath](index.md#appendpath) +- [bufferToHex](index.md#buffertohex) +- [concurrentMap](index.md#concurrentmap) +- [concurrentValuesMap](index.md#concurrentvaluesmap) +- [conditionWatcher](index.md#conditionwatcher) +- [consoleLogger](index.md#consolelogger) +- [currencyToShortMap](index.md#currencytoshortmap) +- [ensureLeading0x](index.md#ensureleading0x) +- [eqAddress](index.md#eqaddress) +- [findAddressIndex](index.md#findaddressindex) +- [getAddressChunks](index.md#getaddresschunks) +- [getContactPhoneNumber](index.md#getcontactphonenumber) +- [getErrorMessage](index.md#geterrormessage) +- [hexToBuffer](index.md#hextobuffer) +- [intersection](index.md#intersection) +- [isContact](index.md#iscontact) +- [isE164Number](index.md#ise164number) +- [isErr](index.md#iserr) +- [isHexString](index.md#ishexstring) +- [isNullAddress](index.md#isnulladdress) +- [isOk](index.md#isok) +- [isValidUrl](index.md#isvalidurl) +- [linkedListChange](index.md#linkedlistchange) +- [linkedListChanges](index.md#linkedlistchanges) +- [makeAsyncThrowable](index.md#makeasyncthrowable) +- [makeThrowable](index.md#makethrowable) +- [mapAddressListDataOnto](index.md#mapaddresslistdataonto) +- [mapAddressListOnto](index.md#mapaddresslistonto) +- [noopLogger](index.md#nooplogger) +- [normalizeAccents](index.md#normalizeaccents) +- [normalizeAddress](index.md#normalizeaddress) +- [normalizeAddressWith0x](index.md#normalizeaddresswith0x) +- [notEmpty](index.md#notempty) +- [parseJsonAsResult](index.md#parsejsonasresult) +- [parseSolidityStringArray](index.md#parsesoliditystringarray) +- [pipeToFuture](index.md#pipetofuture) +- [prefixLogger](index.md#prefixlogger) +- [repeatTask](index.md#repeattask) +- [resolveCurrency](index.md#resolvecurrency) +- [retryAsync](index.md#retryasync) +- [retryAsyncWithBackOff](index.md#retryasyncwithbackoff) +- [retryAsyncWithBackOffAndTimeout](index.md#retryasyncwithbackoffandtimeout) +- [selectiveRetryAsyncWithBackOff](index.md#selectiveretryasyncwithbackoff) +- [serializeSignature](index.md#serializesignature) +- [sleep](index.md#sleep) +- [stringToBoolean](index.md#stringtoboolean) +- [throwIfError](index.md#throwiferror) +- [timeout](index.md#timeout) +- [toFuture](index.md#tofuture) +- [trimLeading0x](index.md#trimleading0x) +- [tryObtainValueWithRetries](index.md#tryobtainvaluewithretries) +- [validateDecimal](index.md#validatedecimal) +- [validateInteger](index.md#validateinteger) +- [zeroRange](index.md#zerorange) +- [zip](index.md#zip) +- [zip3](index.md#zip3) + +## References + +### Address + +Re-exports [Address](address.md#address) + +___ + +### AddressListItem + +Re-exports [AddressListItem](../interfaces/collections.AddressListItem.md) + +___ + +### BaseError + +Re-exports [BaseError](../interfaces/result.BaseError.md) + +___ + +### BaseProps + +Re-exports [BaseProps](../interfaces/inputValidation.BaseProps.md) + +___ + +### Bip39 + +Re-exports [Bip39](../interfaces/account.Bip39.md) + +___ + +### CELO\_DERIVATION\_PATH\_BASE + +Re-exports [CELO_DERIVATION_PATH_BASE](account.md#celo_derivation_path_base) + +___ + +### CURRENCIES + +Re-exports [CURRENCIES](currencies.md#currencies) + +___ + +### CURRENCY\_ENUM + +Re-exports [CURRENCY_ENUM](../enums/currencies.CURRENCY_ENUM.md) + +___ + +### CeloTokenType + +Re-exports [CeloTokenType](currencies.md#celotokentype) + +___ + +### Comparator + +Re-exports [Comparator](collections.md#comparator) + +___ + +### ContactPhoneNumber + +Re-exports [ContactPhoneNumber](../interfaces/contacts.ContactPhoneNumber.md) + +___ + +### Err + +Re-exports [Err](result.md#err) + +___ + +### ErrorResult + +Re-exports [ErrorResult](../interfaces/result.ErrorResult.md) + +___ + +### Future + +Re-exports [Future](../classes/future.Future.md) + +___ + +### JSONParseError + +Re-exports [JSONParseError](../classes/result.JSONParseError.md) + +___ + +### JSONParseErrorType + +Re-exports [JSONParseErrorType](result.md#jsonparseerrortype) + +___ + +### Logger + +Re-exports [Logger](logger.md#logger) + +___ + +### MinimalContact + +Re-exports [MinimalContact](../interfaces/contacts.MinimalContact.md) + +___ + +### MnemonicLanguages + +Re-exports [MnemonicLanguages](../enums/account.MnemonicLanguages.md) + +___ + +### MnemonicStrength + +Re-exports [MnemonicStrength](../enums/account.MnemonicStrength.md) + +___ + +### NULL\_ADDRESS + +Re-exports [NULL_ADDRESS](address.md#null_address) + +___ + +### NativeSigner + +Re-exports [NativeSigner](signatureUtils.md#nativesigner) + +___ + +### Ok + +Re-exports [Ok](result.md#ok) + +___ + +### OkResult + +Re-exports [OkResult](../interfaces/result.OkResult.md) + +___ + +### POP\_SIZE + +Re-exports [POP_SIZE](signatureUtils.md#pop_size) + +___ + +### ParsedPhoneNumber + +Re-exports [ParsedPhoneNumber](../interfaces/phoneNumbers.ParsedPhoneNumber.md) + +___ + +### PhoneNumberBase + +Re-exports [PhoneNumberBase](phoneNumbers.md#phonenumberbase) + +___ + +### RandomNumberGenerator + +Re-exports [RandomNumberGenerator](account.md#randomnumbergenerator) + +___ + +### RepeatTaskContext + +Re-exports [RepeatTaskContext](../interfaces/task.RepeatTaskContext.md) + +___ + +### Result + +Re-exports [Result](result.md#result) + +___ + +### RetryTaskOptions + +Re-exports [RetryTaskOptions](../interfaces/task.RetryTaskOptions.md) + +___ + +### RootError + +Re-exports [RootError](../classes/result.RootError.md) + +___ + +### RunningTask + +Re-exports [RunningTask](../interfaces/task.RunningTask.md) + +___ + +### RunningTaskWithValue + +Re-exports [RunningTaskWithValue](../interfaces/task.RunningTaskWithValue.md) + +___ + +### SHORT\_CURRENCIES + +Re-exports [SHORT_CURRENCIES](../enums/currencies.SHORT_CURRENCIES.md) + +___ + +### Signature + +Re-exports [Signature](../interfaces/signatureUtils.Signature.md) + +___ + +### SignatureBase + +Re-exports [SignatureBase](signatureUtils.md#signaturebase) + +___ + +### Signer + +Re-exports [Signer](../interfaces/signatureUtils.Signer.md) + +___ + +### StableToken + +Re-exports [StableToken](../enums/currencies.StableToken.md) + +___ + +### StringBase + +Re-exports [StringBase](string.md#stringbase) + +___ + +### StrongAddress + +Re-exports [StrongAddress](address.md#strongaddress) + +___ + +### TaskOptions + +Re-exports [TaskOptions](../interfaces/task.TaskOptions.md) + +___ + +### Token + +Re-exports [Token](../enums/currencies.Token.md) + +___ + +### URL\_REGEX + +Re-exports [URL_REGEX](io.md#url_regex) + +___ + +### ValidatorKind + +Re-exports [ValidatorKind](../enums/inputValidation.ValidatorKind.md) + +___ + +### anonymizedPhone + +Re-exports [anonymizedPhone](phoneNumbers.md#anonymizedphone) + +___ + +### appendPath + +Re-exports [appendPath](string.md#appendpath) + +___ + +### bufferToHex + +Re-exports [bufferToHex](address.md#buffertohex) + +___ + +### concurrentMap + +Re-exports [concurrentMap](async.md#concurrentmap) + +___ + +### concurrentValuesMap + +Re-exports [concurrentValuesMap](async.md#concurrentvaluesmap) + +___ + +### conditionWatcher + +Re-exports [conditionWatcher](task.md#conditionwatcher) + +___ + +### consoleLogger + +Re-exports [consoleLogger](logger.md#consolelogger) + +___ + +### currencyToShortMap + +Re-exports [currencyToShortMap](currencies.md#currencytoshortmap) + +___ + +### ensureLeading0x + +Re-exports [ensureLeading0x](address.md#ensureleading0x) + +___ + +### eqAddress + +Re-exports [eqAddress](address.md#eqaddress) + +___ + +### findAddressIndex + +Re-exports [findAddressIndex](address.md#findaddressindex) + +___ + +### getAddressChunks + +Re-exports [getAddressChunks](address.md#getaddresschunks) + +___ + +### getContactPhoneNumber + +Re-exports [getContactPhoneNumber](contacts.md#getcontactphonenumber) + +___ + +### getErrorMessage + +Re-exports [getErrorMessage](displayFormatting.md#geterrormessage) + +___ + +### hexToBuffer + +Re-exports [hexToBuffer](address.md#hextobuffer) + +___ + +### intersection + +Re-exports [intersection](collections.md#intersection) + +___ + +### isContact + +Re-exports [isContact](contacts.md#iscontact) + +___ + +### isE164Number + +Re-exports [isE164Number](phoneNumbers.md#ise164number) + +___ + +### isErr + +Re-exports [isErr](result.md#iserr) + +___ + +### isHexString + +Re-exports [isHexString](address.md#ishexstring) + +___ + +### isNullAddress + +Re-exports [isNullAddress](address.md#isnulladdress) + +___ + +### isOk + +Re-exports [isOk](result.md#isok) + +___ + +### isValidUrl + +Re-exports [isValidUrl](io.md#isvalidurl) + +___ + +### linkedListChange + +Re-exports [linkedListChange](collections.md#linkedlistchange) + +___ + +### linkedListChanges + +Re-exports [linkedListChanges](collections.md#linkedlistchanges) + +___ + +### makeAsyncThrowable + +Re-exports [makeAsyncThrowable](result.md#makeasyncthrowable) + +___ + +### makeThrowable + +Re-exports [makeThrowable](result.md#makethrowable) + +___ + +### mapAddressListDataOnto + +Re-exports [mapAddressListDataOnto](address.md#mapaddresslistdataonto) + +___ + +### mapAddressListOnto + +Re-exports [mapAddressListOnto](address.md#mapaddresslistonto) + +___ + +### noopLogger + +Re-exports [noopLogger](logger.md#nooplogger) + +___ + +### normalizeAccents + +Re-exports [normalizeAccents](string.md#normalizeaccents) + +___ + +### normalizeAddress + +Re-exports [normalizeAddress](address.md#normalizeaddress) + +___ + +### normalizeAddressWith0x + +Re-exports [normalizeAddressWith0x](address.md#normalizeaddresswith0x) + +___ + +### notEmpty + +Re-exports [notEmpty](collections.md#notempty) + +___ + +### parseJsonAsResult + +Re-exports [parseJsonAsResult](result.md#parsejsonasresult) + +___ + +### parseSolidityStringArray + +Re-exports [parseSolidityStringArray](parsing.md#parsesoliditystringarray) + +___ + +### pipeToFuture + +Re-exports [pipeToFuture](future.md#pipetofuture) + +___ + +### prefixLogger + +Re-exports [prefixLogger](logger.md#prefixlogger) + +___ + +### repeatTask + +Re-exports [repeatTask](task.md#repeattask) + +___ + +### resolveCurrency + +Re-exports [resolveCurrency](currencies.md#resolvecurrency) + +___ + +### retryAsync + +Re-exports [retryAsync](async.md#retryasync) + +___ + +### retryAsyncWithBackOff + +Re-exports [retryAsyncWithBackOff](async.md#retryasyncwithbackoff) + +___ + +### retryAsyncWithBackOffAndTimeout + +Re-exports [retryAsyncWithBackOffAndTimeout](async.md#retryasyncwithbackoffandtimeout) + +___ + +### selectiveRetryAsyncWithBackOff + +Re-exports [selectiveRetryAsyncWithBackOff](async.md#selectiveretryasyncwithbackoff) + +___ + +### serializeSignature + +Re-exports [serializeSignature](signatureUtils.md#serializesignature) + +___ + +### sleep + +Re-exports [sleep](async.md#sleep) + +___ + +### stringToBoolean + +Re-exports [stringToBoolean](parsing.md#stringtoboolean) + +___ + +### throwIfError + +Re-exports [throwIfError](result.md#throwiferror) + +___ + +### timeout + +Re-exports [timeout](async.md#timeout) + +___ + +### toFuture + +Re-exports [toFuture](future.md#tofuture) + +___ + +### trimLeading0x + +Re-exports [trimLeading0x](address.md#trimleading0x) + +___ + +### tryObtainValueWithRetries + +Re-exports [tryObtainValueWithRetries](task.md#tryobtainvaluewithretries) + +___ + +### validateDecimal + +Re-exports [validateDecimal](inputValidation.md#validatedecimal) + +___ + +### validateInteger + +Re-exports [validateInteger](inputValidation.md#validateinteger) + +___ + +### zeroRange + +Re-exports [zeroRange](collections.md#zerorange) + +___ + +### zip + +Re-exports [zip](collections.md#zip) + +___ + +### zip3 + +Re-exports [zip3](collections.md#zip3) diff --git a/docs/sdk/base/modules/inputValidation.md b/docs/sdk/base/modules/inputValidation.md new file mode 100644 index 000000000..7b7a6839c --- /dev/null +++ b/docs/sdk/base/modules/inputValidation.md @@ -0,0 +1,59 @@ +[@celo/base](../README.md) / inputValidation + +# Module: inputValidation + +## Table of contents + +### Enumerations + +- [ValidatorKind](../enums/inputValidation.ValidatorKind.md) + +### Interfaces + +- [BaseProps](../interfaces/inputValidation.BaseProps.md) + +### Functions + +- [validateDecimal](inputValidation.md#validatedecimal) +- [validateInteger](inputValidation.md#validateinteger) + +## Functions + +### validateDecimal + +▸ **validateDecimal**(`input`, `decimalSeparator?`): `string` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `input` | `string` | `undefined` | +| `decimalSeparator` | `string` | `'.'` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L19) + +___ + +### validateInteger + +▸ **validateInteger**(`input`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/inputValidation.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/inputValidation.ts#L15) diff --git a/docs/sdk/base/modules/io.md b/docs/sdk/base/modules/io.md new file mode 100644 index 000000000..bfe0555ff --- /dev/null +++ b/docs/sdk/base/modules/io.md @@ -0,0 +1,43 @@ +[@celo/base](../README.md) / io + +# Module: io + +## Table of contents + +### Variables + +- [URL\_REGEX](io.md#url_regex) + +### Functions + +- [isValidUrl](io.md#isvalidurl) + +## Variables + +### URL\_REGEX + +• `Const` **URL\_REGEX**: `RegExp` + +#### Defined in + +[packages/sdk/base/src/io.ts:2](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/io.ts#L2) + +## Functions + +### isValidUrl + +▸ **isValidUrl**(`url`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `url` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/io.ts:6](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/io.ts#L6) diff --git a/docs/sdk/base/modules/lock.md b/docs/sdk/base/modules/lock.md new file mode 100644 index 000000000..f4690ba41 --- /dev/null +++ b/docs/sdk/base/modules/lock.md @@ -0,0 +1,9 @@ +[@celo/base](../README.md) / lock + +# Module: lock + +## Table of contents + +### Classes + +- [Lock](../classes/lock.Lock.md) diff --git a/docs/sdk/base/modules/logger.md b/docs/sdk/base/modules/logger.md new file mode 100644 index 000000000..1bb07834e --- /dev/null +++ b/docs/sdk/base/modules/logger.md @@ -0,0 +1,100 @@ +[@celo/base](../README.md) / logger + +# Module: logger + +## Table of contents + +### Type Aliases + +- [Logger](logger.md#logger) + +### Functions + +- [consoleLogger](logger.md#consolelogger) +- [noopLogger](logger.md#nooplogger) +- [prefixLogger](logger.md#prefixlogger) + +## Type Aliases + +### Logger + +Ƭ **Logger**: (...`args`: `any`[]) => `void` + +#### Type declaration + +▸ (`...args`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +##### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/logger.ts:1](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/logger.ts#L1) + +## Functions + +### consoleLogger + +▸ **consoleLogger**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/logger.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/logger.ts#L11) + +___ + +### noopLogger + +▸ **noopLogger**(`...args`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `any`[] | + +#### Returns + +`void` + +#### Defined in + +[packages/sdk/base/src/logger.ts:3](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/logger.ts#L3) + +___ + +### prefixLogger + +▸ **prefixLogger**(`prefix`, `logger`): [`Logger`](logger.md#logger) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `prefix` | `string` | +| `logger` | [`Logger`](logger.md#logger) | + +#### Returns + +[`Logger`](logger.md#logger) + +#### Defined in + +[packages/sdk/base/src/logger.ts:7](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/logger.ts#L7) diff --git a/docs/sdk/base/modules/parsing.md b/docs/sdk/base/modules/parsing.md new file mode 100644 index 000000000..b99cb1d2f --- /dev/null +++ b/docs/sdk/base/modules/parsing.md @@ -0,0 +1,53 @@ +[@celo/base](../README.md) / parsing + +# Module: parsing + +## Table of contents + +### Functions + +- [parseSolidityStringArray](parsing.md#parsesoliditystringarray) +- [stringToBoolean](parsing.md#stringtoboolean) + +## Functions + +### parseSolidityStringArray + +▸ **parseSolidityStringArray**(`stringLengths`, `data`): `string`[] + +Parses an "array of strings" that is returned from a Solidity function + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `stringLengths` | `number`[] | length of each string in bytes | +| `data` | `string` | 0x-prefixed, hex-encoded string data in utf-8 bytes | + +#### Returns + +`string`[] + +#### Defined in + +[packages/sdk/base/src/parsing.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/parsing.ts#L17) + +___ + +### stringToBoolean + +▸ **stringToBoolean**(`inputString`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `inputString` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/parsing.ts:1](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/parsing.ts#L1) diff --git a/docs/sdk/base/modules/phoneNumbers.md b/docs/sdk/base/modules/phoneNumbers.md new file mode 100644 index 000000000..8e5432b9f --- /dev/null +++ b/docs/sdk/base/modules/phoneNumbers.md @@ -0,0 +1,74 @@ +[@celo/base](../README.md) / phoneNumbers + +# Module: phoneNumbers + +## Table of contents + +### Interfaces + +- [ParsedPhoneNumber](../interfaces/phoneNumbers.ParsedPhoneNumber.md) + +### Variables + +- [PhoneNumberBase](phoneNumbers.md#phonenumberbase) + +### Functions + +- [anonymizedPhone](phoneNumbers.md#anonymizedphone) +- [isE164Number](phoneNumbers.md#ise164number) + +## Variables + +### PhoneNumberBase + +• `Const` **PhoneNumberBase**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `isE164Number` | (`phoneNumber`: `string`) => `boolean` | + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:19](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L19) + +## Functions + +### anonymizedPhone + +▸ **anonymizedPhone**(`phoneNumber`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `phoneNumber` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:15](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L15) + +___ + +### isE164Number + +▸ **isE164Number**(`phoneNumber`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `phoneNumber` | `string` | + +#### Returns + +`boolean` + +#### Defined in + +[packages/sdk/base/src/phoneNumbers.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/phoneNumbers.ts#L11) diff --git a/docs/sdk/base/modules/result.md b/docs/sdk/base/modules/result.md new file mode 100644 index 000000000..8d8f26324 --- /dev/null +++ b/docs/sdk/base/modules/result.md @@ -0,0 +1,301 @@ +[@celo/base](../README.md) / result + +# Module: result + +## Table of contents + +### Classes + +- [JSONParseError](../classes/result.JSONParseError.md) +- [RootError](../classes/result.RootError.md) + +### Interfaces + +- [BaseError](../interfaces/result.BaseError.md) +- [ErrorResult](../interfaces/result.ErrorResult.md) +- [OkResult](../interfaces/result.OkResult.md) + +### Type Aliases + +- [Result](result.md#result) + +### Variables + +- [JSONParseErrorType](result.md#jsonparseerrortype) + +### Functions + +- [Err](result.md#err) +- [Ok](result.md#ok) +- [isErr](result.md#iserr) +- [isOk](result.md#isok) +- [makeAsyncThrowable](result.md#makeasyncthrowable) +- [makeThrowable](result.md#makethrowable) +- [parseJsonAsResult](result.md#parsejsonasresult) +- [throwIfError](result.md#throwiferror) + +## Type Aliases + +### Result + +Ƭ **Result**\<`TResult`, `TError`\>: [`OkResult`](../interfaces/result.OkResult.md)\<`TResult`\> \| [`ErrorResult`](../interfaces/result.ErrorResult.md)\<`TError`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TResult` | `TResult` | +| `TError` | extends `Error` | + +#### Defined in + +[packages/sdk/base/src/result.ts:11](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L11) + +## Variables + +### JSONParseErrorType + +• `Const` **JSONParseErrorType**: ``"JsonParseError"`` + +#### Defined in + +[packages/sdk/base/src/result.ts:78](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L78) + +## Functions + +### Err + +▸ **Err**\<`TError`\>(`error`): [`ErrorResult`](../interfaces/result.ErrorResult.md)\<`TError`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TError` | extends `Error` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `error` | `TError` | + +#### Returns + +[`ErrorResult`](../interfaces/result.ErrorResult.md)\<`TError`\> + +#### Defined in + +[packages/sdk/base/src/result.ts:17](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L17) + +___ + +### Ok + +▸ **Ok**\<`TResult`\>(`result`): [`OkResult`](../interfaces/result.OkResult.md)\<`TResult`\> + +#### Type parameters + +| Name | +| :------ | +| `TResult` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `result` | `TResult` | + +#### Returns + +[`OkResult`](../interfaces/result.OkResult.md)\<`TResult`\> + +#### Defined in + +[packages/sdk/base/src/result.ts:13](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L13) + +___ + +### isErr + +▸ **isErr**\<`TResult`, `TError`\>(`result`): result is ErrorResult\ + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TResult` | `TResult` | +| `TError` | extends `Error` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `result` | [`Result`](result.md#result)\<`TResult`, `TError`\> | + +#### Returns + +result is ErrorResult\ + +#### Defined in + +[packages/sdk/base/src/result.ts:98](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L98) + +___ + +### isOk + +▸ **isOk**\<`TResult`, `TError`\>(`result`): result is OkResult\ + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TResult` | `TResult` | +| `TError` | extends `Error` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `result` | [`Result`](result.md#result)\<`TResult`, `TError`\> | + +#### Returns + +result is OkResult\ + +#### Defined in + +[packages/sdk/base/src/result.ts:92](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L92) + +___ + +### makeAsyncThrowable + +▸ **makeAsyncThrowable**\<`TArgs`, `TResult`, `TError`, `TModifiedError`\>(`f`, `errorModifier?`): (...`args`: `TArgs`) => `Promise`\<`TResult`\> + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TArgs` | extends `any`[] | +| `TResult` | `TResult` | +| `TError` | extends `Error` | +| `TModifiedError` | extends `Error` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `f` | (...`args`: `TArgs`) => `Promise`\<[`Result`](result.md#result)\<`TResult`, `TError`\>\> | +| `errorModifier?` | (`error`: `TError`) => `TModifiedError` | + +#### Returns + +`fn` + +▸ (`...args`): `Promise`\<`TResult`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `TArgs` | + +##### Returns + +`Promise`\<`TResult`\> + +#### Defined in + +[packages/sdk/base/src/result.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L48) + +___ + +### makeThrowable + +▸ **makeThrowable**\<`TArgs`, `TResult`, `TError`, `TModifiedError`\>(`f`, `errorModifier?`): (...`args`: `TArgs`) => `TResult` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TArgs` | extends `any`[] | +| `TResult` | `TResult` | +| `TError` | extends `Error` | +| `TModifiedError` | extends `Error` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `f` | (...`args`: `TArgs`) => [`Result`](result.md#result)\<`TResult`, `TError`\> | +| `errorModifier?` | (`error`: `TError`) => `TModifiedError` | + +#### Returns + +`fn` + +▸ (`...args`): `TResult` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | `TArgs` | + +##### Returns + +`TResult` + +#### Defined in + +[packages/sdk/base/src/result.ts:36](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L36) + +___ + +### parseJsonAsResult + +▸ **parseJsonAsResult**(`data`): [`OkResult`](../interfaces/result.OkResult.md)\<`any`\> \| [`ErrorResult`](../interfaces/result.ErrorResult.md)\<[`JSONParseError`](../classes/result.JSONParseError.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `data` | `string` | + +#### Returns + +[`OkResult`](../interfaces/result.OkResult.md)\<`any`\> \| [`ErrorResult`](../interfaces/result.ErrorResult.md)\<[`JSONParseError`](../classes/result.JSONParseError.md)\> + +#### Defined in + +[packages/sdk/base/src/result.ts:84](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L84) + +___ + +### throwIfError + +▸ **throwIfError**\<`TResult`, `TError`, `TModifiedError`\>(`result`, `errorModifier?`): `TResult` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TResult` | `TResult` | +| `TError` | extends `Error` | +| `TModifiedError` | extends `Error` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `result` | [`Result`](result.md#result)\<`TResult`, `TError`\> | +| `errorModifier?` | (`error`: `TError`) => `TModifiedError` | + +#### Returns + +`TResult` + +#### Defined in + +[packages/sdk/base/src/result.ts:22](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/result.ts#L22) diff --git a/docs/sdk/base/modules/signatureUtils.md b/docs/sdk/base/modules/signatureUtils.md new file mode 100644 index 000000000..718ada530 --- /dev/null +++ b/docs/sdk/base/modules/signatureUtils.md @@ -0,0 +1,88 @@ +[@celo/base](../README.md) / signatureUtils + +# Module: signatureUtils + +## Table of contents + +### Interfaces + +- [Signature](../interfaces/signatureUtils.Signature.md) +- [Signer](../interfaces/signatureUtils.Signer.md) + +### Variables + +- [POP\_SIZE](signatureUtils.md#pop_size) +- [SignatureBase](signatureUtils.md#signaturebase) + +### Functions + +- [NativeSigner](signatureUtils.md#nativesigner) +- [serializeSignature](signatureUtils.md#serializesignature) + +## Variables + +### POP\_SIZE + +• `Const` **POP\_SIZE**: ``65`` + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:1](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L1) + +___ + +### SignatureBase + +• `Const` **SignatureBase**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `NativeSigner` | (`signFn`: (`message`: `string`, `signer`: `string`) => `Promise`\<`string`\>, `signer`: `string`) => [`Signer`](../interfaces/signatureUtils.Signer.md) | +| `serializeSignature` | (`signature`: [`Signature`](../interfaces/signatureUtils.Signature.md)) => `string` | + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:33](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L33) + +## Functions + +### NativeSigner + +▸ **NativeSigner**(`signFn`, `signer`): [`Signer`](../interfaces/signatureUtils.Signer.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signFn` | (`message`: `string`, `signer`: `string`) => `Promise`\<`string`\> | +| `signer` | `string` | + +#### Returns + +[`Signer`](../interfaces/signatureUtils.Signer.md) + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:8](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L8) + +___ + +### serializeSignature + +▸ **serializeSignature**(`signature`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signature` | [`Signature`](../interfaces/signatureUtils.Signature.md) | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/signatureUtils.ts:26](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/signatureUtils.ts#L26) diff --git a/docs/sdk/base/modules/string.md b/docs/sdk/base/modules/string.md new file mode 100644 index 000000000..8d991a46c --- /dev/null +++ b/docs/sdk/base/modules/string.md @@ -0,0 +1,72 @@ +[@celo/base](../README.md) / string + +# Module: string + +## Table of contents + +### Variables + +- [StringBase](string.md#stringbase) + +### Functions + +- [appendPath](string.md#appendpath) +- [normalizeAccents](string.md#normalizeaccents) + +## Variables + +### StringBase + +• `Const` **StringBase**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `appendPath` | (`baseUrl`: `string`, `path`: `string`) => `string` | +| `normalizeAccents` | (`str`: `string`) => `string` | + +#### Defined in + +[packages/sdk/base/src/string.ts:14](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/string.ts#L14) + +## Functions + +### appendPath + +▸ **appendPath**(`baseUrl`, `path`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `baseUrl` | `string` | +| `path` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/string.ts:1](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/string.ts#L1) + +___ + +### normalizeAccents + +▸ **normalizeAccents**(`str`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `str` | `string` | + +#### Returns + +`string` + +#### Defined in + +[packages/sdk/base/src/string.ts:10](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/string.ts#L10) diff --git a/docs/sdk/base/modules/task.md b/docs/sdk/base/modules/task.md new file mode 100644 index 000000000..90cc4309e --- /dev/null +++ b/docs/sdk/base/modules/task.md @@ -0,0 +1,88 @@ +[@celo/base](../README.md) / task + +# Module: task + +## Table of contents + +### Interfaces + +- [RepeatTaskContext](../interfaces/task.RepeatTaskContext.md) +- [RetryTaskOptions](../interfaces/task.RetryTaskOptions.md) +- [RunningTask](../interfaces/task.RunningTask.md) +- [RunningTaskWithValue](../interfaces/task.RunningTaskWithValue.md) +- [TaskOptions](../interfaces/task.TaskOptions.md) + +### Functions + +- [conditionWatcher](task.md#conditionwatcher) +- [repeatTask](task.md#repeattask) +- [tryObtainValueWithRetries](task.md#tryobtainvaluewithretries) + +## Functions + +### conditionWatcher + +▸ **conditionWatcher**(`opts`): [`RunningTask`](../interfaces/task.RunningTask.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | `RepeatTaskOptions` & \{ `onSuccess`: () => `void` \| `Promise`\<`void`\> ; `pollCondition`: () => `Promise`\<`boolean`\> } | + +#### Returns + +[`RunningTask`](../interfaces/task.RunningTask.md) + +#### Defined in + +[packages/sdk/base/src/task.ts:93](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L93) + +___ + +### repeatTask + +▸ **repeatTask**(`opts`, `fn`): [`RunningTask`](../interfaces/task.RunningTask.md) + +Runs an async function eternally until stopped + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `opts` | `RepeatTaskOptions` | - | +| `fn` | (`ctx`: [`RepeatTaskContext`](../interfaces/task.RepeatTaskContext.md)) => `Promise`\<`void`\> | function to run | + +#### Returns + +[`RunningTask`](../interfaces/task.RunningTask.md) + +#### Defined in + +[packages/sdk/base/src/task.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L50) + +___ + +### tryObtainValueWithRetries + +▸ **tryObtainValueWithRetries**\<`A`\>(`opts`): [`RunningTaskWithValue`](../interfaces/task.RunningTaskWithValue.md)\<`A`\> + +#### Type parameters + +| Name | +| :------ | +| `A` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`RetryTaskOptions`](../interfaces/task.RetryTaskOptions.md)\<`A`\> | + +#### Returns + +[`RunningTaskWithValue`](../interfaces/task.RunningTaskWithValue.md)\<`A`\> + +#### Defined in + +[packages/sdk/base/src/task.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/base/src/task.ts#L121) diff --git a/docs/sdk/base/modules/types.md b/docs/sdk/base/modules/types.md new file mode 100644 index 000000000..5bc4c6e29 --- /dev/null +++ b/docs/sdk/base/modules/types.md @@ -0,0 +1,3 @@ +[@celo/base](../README.md) / types + +# Module: types diff --git a/packages/sdk/base/typedoc.json b/packages/sdk/base/typedoc.json index 19ad8ee80..5c96e6405 100644 --- a/packages/sdk/base/typedoc.json +++ b/packages/sdk/base/typedoc.json @@ -5,7 +5,7 @@ "excludePrivate": true, "excludeProtected": true, "hideGenerator": true, - "out": "../../../../docs/sdk/base", + "out": "../../../docs/sdk/base", "gitRevision": "master", "readme": "none", "entryPoints": [ From d9393d0d8ab888f4576e73d8fe32b36d2cd9d697 Mon Sep 17 00:00:00 2001 From: Nicolas Brugneaux Date: Thu, 16 May 2024 17:00:28 +0200 Subject: [PATCH 2/3] Docs typos 2 the electric boogaloo (#241) * chore: regenerate docs * fix: change the path of the docs diffing --- .github/workflows/ci.yml | 4 ++-- docs/command-line-interface/account.md | 10 +++++----- docs/command-line-interface/exchange.md | 2 +- docs/command-line-interface/network.md | 4 ++-- docs/command-line-interface/releasecelo.md | 6 +++--- docs/command-line-interface/transfer.md | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dcdc2b1e..673da782a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,8 +288,8 @@ jobs: - name: Fail if someone forgot to commit docs run: | yarn docs - if [[ $(git status packages/docs --porcelain) ]]; then - git --no-pager diff packages/docs + if [[ $(git status docs --porcelain) ]]; then + git --no-pager diff docs echo "There are git differences after generating all docs" git status git diff diff --git a/docs/command-line-interface/account.md b/docs/command-line-interface/account.md index a52e6b2ce..db963d79d 100644 --- a/docs/command-line-interface/account.md +++ b/docs/command-line-interface/account.md @@ -408,7 +408,7 @@ _See code: [src/commands/account/delete-payment-delegation.ts](https://github.co ## `celocli account:get-metadata ARG1` -Show information about an address. Retreives the metadata URL for an account from the on-chain, then fetches the metadata file off-chain and verifies proofs as able. +Show information about an address. Retrieves the metadata URL for an account from the on-chain, then fetches the metadata file off-chain and verifies proofs as able. ``` USAGE @@ -453,7 +453,7 @@ FLAGS property to sort by (prepend '-' for descending) DESCRIPTION - Show information about an address. Retreives the metadata URL for an account from the + Show information about an address. Retrieves the metadata URL for an account from the on-chain, then fetches the metadata file off-chain and verifies proofs as able. EXAMPLES @@ -897,7 +897,7 @@ _See code: [src/commands/account/register-data-encryption-key.ts](https://github ## `celocli account:register-metadata` -Register metadata URL for an account where users will be able to retieve the metadata file and verify your claims +Register metadata URL for an account where users will be able to retrieve the metadata file and verify your claims ``` USAGE @@ -922,7 +922,7 @@ FLAGS Ignore metadata validity checks --from=0xc1912fEE45d61C87Cc5EA59DaE31190FFFFf232d - (required) Addess of the account to set metadata for + (required) Address of the account to set metadata for --gasCurrency=0x1234567890123456789012345678901234567890 Use a specific gas currency for transaction fees (defaults to CELO if no gas @@ -948,7 +948,7 @@ FLAGS (required) The url to the metadata you want to register DESCRIPTION - Register metadata URL for an account where users will be able to retieve the metadata + Register metadata URL for an account where users will be able to retrieve the metadata file and verify your claims EXAMPLES diff --git a/docs/command-line-interface/exchange.md b/docs/command-line-interface/exchange.md index bae093bf8..58d997630 100644 --- a/docs/command-line-interface/exchange.md +++ b/docs/command-line-interface/exchange.md @@ -218,7 +218,7 @@ FLAGS --globalHelp View all available global flags --stableToken=