-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
167 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters