Skip to content

Commit

Permalink
chore: generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chmanie committed Oct 23, 2024
1 parent 502f76d commit d2346ab
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/sdk/docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
- [ColonyNetwork](classes/ColonyNetwork.md)
- [ColonyToken](classes/ColonyToken.md)
- [ColonyTxCreator](classes/ColonyTxCreator.md)
- [CustomColonyNetwork](classes/CustomColonyNetwork.md)
- [CustomContract](classes/CustomContract.md)
- [ERC20Token](classes/ERC20Token.md)
- [ERC2612Token](classes/ERC2612Token.md)
- [EvaluatedExpenditureEvents\_\_factory](classes/EvaluatedExpenditureEvents__factory.md)
Expand Down
63 changes: 63 additions & 0 deletions packages/sdk/docs/api/classes/CustomColonyNetwork.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Class: CustomColonyNetwork

## Constructors

### constructor

**new CustomColonyNetwork**(`signerOrProvider`, `abi`, `options?`)

Creates a new custom instance of the custom ColonyNetwork

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `signerOrProvider` | [`SignerOrProvider`](../README.md#signerorprovider) | An _ethers_ compatible Signer or Provider instance |
| `abi` | `ContractInterface` | JSON ABI of the custom ColonyNetwork contract |
| `options?` | [`ColonyNetworkOptions`](../interfaces/ColonyNetworkOptions.md) | Optional custom [ColonyNetworkOptions](../interfaces/ColonyNetworkOptions.md) |

## Properties

### ipfs

**ipfs**: [`IpfsMetadata`](IpfsMetadata.md)

The IPFS adapter for Metadata. Defaults to a read-only adapter

___

### network

**network**: [`Network`](../enums/Network.md)

The network the client is connected to. Defaults to Gnosis chain

___

### signerOrProvider

**signerOrProvider**: [`SignerOrProvider`](../README.md#signerorprovider)

An ethers.js [Signer](https://docs.ethers.org/v5/api/signer/#Signer) or [Provider](https://docs.ethers.org/v5/api/providers/).

E.g. a [Wallet](https://docs.ethers.org/v5/api/signer/#Wallet) or a [Web3Provider](https://docs.ethers.org/v5/api/providers/other/#Web3Provider) (MetaMask)

## Methods

### getInternalNetworkContract

**getInternalNetworkContract**(): `IColonyNetwork`

#### Returns

`IColonyNetwork`

___

### getSigner

**getSigner**(): `Signer`

#### Returns

`Signer`
95 changes: 95 additions & 0 deletions packages/sdk/docs/api/classes/CustomContract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Class: CustomContract<A\>

## Type parameters

| Name | Type |
| :------ | :------ |
| `A` | extends `Abi` |

## Constructors

### constructor

**new CustomContract**<`A`\>(`colonyNetwork`, `address`, `abi`)

Creates a new instance of a custom contract

This is your main entry point to talk to the Colony Network Smart Contracts.
From here you should be able to instantiate all the required instances for Colonies and their extensions.

#### Type parameters

| Name | Type |
| :------ | :------ |
| `A` | extends `Abi` |

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `colonyNetwork` | [`ColonyNetwork`](ColonyNetwork.md) \| [`CustomColonyNetwork`](CustomColonyNetwork.md) | [ColonyNetwork](ColonyNetwork.md) instance |
| `address` | \`0x${string}\` | Address of the deployed contract |
| `abi` | `A` | JSON ABI of the contract |

## Properties

### address

**address**: \`0x${string}\`

## Methods

### createTxCreator

**createTxCreator**<`M`, `E`\>(`method`, `args`, `eventData?`, `txConfig?`): `CustomTxCreator`<`A`, `M`, `E`\>

Creates a new CustomTxCreator for custom, permissioned transactions or metatransactions

#### Type parameters

| Name | Type |
| :------ | :------ |
| `M` | extends `string` |
| `E` | extends [`EventData`](../interfaces/EventData.md) |

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `method` | `M` | The transaction method to execute on the contract |
| `args` | { [key in string \| number \| symbol]: { [key in string \| number \| symbol]: AbiParameterToPrimitiveType<Extract<Extract<A[number], Object\>, Object\>["inputs"][key], "inputs"\> }[key] } | The arguments for the method |
| `eventData?` | (`receipt`: [`ContractReceipt`](../interfaces/ContractReceipt.md)) => `Promise`<`E`\> | A function that extracts the relevant event data from the [ContractReceipt](../interfaces/ContractReceipt.md) |
| `txConfig?` | [`TxConfig`](../interfaces/TxConfig.md)<[`DEFAULT`](../enums/MetadataType.md#default)\> | More configuration options, like [MetadataType](../enums/MetadataType.md) if the event contains metadata or if methods are unsupported |

#### Returns

`CustomTxCreator`<`A`, `M`, `E`\>

A CustomTxCreator

___

### read

**read**<`M`\>(`method`, `args`): `Promise`<{ [key in string \| number \| symbol]: { [key in string \| number \| symbol]: AbiParameterToPrimitiveType<ExtractAbiFunction<A, M\>["outputs"][key], "outputs"\> }[key] }\>

Read a contract value

#### Type parameters

| Name | Type |
| :------ | :------ |
| `M` | extends `string` |

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `method` | `M` | The pure/view method to read from the contract |
| `args` | { [key in string \| number \| symbol]: { [key in string \| number \| symbol]: AbiParameterToPrimitiveType<ExtractAbiFunction<A, M\>["inputs"][key], "inputs"\> }[key] } | The arguments for the method |

#### Returns

`Promise`<{ [key in string \| number \| symbol]: { [key in string \| number \| symbol]: AbiParameterToPrimitiveType<ExtractAbiFunction<A, M\>["outputs"][key], "outputs"\> }[key] }\>

A promise resolving into the specific type for the contract return value
6 changes: 3 additions & 3 deletions packages/sdk/docs/api/classes/MetaTxCreator.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Learn more about these functions in their individual documentation
| `C` | extends [`MetaTxBaseContract`](../interfaces/MetaTxBaseContract.md) |
| `M` | extends keyof `C`[``"functions"``] |
| `E` | extends [`EventData`](../interfaces/EventData.md) |
| `MD` | extends [`MetadataType`](../enums/MetadataType.md) |
| `MD` | extends [`MetadataType`](../enums/MetadataType.md) = [`DEFAULT`](../enums/MetadataType.md#default) |

## Hierarchy

Expand All @@ -41,15 +41,15 @@ Learn more about these functions in their individual documentation
| `C` | extends [`MetaTxBaseContract`](../interfaces/MetaTxBaseContract.md) |
| `M` | extends `string` \| `number` \| `symbol` |
| `E` | extends [`EventData`](../interfaces/EventData.md) |
| `MD` | extends [`MetadataType`](../enums/MetadataType.md) |
| `MD` | extends [`MetadataType`](../enums/MetadataType.md) = [`DEFAULT`](../enums/MetadataType.md#default) |

#### Parameters

| Name | Type |
| :------ | :------ |
| `«destructured»` | `Object` |
| › `args` | `unknown`[] \| () => `Promise`<`unknown`[]\> |
| › `colonyNetwork` | [`ColonyNetwork`](ColonyNetwork.md) |
| › `colonyNetwork` | [`ColonyNetwork`](ColonyNetwork.md) \| [`CustomColonyNetwork`](CustomColonyNetwork.md) |
| › `contract` | `C` |
| › `eventData?` | (`receipt`: [`ContractReceipt`](../interfaces/ContractReceipt.md)) => `Promise`<`E`\> |
| › `metadataType?` | `MD` |
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/docs/api/classes/TxCreator.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Learn more about these functions in their individual documentation
| :------ | :------ |
| `«destructured»` | `Object` |
| › `args` | `unknown`[] \| () => `Promise`<`unknown`[]\> |
| › `colonyNetwork` | [`ColonyNetwork`](ColonyNetwork.md) |
| › `colonyNetwork` | [`ColonyNetwork`](ColonyNetwork.md) \| [`CustomColonyNetwork`](CustomColonyNetwork.md) |
| › `contract` | `C` |
| › `eventData?` | (`receipt`: [`ContractReceipt`](../interfaces/ContractReceipt.md)) => `Promise`<`E`\> |
| › `metadataType?` | `MD` |
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/docs/api/interfaces/TxConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Type parameters

| Name |
| :------ |
| `M` |
| Name | Type |
| :------ | :------ |
| `M` | [`DEFAULT`](../enums/MetadataType.md#default) |

## Properties

Expand Down

0 comments on commit d2346ab

Please sign in to comment.