diff --git a/docs/README.md b/docs/README.md index cccf5f4b..bc59add5 100644 --- a/docs/README.md +++ b/docs/README.md @@ -23,26 +23,6 @@ $ yarn build This command generates static content into the `build` directory and can be served using any static contents hosting service. -### Versioning - -We leverage Docusaurus's built-in support for versioning. -For more details, see the [documentation](https://docusaurus.io/docs/versioning). - -NOTE: Please keep the version number consistent with our SDK version numbers. - -To create a new version: - -``` -yarn docusaurus docs:version VERSION_NUMBER - -``` - -For your convenience, this script will create a new version based on `../sdk/package.json` - -``` -yarn version:new -``` - ### Deployment Using SSH: diff --git a/docs/docs/developer/api/sdk/classes/ClientError.md b/docs/docs/developer/api/sdk/classes/ClientError.md index 085ed768..e693102e 100644 --- a/docs/docs/developer/api/sdk/classes/ClientError.md +++ b/docs/docs/developer/api/sdk/classes/ClientError.md @@ -43,7 +43,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:27](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L27) +[sdk/src/types/errors.ts:27](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L27) ## Properties @@ -105,7 +105,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:20](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L20) +[sdk/src/types/errors.ts:20](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L20) --- diff --git a/docs/docs/developer/api/sdk/classes/ConfigurationError.md b/docs/docs/developer/api/sdk/classes/ConfigurationError.md index 44dcd47a..d7a4e44e 100644 --- a/docs/docs/developer/api/sdk/classes/ConfigurationError.md +++ b/docs/docs/developer/api/sdk/classes/ConfigurationError.md @@ -41,7 +41,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:188](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L188) +[sdk/src/types/errors.ts:188](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L188) ## Properties @@ -103,7 +103,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:187](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L187) +[sdk/src/types/errors.ts:187](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L187) --- diff --git a/docs/docs/developer/api/sdk/classes/ContractError.md b/docs/docs/developer/api/sdk/classes/ContractError.md index b3c1924e..2155e94f 100644 --- a/docs/docs/developer/api/sdk/classes/ContractError.md +++ b/docs/docs/developer/api/sdk/classes/ContractError.md @@ -42,7 +42,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:43](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L43) +[sdk/src/types/errors.ts:43](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L43) ## Properties @@ -104,7 +104,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L41) +[sdk/src/types/errors.ts:41](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L41) --- diff --git a/docs/docs/developer/api/sdk/classes/FetchError.md b/docs/docs/developer/api/sdk/classes/FetchError.md index 80cd2ac5..52a4240a 100644 --- a/docs/docs/developer/api/sdk/classes/FetchError.md +++ b/docs/docs/developer/api/sdk/classes/FetchError.md @@ -43,7 +43,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:65](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L65) +[sdk/src/types/errors.ts:65](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L65) ## Properties @@ -105,7 +105,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:58](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L58) +[sdk/src/types/errors.ts:58](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L58) --- diff --git a/docs/docs/developer/api/sdk/classes/HypercertClient.md b/docs/docs/developer/api/sdk/classes/HypercertClient.md index 175836d5..6b39f325 100644 --- a/docs/docs/developer/api/sdk/classes/HypercertClient.md +++ b/docs/docs/developer/api/sdk/classes/HypercertClient.md @@ -54,7 +54,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:58](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L58) +[sdk/src/client.ts:58](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L58) ## Properties @@ -64,7 +64,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L41) +[sdk/src/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L41) --- @@ -74,7 +74,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:44](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L44) +[sdk/src/client.ts:44](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L44) --- @@ -84,7 +84,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:45](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L45) +[sdk/src/client.ts:45](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L45) --- @@ -158,7 +158,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:46](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L46) +[sdk/src/client.ts:46](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L46) --- @@ -168,7 +168,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:42](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L42) +[sdk/src/client.ts:42](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L42) --- @@ -212,7 +212,7 @@ Will throw a `ClientError` if the public client cannot be connected. #### Defined in -[sdk/src/client.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L47) +[sdk/src/client.ts:47](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L47) --- @@ -228,7 +228,7 @@ Whether the client is in read-only mode. #### Defined in -[sdk/src/client.ts:48](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L48) +[sdk/src/client.ts:48](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L48) ## Accessors @@ -246,7 +246,7 @@ The client config. #### Defined in -[sdk/src/client.ts:82](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L82) +[sdk/src/client.ts:82](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L82) --- @@ -272,7 +272,7 @@ Use getDeployments instead. #### Defined in -[sdk/src/client.ts:107](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L107) +[sdk/src/client.ts:107](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L107) --- @@ -294,7 +294,7 @@ The indexer. #### Defined in -[sdk/src/client.ts:98](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L98) +[sdk/src/client.ts:98](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L98) --- @@ -316,7 +316,7 @@ The storage layer. #### Defined in -[sdk/src/client.ts:90](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L90) +[sdk/src/client.ts:90](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L90) ## Methods @@ -355,7 +355,7 @@ Will throw an `InvalidOrMissingError` if any of the proofs are invalid. #### Defined in -[sdk/src/client.ts:454](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L454) +[sdk/src/client.ts:456](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L456) --- @@ -388,7 +388,7 @@ A promise that resolves to the transaction hash. #### Defined in -[sdk/src/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L216) +[sdk/src/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L216) --- @@ -425,7 +425,7 @@ Will throw a `ClientError` if the claim is not owned by the account. #### Defined in -[sdk/src/client.ts:377](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L377) +[sdk/src/client.ts:379](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L379) --- @@ -466,7 +466,7 @@ Will throw a `MalformedDataError` if the provided allowlist or metadata is inval #### Defined in -[sdk/src/client.ts:249](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L249) +[sdk/src/client.ts:249](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L249) --- @@ -486,7 +486,7 @@ Will throw a `MalformedDataError` if the provided allowlist or metadata is inval #### Defined in -[sdk/src/client.ts:485](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L485) +[sdk/src/client.ts:487](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L487) --- @@ -506,7 +506,7 @@ Will throw a `MalformedDataError` if the provided allowlist or metadata is inval #### Defined in -[sdk/src/client.ts:502](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L502) +[sdk/src/client.ts:504](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L504) --- @@ -520,7 +520,7 @@ Will throw a `MalformedDataError` if the provided allowlist or metadata is inval #### Defined in -[sdk/src/client.ts:491](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L491) +[sdk/src/client.ts:493](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L493) --- @@ -552,7 +552,7 @@ Use getDeployments instead. #### Defined in -[sdk/src/client.ts:120](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L120) +[sdk/src/client.ts:120](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L120) --- @@ -582,7 +582,7 @@ a Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/client.ts:168](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L168) +[sdk/src/client.ts:168](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L168) --- @@ -630,7 +630,7 @@ a Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/client.ts:512](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L512) +[sdk/src/client.ts:514](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L514) --- @@ -667,7 +667,7 @@ Will throw a `ClientError` if any of the fractions are not owned by the account. #### Defined in -[sdk/src/client.ts:336](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L336) +[sdk/src/client.ts:338](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L338) --- @@ -707,7 +707,7 @@ Will throw a `MalformedDataError` if the provided metadata is invalid. #### Defined in -[sdk/src/client.ts:139](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L139) +[sdk/src/client.ts:139](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L139) --- @@ -746,7 +746,7 @@ Will throw an `InvalidOrMissingError` if the proof is invalid. #### Defined in -[sdk/src/client.ts:410](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L410) +[sdk/src/client.ts:412](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L412) --- @@ -769,7 +769,7 @@ Will throw an `InvalidOrMissingError` if the proof is invalid. #### Defined in -[sdk/src/client.ts:522](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L522) +[sdk/src/client.ts:524](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L524) --- @@ -808,7 +808,7 @@ Will throw a `ClientError` if the fraction is not owned by the account or if the #### Defined in -[sdk/src/client.ts:291](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L291) +[sdk/src/client.ts:293](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L293) --- @@ -838,7 +838,7 @@ Will throw a `ClientError` if the request fails. #### Defined in -[sdk/src/client.ts:553](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L553) +[sdk/src/client.ts:555](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L555) --- @@ -871,4 +871,4 @@ A promise that resolves to the transaction hash. #### Defined in -[sdk/src/client.ts:188](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L188) +[sdk/src/client.ts:188](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L188) diff --git a/docs/docs/developer/api/sdk/classes/HypercertsStorage.md b/docs/docs/developer/api/sdk/classes/HypercertsStorage.md index 4e0afed6..816fd298 100644 --- a/docs/docs/developer/api/sdk/classes/HypercertsStorage.md +++ b/docs/docs/developer/api/sdk/classes/HypercertsStorage.md @@ -35,7 +35,7 @@ const metadata = await storage.getMetadata("your-hypercert-id"); ### getData -▸ **getData**(`cidOrIpfsUri`): `Promise`<`unknown`\> +▸ **getData**(`cidOrIpfsUri`, `config?`): `Promise`<`unknown`\> Retrieves data from IPFS using the provided CID or IPFS URI. @@ -43,9 +43,10 @@ This method first retrieves the data from IPFS using the `getFromIPFS` function. #### Parameters -| Name | Type | Description | -| :------------- | :------- | :------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | +| Name | Type | Description | +| :------------- | :--------------------------------------------------------------- | :------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | #### Returns @@ -71,13 +72,13 @@ Note: The original implementation using the Web3 Storage client is currently com #### Defined in -[sdk/src/storage.ts:126](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L126) +[sdk/src/storage.ts:145](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L145) --- ### getMetadata -▸ **getMetadata**(`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> +▸ **getMetadata**(`cidOrIpfsUri`, `config?`): `Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> Retrieves Hypercert metadata from IPFS using the provided CID or IPFS URI. @@ -86,9 +87,10 @@ If the data is valid, it returns the data as a `HypercertMetadata` object. #### Parameters -| Name | Type | Description | -| :------------- | :------- | :----------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | +| Name | Type | Description | +| :------------- | :--------------------------------------------------------------- | :----------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | #### Returns @@ -106,13 +108,13 @@ Will throw a `MalformedDataError` if the retrieved data is invalid. #### Defined in -[sdk/src/storage.ts:103](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L103) +[sdk/src/storage.ts:118](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L118) --- ### storeAllowList -▸ **storeAllowList**(`allowList`, `totalUnits`): `Promise`<`string`\> +▸ **storeAllowList**(`allowList`, `totalUnits`, `config?`): `Promise`<`string`\> Stores hypercerts allowlist on IPFS. @@ -121,10 +123,11 @@ If the metadata is valid, it creates a new Blob from the metadata and stores it #### Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------------- | :---------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowList to store. | -| `totalUnits` | `bigint` | - | +| Name | Type | Description | +| :----------- | :--------------------------------------------------------------- | :------------------------------------------ | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowList to store. | +| `totalUnits` | `bigint` | The total number of units in the allowlist. | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | #### Returns @@ -146,13 +149,13 @@ Will throw a `MalformedDataError` if the provided metadata is invalid. #### Defined in -[sdk/src/storage.ts:33](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L33) +[sdk/src/storage.ts:36](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L36) --- ### storeMetadata -▸ **storeMetadata**(`metadata`): `Promise`<`string`\> +▸ **storeMetadata**(`metadata`, `config?`): `Promise`<`string`\> Stores Hypercert metadata using the hypercerts API. @@ -161,9 +164,10 @@ If the metadata is valid, it creates a new Blob from the metadata and stores it #### Parameters -| Name | Type | -| :--------- | :-------------------------------------------------------- | -| `metadata` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | +| Name | Type | Description | +| :--------- | :--------------------------------------------------------------- | :-------------------------------- | +| `metadata` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | - | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | #### Returns @@ -185,4 +189,4 @@ Will throw a `MalformedDataError` if the provided metadata is invalid. #### Defined in -[sdk/src/storage.ts:72](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L72) +[sdk/src/storage.ts:83](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L83) diff --git a/docs/docs/developer/api/sdk/classes/InvalidOrMissingError.md b/docs/docs/developer/api/sdk/classes/InvalidOrMissingError.md index 2458964f..a33dc36f 100644 --- a/docs/docs/developer/api/sdk/classes/InvalidOrMissingError.md +++ b/docs/docs/developer/api/sdk/classes/InvalidOrMissingError.md @@ -43,7 +43,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:83](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L83) +[sdk/src/types/errors.ts:83](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L83) ## Properties @@ -105,7 +105,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:76](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L76) +[sdk/src/types/errors.ts:76](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L76) --- diff --git a/docs/docs/developer/api/sdk/classes/MalformedDataError.md b/docs/docs/developer/api/sdk/classes/MalformedDataError.md index 1c31cae7..c5ba6c49 100644 --- a/docs/docs/developer/api/sdk/classes/MalformedDataError.md +++ b/docs/docs/developer/api/sdk/classes/MalformedDataError.md @@ -43,7 +43,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:155](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L155) +[sdk/src/types/errors.ts:155](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L155) ## Properties @@ -105,7 +105,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:148](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L148) +[sdk/src/types/errors.ts:148](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L148) --- diff --git a/docs/docs/developer/api/sdk/classes/MintingError.md b/docs/docs/developer/api/sdk/classes/MintingError.md index 63301554..582df458 100644 --- a/docs/docs/developer/api/sdk/classes/MintingError.md +++ b/docs/docs/developer/api/sdk/classes/MintingError.md @@ -43,7 +43,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:101](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L101) +[sdk/src/types/errors.ts:101](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L101) ## Properties @@ -105,7 +105,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:94](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L94) +[sdk/src/types/errors.ts:94](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L94) --- diff --git a/docs/docs/developer/api/sdk/classes/StorageError.md b/docs/docs/developer/api/sdk/classes/StorageError.md index d1fc11a4..9721d091 100644 --- a/docs/docs/developer/api/sdk/classes/StorageError.md +++ b/docs/docs/developer/api/sdk/classes/StorageError.md @@ -43,7 +43,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:119](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L119) +[sdk/src/types/errors.ts:119](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L119) ## Properties @@ -105,7 +105,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:112](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L112) +[sdk/src/types/errors.ts:112](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L112) --- diff --git a/docs/docs/developer/api/sdk/classes/UnknownSchemaError.md b/docs/docs/developer/api/sdk/classes/UnknownSchemaError.md index 753ed795..8d131dfa 100644 --- a/docs/docs/developer/api/sdk/classes/UnknownSchemaError.md +++ b/docs/docs/developer/api/sdk/classes/UnknownSchemaError.md @@ -44,7 +44,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:137](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L137) +[sdk/src/types/errors.ts:137](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L137) ## Properties @@ -108,7 +108,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:130](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L130) +[sdk/src/types/errors.ts:130](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L130) --- diff --git a/docs/docs/developer/api/sdk/classes/UnsupportedChainError.md b/docs/docs/developer/api/sdk/classes/UnsupportedChainError.md index f5f87b74..7fc91766 100644 --- a/docs/docs/developer/api/sdk/classes/UnsupportedChainError.md +++ b/docs/docs/developer/api/sdk/classes/UnsupportedChainError.md @@ -45,7 +45,7 @@ Error.constructor #### Defined in -[sdk/src/types/errors.ts:174](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L174) +[sdk/src/types/errors.ts:174](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L174) ## Properties @@ -109,7 +109,7 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L167) +[sdk/src/types/errors.ts:167](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L167) --- diff --git a/docs/docs/developer/api/sdk/index.md b/docs/docs/developer/api/sdk/index.md index e40c271b..9009c901 100644 --- a/docs/docs/developer/api/sdk/index.md +++ b/docs/docs/developer/api/sdk/index.md @@ -113,7 +113,8 @@ const { } = new HypercertClient({ chain: { id: 11155111 } }); ``` -The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata from IPFS. It is used by the HypercertClient to store metadata when creating new Hypercerts. +The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata from IPFS. It is +used by the HypercertClient to store metadata when creating new Hypercerts. ```js const { diff --git a/docs/docs/developer/api/sdk/interfaces/CustomError.md b/docs/docs/developer/api/sdk/interfaces/CustomError.md index 8acfe8fd..91fa7655 100644 --- a/docs/docs/developer/api/sdk/interfaces/CustomError.md +++ b/docs/docs/developer/api/sdk/interfaces/CustomError.md @@ -35,4 +35,4 @@ Additional error payload. #### Defined in -[sdk/src/types/errors.ts:10](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L10) +[sdk/src/types/errors.ts:10](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L10) diff --git a/docs/docs/developer/api/sdk/interfaces/DuplicateEvaluation.md b/docs/docs/developer/api/sdk/interfaces/DuplicateEvaluation.md index 41eb7831..5c608703 100644 --- a/docs/docs/developer/api/sdk/interfaces/DuplicateEvaluation.md +++ b/docs/docs/developer/api/sdk/interfaces/DuplicateEvaluation.md @@ -18,7 +18,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:22](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L22) +[sdk/src/types/evaluation.d.ts:22](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L22) --- @@ -28,7 +28,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L24) +[sdk/src/types/evaluation.d.ts:24](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L24) --- @@ -38,7 +38,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L23) +[sdk/src/types/evaluation.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L23) --- @@ -48,4 +48,4 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:21](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L21) +[sdk/src/types/evaluation.d.ts:21](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L21) diff --git a/docs/docs/developer/api/sdk/interfaces/EASEvaluation.md b/docs/docs/developer/api/sdk/interfaces/EASEvaluation.md index 825fdd95..43f03596 100644 --- a/docs/docs/developer/api/sdk/interfaces/EASEvaluation.md +++ b/docs/docs/developer/api/sdk/interfaces/EASEvaluation.md @@ -18,7 +18,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L41) +[sdk/src/types/evaluation.d.ts:41](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L41) --- @@ -28,7 +28,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:42](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L42) +[sdk/src/types/evaluation.d.ts:42](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L42) --- @@ -38,7 +38,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L40) +[sdk/src/types/evaluation.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L40) --- @@ -48,4 +48,4 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:43](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L43) +[sdk/src/types/evaluation.d.ts:43](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L43) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertClaimdata.md b/docs/docs/developer/api/sdk/interfaces/HypercertClaimdata.md index 6dbcb7d4..7cca1e03 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertClaimdata.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertClaimdata.md @@ -34,7 +34,7 @@ Contributors #### Defined in -[sdk/src/types/claimdata.d.ts:53](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L53) +[sdk/src/types/claimdata.d.ts:53](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/claimdata.d.ts#L53) --- @@ -59,7 +59,7 @@ Scopes of impact #### Defined in -[sdk/src/types/claimdata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L15) +[sdk/src/types/claimdata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/claimdata.d.ts#L15) --- @@ -83,7 +83,7 @@ Impact time period. The value is UNIX time in seconds from epoch. #### Defined in -[sdk/src/types/claimdata.d.ts:44](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L44) +[sdk/src/types/claimdata.d.ts:44](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/claimdata.d.ts#L44) --- @@ -108,7 +108,7 @@ Rights #### Defined in -[sdk/src/types/claimdata.d.ts:62](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L62) +[sdk/src/types/claimdata.d.ts:62](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/claimdata.d.ts#L62) --- @@ -133,7 +133,7 @@ Scopes of work #### Defined in -[sdk/src/types/claimdata.d.ts:25](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L25) +[sdk/src/types/claimdata.d.ts:25](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/claimdata.d.ts#L25) --- @@ -157,4 +157,4 @@ Work time period. The value is UNIX time in seconds from epoch. #### Defined in -[sdk/src/types/claimdata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L35) +[sdk/src/types/claimdata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/claimdata.d.ts#L35) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertClientInterface.md b/docs/docs/developer/api/sdk/interfaces/HypercertClientInterface.md index e7cdf71b..08e1a21a 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertClientInterface.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertClientInterface.md @@ -62,7 +62,7 @@ The order of the arrays must be equal. #### Defined in -[sdk/src/types/client.ts:255](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L255) +[sdk/src/types/client.ts:283](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L283) --- @@ -96,7 +96,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:189](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L189) +[sdk/src/types/client.ts:217](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L217) --- @@ -128,7 +128,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:230](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L230) +[sdk/src/types/client.ts:258](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L258) --- @@ -142,7 +142,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:136](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L136) +[sdk/src/types/client.ts:164](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L164) --- @@ -177,7 +177,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:203](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L203) +[sdk/src/types/client.ts:231](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L231) --- @@ -209,7 +209,7 @@ The addresses, graph name and graph url. #### Defined in -[sdk/src/types/client.ts:147](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L147) +[sdk/src/types/client.ts:175](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L175) --- @@ -241,7 +241,7 @@ A Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/types/client.ts:167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L167) +[sdk/src/types/client.ts:195](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L195) --- @@ -257,7 +257,7 @@ The indexer used by the client. #### Defined in -[sdk/src/types/client.ts:135](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L135) +[sdk/src/types/client.ts:163](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L163) --- @@ -289,7 +289,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:223](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L223) +[sdk/src/types/client.ts:251](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L251) --- @@ -323,7 +323,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:156](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L156) +[sdk/src/types/client.ts:184](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L184) --- @@ -357,7 +357,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:239](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L239) +[sdk/src/types/client.ts:267](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L267) --- @@ -373,7 +373,7 @@ Whether the client is in read-only mode. #### Defined in -[sdk/src/types/client.ts:131](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L131) +[sdk/src/types/client.ts:159](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L159) --- @@ -406,7 +406,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L216) +[sdk/src/types/client.ts:244](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L244) --- @@ -422,7 +422,7 @@ The storage layer used by the client. #### Defined in -[sdk/src/types/client.ts:133](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L133) +[sdk/src/types/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L161) --- @@ -456,4 +456,4 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:176](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L176) +[sdk/src/types/client.ts:204](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L204) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertClientMethods.md b/docs/docs/developer/api/sdk/interfaces/HypercertClientMethods.md index 59ee7d96..260622af 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertClientMethods.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertClientMethods.md @@ -52,7 +52,7 @@ The order of the arrays must be equal. #### Defined in -[sdk/src/types/client.ts:255](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L255) +[sdk/src/types/client.ts:283](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L283) --- @@ -82,7 +82,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:189](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L189) +[sdk/src/types/client.ts:217](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L217) --- @@ -110,7 +110,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:230](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L230) +[sdk/src/types/client.ts:258](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L258) --- @@ -141,7 +141,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:203](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L203) +[sdk/src/types/client.ts:231](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L231) --- @@ -169,7 +169,7 @@ The addresses, graph name and graph url. #### Defined in -[sdk/src/types/client.ts:147](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L147) +[sdk/src/types/client.ts:175](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L175) --- @@ -197,7 +197,7 @@ A Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/types/client.ts:167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L167) +[sdk/src/types/client.ts:195](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L195) --- @@ -225,7 +225,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:223](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L223) +[sdk/src/types/client.ts:251](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L251) --- @@ -255,7 +255,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:156](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L156) +[sdk/src/types/client.ts:184](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L184) --- @@ -285,7 +285,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:239](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L239) +[sdk/src/types/client.ts:267](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L267) --- @@ -314,7 +314,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L216) +[sdk/src/types/client.ts:244](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L244) --- @@ -344,4 +344,4 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:176](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L176) +[sdk/src/types/client.ts:204](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L204) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md b/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md index a03e6436..430c65c1 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md @@ -22,7 +22,7 @@ The state of the Hypercert client. #### Defined in -[sdk/src/types/client.ts:136](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L136) +[sdk/src/types/client.ts:164](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L164) --- @@ -34,7 +34,7 @@ The indexer used by the client. #### Defined in -[sdk/src/types/client.ts:135](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L135) +[sdk/src/types/client.ts:163](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L163) --- @@ -46,7 +46,7 @@ Whether the client is in read-only mode. #### Defined in -[sdk/src/types/client.ts:131](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L131) +[sdk/src/types/client.ts:159](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L159) --- @@ -58,4 +58,4 @@ The storage layer used by the client. #### Defined in -[sdk/src/types/client.ts:133](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L133) +[sdk/src/types/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L161) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertEvaluationSchema.md b/docs/docs/developer/api/sdk/interfaces/HypercertEvaluationSchema.md index eba16af0..49f13d2b 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertEvaluationSchema.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertEvaluationSchema.md @@ -20,7 +20,7 @@ Schema for evaluating Hypercerts across different sources and evaluation types #### Defined in -[sdk/src/types/evaluation.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L15) +[sdk/src/types/evaluation.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L15) --- @@ -30,7 +30,7 @@ Schema for evaluating Hypercerts across different sources and evaluation types #### Defined in -[sdk/src/types/evaluation.d.ts:16](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L16) +[sdk/src/types/evaluation.d.ts:16](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L16) --- @@ -40,4 +40,4 @@ Schema for evaluating Hypercerts across different sources and evaluation types #### Defined in -[sdk/src/types/evaluation.d.ts:17](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L17) +[sdk/src/types/evaluation.d.ts:17](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L17) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertIndexerInterface.md b/docs/docs/developer/api/sdk/interfaces/HypercertIndexerInterface.md index a08235b2..71fc12b6 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertIndexerInterface.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertIndexerInterface.md @@ -28,7 +28,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:20](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L20) +[sdk/src/types/indexer.ts:20](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L20) --- @@ -53,7 +53,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:19](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L19) +[sdk/src/types/indexer.ts:19](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L19) --- @@ -77,7 +77,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:21](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L21) +[sdk/src/types/indexer.ts:21](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L21) --- @@ -101,7 +101,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L24) +[sdk/src/types/indexer.ts:24](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L24) --- @@ -126,7 +126,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L23) +[sdk/src/types/indexer.ts:23](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L23) --- @@ -151,7 +151,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:22](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L22) +[sdk/src/types/indexer.ts:22](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L22) --- @@ -161,4 +161,4 @@ custom_edit_url: null #### Defined in -[sdk/src/types/indexer.ts:18](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L18) +[sdk/src/types/indexer.ts:18](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L18) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertMetadata.md b/docs/docs/developer/api/sdk/interfaces/HypercertMetadata.md index d65c96b0..d1f19951 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertMetadata.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertMetadata.md @@ -18,7 +18,7 @@ A CID pointer to the merke tree proof json on ipfs #### Defined in -[sdk/src/types/metadata.d.ts:39](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L39) +[sdk/src/types/metadata.d.ts:39](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L39) --- @@ -30,7 +30,7 @@ Describes the asset to which this token represents #### Defined in -[sdk/src/types/metadata.d.ts:19](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L19) +[sdk/src/types/metadata.d.ts:19](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L19) --- @@ -42,7 +42,7 @@ An url pointing to the external website of the project #### Defined in -[sdk/src/types/metadata.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L23) +[sdk/src/types/metadata.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L23) --- @@ -52,7 +52,7 @@ An url pointing to the external website of the project #### Defined in -[sdk/src/types/metadata.d.ts:45](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L45) +[sdk/src/types/metadata.d.ts:45](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L45) --- @@ -64,7 +64,7 @@ A URI pointing to a resource with mime type image/\* representing the asset to w #### Defined in -[sdk/src/types/metadata.d.ts:27](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L27) +[sdk/src/types/metadata.d.ts:27](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L27) --- @@ -76,7 +76,7 @@ Identifies the asset to which this token represents #### Defined in -[sdk/src/types/metadata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L15) +[sdk/src/types/metadata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L15) --- @@ -86,7 +86,7 @@ Identifies the asset to which this token represents #### Defined in -[sdk/src/types/metadata.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L40) +[sdk/src/types/metadata.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L40) --- @@ -98,7 +98,7 @@ Describes the asset to which this token represents #### Defined in -[sdk/src/types/metadata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L35) +[sdk/src/types/metadata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L35) --- @@ -110,4 +110,4 @@ The version of Hypercert schema used to describe this hypercert #### Defined in -[sdk/src/types/metadata.d.ts:31](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L31) +[sdk/src/types/metadata.d.ts:31](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/metadata.d.ts#L31) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertPointer.md b/docs/docs/developer/api/sdk/interfaces/HypercertPointer.md index 1e369342..627f67c6 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertPointer.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertPointer.md @@ -18,7 +18,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:28](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L28) +[sdk/src/types/evaluation.d.ts:28](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L28) --- @@ -28,7 +28,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:30](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L30) +[sdk/src/types/evaluation.d.ts:30](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L30) --- @@ -38,4 +38,4 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:29](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L29) +[sdk/src/types/evaluation.d.ts:29](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L29) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertStorageInterface.md b/docs/docs/developer/api/sdk/interfaces/HypercertStorageInterface.md index aaec7a73..31f846a0 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertStorageInterface.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertStorageInterface.md @@ -16,19 +16,20 @@ The interface for the Hypercert storage layer. ### getData -• **getData**: (`cidOrIpfsUri`: `string`) => `Promise`<`unknown`\> +• **getData**: (`cidOrIpfsUri`: `string`, `config?`: [`StorageConfigOverrides`](../modules.md#storageconfigoverrides)) => `Promise`<`unknown`\> #### Type declaration -▸ (`cidOrIpfsUri`): `Promise`<`unknown`\> +▸ (`cidOrIpfsUri`, `config?`): `Promise`<`unknown`\> Retrieves arbitrary data from IPFS. ##### Parameters -| Name | Type | Description | -| :------------- | :------- | :------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | +| Name | Type | Description | +| :------------- | :--------------------------------------------------------------- | :------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | ##### Returns @@ -38,25 +39,26 @@ A Promise that resolves to the retrieved data. #### Defined in -[sdk/src/types/client.ts:110](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L110) +[sdk/src/types/client.ts:138](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L138) --- ### getMetadata -• **getMetadata**: (`cidOrIpfsUri`: `string`) => `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> +• **getMetadata**: (`cidOrIpfsUri`: `string`, `config?`: [`StorageConfigOverrides`](../modules.md#storageconfigoverrides)) => `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> #### Type declaration -▸ (`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> +▸ (`cidOrIpfsUri`, `config?`): `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> Retrieves the metadata for a hypercerts. ##### Parameters -| Name | Type | Description | -| :------------- | :------- | :----------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | +| Name | Type | Description | +| :------------- | :--------------------------------------------------------------- | :----------------------------------------------- | +| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | ##### Returns @@ -66,26 +68,27 @@ A Promise that resolves to the retrieved metadata. #### Defined in -[sdk/src/types/client.ts:103](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L103) +[sdk/src/types/client.ts:130](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L130) --- ### storeAllowList -• **storeAllowList**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `totalUnits`: `bigint`) => `Promise`<`string`\> +• **storeAllowList**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `totalUnits`: `bigint`, `config?`: [`StorageConfigOverrides`](../modules.md#storageconfigoverrides)) => `Promise`<`string`\> #### Type declaration -▸ (`allowList`, `totalUnits`): `Promise`<`string`\> +▸ (`allowList`, `totalUnits`, `config?`): `Promise`<`string`\> Stores the allowlost for a hypercert. ##### Parameters -| Name | Type | Description | -| :----------- | :------------------------------------------------- | :--------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The metadata to store. | -| `totalUnits` | `bigint` | - | +| Name | Type | Description | +| :----------- | :--------------------------------------------------------------- | :-------------------------------- | +| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The metadata to store. | +| `totalUnits` | `bigint` | - | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | ##### Returns @@ -95,25 +98,26 @@ A Promise that resolves to the CID of the stored metadata. #### Defined in -[sdk/src/types/client.ts:89](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L89) +[sdk/src/types/client.ts:114](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L114) --- ### storeMetadata -• **storeMetadata**: (`metadata`: [`HypercertMetadata`](HypercertMetadata.md)) => `Promise`<`string`\> +• **storeMetadata**: (`metadata`: [`HypercertMetadata`](HypercertMetadata.md), `config?`: [`StorageConfigOverrides`](../modules.md#storageconfigoverrides)) => `Promise`<`string`\> #### Type declaration -▸ (`metadata`): `Promise`<`string`\> +▸ (`metadata`, `config?`): `Promise`<`string`\> Stores the metadata for a hypercert. ##### Parameters -| Name | Type | Description | -| :--------- | :------------------------------------------ | :--------------------- | -| `metadata` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata to store. | +| Name | Type | Description | +| :--------- | :--------------------------------------------------------------- | :-------------------------------- | +| `metadata` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata to store. | +| `config?` | [`StorageConfigOverrides`](../modules.md#storageconfigoverrides) | An optional configuration object. | ##### Returns @@ -123,4 +127,4 @@ A Promise that resolves to the CID of the stored metadata. #### Defined in -[sdk/src/types/client.ts:96](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L96) +[sdk/src/types/client.ts:122](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L122) diff --git a/docs/docs/developer/api/sdk/interfaces/IPFSEvaluation.md b/docs/docs/developer/api/sdk/interfaces/IPFSEvaluation.md index f3003492..a54bf4a9 100644 --- a/docs/docs/developer/api/sdk/interfaces/IPFSEvaluation.md +++ b/docs/docs/developer/api/sdk/interfaces/IPFSEvaluation.md @@ -18,7 +18,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:48](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L48) +[sdk/src/types/evaluation.d.ts:48](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L48) --- @@ -28,4 +28,4 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L47) +[sdk/src/types/evaluation.d.ts:47](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L47) diff --git a/docs/docs/developer/api/sdk/interfaces/SimpleTextEvaluation.md b/docs/docs/developer/api/sdk/interfaces/SimpleTextEvaluation.md index bb72a191..7d6bdd8b 100644 --- a/docs/docs/developer/api/sdk/interfaces/SimpleTextEvaluation.md +++ b/docs/docs/developer/api/sdk/interfaces/SimpleTextEvaluation.md @@ -18,7 +18,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L35) +[sdk/src/types/evaluation.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L35) --- @@ -28,7 +28,7 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:36](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L36) +[sdk/src/types/evaluation.d.ts:36](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L36) --- @@ -38,4 +38,4 @@ custom_edit_url: null #### Defined in -[sdk/src/types/evaluation.d.ts:34](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L34) +[sdk/src/types/evaluation.d.ts:34](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L34) diff --git a/docs/docs/developer/api/sdk/modules.md b/docs/docs/developer/api/sdk/modules.md index 3402343c..d6f88192 100644 --- a/docs/docs/developer/api/sdk/modules.md +++ b/docs/docs/developer/api/sdk/modules.md @@ -55,7 +55,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/types/hypercerts.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L24) +[sdk/src/types/hypercerts.ts:24](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L24) --- @@ -80,7 +80,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:195](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L195) +[sdk/src/indexer/gql/graphql.ts:195](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L195) --- @@ -97,7 +97,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1167) +[sdk/src/indexer/gql/graphql.ts:1156](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1156) --- @@ -119,7 +119,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:208](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L208) +[sdk/src/indexer/gql/graphql.ts:208](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L208) --- @@ -136,7 +136,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1194](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1194) +[sdk/src/indexer/gql/graphql.ts:1205](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1205) --- @@ -153,7 +153,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1187](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1187) +[sdk/src/indexer/gql/graphql.ts:1196](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1196) --- @@ -170,7 +170,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1177](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1177) +[sdk/src/indexer/gql/graphql.ts:1177](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1177) --- @@ -187,7 +187,39 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1151](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1151) +[sdk/src/indexer/gql/graphql.ts:1118](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1118) + +--- + +### ContractOverrides + +Ƭ **ContractOverrides**: `Object` + +Configuration options for the contract interactions. + +**`Param`** + +The value to send with the transaction (in wei). + +**`Param`** + +The gas price to use for the transaction (in wei). + +**`Param`** + +The gas limit to use for the transaction (in wei). + +#### Type declaration + +| Name | Type | +| :---------- | :------- | +| `gasLimit?` | `bigint` | +| `gasPrice?` | `bigint` | +| `value?` | `bigint` | + +#### Defined in + +[sdk/src/types/client.ts:26](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L26) --- @@ -197,7 +229,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/types/client.ts:17](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L17) +[sdk/src/types/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L41) --- @@ -218,7 +250,7 @@ Represents a deployment of a contract on a specific network. #### Defined in -[sdk/src/types/client.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L35) +[sdk/src/types/client.ts:59](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L59) --- @@ -234,7 +266,7 @@ Represents a deployment of a contract on a specific network. #### Defined in -[sdk/src/indexer/gql/gql.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L47) +[sdk/src/indexer/gql/gql.ts:53](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L53) --- @@ -248,7 +280,7 @@ and run json-schema-to-typescript to regenerate this file. #### Defined in -[sdk/src/types/evaluation.d.ts:8](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L8) +[sdk/src/types/evaluation.d.ts:8](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L8) --- @@ -258,7 +290,7 @@ and run json-schema-to-typescript to regenerate this file. #### Defined in -[sdk/src/types/evaluation.d.ts:9](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L9) +[sdk/src/types/evaluation.d.ts:9](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/evaluation.d.ts#L9) --- @@ -274,7 +306,7 @@ and run json-schema-to-typescript to regenerate this file. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:6](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L6) +[sdk/src/indexer/gql/fragment-masking.ts:5](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L5) --- @@ -286,7 +318,7 @@ Configuration options for the Hypercert client. #### Defined in -[sdk/src/types/client.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L47) +[sdk/src/types/client.ts:71](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L71) --- @@ -304,7 +336,7 @@ The props for the Hypercert client. #### Defined in -[sdk/src/types/client.ts:116](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L116) +[sdk/src/types/client.ts:144](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L144) --- @@ -320,7 +352,7 @@ The signer is required for submitting evaluations. #### Defined in -[sdk/src/types/client.ts:76](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L76) +[sdk/src/types/client.ts:100](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L100) --- @@ -346,7 +378,7 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/types/client.ts:67](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L67) +[sdk/src/types/client.ts:91](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L91) --- @@ -356,7 +388,7 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/types/errors.ts:195](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L195) +[sdk/src/types/errors.ts:195](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/errors.ts#L195) --- @@ -378,7 +410,7 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/types/indexer.ts:10](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L10) +[sdk/src/types/indexer.ts:10](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/indexer.ts#L10) --- @@ -395,7 +427,29 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/indexer/gql/graphql.ts:1160](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1160) +[sdk/src/indexer/gql/graphql.ts:1138](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1138) + +--- + +### StorageConfigOverrides + +Ƭ **StorageConfigOverrides**: `Object` + +Configuration options for the Hypercert storage layer. + +**`Param`** + +The timeout (im ms) for the HTTP request; for example for uploading metadata or fetching allowlists. + +#### Type declaration + +| Name | Type | +| :--------- | :------- | +| `timeout?` | `number` | + +#### Defined in + +[sdk/src/types/client.ts:36](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L36) --- @@ -403,27 +457,25 @@ nft.storage and web3.storage are no longer used Ƭ **SupportedChainIds**: `10` \| `42220` \| `11155111` +Enum to verify the supported chainIds + +**`Note`** + +10 = Optimism, 42220 = Celo, 11155111 = Sepolia + #### Defined in -[sdk/src/types/client.ts:10](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L10) +[sdk/src/types/client.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L15) --- ### SupportedOverrides -Ƭ **SupportedOverrides**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `gasLimit?` | `bigint` | -| `gasPrice?` | `bigint` | -| `value?` | `bigint` | +Ƭ **SupportedOverrides**: [`ContractOverrides`](modules.md#contractoverrides) & [`StorageConfigOverrides`](modules.md#storageconfigoverrides) #### Defined in -[sdk/src/types/client.ts:11](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L11) +[sdk/src/types/client.ts:17](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L17) --- @@ -433,9 +485,9 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L9) +[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L9) -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L15) +[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L15) ## Variables @@ -445,7 +497,7 @@ nft.storage and web3.storage are no longer used #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5782 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5782 --- @@ -455,7 +507,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6906 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6906 --- @@ -465,7 +517,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:1226 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:1226 --- @@ -475,7 +527,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:35 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:35 --- @@ -485,7 +537,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3071 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3071 --- @@ -495,7 +547,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:4585 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:4585 --- @@ -505,7 +557,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5110 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5110 --- @@ -515,7 +567,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5855 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5855 --- @@ -525,7 +577,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6380 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6380 --- @@ -535,7 +587,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5379 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5379 --- @@ -545,7 +597,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6649 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6649 --- @@ -555,7 +607,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3508 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3508 --- @@ -565,7 +617,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3 #### Defined in -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3974 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3974 --- @@ -585,9 +637,9 @@ Represents the possible transfer restrictions of a claim matching the hypercerts #### Defined in -[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L9) +[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L9) -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L15) +[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L15) --- @@ -601,7 +653,7 @@ Represents the possible transfer restrictions of a claim matching the hypercerts #### Defined in -[sdk/src/constants.ts:12](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/constants.ts#L12) +[sdk/src/constants.ts:12](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/constants.ts#L12) --- @@ -611,7 +663,7 @@ Represents the possible transfer restrictions of a claim matching the hypercerts #### Defined in -[sdk/src/constants.ts:18](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/constants.ts#L18) +[sdk/src/constants.ts:18](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/constants.ts#L18) --- @@ -630,7 +682,7 @@ Represents the possible transfer restrictions of a claim matching the hypercerts #### Defined in -[sdk/src/utils/logger.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/logger.ts#L24) +[sdk/src/utils/logger.ts:24](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/logger.ts#L24) ## Functions @@ -669,7 +721,7 @@ Formats input data to an object containing HypercertMetadata including appropria #### Defined in -[sdk/src/utils/formatter.ts:27](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/formatter.ts#L27) +[sdk/src/utils/formatter.ts:27](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/formatter.ts#L27) --- @@ -757,7 +809,7 @@ This method is a wrapper around basic viem utilties to parse ClaimStored(uint256 #### Defined in -[sdk/src/utils/txParser.ts:26](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/txParser.ts#L26) +[sdk/src/utils/txParser.ts:26](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/txParser.ts#L26) --- @@ -765,17 +817,17 @@ This method is a wrapper around basic viem utilties to parse ClaimStored(uint256 ▸ **getFromIPFS**(`cidOrIpfsUri`, `timeout?`): `Promise`<`unknown`\> -Fetches data from IPFS using either the NFT Storage gateway or the Web3Up gateway. +Fetches data from IPFS using either the DWeb IPFS, NFT Storage, or the Web3Up gateway. -This function attempts to fetch data from the NFT Storage gateway first. If the request times out, it then tries to fetch the data from the Web3Up gateway. -If the data cannot be fetched from either gateway, it throws a `StorageError`. +This function attempts to fetch data from all gateways at the same time and returns on the first on to resolve. +If the data cannot be fetched from any gateway, it throws a `StorageError`. #### Parameters -| Name | Type | Default value | Description | -| :------------- | :------- | :------------ | :---------------------------------------------------------------------- | -| `cidOrIpfsUri` | `string` | `undefined` | The CID or IPFS URI of the data to fetch. | -| `timeout?` | `number` | `10000` | The timeout for the fetch request in milliseconds. Defaults to 10000ms. | +| Name | Type | Default value | Description | +| :------------- | :------- | :------------ | :---------------------------------------- | +| `cidOrIpfsUri` | `string` | `undefined` | The CID or IPFS URI of the data to fetch. | +| `timeout` | `number` | `10000` | - | #### Returns @@ -791,7 +843,7 @@ Will throw a `StoragjeError` if the data cannot be fetched from either gateway. #### Defined in -[sdk/src/utils/fetchers.ts:17](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/fetchers.ts#L17) +[sdk/src/utils/fetchers.ts:17](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/fetchers.ts#L17) --- @@ -826,7 +878,7 @@ Will throw an error if the Merkle tree cannot be fetched. #### Defined in -[sdk/src/utils/allowlist.ts:43](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/allowlist.ts#L43) +[sdk/src/utils/allowlist.ts:43](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/allowlist.ts#L43) --- @@ -865,7 +917,7 @@ Please regenerate the types. #### Defined in -[sdk/src/indexer/gql/gql.ts:32](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L32) +[sdk/src/indexer/gql/gql.ts:34](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L34) ▸ **graphql**(`source`): typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"``] @@ -883,7 +935,7 @@ typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: #### Defined in -[sdk/src/indexer/gql/gql.ts:37](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L37) +[sdk/src/indexer/gql/gql.ts:39](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L39) ▸ **graphql**(`source`): typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"``] @@ -901,7 +953,7 @@ typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirec #### Defined in -[sdk/src/indexer/gql/gql.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L41) +[sdk/src/indexer/gql/gql.ts:45](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L45) --- @@ -921,7 +973,7 @@ typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirec #### Defined in -[sdk/src/utils/errors.ts:39](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/errors.ts#L39) +[sdk/src/utils/errors.ts:39](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/errors.ts#L39) --- @@ -943,7 +995,7 @@ Method to catch errors and log them #### Defined in -[sdk/src/utils/errors.ts:22](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/errors.ts#L22) +[sdk/src/utils/errors.ts:22](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/errors.ts#L22) --- @@ -972,7 +1024,7 @@ data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:51](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L51) +[sdk/src/indexer/gql/fragment-masking.ts:51](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L51) --- @@ -1000,7 +1052,7 @@ data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:45](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L45) +[sdk/src/indexer/gql/fragment-masking.ts:45](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L45) --- @@ -1020,7 +1072,7 @@ data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never #### Defined in -[sdk/src/utils/allowlist.ts:6](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/allowlist.ts#L6) +[sdk/src/utils/allowlist.ts:6](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/allowlist.ts#L6) --- @@ -1110,21 +1162,22 @@ An ethers.js `Provider` instance, or `undefined` if no chain is found in the `Pu #### Defined in -[sdk/src/utils/adapters.ts:19](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/adapters.ts#L19) +[sdk/src/utils/adapters.ts:19](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/adapters.ts#L19) --- ### uploadAllowlist -▸ **uploadAllowlist**(`req`): `Promise`<`ResponseData`<\{ `cid`: `string` }\>\> +▸ **uploadAllowlist**(`req`, `config?`): `Promise`<`ResponseData`<\{ `cid`: `string` }\>\> Uploads an allowlist to the API. #### Parameters -| Name | Type | Description | -| :---- | :--------------------- | :----------------------------------------------------------------------------------------------------------------- | -| `req` | `AllowListPostRequest` | The request body containing the allowlist and total units. The allowList should be a stringified Merkle tree dump. | +| Name | Type | Description | +| :-------- | :------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------- | +| `req` | `AllowListPostRequest` | The request body containing the allowlist and total units. The allowList should be a stringified Merkle tree dump. | +| `config?` | [`StorageConfigOverrides`](modules.md#storageconfigoverrides) | An optional configuration object. | #### Returns @@ -1134,21 +1187,22 @@ The response data from the API. #### Defined in -[sdk/src/utils/apis.ts:49](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/apis.ts#L49) +[sdk/src/utils/apis.ts:52](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/apis.ts#L52) --- ### uploadMetadata -▸ **uploadMetadata**(`metadata`): `Promise`<`ResponseData`<\{ `cid`: `string` }\>\> +▸ **uploadMetadata**(`metadata`, `config?`): `Promise`<`ResponseData`<\{ `cid`: `string` }\>\> Uploads metadata to the API. #### Parameters -| Name | Type | Description | -| :--------- | :----------------------------------------------------- | :--------------------------------------------------------------------------------------- | -| `metadata` | [`HypercertMetadata`](interfaces/HypercertMetadata.md) | The metadata to upload. Should be an object that conforms to the HypercertMetadata type. | +| Name | Type | Description | +| :--------- | :------------------------------------------------------------ | :--------------------------------------------------------------------------------------- | +| `metadata` | [`HypercertMetadata`](interfaces/HypercertMetadata.md) | The metadata to upload. Should be an object that conforms to the HypercertMetadata type. | +| `config?` | [`StorageConfigOverrides`](modules.md#storageconfigoverrides) | An optional configuration object. | #### Returns @@ -1158,7 +1212,7 @@ The response data from the API. #### Defined in -[sdk/src/utils/apis.ts:33](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/apis.ts#L33) +[sdk/src/utils/apis.ts:34](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/apis.ts#L34) --- @@ -1185,7 +1239,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:18](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L18) +[sdk/src/indexer/gql/fragment-masking.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L15) ▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` \| `null` \| `undefined` @@ -1208,7 +1262,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L23) +[sdk/src/indexer/gql/fragment-masking.ts:20](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L20) ▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> @@ -1231,7 +1285,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:28](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L28) +[sdk/src/indexer/gql/fragment-masking.ts:25](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L25) ▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> \| `null` \| `undefined` @@ -1254,7 +1308,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:33](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L33) +[sdk/src/indexer/gql/fragment-masking.ts:30](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L30) --- @@ -1282,7 +1336,7 @@ An object that includes a validity flag and any errors that occurred during vali #### Defined in -[sdk/src/validator/index.ts:108](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L108) +[sdk/src/validator/index.ts:108](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L108) --- @@ -1310,7 +1364,7 @@ An object that includes a validity flag and any errors that occurred during vali #### Defined in -[sdk/src/validator/index.ts:77](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L77) +[sdk/src/validator/index.ts:77](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L77) --- @@ -1338,7 +1392,7 @@ An object that includes a validity flag and any errors that occurred during vali #### Defined in -[sdk/src/validator/index.ts:143](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L143) +[sdk/src/validator/index.ts:143](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L143) --- @@ -1366,7 +1420,7 @@ An object that includes a validity flag and any errors that occurred during vali #### Defined in -[sdk/src/validator/index.ts:46](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L46) +[sdk/src/validator/index.ts:46](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L46) --- @@ -1394,7 +1448,7 @@ An object that includes a validity flag and any errors that occurred during vali #### Defined in -[sdk/src/validator/index.ts:173](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L173) +[sdk/src/validator/index.ts:173](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L173) --- @@ -1426,7 +1480,7 @@ Will throw a `MintingError` if the signer address is invalid or if the Merkle pr #### Defined in -[sdk/src/validator/index.ts:205](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L205) +[sdk/src/validator/index.ts:205](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L205) --- @@ -1458,7 +1512,7 @@ Will throw a `MintingError` if the lengths of the input arrays are not equal or #### Defined in -[sdk/src/validator/index.ts:228](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L228) +[sdk/src/validator/index.ts:228](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/validator/index.ts#L228) --- @@ -1517,4 +1571,4 @@ An ethers.js `Signer` instance, or `undefined` if no chain is found in the `Wall #### Defined in -[sdk/src/utils/adapters.ts:51](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/adapters.ts#L51) +[sdk/src/utils/adapters.ts:51](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/adapters.ts#L51) diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 6d4c8bec..810246db 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -54,13 +54,6 @@ export default async function createConfigAsync() { { blog: false, // Optional: disable the blog plugin docs: { - lastVersion: "current", //https://docusaurus.io/docs/versioning - versions: { - current: { - label: "1.4.1", - path: "1.4.1", - }, - }, routeBasePath: "/", // Serve the docs at the site's root sidebarPath: "./sidebars.js", // Please change this to your repo. diff --git a/docs/package.json b/docs/package.json index d6275d94..27df3a67 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/docs", - "version": "1.0.0-alpha.2", + "version": "1.1.0", "license": "Apache-2.0", "private": false, "scripts": { diff --git a/docs/src/components/homepage/homeNavBoxes.js b/docs/src/components/homepage/homeNavBoxes.js index 5f99df91..dab34160 100644 --- a/docs/src/components/homepage/homeNavBoxes.js +++ b/docs/src/components/homepage/homeNavBoxes.js @@ -7,26 +7,26 @@ const FeatureList = [ title: "Introduction", icon: "img/icons/hypercerts_logo_green.png", items: [ - { url: "1.4.1/intro", text: "What are hypercerts?" }, - { url: "1.4.1/about", text: "About the Hypercerts Foundation" }, - { url: "1.4.1/faq", text: "Frequently Asked Questions" }, - { url: "1.4.1/further-resources", text: "Further Resources" }, + { url: "intro", text: "What are hypercerts?" }, + { url: "about", text: "About the Hypercerts Foundation" }, + { url: "faq", text: "Frequently Asked Questions" }, + { url: "further-resources", text: "Further Resources" }, ], }, { title: "Vision & Whitepaper", icon: "img/icons/hypercerts_logo_beige.png", items: [ - { url: "1.4.1/whitepaper/whitepaper-intro", text: "Introduction" }, + { url: "whitepaper/whitepaper-intro", text: "Introduction" }, { url: "whitepaper/ifs", text: "Impact Funding Systems (IFSs)" }, { - url: "1.4.1/whitepaper/hypercerts-intro", + url: "whitepaper/hypercerts-intro", text: "Hypercerts: a New Primitive", }, - { url: "1.4.1/whitepaper/impact-space", text: "A Consistent Impact Space" }, - { url: "1.4.1/whitepaper/evaluations", text: "Open Impact Evaluations" }, + { url: "whitepaper/impact-space", text: "A Consistent Impact Space" }, + { url: "whitepaper/evaluations", text: "Open Impact Evaluations" }, { - url: "1.4.1/whitepaper/retrospective-funding", + url: "whitepaper/retrospective-funding", text: "Retrospective Impact Funding", }, ], @@ -35,10 +35,10 @@ const FeatureList = [ title: "Minting Guide", icon: "img/icons/hypercerts_logo_red.png", items: [ - { url: "1.4.1/minting-guide/minting-guide-start", text: "Getting Started" }, - { url: "1.4.1/minting-guide/step-by-step", text: "Step-by-step Instructions" }, + { url: "minting-guide/minting-guide-start", text: "Getting Started" }, + { url: "minting-guide/step-by-step", text: "Step-by-step Instructions" }, { - url: "1.4.1/minting-guide/gitcoin-round", + url: "minting-guide/gitcoin-round", text: "Gitcoin Alpha Round Instructions", }, ], @@ -47,10 +47,10 @@ const FeatureList = [ title: "Developers", icon: "img/icons/hypercerts_logo_yellow.png", items: [ - { url: "1.4.1/developer", text: "Developer docs" }, - { url: "1.4.1/implementation/token-standard", text: "Token Standard" }, - { url: "1.4.1/implementation/metadata", text: "Metadata Standard" }, - { url: "1.4.1/implementation/glossary", text: "Glossary" }, + { url: "developer", text: "Developer docs" }, + { url: "implementation/token-standard", text: "Token Standard" }, + { url: "implementation/metadata", text: "Metadata Standard" }, + { url: "implementation/glossary", text: "Glossary" }, ], }, ]; diff --git a/docs/versioned_docs/static/.nojekyll b/docs/versioned_docs/static/.nojekyll deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/versioned_docs/static/img/creating.png b/docs/versioned_docs/static/img/creating.png deleted file mode 100644 index 17807cd3..00000000 Binary files a/docs/versioned_docs/static/img/creating.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/docusaurus.png b/docs/versioned_docs/static/img/docusaurus.png deleted file mode 100644 index f458149e..00000000 Binary files a/docs/versioned_docs/static/img/docusaurus.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/favicon.ico b/docs/versioned_docs/static/img/favicon.ico deleted file mode 100644 index 576d606a..00000000 Binary files a/docs/versioned_docs/static/img/favicon.ico and /dev/null differ diff --git a/docs/versioned_docs/static/img/hypercert_data_layer.png b/docs/versioned_docs/static/img/hypercert_data_layer.png deleted file mode 100644 index 6978885f..00000000 Binary files a/docs/versioned_docs/static/img/hypercert_data_layer.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/hypercert_evaluations.png b/docs/versioned_docs/static/img/hypercert_evaluations.png deleted file mode 100644 index fe824d5f..00000000 Binary files a/docs/versioned_docs/static/img/hypercert_evaluations.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/hypercert_example.png b/docs/versioned_docs/static/img/hypercert_example.png deleted file mode 100644 index be9b9155..00000000 Binary files a/docs/versioned_docs/static/img/hypercert_example.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/hypercert_id.png b/docs/versioned_docs/static/img/hypercert_id.png deleted file mode 100644 index 05b82081..00000000 Binary files a/docs/versioned_docs/static/img/hypercert_id.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/hypercert_tech_report.png b/docs/versioned_docs/static/img/hypercert_tech_report.png deleted file mode 100644 index 67b9a1a6..00000000 Binary files a/docs/versioned_docs/static/img/hypercert_tech_report.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/icons/beige.svg b/docs/versioned_docs/static/img/icons/beige.svg deleted file mode 100644 index 65376c72..00000000 --- a/docs/versioned_docs/static/img/icons/beige.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/docs/versioned_docs/static/img/icons/github-mark.png b/docs/versioned_docs/static/img/icons/github-mark.png deleted file mode 100644 index 6cb3b705..00000000 Binary files a/docs/versioned_docs/static/img/icons/github-mark.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/icons/green.svg b/docs/versioned_docs/static/img/icons/green.svg deleted file mode 100644 index d23f2ee0..00000000 --- a/docs/versioned_docs/static/img/icons/green.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/docs/versioned_docs/static/img/icons/hypercerts_logo_beige.png b/docs/versioned_docs/static/img/icons/hypercerts_logo_beige.png deleted file mode 100644 index eac7eefb..00000000 Binary files a/docs/versioned_docs/static/img/icons/hypercerts_logo_beige.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/icons/hypercerts_logo_green.png b/docs/versioned_docs/static/img/icons/hypercerts_logo_green.png deleted file mode 100644 index 3f114385..00000000 Binary files a/docs/versioned_docs/static/img/icons/hypercerts_logo_green.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/icons/hypercerts_logo_red.png b/docs/versioned_docs/static/img/icons/hypercerts_logo_red.png deleted file mode 100644 index caa11af9..00000000 Binary files a/docs/versioned_docs/static/img/icons/hypercerts_logo_red.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/icons/hypercerts_logo_yellow.png b/docs/versioned_docs/static/img/icons/hypercerts_logo_yellow.png deleted file mode 100644 index c83726fb..00000000 Binary files a/docs/versioned_docs/static/img/icons/hypercerts_logo_yellow.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/icons/red.svg b/docs/versioned_docs/static/img/icons/red.svg deleted file mode 100644 index 0d2adb64..00000000 --- a/docs/versioned_docs/static/img/icons/red.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/docs/versioned_docs/static/img/icons/yellow.svg b/docs/versioned_docs/static/img/icons/yellow.svg deleted file mode 100644 index cbe666e7..00000000 --- a/docs/versioned_docs/static/img/icons/yellow.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/docs/versioned_docs/static/img/increasing_rewards.png b/docs/versioned_docs/static/img/increasing_rewards.png deleted file mode 100644 index 6d6e6ca0..00000000 Binary files a/docs/versioned_docs/static/img/increasing_rewards.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/logo.svg b/docs/versioned_docs/static/img/logo.svg deleted file mode 100644 index 9db6d0d0..00000000 --- a/docs/versioned_docs/static/img/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/versioned_docs/static/img/merging.png b/docs/versioned_docs/static/img/merging.png deleted file mode 100644 index 4ae1679f..00000000 Binary files a/docs/versioned_docs/static/img/merging.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/retrospective_funding.png b/docs/versioned_docs/static/img/retrospective_funding.png deleted file mode 100644 index 2a634e6f..00000000 Binary files a/docs/versioned_docs/static/img/retrospective_funding.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/splitting.png b/docs/versioned_docs/static/img/splitting.png deleted file mode 100644 index 19c15a31..00000000 Binary files a/docs/versioned_docs/static/img/splitting.png and /dev/null differ diff --git a/docs/versioned_docs/static/img/undraw_docusaurus_mountain.svg b/docs/versioned_docs/static/img/undraw_docusaurus_mountain.svg deleted file mode 100644 index af961c49..00000000 --- a/docs/versioned_docs/static/img/undraw_docusaurus_mountain.svg +++ /dev/null @@ -1,171 +0,0 @@ - - Easy to Use - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/versioned_docs/static/img/undraw_docusaurus_react.svg b/docs/versioned_docs/static/img/undraw_docusaurus_react.svg deleted file mode 100644 index 94b5cf08..00000000 --- a/docs/versioned_docs/static/img/undraw_docusaurus_react.svg +++ /dev/null @@ -1,170 +0,0 @@ - - Powered by React - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/versioned_docs/static/img/undraw_docusaurus_tree.svg b/docs/versioned_docs/static/img/undraw_docusaurus_tree.svg deleted file mode 100644 index d9161d33..00000000 --- a/docs/versioned_docs/static/img/undraw_docusaurus_tree.svg +++ /dev/null @@ -1,40 +0,0 @@ - - Focus on What Matters - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/versioned_docs/static/pdf/hypercerts_Tech_Report_draft.pdf b/docs/versioned_docs/static/pdf/hypercerts_Tech_Report_draft.pdf deleted file mode 100644 index 3f5f6fc3..00000000 Binary files a/docs/versioned_docs/static/pdf/hypercerts_Tech_Report_draft.pdf and /dev/null differ diff --git a/docs/versioned_docs/static/pdf/hypercerts_slides_FtC202203.pdf b/docs/versioned_docs/static/pdf/hypercerts_slides_FtC202203.pdf deleted file mode 100644 index 0ea059ce..00000000 Binary files a/docs/versioned_docs/static/pdf/hypercerts_slides_FtC202203.pdf and /dev/null differ diff --git a/docs/versioned_docs/static/pdf/hypercerts_slides_FtC202206.pdf b/docs/versioned_docs/static/pdf/hypercerts_slides_FtC202206.pdf deleted file mode 100644 index 821f8c44..00000000 Binary files a/docs/versioned_docs/static/pdf/hypercerts_slides_FtC202206.pdf and /dev/null differ diff --git a/docs/versioned_docs/static/pdf/hypercerts_whitepaper_v0.pdf b/docs/versioned_docs/static/pdf/hypercerts_whitepaper_v0.pdf deleted file mode 100644 index 930fbbbd..00000000 Binary files a/docs/versioned_docs/static/pdf/hypercerts_whitepaper_v0.pdf and /dev/null differ diff --git a/docs/versioned_docs/version-1.0.0/about.md b/docs/versioned_docs/version-1.0.0/about.md deleted file mode 100644 index e2d4eb79..00000000 --- a/docs/versioned_docs/version-1.0.0/about.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: The Hypercerts Foundation -id: about ---- - -# The Hypercerts Foundation - -### Mission - -The mission of the Hypercerts Foundation is to advance the development and adoption of open-source protocols for funding and rewarding positive impact. - -### Organization - -The Hypercerts Foundation is a fully independent organisation working closely with stakeholders in the open source, scientific research, and cryptography communities to develop and promote additional protocols that are decentralized, secure, and transparent. The Foundation will also provide support and resources to help drive the wider adoption of these protocols. - -### History - -Research on hypercerts was first presented to the public by David A. Dalrymple at the conference series Funding the Commons in March 2022. However, the concept of “impact certificates” has been a recurring theme at conferences and in online discussion forums since at least 2014. In late 2022, a small team of research scientists, developers, and practitioners began implementing hypercerts as a set of Ethereum-based smart contracts that could be used to assert and fund impact claims. The Hypercerts Foundation will now serve as the long-term home for this work. - -The new foundation is supported in part by Protocol Labs and is part of the broader Protocol Labs Network of hundreds of companies and organizations. The Foundation will complement Protocol Labs Network’s mission of enabling a more secure, open, and accessible internet. The Hypercerts Foundation, however, is fully independent and will focus on protocol development and cultivating a community of developers and impact entrepreneurs well beyond the Protocol Labs Network. - -### Further links - -Read the full [announcement of the Hypercerts Foundation](https://hypercerts.notion.site/Introducing-the-Hypercerts-Foundation-d956203fe0fc4792980da138015e770a). diff --git a/docs/versioned_docs/version-1.0.0/developer/allowlists.md b/docs/versioned_docs/version-1.0.0/developer/allowlists.md deleted file mode 100644 index 61200236..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/allowlists.md +++ /dev/null @@ -1,101 +0,0 @@ -# Allowlists - -Allowlists are an efficient way to enable distribution of hypercert fractions amongst a group. -First, the creator will create the hypercert with the metadata and an immutable allowlist. -With the `claimId`, every account specified in the allowlist can later mint their fraction token from that allowlist. - -## Create an allowlist - -First specify an allowlist, mapping addresses to the number of units they should receive. - -```js -import { - TransferRestrictions, - formatHypercertData, - Allowlist, -} from "@hypercerts-org/sdk"; - -const allowlist: Allowlist = [ - { address: "0x123....asfcnaes", units: 100n }, - { address: "0xabc....w2dwqwef", units: 100n }, -]; -``` - -Then, call `createAllowlist` with the metadata and allowlist. - -```js -const { metadata } = formatHypercertData(...); -const totalUnits = 10000n; -const transferRestrictions = TransferRestrictions.FromCreatorOnly - -const txHash = await hypercerts.createAllowlist({ - allowList, - metaData, - totalUnits, - transferRestrictions: TransferRestrictions.FromCreatorOnly, -}); -``` - -> **note** We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree generation and data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree) - -It first checks if the client is writable and if the operator is a signer. If the operator is not a signer, it throws an `InvalidOrMissingError`. - -Next, it validates the allowlist and metadata by calling the `validateAllowlist` and `validateMetaData` functions respectively. If either the allowlist or metadata is invalid, it throws a `MalformedDataError`. - -Once the allowlist and metadata are validated, the method creates a Merkle tree from the allowlist and stores it on IPFS. It then stores the metadata on IPFS as well. - -Finally, the method invokes the `createAllowlist` function on the contract with the signer's `address`, the total number of `units`, the Merkle tree `root`, the metadata `CID`, and the `transfer restrictions`. If the method is called with `overrides`, it passes them to the createAllowlist function. - -## Claiming a fraction token - -Users can claim their fraction tokens for many hypercerts at once using `mintClaimFractionFromAllowlist`. To determine the input the following information is required: - -| Variable | Type | Source | -| -------- | ------ | ------------- | ----------- | -| claimId | bigint | Hypercert ID | -| units | bigint | Allowlist | -| proof | `(Hex | ByteArray)[]` | Merkle tree | - -We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree). You can get the `proof` and `units` by traversing the merkle tree. - -Then, call `mintClaimFractionFromAllowlist` with the required data. The contracts will also verify the proofs. However, when providing the `root` in the function input, the proofs will be verified before a transaction is submitted. - -```js -import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; - -const claimId = "0x822f17a9a5eecfd...85254363386255337"; -const address = "0xc0ffee254729296a45a3885639AC7E10F9d54979"; - -const { indexer, storage } = hypercertsClient; -const claimById = await indexer.claimById(claimId); -const { uri, tokenID: _id } = claimById.claim; -const metadata = await storage.getMetadata(uri || ""); -const treeResponse = await storage.getData(metadata.allowList); -const tree = StandardMerkleTree.load(JSON.parse(treeResponse)); - -let args; -// Find the proof in the allowlist -for (const [leaf, value] of tree.entries()) { - if (value[0] === address) { - args = { - proofs: tree.getProof(leaf), - units: Number(value[1]), - claimId: _id, - }; - break; - } -} - -// Mint fraction token -const tx = await hypercerts.mintClaimFractionFromAllowlist({ - ...args, -}); -``` - -Let's see what happens under the hood: - -First, the method checks that the client is not `read only` and that the operator is a signer. If not, it throws an `InvalidOrMissingError`. - -Next, the method verifies the Merkle `proof` using the OpenZeppelin Merkle tree library. If a `root` is provided, the method uses it to verify the proof. If the proof is invalid, it throws an error. - -Finally, the method calls the `mintClaimFromAllowlist` function on the contract with the signer `address`, Merkle `proof`, `claim ID`, and number of `units` as parameters. If overrides are provided, the method uses them to send the transaction. Otherwise, it sends the transaction without overrides. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md deleted file mode 100644 index 4cb96bfc..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md +++ /dev/null @@ -1,46 +0,0 @@ -# BatchOrderTypehashRegistry - -_LooksRare protocol team (👀,💎)_ - -> BatchOrderTypehashRegistry - -The contract generates the batch order hash that is used to compute the digest for signature verification. - -## Methods - -### hashBatchOrder - -```solidity -function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) -``` - -This function returns the hash of the concatenation of batch order type hash and merkle root. - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ------------------- | -| root | bytes32 | Merkle root | -| proofLength | uint256 | Merkle proof length | - -#### Returns - -| Name | Type | Description | -| -------------- | ------- | -------------------- | -| batchOrderHash | bytes32 | The batch order hash | - -## Errors - -### MerkleProofTooLarge - -```solidity -error MerkleProofTooLarge(uint256 length) -``` - -It is returned if the length of the merkle proof provided is greater than tolerated. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ------------ | -| length | uint256 | Proof length | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md deleted file mode 100644 index a32aef65..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md +++ /dev/null @@ -1,76 +0,0 @@ -# CreatorFeeManagerWithRebates - -_LooksRare protocol team (👀,💎)_ - -> CreatorFeeManagerWithRebates - -This contract returns the creator fee address and the creator rebate amount. - -## Methods - -### STANDARD_ROYALTY_FEE_BP - -```solidity -function STANDARD_ROYALTY_FEE_BP() external view returns (uint256) -``` - -Standard royalty fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### royaltyFeeRegistry - -```solidity -function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) -``` - -Royalty fee registry interface. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | contract IRoyaltyFeeRegistry | undefined | - -### viewCreatorFeeInfo - -```solidity -function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) -``` - -This function returns the creator address and calculates the creator fee amount. - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | -| itemIds | uint256[] | Array of item ids | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ------------------ | -| creator | address | Creator address | -| creatorFeeAmount | uint256 | Creator fee amount | - -## Errors - -### BundleEIP2981NotAllowed - -```solidity -error BundleEIP2981NotAllowed(address collection) -``` - -It is returned if the bundle contains multiple itemIds with different creator fee structure. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md deleted file mode 100644 index 41cab900..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md +++ /dev/null @@ -1,64 +0,0 @@ -# CreatorFeeManagerWithRoyalties - -_LooksRare protocol team (👀,💎)_ - -> CreatorFeeManagerWithRoyalties - -This contract returns the creator fee address and the creator fee amount. - -## Methods - -### royaltyFeeRegistry - -```solidity -function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) -``` - -Royalty fee registry interface. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | contract IRoyaltyFeeRegistry | undefined | - -### viewCreatorFeeInfo - -```solidity -function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) -``` - -This function returns the creator address and calculates the creator fee amount. - -_There are two on-chain sources for the royalty fee to distribute. 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined for all items of a collection. 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection. The on-chain logic looks up the registry first. If it does not find anything, it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId. For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient differ among the itemIds part of the bundle, the trade reverts. This contract DOES NOT enforce any restriction for extremely high creator fee, nor verifies the creator fee fetched is inferior to the total price. If any contract relies on it to build an on-chain royalty logic, it should implement protection against: (1) high royalties (2) potential unexpected royalty changes that can occur after the creation of the order._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | -| itemIds | uint256[] | Array of item ids | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ------------------ | -| creator | address | Creator address | -| creatorFeeAmount | uint256 | Creator fee amount | - -## Errors - -### BundleEIP2981NotAllowed - -```solidity -error BundleEIP2981NotAllowed(address collection) -``` - -It is returned if the bundle contains multiple itemIds with different creator fee structure. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CurrencyManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CurrencyManager.md deleted file mode 100644 index 9ff1c0fc..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/CurrencyManager.md +++ /dev/null @@ -1,250 +0,0 @@ -# CurrencyManager - -_LooksRare protocol team (👀,💎)_ - -> CurrencyManager - -This contract manages the list of valid fungible currencies. - -## Methods - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -## Errors - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/ExecutionManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/ExecutionManager.md deleted file mode 100644 index 83eefc37..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/ExecutionManager.md +++ /dev/null @@ -1,751 +0,0 @@ -# ExecutionManager - -_LooksRare protocol team (👀,💎); bitbeckers;_ - -> ExecutionManager - -This contract handles the execution and resolution of transactions. A transaction is executed on-chain when an off-chain maker order is matched by on-chain taker order of a different kind. For instance, a taker ask is executed against a maker bid (or a taker bid against a maker ask). - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -Creator fee manager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint16) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | uint16 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### protocolFeeRecipient - -```solidity -function protocolFeeRecipient() external view returns (address) -``` - -Protocol fee recipient. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### updateCreatorFeeManager - -```solidity -function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable -``` - -This function allows the owner to update the creator fee manager address. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ---------------------------------- | -| newCreatorFeeManager | address | Address of the creator fee manager | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateMaxCreatorFeeBp - -```solidity -function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable -``` - -This function allows the owner to update the maximum creator fee (in basis point). - -_The maximum value that can be set is 25%. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------ | ---------------------------------------- | -| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | - -### updateProtocolFeeRecipient - -```solidity -function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable -``` - -This function allows the owner to update the protocol fee recipient. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ---------------------------------- | -| newProtocolFeeRecipient | address | New protocol fee recipient address | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| creatorFeeManager | address | undefined | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| maxCreatorFeeBp | uint256 | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| protocolFeeRecipient | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -## Errors - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/InheritedStrategy.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/InheritedStrategy.md deleted file mode 100644 index 022cce57..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/InheritedStrategy.md +++ /dev/null @@ -1,9 +0,0 @@ -# InheritedStrategy - -_LooksRare protocol team (👀,💎)_ - -> InheritedStrategy - -This contract handles the verification of parameters for standard transactions. It does not verify the taker struct's itemIds and amounts array as well as minPrice (taker ask) / maxPrice (taker bid) because before the taker executes the transaction and the maker itemIds/amounts/price should have already been confirmed off-chain. - -_A standard transaction (bid or ask) is mapped to strategyId = 0._ diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/LooksRareProtocol.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/LooksRareProtocol.md deleted file mode 100644 index cc542c7e..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/LooksRareProtocol.md +++ /dev/null @@ -1,1157 +0,0 @@ -# LooksRareProtocol - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> LooksRareProtocol - -This contract is the core smart contract of the LooksRare protocol ("v2"). It is the main entry point for users to initiate transactions with taker orders and manage the cancellation of maker orders, which exist off-chain. ~~~~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~- ~~~~~~~~ ~~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~~ ~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~~ ~~~~~~~~ ~~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~~~~ - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### WETH - -```solidity -function WETH() external view returns (address) -``` - -Wrapped ETH. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### chainId - -```solidity -function chainId() external view returns (uint256) -``` - -Current chainId. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -Creator fee manager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### domainSeparator - -```solidity -function domainSeparator() external view returns (bytes32) -``` - -Current domain separator. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### executeMultipleTakerBids - -```solidity -function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable -``` - -#### Parameters - -| Name | Type | Description | -| --------------- | ------------------------- | ----------- | -| takerBids | OrderStructs.Taker[] | undefined | -| makerAsks | OrderStructs.Maker[] | undefined | -| makerSignatures | bytes[] | undefined | -| merkleTrees | OrderStructs.MerkleTree[] | undefined | -| isAtomic | bool | undefined | - -### executeTakerAsk - -```solidity -function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -### executeTakerBid - -```solidity -function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -### hashBatchOrder - -```solidity -function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) -``` - -This function returns the hash of the concatenation of batch order type hash and merkle root. - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ------------------- | -| root | bytes32 | Merkle root | -| proofLength | uint256 | Merkle proof length | - -#### Returns - -| Name | Type | Description | -| -------------- | ------- | -------------------- | -| batchOrderHash | bytes32 | The batch order hash | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint16) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | uint16 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### protocolFeeRecipient - -```solidity -function protocolFeeRecipient() external view returns (address) -``` - -Protocol fee recipient. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### restrictedExecuteTakerBid - -```solidity -function restrictedExecuteTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, address sender, bytes32 orderHash) external nonpayable returns (uint256 protocolFeeAmount) -``` - -#### Parameters - -| Name | Type | Description | -| --------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | -| sender | address | undefined | -| orderHash | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| protocolFeeAmount | uint256 | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### transferManager - -```solidity -function transferManager() external view returns (contract TransferManager) -``` - -Transfer manager for ERC721, ERC1155 and Hypercerts. - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------ | ----------- | -| \_0 | contract TransferManager | undefined | - -### updateCreatorFeeManager - -```solidity -function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable -``` - -This function allows the owner to update the creator fee manager address. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ---------------------------------- | -| newCreatorFeeManager | address | Address of the creator fee manager | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateDomainSeparator - -```solidity -function updateDomainSeparator() external nonpayable -``` - -This function allows the owner to update the domain separator (if possible). - -_Only callable by owner. If there is a fork of the network with a new chainId, it allows the owner to reset the domain separator for the new chain id._ - -### updateETHGasLimitForTransfer - -```solidity -function updateETHGasLimitForTransfer(uint256 newGasLimitETHTransfer) external nonpayable -``` - -This function allows the owner to update the maximum ETH gas limit for a standard transfer. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------ | -| newGasLimitETHTransfer | uint256 | New gas limit for ETH transfer | - -### updateMaxCreatorFeeBp - -```solidity -function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable -``` - -This function allows the owner to update the maximum creator fee (in basis point). - -_The maximum value that can be set is 25%. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------ | ---------------------------------------- | -| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | - -### updateProtocolFeeRecipient - -```solidity -function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable -``` - -This function allows the owner to update the protocol fee recipient. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ---------------------------------- | -| newProtocolFeeRecipient | address | New protocol fee recipient address | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| creatorFeeManager | address | undefined | - -### NewDomainSeparator - -```solidity -event NewDomainSeparator() -``` - -It is emitted if there is a change in the domain separator. - -### NewGasLimitETHTransfer - -```solidity -event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) -``` - -It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). - -#### Parameters - -| Name | Type | Description | -| ------------------- | ------- | ----------- | -| gasLimitETHTransfer | uint256 | undefined | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| maxCreatorFeeBp | uint256 | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| protocolFeeRecipient | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -### TakerAsk - -```solidity -event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker ask transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | -| askUser | address | undefined | -| bidUser | address | undefined | -| strategyId | uint256 | undefined | -| currency | address | undefined | -| collection | address | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| feeRecipients | address[2] | undefined | -| feeAmounts | uint256[3] | undefined | - -### TakerBid - -```solidity -event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker bid transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | -| bidUser | address | undefined | -| bidRecipient | address | undefined | -| strategyId | uint256 | undefined | -| currency | address | undefined | -| collection | address | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| feeRecipients | address[2] | undefined | -| feeAmounts | uint256[3] | undefined | - -## Errors - -### CallerInvalid - -```solidity -error CallerInvalid() -``` - -It is returned if the function cannot be called by the sender. - -### ChainIdInvalid - -```solidity -error ChainIdInvalid() -``` - -It is returned if the domain separator should change. - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### CurrencyInvalid - -```solidity -error CurrencyInvalid() -``` - -It is returned if the currency is invalid. - -### ERC20TransferFromFail - -```solidity -error ERC20TransferFromFail() -``` - -It is emitted if the ERC20 transferFrom fails. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### MerkleProofTooLarge - -```solidity -error MerkleProofTooLarge(uint256 length) -``` - -It is returned if the length of the merkle proof provided is greater than tolerated. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ------------ | -| length | uint256 | Proof length | - -### NewGasLimitETHTransferTooLow - -```solidity -error NewGasLimitETHTransferTooLow() -``` - -It is returned if the gas limit for a standard ETH transfer is too low. - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### NoncesInvalid - -```solidity -error NoncesInvalid() -``` - -It is returned if the nonces are invalid. - -### NotAContract - -```solidity -error NotAContract() -``` - -It is emitted if the call recipient is not a contract. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### NullSignerAddress - -```solidity -error NullSignerAddress() -``` - -It is emitted if the signer is null. - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### QuoteTypeInvalid - -```solidity -error QuoteTypeInvalid() -``` - -It is returned if the maker quote type is invalid. - -### ReentrancyFail - -```solidity -error ReentrancyFail() -``` - -This is returned when there is a reentrant call. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### SameDomainSeparator - -```solidity -error SameDomainSeparator() -``` - -It is returned if the domain separator cannot be updated (i.e. the chainId is the same). - -### SignatureEOAInvalid - -```solidity -error SignatureEOAInvalid() -``` - -It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). - -### SignatureERC1271Invalid - -```solidity -error SignatureERC1271Invalid() -``` - -It is emitted if the signature is invalid for a ERC1271 contract signer. - -### SignatureLengthInvalid - -```solidity -error SignatureLengthInvalid(uint256 length) -``` - -It is emitted if the signature's length is neither 64 nor 65 bytes. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| length | uint256 | undefined | - -### SignatureParameterSInvalid - -```solidity -error SignatureParameterSInvalid() -``` - -It is emitted if the signature is invalid due to S parameter. - -### SignatureParameterVInvalid - -```solidity -error SignatureParameterVInvalid(uint8 v) -``` - -It is emitted if the signature is invalid due to V parameter. - -#### Parameters - -| Name | Type | Description | -| ---- | ----- | ----------- | -| v | uint8 | undefined | - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### UnsupportedCollectionType - -```solidity -error UnsupportedCollectionType() -``` - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/NonceManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/NonceManager.md deleted file mode 100644 index fea95495..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/NonceManager.md +++ /dev/null @@ -1,193 +0,0 @@ -# NonceManager - -_LooksRare protocol team (👀,💎)_ - -> NonceManager - -This contract handles the nonce logic that is used for invalidating maker orders that exist off-chain. The nonce logic revolves around three parts at the user level: - order nonce (orders sharing an order nonce are conditional, OCO-like) - subset (orders can be grouped under a same subset) - bid/ask (all orders can be executed only if the bid/ask nonce matches the user's one on-chain) Only the order nonce is invalidated at the time of the execution of a maker order that contains it. - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -## Errors - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md deleted file mode 100644 index 36f6a35c..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/ProtocolFeeRecipient.md +++ /dev/null @@ -1,75 +0,0 @@ -# ProtocolFeeRecipient - -_LooksRare protocol team (👀,💎)_ - -> ProtocolFeeRecipient - -This contract is used to receive protocol fees and transfer them to the fee sharing setter. Fee sharing setter cannot receive ETH directly, so we need to use this contract as a middleman to convert ETH into WETH before sending it. - -## Methods - -### FEE_SHARING_SETTER - -```solidity -function FEE_SHARING_SETTER() external view returns (address) -``` - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### WETH - -```solidity -function WETH() external view returns (contract IWETH) -``` - -#### Returns - -| Name | Type | Description | -| ---- | -------------- | ----------- | -| \_0 | contract IWETH | undefined | - -### transferERC20 - -```solidity -function transferERC20(address currency) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ---------------------- | -| currency | address | ERC20 currency address | - -### transferETH - -```solidity -function transferETH() external nonpayable -``` - -## Errors - -### ERC20TransferFail - -```solidity -error ERC20TransferFail() -``` - -It is emitted if the ERC20 transfer fails. - -### NotAContract - -```solidity -error NotAContract() -``` - -It is emitted if the call recipient is not a contract. - -### NothingToTransfer - -```solidity -error NothingToTransfer() -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/StrategyManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/StrategyManager.md deleted file mode 100644 index a55f3985..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/StrategyManager.md +++ /dev/null @@ -1,391 +0,0 @@ -# StrategyManager - -_LooksRare protocol team (👀,💎)_ - -> StrategyManager - -This contract handles the addition and the update of execution strategies. - -## Methods - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -## Errors - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/TransferManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/TransferManager.md deleted file mode 100644 index c6766114..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/TransferManager.md +++ /dev/null @@ -1,553 +0,0 @@ -# TransferManager - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> TransferManager - -This contract provides the transfer functions for ERC721/ERC1155/Hypercert for contracts that require them. Collection type "0" refers to ERC721 transfer functions. Collection type "1" refers to ERC1155 transfer functions. Collection type "2" refers to Hypercert transfer functions. - -_"Safe" transfer functions for ERC721 are not implemented since they come with added gas costs to verify if the recipient is a contract as it requires verifying the receiver interface is valid._ - -## Methods - -### allowOperator - -```solidity -function allowOperator(address operator) external nonpayable -``` - -This function allows an operator to be added for the shared transfer system. Once the operator is allowed, users can grant NFT approvals to this operator. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ------------------------- | -| operator | address | Operator address to allow | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### grantApprovals - -```solidity -function grantApprovals(address[] operators) external nonpayable -``` - -This function allows a user to grant approvals for an array of operators. Users cannot grant approvals if the operator is not allowed by this contract's owner. - -_Each operator address must be globally allowed to be approved._ - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| operators | address[] | Array of operator addresses | - -### hasUserApprovedOperator - -```solidity -function hasUserApprovedOperator(address, address) external view returns (bool) -``` - -This returns whether the user has approved the operator address. The first address is the user and the second address is the operator (e.g. LooksRareProtocol). - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isOperatorAllowed - -```solidity -function isOperatorAllowed(address) external view returns (bool) -``` - -This returns whether the operator address is allowed by this contract's owner. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### removeOperator - -```solidity -function removeOperator(address operator) external nonpayable -``` - -This function allows the user to remove an operator for the shared transfer system. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | -------------------------- | -| operator | address | Operator address to remove | - -### revokeApprovals - -```solidity -function revokeApprovals(address[] operators) external nonpayable -``` - -This function allows a user to revoke existing approvals for an array of operators. - -_Each operator address must be approved at the user level to be revoked._ - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| operators | address[] | Array of operator addresses | - -### splitItemsHypercert - -```solidity -function splitItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function splits and transfers a fraction of a hypercert. - -_It does not allow batch transferring._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -### transferBatchItemsAcrossCollections - -```solidity -function transferBatchItemsAcrossCollections(ITransferManager.BatchTransferItem[] items, address from, address to) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| ----- | ------------------------------------ | ----------- | -| items | ITransferManager.BatchTransferItem[] | undefined | -| from | address | undefined | -| to | address | undefined | - -### transferItemsERC1155 - -```solidity -function transferItemsERC1155(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function transfers items for a single ERC1155 collection. - -_It does not allow batch transferring if from = msg.sender since native function should be used._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -### transferItemsERC721 - -```solidity -function transferItemsERC721(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function transfers items for a single ERC721 collection. - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -### transferItemsHypercert - -```solidity -function transferItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function transfers items for a single Hypercert. - -_It does not allow batch transferring if from = msg.sender since native function should be used._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -## Events - -### ApprovalsGranted - -```solidity -event ApprovalsGranted(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are granted by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | ----------- | -| user | address | undefined | -| operators | address[] | undefined | - -### ApprovalsRemoved - -```solidity -event ApprovalsRemoved(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are revoked by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | ----------- | -| user | address | undefined | -| operators | address[] | undefined | - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### OperatorAllowed - -```solidity -event OperatorAllowed(address operator) -``` - -It is emitted if a new operator is added to the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | - -### OperatorRemoved - -```solidity -event OperatorRemoved(address operator) -``` - -It is emitted if an operator is removed from the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | - -## Errors - -### AmountInvalid - -```solidity -error AmountInvalid() -``` - -It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. - -### ERC1155SafeBatchTransferFromFail - -```solidity -error ERC1155SafeBatchTransferFromFail() -``` - -It is emitted if the ERC1155 safeBatchTransferFrom fails. - -### ERC1155SafeTransferFromFail - -```solidity -error ERC1155SafeTransferFromFail() -``` - -It is emitted if the ERC1155 safeTransferFrom fails. - -### ERC721TransferFromFail - -```solidity -error ERC721TransferFromFail() -``` - -It is emitted if the ERC721 transferFrom fails. - -### HypercertSplitFractionError - -```solidity -error HypercertSplitFractionError() -``` - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotAContract - -```solidity -error NotAContract() -``` - -It is emitted if the call recipient is not a contract. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### OperatorAlreadyAllowed - -```solidity -error OperatorAlreadyAllowed() -``` - -It is returned if the transfer caller is already allowed by the owner. - -_This error can only be returned for owner operations._ - -### OperatorAlreadyApprovedByUser - -```solidity -error OperatorAlreadyApprovedByUser() -``` - -It is returned if the operator to approve has already been approved by the user. - -### OperatorNotAllowed - -```solidity -error OperatorNotAllowed() -``` - -It is returned if the operator to approve is not in the global allowlist defined by the owner. - -_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ - -### OperatorNotApprovedByUser - -```solidity -error OperatorNotApprovedByUser() -``` - -It is returned if the operator to revoke has not been previously approved by the user. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferCallerInvalid - -```solidity -error TransferCallerInvalid() -``` - -It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/TransferSelectorNFT.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/TransferSelectorNFT.md deleted file mode 100644 index 9011bd50..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/TransferSelectorNFT.md +++ /dev/null @@ -1,779 +0,0 @@ -# TransferSelectorNFT - -_LooksRare protocol team (👀,💎); bitbeckers;_ - -> TransferSelectorNFT - -This contract handles the logic for transferring non-fungible items. - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -Creator fee manager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint16) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | uint16 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### protocolFeeRecipient - -```solidity -function protocolFeeRecipient() external view returns (address) -``` - -Protocol fee recipient. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### transferManager - -```solidity -function transferManager() external view returns (contract TransferManager) -``` - -Transfer manager for ERC721, ERC1155 and Hypercerts. - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------ | ----------- | -| \_0 | contract TransferManager | undefined | - -### updateCreatorFeeManager - -```solidity -function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable -``` - -This function allows the owner to update the creator fee manager address. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ---------------------------------- | -| newCreatorFeeManager | address | Address of the creator fee manager | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateMaxCreatorFeeBp - -```solidity -function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable -``` - -This function allows the owner to update the maximum creator fee (in basis point). - -_The maximum value that can be set is 25%. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------ | ---------------------------------------- | -| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | - -### updateProtocolFeeRecipient - -```solidity -function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable -``` - -This function allows the owner to update the protocol fee recipient. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ---------------------------------- | -| newProtocolFeeRecipient | address | New protocol fee recipient address | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| creatorFeeManager | address | undefined | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| maxCreatorFeeBp | uint256 | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| protocolFeeRecipient | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -## Errors - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### ReentrancyFail - -```solidity -error ReentrancyFail() -``` - -This is returned when there is a reentrant call. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### UnsupportedCollectionType - -```solidity -error UnsupportedCollectionType() -``` - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md deleted file mode 100644 index 37866658..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md +++ /dev/null @@ -1,41 +0,0 @@ -# BaseStrategy - -_LooksRare protocol team (👀,💎)_ - -> BaseStrategy - -## Methods - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerOrder | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md deleted file mode 100644 index c9503939..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md +++ /dev/null @@ -1,212 +0,0 @@ -# BaseStrategyChainlinkPriceLatency - -_LooksRare protocol team (👀,💎)_ - -> BaseStrategyChainlinkPriceLatency - -This contract allows the owner to define the maximum acceptable Chainlink price latency. - -## Methods - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### maxLatency - -```solidity -function maxLatency() external view returns (uint256) -``` - -Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -## Errors - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md deleted file mode 100644 index e2d77dd3..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md +++ /dev/null @@ -1,342 +0,0 @@ -# StrategyChainlinkUSDDynamicAsk - -_LooksRare protocol team (👀,💎)_ - -> StrategyChainlinkUSDDynamicAsk - -This contract allows a seller to sell an NFT priced in USD and the receivable amount to be in ETH. - -## Methods - -### ETH_USD_PRICE_FEED_DECIMALS - -```solidity -function ETH_USD_PRICE_FEED_DECIMALS() external view returns (uint256) -``` - -_It is possible to call priceFeed.decimals() to get the decimals, but to save gas, it is hard coded instead._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### WETH - -```solidity -function WETH() external view returns (address) -``` - -Wrapped ether (WETH) address. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### executeStrategyWithTakerBid - -```solidity -function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -### maxLatency - -```solidity -function maxLatency() external view returns (uint256) -``` - -Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### priceFeed - -```solidity -function priceFeed() external view returns (contract AggregatorV3Interface) -``` - -ETH/USD Chainlink price feed - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------------ | ----------- | -| \_0 | contract AggregatorV3Interface | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -## Errors - -### BidTooLow - -```solidity -error BidTooLow() -``` - -It is returned if the bid price is too low for the ask user. - -### ChainlinkPriceInvalid - -```solidity -error ChainlinkPriceInvalid() -``` - -It is returned if the Chainlink price is invalid (e.g. negative). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. - -### PriceNotRecentEnough - -```solidity -error PriceNotRecentEnough() -``` - -It is returned if the current block time relative to the latest price's update time is greater than the latency tolerance. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md deleted file mode 100644 index ddec4495..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md +++ /dev/null @@ -1,127 +0,0 @@ -# StrategyCollectionOffer - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> StrategyCollectionOffer - -This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount must be 1 (fractions are NFTs) - -## Methods - -### executeCollectionStrategyWithTakerAsk - -```solidity -function executeCollectionStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeCollectionStrategyWithTakerAskWithAllowlist - -```solidity -function executeCollectionStrategyWithTakerAskWithAllowlist(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeCollectionStrategyWithTakerAskWithProof - -```solidity -function executeCollectionStrategyWithTakerAskWithProof(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerBid | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md deleted file mode 100644 index 1227878d..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md +++ /dev/null @@ -1,83 +0,0 @@ -# StrategyDutchAuction - -_LooksRare protocol team (👀,💎)_ - -> StrategyDutchAuction - -This contract offers a single execution strategy for users to create Dutch auctions. - -## Methods - -### executeStrategyWithTakerBid - -```solidity -function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### BidTooLow - -```solidity -error BidTooLow() -``` - -It is returned if the bid price is too low for the ask user. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md deleted file mode 100644 index 43f14059..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md +++ /dev/null @@ -1,123 +0,0 @@ -# StrategyHypercertFractionOffer - -_LooksRare protocol team (👀,💎); bitbeckers;_ - -> StrategyHypercertFractionOffer - -This contract offers a single execution strategy for users to bid on a specific amount of units in an hypercerts that's for sale. Example: Alice has 100 units of a hypercert (id: 42) for sale at a minimum price of 0.001 ETH/unit. Bob wants to buy 10 units. Bob can create a taker bid order with the following parameters: - unitAmount: 10000 // Total amount for sale; in `amounts` array - minUnitAmount: 100 // Minimum amount to buy; in `additionalParameters` - maxUnitAmount: 1000 // Maximum amount to buy; in `additionalParameters` - acceptedTokenAmount: 1000000000000000 (0.001 ETH in wei) - acceptedTokenAddress: 0x0000000000000000000000000000000000000000 - proof: [0xsdadfa....s9fds,0xdasdas...asff8e] This strategy will validate the available units and the price.This contract offers execution strategies for users to create maker bid offers for items in a collection. There are three available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. 3. If Hypercert, the amount can be greater than 1 because they represent units held by the hypercert. - -_Use cases can include tiered pricing; think early bird tickets._ - -## Methods - -### executeHypercertFractionStrategyWithTakerBid - -```solidity -function executeHypercertFractionStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeHypercertFractionStrategyWithTakerBidWithAllowlist - -```solidity -function executeHypercertFractionStrategyWithTakerBidWithAllowlist(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### AmountInvalid - -```solidity -error AmountInvalid() -``` - -It is returned if the amount is invalid. For ERC721, any number that is not 1. For ERC1155 and Hypercert, if amount is 0. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md deleted file mode 100644 index 6a1f0cd5..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md +++ /dev/null @@ -1,75 +0,0 @@ -# StrategyItemIdsRange - -_LooksRare protocol team (👀,💎)_ - -> StrategyItemIdsRange - -This contract offers a single execution strategy for users to bid on a specific amount of items in a range bounded by 2 item ids. - -## Methods - -### executeStrategyWithTakerAsk - -```solidity -function executeStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerBid | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md deleted file mode 100644 index 76918fc5..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md +++ /dev/null @@ -1,215 +0,0 @@ -# OrderValidatorV2A - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> OrderValidatorV2A - -This contract is used to check the validity of maker ask/bid orders in the LooksRareProtocol (v2). It performs checks for: 1. Protocol allowlist issues (i.e. currency or strategy not allowed) 2. Maker order-specific issues (e.g., order invalid due to format or other-strategy specific issues) 3. Nonce related issues (e.g., nonce executed or cancelled) 4. Signature related issues and merkle tree parameters 5. Timestamp related issues (e.g., order expired) 6. Asset-related issues for ERC20/ERC721/ERC1155/Hypercerts (approvals and balances) 7. Collection-type suggestions 8. Transfer manager related issues 9. Creator fee related issues (e.g., creator fee too high, ERC2981 bundles) - -_This version does not handle strategies with partial fills._ - -## Methods - -### CRITERIA_GROUPS - -```solidity -function CRITERIA_GROUPS() external view returns (uint256) -``` - -Number of distinct criteria groups checked to evaluate the validity of an order. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### ERC1155_INTERFACE_ID - -```solidity -function ERC1155_INTERFACE_ID() external view returns (bytes4) -``` - -ERC1155 interfaceId. - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### ERC721_INTERFACE_ID_1 - -```solidity -function ERC721_INTERFACE_ID_1() external view returns (bytes4) -``` - -ERC721 potential interfaceId. - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### ERC721_INTERFACE_ID_2 - -```solidity -function ERC721_INTERFACE_ID_2() external view returns (bytes4) -``` - -ERC721 potential interfaceId. - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### HYPERCERT_INTERFACE_ID - -```solidity -function HYPERCERT_INTERFACE_ID() external view returns (bytes4) -``` - -Hypercert interfaceId - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### checkMakerOrderValidity - -```solidity -function checkMakerOrderValidity(OrderStructs.Maker makerOrder, bytes signature, OrderStructs.MerkleTree merkleTree) external view returns (uint256[9] validationCodes) -``` - -#### Parameters - -| Name | Type | Description | -| ---------- | ----------------------- | ----------- | -| makerOrder | OrderStructs.Maker | undefined | -| signature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -#### Returns - -| Name | Type | Description | -| --------------- | ---------- | ----------- | -| validationCodes | uint256[9] | undefined | - -### checkMultipleMakerOrderValidities - -```solidity -function checkMultipleMakerOrderValidities(OrderStructs.Maker[] makerOrders, bytes[] signatures, OrderStructs.MerkleTree[] merkleTrees) external view returns (uint256[9][] validationCodes) -``` - -#### Parameters - -| Name | Type | Description | -| ----------- | ------------------------- | ----------- | -| makerOrders | OrderStructs.Maker[] | undefined | -| signatures | bytes[] | undefined | -| merkleTrees | OrderStructs.MerkleTree[] | undefined | - -#### Returns - -| Name | Type | Description | -| --------------- | ------------ | ----------- | -| validationCodes | uint256[9][] | undefined | - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -CreatorFeeManager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### deriveProtocolParameters - -```solidity -function deriveProtocolParameters() external nonpayable -``` - -Derive protocol parameters. Anyone can call this function. - -_It allows adjusting if the domain separator or creator fee manager address were to change._ - -### domainSeparator - -```solidity -function domainSeparator() external view returns (bytes32) -``` - -LooksRareProtocol domain separator. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### looksRareProtocol - -```solidity -function looksRareProtocol() external view returns (contract LooksRareProtocol) -``` - -LooksRareProtocol. - -#### Returns - -| Name | Type | Description | -| ---- | -------------------------- | ----------- | -| \_0 | contract LooksRareProtocol | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint256) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### transferManager - -```solidity -function transferManager() external view returns (contract TransferManager) -``` - -TransferManager - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------ | ----------- | -| \_0 | contract TransferManager | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md deleted file mode 100644 index 91be29a9..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md +++ /dev/null @@ -1,159 +0,0 @@ -# ProtocolHelpers - -_LooksRare protocol team (👀,💎)_ - -> ProtocolHelpers - -This contract contains helper view functions for order creation. - -## Methods - -### computeDigestMerkleTree - -```solidity -function computeDigestMerkleTree(OrderStructs.MerkleTree merkleTree) external view returns (bytes32 digest) -``` - -#### Parameters - -| Name | Type | Description | -| ---------- | ----------------------- | ----------- | -| merkleTree | OrderStructs.MerkleTree | undefined | - -#### Returns - -| Name | Type | Description | -| ------ | ------- | ----------- | -| digest | bytes32 | undefined | - -### computeMakerDigest - -```solidity -function computeMakerDigest(OrderStructs.Maker maker) external view returns (bytes32 digest) -``` - -#### Parameters - -| Name | Type | Description | -| ----- | ------------------ | ----------- | -| maker | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------ | ------- | ----------- | -| digest | bytes32 | undefined | - -### looksRareProtocol - -```solidity -function looksRareProtocol() external view returns (contract LooksRareProtocol) -``` - -#### Returns - -| Name | Type | Description | -| ---- | -------------------------- | ----------- | -| \_0 | contract LooksRareProtocol | undefined | - -### verifyMakerSignature - -```solidity -function verifyMakerSignature(OrderStructs.Maker maker, bytes makerSignature, address signer) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ------------------ | ----------- | -| maker | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| signer | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### verifyMerkleTree - -```solidity -function verifyMerkleTree(OrderStructs.MerkleTree merkleTree, bytes makerSignature, address signer) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| merkleTree | OrderStructs.MerkleTree | undefined | -| makerSignature | bytes | undefined | -| signer | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Errors - -### NullSignerAddress - -```solidity -error NullSignerAddress() -``` - -It is emitted if the signer is null. - -### SignatureEOAInvalid - -```solidity -error SignatureEOAInvalid() -``` - -It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). - -### SignatureERC1271Invalid - -```solidity -error SignatureERC1271Invalid() -``` - -It is emitted if the signature is invalid for a ERC1271 contract signer. - -### SignatureLengthInvalid - -```solidity -error SignatureLengthInvalid(uint256 length) -``` - -It is emitted if the signature's length is neither 64 nor 65 bytes. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| length | uint256 | undefined | - -### SignatureParameterSInvalid - -```solidity -error SignatureParameterSInvalid() -``` - -It is emitted if the signature is invalid due to S parameter. - -### SignatureParameterVInvalid - -```solidity -error SignatureParameterVInvalid(uint8 v) -``` - -It is emitted if the signature is invalid due to V parameter. - -#### Parameters - -| Name | Type | Description | -| ---- | ----- | ----------- | -| v | uint8 | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md deleted file mode 100644 index b832744e..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md +++ /dev/null @@ -1,60 +0,0 @@ -# ICreatorFeeManager - -_LooksRare protocol team (👀,💎)_ - -> ICreatorFeeManager - -## Methods - -### royaltyFeeRegistry - -```solidity -function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry royaltyFeeRegistry) -``` - -It returns the royalty fee registry address/interface. - -#### Returns - -| Name | Type | Description | -| ------------------ | ---------------------------- | ------------------------------------- | -| royaltyFeeRegistry | contract IRoyaltyFeeRegistry | Interface of the royalty fee registry | - -### viewCreatorFeeInfo - -```solidity -function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) -``` - -This function returns the creator address and calculates the creator fee amount. - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | -| itemIds | uint256[] | Array of item ids | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ------------------ | -| creator | address | Creator address | -| creatorFeeAmount | uint256 | Creator fee amount | - -## Errors - -### BundleEIP2981NotAllowed - -```solidity -error BundleEIP2981NotAllowed(address collection) -``` - -It is returned if the bundle contains multiple itemIds with different creator fee structure. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md deleted file mode 100644 index da683d8c..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md +++ /dev/null @@ -1,22 +0,0 @@ -# ICurrencyManager - -_LooksRare protocol team (👀,💎)_ - -> ICurrencyManager - -## Events - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------------------------------- | -| currency | address | Currency address (address(0) = ETH) | -| isAllowed | bool | Whether the currency is allowed | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md deleted file mode 100644 index 0e86c75b..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IExecutionManager.md +++ /dev/null @@ -1,99 +0,0 @@ -# IExecutionManager - -_LooksRare protocol team (👀,💎)_ - -> IExecutionManager - -## Events - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | -------------------------------------- | -| creatorFeeManager | address | Address of the new creator fee manager | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ---------------------------------------- | -| maxCreatorFeeBp | uint256 | New maximum creator fee (in basis point) | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------------------------------------- | -| protocolFeeRecipient | address | Address of the new protocol fee recipient | - -## Errors - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md deleted file mode 100644 index 393cb24b..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md +++ /dev/null @@ -1,41 +0,0 @@ -# IImmutableCreate2Factory - -## Methods - -### findCreate2Address - -```solidity -function findCreate2Address(bytes32 salt, bytes initializationCode) external view returns (address deploymentAddress) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| salt | bytes32 | undefined | -| initializationCode | bytes | undefined | - -#### Returns - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| deploymentAddress | address | undefined | - -### safeCreate2 - -```solidity -function safeCreate2(bytes32 salt, bytes initializationCode) external payable returns (address deploymentAddress) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| salt | bytes32 | undefined | -| initializationCode | bytes | undefined | - -#### Returns - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| deploymentAddress | address | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md deleted file mode 100644 index e7414f54..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md +++ /dev/null @@ -1,157 +0,0 @@ -# ILooksRareProtocol - -_LooksRare protocol team (👀,💎)_ - -> ILooksRareProtocol - -## Methods - -### executeMultipleTakerBids - -```solidity -function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable -``` - -#### Parameters - -| Name | Type | Description | -| --------------- | ------------------------- | ----------- | -| takerBids | OrderStructs.Taker[] | undefined | -| makerAsks | OrderStructs.Maker[] | undefined | -| makerSignatures | bytes[] | undefined | -| merkleTrees | OrderStructs.MerkleTree[] | undefined | -| isAtomic | bool | undefined | - -### executeTakerAsk - -```solidity -function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -### executeTakerBid - -```solidity -function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -## Events - -### NewDomainSeparator - -```solidity -event NewDomainSeparator() -``` - -It is emitted if there is a change in the domain separator. - -### NewGasLimitETHTransfer - -```solidity -event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) -``` - -It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). - -#### Parameters - -| Name | Type | Description | -| ------------------- | ------- | ----------------------------- | -| gasLimitETHTransfer | uint256 | Gas limit for an ETH transfer | - -### TakerAsk - -```solidity -event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker ask transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | -| askUser | address | Address of the ask user | -| bidUser | address | Address of the bid user | -| strategyId | uint256 | Id of the strategy | -| currency | address | Address of the currency | -| collection | address | Address of the collection | -| itemIds | uint256[] | Array of item ids | -| amounts | uint256[] | Array of amounts (for item ids) | -| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it can be the taker ask user or different) feeRecipients[1] Creator fee recipient (if none, address(0)) | -| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | - -### TakerBid - -```solidity -event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker bid transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | -| bidUser | address | Address of the bid user | -| bidRecipient | address | Address of the recipient of the bid | -| strategyId | uint256 | Id of the strategy | -| currency | address | Address of the currency | -| collection | address | Address of the collection | -| itemIds | uint256[] | Array of item ids | -| amounts | uint256[] | Array of amounts (for item ids) | -| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it is the maker ask user) feeRecipients[1] Creator fee recipient (if none, address(0)) | -| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | - -## Errors - -### ChainIdInvalid - -```solidity -error ChainIdInvalid() -``` - -It is returned if the domain separator should change. - -### NewGasLimitETHTransferTooLow - -```solidity -error NewGasLimitETHTransferTooLow() -``` - -It is returned if the gas limit for a standard ETH transfer is too low. - -### NoncesInvalid - -```solidity -error NoncesInvalid() -``` - -It is returned if the nonces are invalid. - -### SameDomainSeparator - -```solidity -error SameDomainSeparator() -``` - -It is returned if the domain separator cannot be updated (i.e. the chainId is the same). diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/INonceManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/INonceManager.md deleted file mode 100644 index eaa3f977..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/INonceManager.md +++ /dev/null @@ -1,53 +0,0 @@ -# INonceManager - -_LooksRare protocol team (👀,💎)_ - -> INonceManager - -## Events - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ------------------- | -| user | address | Address of the user | -| bidNonce | uint256 | New bid nonce | -| askNonce | uint256 | New ask nonce | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ------------------------------- | -| user | address | Address of the user | -| orderNonces | uint256[] | Array of order nonces cancelled | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | -------------------------------- | -| user | address | Address of the user | -| subsetNonces | uint256[] | Array of subset nonces cancelled | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md deleted file mode 100644 index 5ed0ef6c..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md +++ /dev/null @@ -1,29 +0,0 @@ -# IRoyaltyFeeRegistry - -_LooksRare protocol team (👀,💎)_ - -> IRoyaltyFeeRegistry - -## Methods - -### royaltyInfo - -```solidity -function royaltyInfo(address collection, uint256 price) external view returns (address receiver, uint256 royaltyFee) -``` - -This function returns the royalty information for a collection at a given transaction price. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | - -#### Returns - -| Name | Type | Description | -| ---------- | ------- | ------------------ | -| receiver | address | Receiver address | -| royaltyFee | uint256 | Royalty fee amount | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IStrategy.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IStrategy.md deleted file mode 100644 index 2b4a45bc..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IStrategy.md +++ /dev/null @@ -1,41 +0,0 @@ -# IStrategy - -_LooksRare protocol team (👀,💎)_ - -> IStrategy - -## Methods - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool isStrategy) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---------- | ---- | ---------------------------------------------- | -| isStrategy | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerOrder | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md deleted file mode 100644 index ae6ea7b1..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/IStrategyManager.md +++ /dev/null @@ -1,84 +0,0 @@ -# IStrategyManager - -_LooksRare protocol team (👀,💎)_ - -> IStrategyManager - -## Events - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------------- | -| strategyId | uint256 | Id of the new strategy | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the transaction to be executed | -| isMakerBid | bool | Whether the strategyId is for maker bid | -| implementation | address | Address of the implementation of the strategy | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | -------------------------------------------------------- | -| strategyId | uint256 | Id of the strategy | -| isActive | bool | Whether the strategy is active (or not) after the update | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | - -## Errors - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md deleted file mode 100644 index 3ba8ca81..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/interfaces/ITransferManager.md +++ /dev/null @@ -1,111 +0,0 @@ -# ITransferManager - -_LooksRare protocol team (👀,💎)_ - -> ITransferManager - -## Events - -### ApprovalsGranted - -```solidity -event ApprovalsGranted(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are granted by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| user | address | Address of the user | -| operators | address[] | Array of operator addresses | - -### ApprovalsRemoved - -```solidity -event ApprovalsRemoved(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are revoked by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| user | address | Address of the user | -| operators | address[] | Array of operator addresses | - -### OperatorAllowed - -```solidity -event OperatorAllowed(address operator) -``` - -It is emitted if a new operator is added to the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ---------------- | -| operator | address | Operator address | - -### OperatorRemoved - -```solidity -event OperatorRemoved(address operator) -``` - -It is emitted if an operator is removed from the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ---------------- | -| operator | address | Operator address | - -## Errors - -### OperatorAlreadyAllowed - -```solidity -error OperatorAlreadyAllowed() -``` - -It is returned if the transfer caller is already allowed by the owner. - -_This error can only be returned for owner operations._ - -### OperatorAlreadyApprovedByUser - -```solidity -error OperatorAlreadyApprovedByUser() -``` - -It is returned if the operator to approve has already been approved by the user. - -### OperatorNotAllowed - -```solidity -error OperatorNotAllowed() -``` - -It is returned if the operator to approve is not in the global allowlist defined by the owner. - -_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ - -### OperatorNotApprovedByUser - -```solidity -error OperatorNotApprovedByUser() -``` - -It is returned if the operator to revoke has not been previously approved by the user. - -### TransferCallerInvalid - -```solidity -error TransferCallerInvalid() -``` - -It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md deleted file mode 100644 index 1b1f41a2..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/CurrencyValidator.md +++ /dev/null @@ -1,7 +0,0 @@ -# CurrencyValidator - -_LooksRare protocol team (👀,💎)_ - -> CurrencyValidator - -This library validates the order currency to be the chain's native currency or the specified ERC20 token. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md deleted file mode 100644 index 5951cc56..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md +++ /dev/null @@ -1,21 +0,0 @@ -# LowLevelHypercertCaller - -_bitbeckers_ - -> LowLevelHypercertCaller - -This contract contains low-level calls to transfer ERC1155 tokens. - -## Errors - -### HypercertSplitFractionError - -```solidity -error HypercertSplitFractionError() -``` - -### NotAContract - -```solidity -error NotAContract() -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md deleted file mode 100644 index 943a54cd..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md +++ /dev/null @@ -1,7 +0,0 @@ -# MerkleProofCalldataWithNodes - -_OpenZeppelin (adjusted by LooksRare)_ - -> MerkleProofCalldataWithNodes - -This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md deleted file mode 100644 index 37529181..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md +++ /dev/null @@ -1,7 +0,0 @@ -# MerkleProofMemory - -_OpenZeppelin (adjusted by LooksRare)_ - -> MerkleProofMemory - -This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OrderStructs.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OrderStructs.md deleted file mode 100644 index 6ffa83e2..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/marketplace/libraries/OrderStructs.md +++ /dev/null @@ -1,7 +0,0 @@ -# OrderStructs - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> OrderStructs - -This library contains all order struct types for the LooksRare protocol (v2). diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/AllowlistMinter.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/AllowlistMinter.md deleted file mode 100644 index 4684053c..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/AllowlistMinter.md +++ /dev/null @@ -1,84 +0,0 @@ -# AllowlistMinter - -_bitbeckers_ - -> Interface for hypercert token interactions - -This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) - -## Methods - -### hasBeenClaimed - -```solidity -function hasBeenClaimed(uint256, bytes32) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | -| \_1 | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### isAllowedToClaim - -```solidity -function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| proof | bytes32[] | undefined | -| claimID | uint256 | undefined | -| leaf | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| --------- | ---- | ----------- | -| isAllowed | bool | undefined | - -## Events - -### AllowlistCreated - -```solidity -event AllowlistCreated(uint256 tokenID, bytes32 root) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| root | bytes32 | undefined | - -### LeafClaimed - -```solidity -event LeafClaimed(uint256 tokenID, bytes32 leaf) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| leaf | bytes32 | undefined | - -## Errors - -### DoesNotExist - -```solidity -error DoesNotExist() -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/HypercertMinter.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/HypercertMinter.md deleted file mode 100644 index 518efa42..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/HypercertMinter.md +++ /dev/null @@ -1,895 +0,0 @@ -# HypercertMinter - -_bitbeckers_ - -> Contract for managing hypercert claims and whitelists - -Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. - -_Wrapper contract to expose and chain functions._ - -## Methods - -### \_\_SemiFungible1155_init - -```solidity -function __SemiFungible1155_init() external nonpayable -``` - -_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - -_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - -_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | --------- | ----------- | -| \_0 | uint256[] | undefined | - -### batchBurnFraction - -```solidity -function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable -``` - -Burn a claimtoken - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ----------- | -| \_account | address | undefined | -| \_tokenIDs | uint256[] | undefined | - -### batchMintClaimsFromAllowlists - -```solidity -function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable -``` - -Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` - -_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ - -#### Parameters - -| Name | Type | Description | -| -------- | ----------- | ----------- | -| account | address | undefined | -| proofs | bytes32[][] | undefined | -| claimIDs | uint256[] | undefined | -| units | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256) external nonpayable -``` - -Burn a claimtoken; override is needed to update units/values - -_see {ERC1155Burnable}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | -| \_2 | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable -``` - -Batch burn claimtokens; override is needed to update units/values - -_see {ERC1155Burnable}_ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| account | address | undefined | -| ids | uint256[] | undefined | -| \_2 | uint256[] | undefined | - -### burnFraction - -```solidity -function burnFraction(address _account, uint256 _tokenID) external nonpayable -``` - -Burn a claimtoken - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| \_account | address | undefined | -| \_tokenID | uint256 | undefined | - -### createAllowlist - -```solidity -function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -Register a claim and the whitelist for minting token(s) belonging to that claim - -_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| merkleRoot | bytes32 | undefined | -| \_uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### hasBeenClaimed - -```solidity -function hasBeenClaimed(uint256, bytes32) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | -| \_1 | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### initialize - -```solidity -function initialize() external nonpayable -``` - -_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ - -### isAllowedToClaim - -```solidity -function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| proof | bytes32[] | undefined | -| claimID | uint256 | undefined | -| leaf | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| --------- | ---- | ----------- | -| isAllowed | bool | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - -_See {IERC1155-isApprovedForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### mergeFractions - -```solidity -function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable -``` - -Merge the value of tokens belonging to the same claim - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------------- | --------- | ----------- | -| \_account | address | undefined | -| \_fractionIDs | uint256[] | undefined | - -### mintClaim - -```solidity -function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -Mint a semi-fungible token for the impact claim referenced via `uri` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| \_uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### mintClaimFromAllowlist - -```solidity -function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable -``` - -Mint a semi-fungible token representing a fraction of the claim - -_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| account | address | undefined | -| proof | bytes32[] | undefined | -| claimID | uint256 | undefined | -| units | uint256 | undefined | - -### mintClaimWithFractions - -```solidity -function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -Mint semi-fungible tokens for the impact claim referenced via `uri` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| fractions | uint256[] | undefined | -| \_uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | string | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -_Returns the address of the current owner._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenID) external view returns (address _owner) -``` - -_Returns the owner of a given token ID._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------------------------- | -| tokenID | uint256 | The ID of the token to query. | - -#### Returns - -| Name | Type | Description | -| ------- | ------- | -------------------------------------- | -| \_owner | address | The address of the owner of the token. | - -### pause - -```solidity -function pause() external nonpayable -``` - -PAUSABLE - -### paused - -```solidity -function paused() external view returns (bool) -``` - -_Returns true if the contract is paused, and false otherwise._ - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### proxiableUUID - -```solidity -function proxiableUUID() external view returns (bytes32) -``` - -_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### readTransferRestriction - -```solidity -function readTransferRestriction(uint256 tokenID) external view returns (string) -``` - -TRANSFER RESTRICTIONS - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | string | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - -_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - -_See {IERC1155-safeBatchTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - -_See {IERC1155-safeTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - -_See {IERC1155-setApprovalForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | -| approved | bool | undefined | - -### splitFraction - -```solidity -function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable -``` - -Split a claimtokens value into parts with summed value equal to the original - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| -------------- | --------- | ----------- | -| \_account | address | undefined | -| \_tokenID | uint256 | undefined | -| \_newFractions | uint256[] | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - -_See {IERC165-supportsInterface}._ - -#### Parameters - -| Name | Type | Description | -| ----------- | ------ | ----------- | -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - -_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### unitsOf - -```solidity -function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) -``` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### unitsOf - -```solidity -function unitsOf(uint256 tokenID) external view returns (uint256 units) -``` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - -### upgradeTo - -```solidity -function upgradeTo(address newImplementation) external nonpayable -``` - -_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | - -### upgradeToAndCall - -```solidity -function upgradeToAndCall(address newImplementation, bytes data) external payable -``` - -_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | -| data | bytes | undefined | - -### uri - -```solidity -function uri(uint256 tokenID) external view returns (string _uri) -``` - -_see { IHypercertMetadata}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------ | ----------- | -| \_uri | string | undefined | - -## Events - -### AdminChanged - -```solidity -event AdminChanged(address previousAdmin, address newAdmin) -``` - -#### Parameters - -| Name | Type | Description | -| ------------- | ------- | ----------- | -| previousAdmin | address | undefined | -| newAdmin | address | undefined | - -### AllowlistCreated - -```solidity -event AllowlistCreated(uint256 tokenID, bytes32 root) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| root | bytes32 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### BatchValueTransfer - -```solidity -event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) -``` - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| claimIDs | uint256[] | undefined | -| fromTokenIDs | uint256[] | undefined | -| toTokenIDs | uint256[] | undefined | -| values | uint256[] | undefined | - -### BeaconUpgraded - -```solidity -event BeaconUpgraded(address indexed beacon) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------- | ----------- | -| beacon `indexed` | address | undefined | - -### ClaimStored - -```solidity -event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| claimID `indexed` | uint256 | undefined | -| uri | string | undefined | -| totalUnits | uint256 | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ----- | ----------- | -| version | uint8 | undefined | - -### LeafClaimed - -```solidity -event LeafClaimed(uint256 tokenID, bytes32 leaf) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| leaf | bytes32 | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ----------- | -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - -#### Parameters - -| Name | Type | Description | -| ------------ | ------- | ----------- | -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | - -### Upgraded - -```solidity -event Upgraded(address indexed implementation) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------------ | ------- | ----------- | -| implementation `indexed` | address | undefined | - -### ValueTransfer - -```solidity -event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) -``` - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ----------- | -| claimID | uint256 | undefined | -| fromTokenID | uint256 | undefined | -| toTokenID | uint256 | undefined | -| value | uint256 | undefined | - -## Errors - -### AlreadyClaimed - -```solidity -error AlreadyClaimed() -``` - -### ArraySize - -```solidity -error ArraySize() -``` - -### DoesNotExist - -```solidity -error DoesNotExist() -``` - -### DuplicateEntry - -```solidity -error DuplicateEntry() -``` - -### Invalid - -```solidity -error Invalid() -``` - -### NotAllowed - -```solidity -error NotAllowed() -``` - -### NotApprovedOrOwner - -```solidity -error NotApprovedOrOwner() -``` - -### TransfersNotAllowed - -```solidity -error TransfersNotAllowed() -``` - -### TypeMismatch - -```solidity -error TypeMismatch() -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/SemiFungible1155.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/SemiFungible1155.md deleted file mode 100644 index a4086e37..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/SemiFungible1155.md +++ /dev/null @@ -1,457 +0,0 @@ -# SemiFungible1155 - -_bitbeckers_ - -> Contract for minting semi-fungible EIP1155 tokens - -Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` - -_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ - -## Methods - -### \_\_SemiFungible1155_init - -```solidity -function __SemiFungible1155_init() external nonpayable -``` - -_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - -_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - -_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | --------- | ----------- | -| \_0 | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256 value) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| account | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - -_See {IERC1155-isApprovedForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -_Returns the address of the current owner._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenID) external view returns (address _owner) -``` - -_Returns the owner of a given token ID._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------------------------- | -| tokenID | uint256 | The ID of the token to query. | - -#### Returns - -| Name | Type | Description | -| ------- | ------- | -------------------------------------- | -| \_owner | address | The address of the owner of the token. | - -### proxiableUUID - -```solidity -function proxiableUUID() external view returns (bytes32) -``` - -_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - -_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - -_See {IERC1155-safeBatchTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - -_See {IERC1155-safeTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - -_See {IERC1155-setApprovalForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - -_See {IERC165-supportsInterface}._ - -#### Parameters - -| Name | Type | Description | -| ----------- | ------ | ----------- | -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - -_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### upgradeTo - -```solidity -function upgradeTo(address newImplementation) external nonpayable -``` - -_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | - -### upgradeToAndCall - -```solidity -function upgradeToAndCall(address newImplementation, bytes data) external payable -``` - -_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | -| data | bytes | undefined | - -### uri - -```solidity -function uri(uint256 tokenID) external view returns (string _uri) -``` - -_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------------------------------------------------- | -| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | - -#### Returns - -| Name | Type | Description | -| ----- | ------ | -------------------------------------------- | -| \_uri | string | The metadata URI for the specified token ID. | - -## Events - -### AdminChanged - -```solidity -event AdminChanged(address previousAdmin, address newAdmin) -``` - -#### Parameters - -| Name | Type | Description | -| ------------- | ------- | ----------- | -| previousAdmin | address | undefined | -| newAdmin | address | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### BatchValueTransfer - -```solidity -event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) -``` - -_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| claimIDs | uint256[] | undefined | -| fromTokenIDs | uint256[] | undefined | -| toTokenIDs | uint256[] | undefined | -| values | uint256[] | undefined | - -### BeaconUpgraded - -```solidity -event BeaconUpgraded(address indexed beacon) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------- | ----------- | -| beacon `indexed` | address | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ----- | ----------- | -| version | uint8 | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ----------- | -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - -#### Parameters - -| Name | Type | Description | -| ------------ | ------- | ----------- | -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Upgraded - -```solidity -event Upgraded(address indexed implementation) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------------ | ------- | ----------- | -| implementation `indexed` | address | undefined | - -### ValueTransfer - -```solidity -event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) -``` - -_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ----------- | -| claimID | uint256 | undefined | -| fromTokenID | uint256 | undefined | -| toTokenID | uint256 | undefined | -| value | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/interfaces/IAllowlist.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/interfaces/IAllowlist.md deleted file mode 100644 index 72455b43..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/interfaces/IAllowlist.md +++ /dev/null @@ -1,29 +0,0 @@ -# IAllowlist - -_bitbeckers_ - -> Interface for allowlist - -This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) - -## Methods - -### isAllowedToClaim - -```solidity -function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| proof | bytes32[] | undefined | -| tokenID | uint256 | undefined | -| leaf | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| --------- | ---- | ----------- | -| isAllowed | bool | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md deleted file mode 100644 index 30ed6f95..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/interfaces/IHypercertToken.md +++ /dev/null @@ -1,192 +0,0 @@ -# IHypercertToken - -_bitbeckers_ - -> Interface for hypercert token interactions - -This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) - -## Methods - -### batchBurnFraction - -```solidity -function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable -``` - -Operator must be allowed by `creator` and the tokens must represent the total amount of available units. - -_Function to burn the tokens at `tokenIDs` for `account`_ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| account | address | undefined | -| tokenIDs | uint256[] | undefined | - -### burnFraction - -```solidity -function burnFraction(address account, uint256 tokenID) external nonpayable -``` - -Operator must be allowed by `creator` and the token must represent the total amount of available units. - -_Function to burn the token at `tokenID` for `account`_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | - -### mergeFractions - -```solidity -function mergeFractions(address account, uint256[] tokenIDs) external nonpayable -``` - -Tokens that have been merged are burned. - -_Function called to merge tokens within `tokenIDs`._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| account | address | undefined | -| tokenIDs | uint256[] | undefined | - -### mintClaim - -```solidity -function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### mintClaimWithFractions - -```solidity -function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| fractions | uint256[] | undefined | -| uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### splitFraction - -```solidity -function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable -``` - -The sum of `values` must equal the current value of `_tokenID`. - -_Function called to split `tokenID` owned by `account` into units declared in `values`._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | -| \_values | uint256[] | undefined | - -### unitsOf - -```solidity -function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) -``` - -_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### unitsOf - -```solidity -function unitsOf(uint256 tokenID) external view returns (uint256 units) -``` - -_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### uri - -```solidity -function uri(uint256 tokenID) external view returns (string metadata) -``` - -_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------ | ----------- | -| metadata | string | undefined | - -## Events - -### ClaimStored - -```solidity -event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) -``` - -_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| claimID `indexed` | uint256 | undefined | -| uri | string | undefined | -| totalUnits | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/libs/Errors.md b/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/libs/Errors.md deleted file mode 100644 index 93fe0124..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/contracts/protocol/libs/Errors.md +++ /dev/null @@ -1,59 +0,0 @@ -# Errors - -_bitbeckers_ - -## Errors - -### AlreadyClaimed - -```solidity -error AlreadyClaimed() -``` - -### ArraySize - -```solidity -error ArraySize() -``` - -### DoesNotExist - -```solidity -error DoesNotExist() -``` - -### DuplicateEntry - -```solidity -error DuplicateEntry() -``` - -### Invalid - -```solidity -error Invalid() -``` - -### NotAllowed - -```solidity -error NotAllowed() -``` - -### NotApprovedOrOwner - -```solidity -error NotApprovedOrOwner() -``` - -### TransfersNotAllowed - -```solidity -error TransfersNotAllowed() -``` - -### TypeMismatch - -```solidity -error TypeMismatch() -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/api/index.md b/docs/versioned_docs/version-1.0.0/developer/api/index.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/_category_.yml b/docs/versioned_docs/version-1.0.0/developer/api/sdk/_category_.yml deleted file mode 100644 index 5c4b05b1..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/_category_.yml +++ /dev/null @@ -1,3 +0,0 @@ -label: "API SDK" -position: 0 -collapsed: false \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ClientError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ClientError.md deleted file mode 100644 index 6ff5198d..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ClientError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "ClientError" -title: "Class: ClientError" -sidebar_label: "ClientError" -sidebar_position: 0 -custom_edit_url: null ---- - -An error that is caused by a problem with the client. - -## Hierarchy - -- `Error` - - ↳ **`ClientError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new ClientError**(`message`, `payload?`): [`ClientError`](ClientError.md) - -Creates a new instance of the ClientError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`ClientError`](ClientError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:27](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L27) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:20](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L20) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ConfigurationError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ConfigurationError.md deleted file mode 100644 index ef36adaa..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ConfigurationError.md +++ /dev/null @@ -1,196 +0,0 @@ ---- -id: "ConfigurationError" -title: "Class: ConfigurationError" -sidebar_label: "ConfigurationError" -sidebar_position: 0 -custom_edit_url: null ---- - -The configuration was invalid - -## Hierarchy - -- `Error` - - ↳ **`ConfigurationError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new ConfigurationError**(`message`, `payload?`): [`ConfigurationError`](ConfigurationError.md) - -#### Parameters - -| Name | Type | -| :--------- | :------- | -| `message` | `string` | -| `payload?` | `Object` | - -#### Returns - -[`ConfigurationError`](ConfigurationError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:188](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L188) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:187](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L187) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ContractError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ContractError.md deleted file mode 100644 index ec81132a..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/ContractError.md +++ /dev/null @@ -1,197 +0,0 @@ ---- -id: "ContractError" -title: "Class: ContractError" -sidebar_label: "ContractError" -sidebar_position: 0 -custom_edit_url: null ---- - -An error that is returned by the contract - -## Hierarchy - -- `Error` - - ↳ **`ContractError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new ContractError**(`errorName?`, `payload?`): [`ContractError`](ContractError.md) - -#### Parameters - -| Name | Type | -| :------------- | :------------------------------ | -| `errorName?` | `string` | -| `payload?` | `Object` | -| `payload.data` | \`0x$\{string}\` \| `BaseError` | - -#### Returns - -[`ContractError`](ContractError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:43](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L43) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:41](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L41) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/FetchError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/FetchError.md deleted file mode 100644 index 1e32a4a2..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/FetchError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "FetchError" -title: "Class: FetchError" -sidebar_label: "FetchError" -sidebar_position: 0 -custom_edit_url: null ---- - -Fails fetching a remote resource - -## Hierarchy - -- `Error` - - ↳ **`FetchError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new FetchError**(`message`, `payload?`): [`FetchError`](FetchError.md) - -Creates a new instance of the FetchError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`FetchError`](FetchError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:65](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L65) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:58](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L58) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/HypercertClient.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/HypercertClient.md deleted file mode 100644 index ad12433a..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/HypercertClient.md +++ /dev/null @@ -1,818 +0,0 @@ ---- -id: "HypercertClient" -title: "Class: HypercertClient" -sidebar_label: "HypercertClient" -sidebar_position: 0 -custom_edit_url: null ---- - -The `HypercertClient` is a core class in the hypercerts SDK, providing a high-level interface to interact with the hypercerts system. - -It encapsulates the logic for storage, evaluation, indexing, and wallet interactions, abstracting the complexity and providing a simple API for users. -The client is read-only if the storage is read-only (no nft.storage/web3.storage keys) or if no walletClient was found. - -**`Example`** - -```ts -const config: Partial = { - chain: { id: 5 }, -}; -const client = new HypercertClient(config); -``` - -**`Param`** - -The configuration options for the client. - -## Implements - -- [`HypercertClientInterface`](../interfaces/HypercertClientInterface.md) - -## Constructors - -### constructor - -• **new HypercertClient**(`config`): [`HypercertClient`](HypercertClient.md) - -Creates a new instance of the `HypercertClient` class. - -This constructor takes a `config` parameter that is used to configure the client. The `config` parameter should be a `HypercertClientConfig` object. If the public client cannot be connected, it throws a `ClientError`. - -#### Parameters - -| Name | Type | Description | -| :------- | :------------------------------------------------------------------------- | :---------------------------------------- | -| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | The configuration options for the client. | - -#### Returns - -[`HypercertClient`](HypercertClient.md) - -**`Throws`** - -Will throw a `ClientError` if the public client cannot be connected. - -#### Defined in - -[sdk/src/client.ts:55](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L55) - -## Properties - -### \_config - -• `Readonly` **\_config**: `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> - -#### Defined in - -[sdk/src/client.ts:38](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L38) - ---- - -### \_evaluator - -• `Private` `Optional` **\_evaluator**: `HypercertEvaluator` - -#### Defined in - -[sdk/src/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L41) - ---- - -### \_indexer - -• `Private` **\_indexer**: `HypercertIndexer` - -#### Defined in - -[sdk/src/client.ts:42](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L42) - ---- - -### \_publicClient - -• `Private` **\_publicClient**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `account` | `undefined` | The Account of the Client. | -| `batch?` | \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } | Flags for batch settings. | -| `batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `call` | (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> | Executes a new message call immediately without submitting a transaction to the network. - Docs: https://viem.sh/docs/actions/public/call.html - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) ` | -| `chain` | `undefined` \| `Chain` | Chain for the client. | -| `createBlockFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> | Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter) **`Example`** `ts import { createPublicClient, createBlockFilter, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await createBlockFilter(client) // { id: "0x345a6572337856574a76364e457a4366", type: 'block' } ` | -| `createContractEventFilter` | (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html). - Docs: https://viem.sh/docs/contract/createContractEventFilter.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), }) ` | -| `createEventFilter` | (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> | Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createEventFilter.html - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', }) ` | -| `createPendingTransactionFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> | Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' } ` | -| `estimateContractGas` | (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas.html **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gas = await client.estimateContractGas({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), functionName: 'mint', account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | -| `estimateFeesPerGas` | (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> | Returns an estimate for the fees per gas for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateFeesPerGas() // { maxFeePerGas: ..., maxPriorityFeePerGas: ... } ` | -| `estimateGas` | (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas.html - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) **`Example`** `ts import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasEstimate = await client.estimateGas({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }) ` | -| `estimateMaxPriorityFeePerGas` | (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> | Returns an estimate for the max priority fee per gas (in wei) for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() // 10000000n ` | -| `extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> | - | -| `getBalance` | (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> | Returns the balance of an address in wei. - Docs: https://viem.sh/docs/actions/public/getBalance.html - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance) **`Remarks`** You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html). `ts const balance = await getBalance(client, { address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', blockTag: 'safe' }) const balanceAsEther = formatEther(balance) // "6.942" ` **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const balance = await client.getBalance({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) // 10000000000000000000000n (wei) ` | -| `getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getBlock() ` | -| `getBlockNumber` | (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> | Returns the number of the most recent block seen. - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blockNumber = await client.getBlockNumber() // 69420n ` | -| `getBlockTransactionCount` | (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of Transactions at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html - JSON-RPC Methods: - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const count = await client.getBlockTransactionCount() ` | -| `getBytecode` | (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> | Retrieves the bytecode at an address. - Docs: https://viem.sh/docs/contract/getBytecode.html - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getBytecode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', }) ` | -| `getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const chainId = await client.getChainId() // 1 ` | -| `getContractEvents` | (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents.html - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { wagmiAbi } from './abi' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getContractEvents(client, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: wagmiAbi, eventName: 'Transfer' }) ` | -| `getEnsAddress` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAddress = await client.getEnsAddress({ name: normalize('wagmi-dev.eth'), }) // '0xd2135CfB216b74109775236E36d4b433F1DF507B' ` | -| `getEnsAvatar` | (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAvatar = await client.getEnsAvatar({ name: normalize('wagmi-dev.eth'), }) // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio' ` | -| `getEnsName` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensName = await client.getEnsName({ address: '0xd2135CfB216b74109775236E36d4b433F1DF507B', }) // 'wagmi-dev.eth' ` | -| `getEnsResolver` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> | Gets resolver for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const resolverAddress = await client.getEnsResolver({ name: normalize('wagmi-dev.eth'), }) // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41' ` | -| `getEnsText` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const twitterRecord = await client.getEnsText({ name: normalize('wagmi-dev.eth'), key: 'com.twitter', }) // 'wagmi_sh' ` | -| `getFeeHistory` | (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> | Returns a collection of historical gas information. - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const feeHistory = await client.getFeeHistory({ blockCount: 4, rewardPercentiles: [25, 75], }) ` | -| `getFilterChanges` | (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called. - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) **`Remarks`** A Filter can be created from the following actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) Depending on the type of filter, the return value will be different: - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs. - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes. - If the filter was created with `createBlockFilter`, it returns a list of block hashes. **`Example`** `ts // Blocks import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createBlockFilter() const hashes = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Contract Events import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), eventName: 'Transfer', }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Raw Events import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Transactions import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() const hashes = await client.getFilterChanges({ filter }) ` | -| `getFilterLogs` | (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs since the filter was created. - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) **`Remarks`** `getFilterLogs` is only compatible with **event filters**. **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterLogs({ filter }) ` | -| `getGasPrice` | () => `Promise`<`bigint`\> | Returns the current price of gas (in wei). - Docs: https://viem.sh/docs/actions/public/getGasPrice.html - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasPrice = await client.getGasPrice() ` | -| `getLogs` | (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs matching the provided parameters. - Docs: https://viem.sh/docs/actions/public/getLogs.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getLogs() ` | -| `getProof` | (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> | Returns the account and storage values of the specified account including the Merkle-proof. - Docs: https://viem.sh/docs/actions/public/getProof.html - JSON-RPC Methods: - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getProof({ address: '0x...', storageKeys: ['0x...'], }) ` | -| `getStorageAt` | (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> | Returns the value from a storage slot at a given address. - Docs: https://viem.sh/docs/contract/getStorageAt.html - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getStorageAt } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getStorageAt({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', slot: toHex(0), }) ` | -| `getTransaction` | (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transaction = await client.getTransaction({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `getTransactionConfirmations` | (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> | Returns the number of blocks passed (confirmations) since the transaction was processed on a block. - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const confirmations = await client.getTransactionConfirmations({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `getTransactionCount` | (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionCount = await client.getTransactionCount({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `getTransactionReceipt` | (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> | Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.getTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `key` | `string` | A key for the client. | -| `multicall` | (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall). - Docs: https://viem.sh/docs/contract/multicall.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const abi = parseAbi([ 'function balanceOf(address) view returns (uint256)', 'function totalSupply() view returns (uint256)', ]) const result = await client.multicall({ contracts: [ { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'totalSupply', }, ], }) // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }] ` | -| `name` | `string` | A name for the client. | -| `pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `readContract` | (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts **`Remarks`** A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' import { readContract } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.readContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function balanceOf(address) view returns (uint256)']), functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }) // 424122n ` | -| `request` | `EIP1193RequestFn`<`PublicRpcSchema`\> | Request function wrapped with friendly error handling | -| `sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `simulateContract` | (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> | Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions. - Docs: https://viem.sh/docs/contract/simulateContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts **`Remarks`** This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32) view returns (uint32)']), functionName: 'mint', args: ['69420'], account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `type` | `string` | The type of client. | -| `uid` | `string` | A unique ID for the client. | -| `uninstallFilter` | (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> | Destroys a Filter that was created from one of the following Actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { createPendingTransactionFilter, uninstallFilter } from 'viem/public' const filter = await client.createPendingTransactionFilter() const uninstalled = await client.uninstallFilter({ filter }) // true ` | -| `verifyMessage` | (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> | - | -| `verifyTypedData` | (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> | - | -| `waitForTransactionReceipt` | (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> | Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed. - If a Transaction has been replaced: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions - Checks if one of the Transactions is a replacement - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt). **`Remarks`** The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions). Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce. There are 3 types of Transaction Replacement reasons: - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`) - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`) - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.waitForTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `watchBlockNumber` | (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` | Watches and returns incoming block numbers. - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlockNumber({ onBlockNumber: (blockNumber) => console.log(blockNumber), }) ` | -| `watchBlocks` | (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` | Watches and returns information for incoming blocks. - Docs: https://viem.sh/docs/actions/public/watchBlocks.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlocks({ onBlock: (block) => console.log(block), }) ` | -| `watchContractEvent` | (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent.html **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchContractEvent({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']), eventName: 'Transfer', args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, onLogs: (logs) => console.log(logs), }) ` | -| `watchEvent` | (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent.html - JSON-RPC Methods: - **RPC Provider supports `eth_newFilter`:** - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize). - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - **RPC Provider does not support `eth_newFilter`:** - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval. **`Remarks`** This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchEvent({ onLogs: (logs) => console.log(logs), }) ` | -| `watchPendingTransactions` | (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` | Watches and returns pending transaction hashes. - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html - JSON-RPC Methods: - When `poll: true` - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter. - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event. **`Remarks`** This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchPendingTransactions({ onTransactions: (hashes) => console.log(hashes), }) ` | - -#### Defined in - -[sdk/src/client.ts:43](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L43) - ---- - -### \_storage - -• `Private` **\_storage**: [`HypercertsStorage`](HypercertsStorage.md) - -#### Defined in - -[sdk/src/client.ts:39](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L39) - ---- - -### \_walletClient - -• `Private` `Optional` **\_walletClient**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :-------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `account` | `undefined` \| `Account` | The Account of the Client. | -| `addChain` | (`args`: `AddChainParameters`) => `Promise`<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain.html - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism }) ` | -| `batch?` | \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } | Flags for batch settings. | -| `batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `chain` | `undefined` \| `Chain` | Chain for the client. | -| `deployContract` | (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts **`Example`** `ts import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', }) ` | -| `extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> | - | -| `getAddresses` | () => `Promise`<`GetAddressesReturnType`\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses() ` | -| `getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1 ` | -| `getPermissions` | () => `Promise`<`GetPermissionsReturnType`\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions() ` | -| `key` | `string` | A key for the client. | -| `name` | `string` | A name for the client. | -| `pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `request` | `EIP1193RequestFn`<`WalletRpcSchema`\> | Request function wrapped with friendly error handling | -| `requestAddresses` | () => `Promise`<`RequestAddressesReturnType`\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses() ` | -| `requestPermissions` | (`args`: \{ [x: string]: Record; eth_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} }) ` | -| `sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `sendTransaction` | (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` | -| `signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage.html - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signMessage({ message: 'hello world', }) ` | -| `signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` | -| `signTypedData` | (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` | -| `switchChain` | (`args`: `SwitchChainParameters`) => `Promise`<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id }) ` | -| `transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `type` | `string` | The type of client. | -| `uid` | `string` | A unique ID for the client. | -| `watchAsset` | (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, }) ` | -| `writeContract` | (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.** **`Example`** `ts import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], }) ` **`Example`** `ts // With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request) ` | - -#### Defined in - -[sdk/src/client.ts:44](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L44) - ---- - -### readonly - -• **readonly**: `boolean` - -Whether the client is in read-only mode. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[readonly](../interfaces/HypercertClientInterface.md#readonly) - -#### Defined in - -[sdk/src/client.ts:45](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L45) - -## Accessors - -### config - -• `get` **config**(): `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> - -Gets the config for the client. - -#### Returns - -`Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> - -The client config. - -#### Defined in - -[sdk/src/client.ts:79](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L79) - ---- - -### contract - -• `get` **contract**(): `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -Gets the HypercertMinter contract used by the client. - -#### Returns - -`GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -The contract. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[contract](../interfaces/HypercertClientInterface.md#contract) - -#### Defined in - -[sdk/src/client.ts:103](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L103) - ---- - -### indexer - -• `get` **indexer**(): `HypercertIndexer` - -Gets the indexer for the client. - -#### Returns - -`HypercertIndexer` - -The indexer. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[indexer](../interfaces/HypercertClientInterface.md#indexer) - -#### Defined in - -[sdk/src/client.ts:95](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L95) - ---- - -### storage - -• `get` **storage**(): [`HypercertsStorage`](HypercertsStorage.md) - -Gets the storage layer for the client. - -#### Returns - -[`HypercertsStorage`](HypercertsStorage.md) - -The storage layer. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[storage](../interfaces/HypercertClientInterface.md#storage) - -#### Defined in - -[sdk/src/client.ts:87](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L87) - -## Methods - -### batchMintClaimFractionsFromAllowlists - -▸ **batchMintClaimFractionsFromAllowlists**(`claimIds`, `units`, `proofs`, `roots?`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints multiple claim fractions from allowlists in a batch. - -This method first retrieves the wallet client and account using the `getWallet` method. If the roots are provided, it verifies each proof using the `verifyMerkleProofs` function. If any of the proofs are invalid, it throws an `InvalidOrMissingError`. -It then simulates a contract call to the `batchMintClaimsFromAllowlists` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :------------------------------------------------------------------------ | -| `claimIds` | `bigint`[] | The IDs of the claims to mint. | -| `units` | `bigint`[] | The units of each claim to mint. | -| `proofs` | (\`0x$\{string}\` \| `Uint8Array`)[][] | The proofs for each claim. | -| `roots?` | (\`0x$\{string}\` \| `Uint8Array`)[] | The roots of each proof. If provided, they are used to verify the proofs. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw an `InvalidOrMissingError` if any of the proofs are invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[batchMintClaimFractionsFromAllowlists](../interfaces/HypercertClientInterface.md#batchmintclaimfractionsfromallowlists) - -#### Defined in - -[sdk/src/client.ts:459](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L459) - ---- - -### batchTransferFractions - -▸ **batchTransferFractions**(`fractionIds`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers multiple claim fractions to a new owner. - -This method first retrieves the wallet client and account using the `getWallet` method. -It then simulates a contract call to the `safeBatchTransferFrom` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------- | -| `fractionIds` | `bigint`[] | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[batchTransferFractions](../interfaces/HypercertClientInterface.md#batchtransferfractions) - -#### Defined in - -[sdk/src/client.ts:210](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L210) - ---- - -### burnClaimFraction - -▸ **burnClaimFraction**(`claimId`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Burns a claim fraction. - -This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner of the claim using the `ownerOf` method of the read contract. -If the claim is not owned by the account, it throws a `ClientError`. -It then simulates a contract call to the `burnFraction` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :---------------------------------------- | -| `claimId` | `bigint` | The ID of the claim to burn. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `ClientError` if the claim is not owned by the account. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[burnClaimFraction](../interfaces/HypercertClientInterface.md#burnclaimfraction) - -#### Defined in - -[sdk/src/client.ts:382](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L382) - ---- - -### createAllowlist - -▸ **createAllowlist**(`allowList`, `metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Creates an allowlist. - -This method first validates the provided allowlist and metadata using the `validateAllowlist` and `validateMetaData` functions respectively. If either is invalid, it throws a `MalformedDataError`. -It then creates an allowlist from the provided entries and stores it on IPFS using the `storeData` method of the storage client. -After that, it stores the metadata (including the CID of the allowlist) on IPFS using the `storeMetadata` method of the storage client. -Finally, it simulates a contract call to the `createAllowlist` function with the provided parameters and the stored metadata CID, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :---------------------------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The entries for the allowlist. | -| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restrictions for the claim. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided allowlist or metadata is invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[createAllowlist](../interfaces/HypercertClientInterface.md#createallowlist) - -#### Defined in - -[sdk/src/client.ts:243](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L243) - ---- - -### getCleanedOverrides - -▸ **getCleanedOverrides**(`overrides?`): `Object` - -#### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Object` - -#### Defined in - -[sdk/src/client.ts:499](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L499) - ---- - -### getContractConfig - -▸ **getContractConfig**(): `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[], `undefined` \| `Client`<`Transport`, `undefined` \| `Chain`\>, `undefined` \| `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`\>, \`0x$\{string}\`, `string`, `string`, `string`, `false`\> - -#### Returns - -`GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[], `undefined` \| `Client`<`Transport`, `undefined` \| `Chain`\>, `undefined` \| `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`\>, \`0x$\{string}\`, `string`, `string`, `string`, `false`\> - -#### Defined in - -[sdk/src/client.ts:490](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L490) - ---- - -### getTransferRestrictions - -▸ **getTransferRestrictions**(`fractionId`): `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -Gets the TransferRestrictions for a claim. - -This method first retrieves the read contract using the `getContract` method. It then simulates a contract call to the `readTransferRestriction` function with the provided fraction ID. - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `fractionId` | `bigint` | - -#### Returns - -`Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -a Promise that resolves to the applicable transfer restrictions. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[getTransferRestrictions](../interfaces/HypercertClientInterface.md#gettransferrestrictions) - -#### Defined in - -[sdk/src/client.ts:162](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L162) - ---- - -### getWallet - -▸ **getWallet**(): `Object` - -#### Returns - -`Object` - -| Name | Type | -| :--------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `account` | `Account` | -| `walletClient` | \{ `account`: `undefined` \| `Account` ; `addChain`: (`args`: `AddChainParameters`) => `Promise`<`void`\> ; `batch?`: \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } ; `cacheTime`: `number` ; `chain`: `undefined` \| `Chain` ; `deployContract`: (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> ; `extend`: (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> ; `getAddresses`: () => `Promise`<`GetAddressesReturnType`\> ; `getChainId`: () => `Promise`<`number`\> ; `getPermissions`: () => `Promise`<`GetPermissionsReturnType`\> ; `key`: `string` ; `name`: `string` ; `pollingInterval`: `number` ; `prepareTransactionRequest`: (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> ; `request`: `EIP1193RequestFn`<`WalletRpcSchema`\> ; `requestAddresses`: () => `Promise`<`RequestAddressesReturnType`\> ; `requestPermissions`: (`args`: \{ [x: string]: Record; eth\_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> ; `sendRawTransaction`: (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> ; `sendTransaction`: (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> ; `signMessage`: (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> ; `signTransaction`: (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> ; `signTypedData`: (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> ; `switchChain`: (`args`: `SwitchChainParameters`) => `Promise`<`void`\> ; `transport`: `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> ; `type`: `string` ; `uid`: `string` ; `watchAsset`: (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> ; `writeContract`: (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> } | -| `walletClient.account` | `undefined` \| `Account` | -| `walletClient.addChain` | (`args`: `AddChainParameters`) => `Promise`<`void`\> | -| `walletClient.batch?` | \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } | -| `walletClient.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | -| `walletClient.cacheTime` | `number` | -| `walletClient.chain` | `undefined` \| `Chain` | -| `walletClient.deployContract` | (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> | -| `walletClient.getAddresses` | () => `Promise`<`GetAddressesReturnType`\> | -| `walletClient.getChainId` | () => `Promise`<`number`\> | -| `walletClient.getPermissions` | () => `Promise`<`GetPermissionsReturnType`\> | -| `walletClient.key` | `string` | -| `walletClient.name` | `string` | -| `walletClient.pollingInterval` | `number` | -| `walletClient.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | -| `walletClient.request` | `EIP1193RequestFn`<`WalletRpcSchema`\> | -| `walletClient.requestAddresses` | () => `Promise`<`RequestAddressesReturnType`\> | -| `walletClient.requestPermissions` | (`args`: \{ [x: string]: Record; eth_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> | -| `walletClient.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.sendTransaction` | (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.signTypedData` | (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.switchChain` | (`args`: `SwitchChainParameters`) => `Promise`<`void`\> | -| `walletClient.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | -| `walletClient.type` | `string` | -| `walletClient.uid` | `string` | -| `walletClient.watchAsset` | (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> | -| `walletClient.writeContract` | (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | - -#### Defined in - -[sdk/src/client.ts:509](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L509) - ---- - -### mergeFractionUnits - -▸ **mergeFractionUnits**(`fractionIds`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Merges multiple fractions into a single fraction. - -This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner of each fraction using the `ownerOf` method of the read contract. -If any of the fractions are not owned by the account, it throws a `ClientError`. -It then simulates a contract call to the `mergeFractions` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------------------------------------------------------- | :---------------------------------------- | -| `fractionIds` | `bigint`[] | The IDs of the fractions to merge. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `ClientError` if any of the fractions are not owned by the account. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[mergeFractionUnits](../interfaces/HypercertClientInterface.md#mergefractionunits) - -#### Defined in - -[sdk/src/client.ts:341](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L341) - ---- - -### mintClaim - -▸ **mintClaim**(`metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a new claim. - -This method first validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. -It then stores the metadata on IPFS using the `storeMetadata` method of the storage client. -After that, it simulates a contract call to the `mintClaim` function with the provided parameters and the stored metadata CID to validate the transaction. -Finally, it submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :---------------------------------------- | -| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restrictions for the claim. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided metadata is invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[mintClaim](../interfaces/HypercertClientInterface.md#mintclaim) - -#### Defined in - -[sdk/src/client.ts:127](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L127) - ---- - -### mintClaimFractionFromAllowlist - -▸ **mintClaimFractionFromAllowlist**(`claimId`, `units`, `proof`, `root?`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a claim fraction from an allowlist. - -This method first retrieves the wallet client and account using the `getWallet` method. It then verifies the provided proof using the `verifyMerkleProof` function. If the proof is invalid, it throws an `InvalidOrMissingError`. -It then simulates a contract call to the `mintClaimFromAllowlist` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :------------------------------------------------------------------ | -| `claimId` | `bigint` | The ID of the claim to mint. | -| `units` | `bigint` | The units of the claim to mint. | -| `proof` | (\`0x$\{string}\` \| `Uint8Array`)[] | The proof for the claim. | -| `root?` | \`0x$\{string}\` \| `Uint8Array` | The root of the proof. If provided, it is used to verify the proof. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw an `InvalidOrMissingError` if the proof is invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[mintClaimFractionFromAllowlist](../interfaces/HypercertClientInterface.md#mintclaimfractionfromallowlist) - -#### Defined in - -[sdk/src/client.ts:415](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L415) - ---- - -### simulateRequest - -▸ **simulateRequest**(`account`, `functionName`, `args`, `overrides?`): `Promise`<\{ `abi`: `Narrow`<\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" }\>[] ; `accessList?`: `AccessList` ; `account`: \`0x$\{string}\` \| `Account` ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `chain`: `undefined` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"legacy"` \| `"eip2930"` \| `"eip1559"` ; `value?`: `bigint` }\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------------------------------------------- | -| `account` | `Account` | -| `functionName` | `string` | -| `args` | `unknown`[] | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Promise`<\{ `abi`: `Narrow`<\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" }\>[] ; `accessList?`: `AccessList` ; `account`: \`0x$\{string}\` \| `Account` ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `chain`: `undefined` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"legacy"` \| `"eip2930"` \| `"eip1559"` ; `value?`: `bigint` }\> - -#### Defined in - -[sdk/src/client.ts:519](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L519) - ---- - -### splitFractionUnits - -▸ **splitFractionUnits**(`fractionId`, `fractions`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Splits a fraction into multiple fractions. - -This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner and total units of the fraction using the `ownerOf` and `unitsOf` methods of the read contract. -If the fraction is not owned by the account, it throws a `ClientError`. -It then checks if the sum of the provided fractions is equal to the total units of the fraction. If not, it throws a `ClientError`. -Finally, it simulates a contract call to the `splitFraction` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :---------------------------------------- | -| `fractionId` | `bigint` | The ID of the fraction to split. | -| `fractions` | `bigint`[] | The fractions to split the fraction into. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `ClientError` if the fraction is not owned by the account or if the sum of the fractions is not equal to the total units of the fraction. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[splitFractionUnits](../interfaces/HypercertClientInterface.md#splitfractionunits) - -#### Defined in - -[sdk/src/client.ts:296](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L296) - ---- - -### submitRequest - -▸ **submitRequest**(`request`): `Promise`<\`0x$\{string}\`\> - -Submits a contract request. - -This method submits a contract request using the `writeContract` method of the wallet client. If the request fails, it throws a `ClientError`. - -#### Parameters - -| Name | Type | Description | -| :-------- | :---- | :------------------------------ | -| `request` | `any` | The contract request to submit. | - -#### Returns - -`Promise`<\`0x$\{string}\`\> - -A promise that resolves to the hash of the submitted request. - -**`Throws`** - -Will throw a `ClientError` if the request fails. - -#### Defined in - -[sdk/src/client.ts:550](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L550) - ---- - -### transferFraction - -▸ **transferFraction**(`fractionId`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers a claim fraction to a new owner. - -This method first retrieves the wallet client and account using the `getWallet` method. -It then simulates a contract call to the `safeTransferFrom` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `fractionId` | `bigint` | -| `to` | `string` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[transferFraction](../interfaces/HypercertClientInterface.md#transferfraction) - -#### Defined in - -[sdk/src/client.ts:182](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/client.ts#L182) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/HypercertsStorage.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/HypercertsStorage.md deleted file mode 100644 index b76c9f96..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/HypercertsStorage.md +++ /dev/null @@ -1,243 +0,0 @@ ---- -id: "HypercertsStorage" -title: "Class: HypercertsStorage" -sidebar_label: "HypercertsStorage" -sidebar_position: 0 -custom_edit_url: null ---- - -A class that provides storage functionality for Hypercerts. - -This class implements the `HypercertStorageInterface` and provides methods for storing and retrieving Hypercerts. It uses the NFT Storage and Web3 Storage APIs for storage, and can be configured to be read-only. - -**`Example`** - -```ts -const storage = new HypercertsStorage({ - nftStorageToken: "your-nft-storage-token", - web3StorageToken: "your-web3-storage-token", -}); -const metadata = await storage.getMetadata("your-hypercert-id"); -``` - -## Implements - -- [`HypercertStorageInterface`](../interfaces/HypercertStorageInterface.md) - -## Constructors - -### constructor - -• **new HypercertsStorage**(`overrides`): [`HypercertsStorage`](HypercertsStorage.md) - -Creates a new instance of the `HypercertsStorage` class. - -This constructor takes an optional `overrides` parameter that can be used to override the default configuration. If the NFT Storage or Web3 Storage API keys are missing or invalid, the storage will be read-only. - -#### Parameters - -| Name | Type | Description | -| :---------- | :--------------------------------------------------------------------------- | :------------------------------------------- | -| `overrides` | `Partial`<[`HypercertStorageConfig`](../modules.md#hypercertstorageconfig)\> | The configuration overrides for the storage. | - -#### Returns - -[`HypercertsStorage`](HypercertsStorage.md) - -#### Defined in - -[sdk/src/storage.ts:47](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L47) - -## Properties - -### nftStorageClient - -• `Optional` **nftStorageClient**: `NFTStorage` - -The NFT Storage client used for storing and retrieving Hypercerts. - -#### Defined in - -[sdk/src/storage.ts:36](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L36) - ---- - -### readonly - -• **readonly**: `boolean` = `true` - -Whether the storage is read-only. If true, the storage methods will not perform any write operations. - -#### Defined in - -[sdk/src/storage.ts:34](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L34) - ---- - -### web3StorageClient - -• `Optional` **web3StorageClient**: `Web3Storage` - -The Web3 Storage client used for storing and retrieving Hypercerts. - -#### Defined in - -[sdk/src/storage.ts:38](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L38) - -## Methods - -### getData - -▸ **getData**(`cidOrIpfsUri`): `Promise`<`unknown`\> - -Retrieves data from IPFS using the provided CID or IPFS URI. - -This method first retrieves the data from IPFS using the `getFromIPFS` function. It then parses the retrieved data as JSON and returns it. - -#### Parameters - -| Name | Type | Description | -| :------------- | :------- | :------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | - -#### Returns - -`Promise`<`unknown`\> - -A promise that resolves to the retrieved data. - -**`Throws`** - -Will throw a `FetchError` if the retrieval operation fails. - -**`Throws`** - -Will throw a `MalformedDataError` if the retrieved data is not a single file. - -**`Remarkts`** - -Note: The original implementation using the Web3 Storage client is currently commented out due to issues with upstream repos. This will be replaced once those issues are resolved. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[getData](../interfaces/HypercertStorageInterface.md#getdata) - -#### Defined in - -[sdk/src/storage.ts:167](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L167) - ---- - -### getMetadata - -▸ **getMetadata**(`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> - -Retrieves Hypercert metadata from IPFS using the provided CID or IPFS URI. - -This method first retrieves the data from IPFS using the `getFromIPFS` function. It then validates the retrieved data using the `validateMetaData` function. If the data is invalid, it throws a `MalformedDataError`. -If the data is valid, it returns the data as a `HypercertMetadata` object. - -#### Parameters - -| Name | Type | Description | -| :------------- | :------- | :----------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | - -#### Returns - -`Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> - -A promise that resolves to the retrieved metadata. - -**`Throws`** - -Will throw a `MalformedDataError` if the retrieved data is invalid. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[getMetadata](../interfaces/HypercertStorageInterface.md#getmetadata) - -#### Defined in - -[sdk/src/storage.ts:114](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L114) - ---- - -### storeData - -▸ **storeData**(`data`): `Promise`<`CIDString`\> - -Stores data using the Web3 Storage client. - -This method first checks if the storage is read-only or if the Web3 Storage client is not configured. If either of these conditions is true, it throws a `StorageError`. -It then creates a new Blob from the provided data and stores it using the Web3 Storage client. If the storage operation fails, it throws a `StorageError`. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------- | :----------------------------------------------- | -| `data` | `unknown` | The data to store. This can be any type of data. | - -#### Returns - -`Promise`<`CIDString`\> - -A promise that resolves to the CID of the stored data. - -**`Throws`** - -Will throw a `StorageError` if the storage is read-only, if the Web3 Storage client is not configured, or if the storage operation fails. - -**`Remarks`** - -Even though web3.storage takes a list of files, we'll assume we're only storing 1 JSON blob. -Because we pay for storage quotas, this data is stored best effort. -If you are using our default keys, we may delete older data if we hit our storage quota. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[storeData](../interfaces/HypercertStorageInterface.md#storedata) - -#### Defined in - -[sdk/src/storage.ts:139](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L139) - ---- - -### storeMetadata - -▸ **storeMetadata**(`data`): `Promise`<`CIDString`\> - -Stores Hypercert metadata using the NFT Storage client. - -This method first checks if the storage is read-only or if the NFT Storage client is not configured. If either of these conditions is true, it throws a `StorageError`. -It then validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. -If the metadata is valid, it creates a new Blob from the metadata and stores it using the NFT Storage client. If the storage operation fails, it throws a `StorageError`. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------------------------------------------------------- | :----------------------------------------------------------------------------------------------------- | -| `data` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The Hypercert metadata to store. This should be an object that conforms to the HypercertMetadata type. | - -#### Returns - -`Promise`<`CIDString`\> - -A promise that resolves to the CID of the stored metadata. - -**`Throws`** - -Will throw a `StorageError` if the storage is read-only, if the NFT Storage client is not configured, or if the storage operation fails. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided metadata is invalid. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[storeMetadata](../interfaces/HypercertStorageInterface.md#storemetadata) - -#### Defined in - -[sdk/src/storage.ts:81](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/storage.ts#L81) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/InvalidOrMissingError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/InvalidOrMissingError.md deleted file mode 100644 index 055cc2e6..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/InvalidOrMissingError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "InvalidOrMissingError" -title: "Class: InvalidOrMissingError" -sidebar_label: "InvalidOrMissingError" -sidebar_position: 0 -custom_edit_url: null ---- - -The provided value was undefined or empty - -## Hierarchy - -- `Error` - - ↳ **`InvalidOrMissingError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new InvalidOrMissingError**(`message`, `payload?`): [`InvalidOrMissingError`](InvalidOrMissingError.md) - -Creates a new instance of the InvalidOrMissingError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`InvalidOrMissingError`](InvalidOrMissingError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:83](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L83) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:76](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L76) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/MalformedDataError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/MalformedDataError.md deleted file mode 100644 index d9349882..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/MalformedDataError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "MalformedDataError" -title: "Class: MalformedDataError" -sidebar_label: "MalformedDataError" -sidebar_position: 0 -custom_edit_url: null ---- - -Data doesn't conform to expectations - -## Hierarchy - -- `Error` - - ↳ **`MalformedDataError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new MalformedDataError**(`message`, `payload?`): [`MalformedDataError`](MalformedDataError.md) - -Creates a new instance of the MalformedDataError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`MalformedDataError`](MalformedDataError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:155](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L155) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:148](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L148) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/MintingError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/MintingError.md deleted file mode 100644 index 66739db6..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/MintingError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "MintingError" -title: "Class: MintingError" -sidebar_label: "MintingError" -sidebar_position: 0 -custom_edit_url: null ---- - -Minting transaction failed - -## Hierarchy - -- `Error` - - ↳ **`MintingError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new MintingError**(`message`, `payload?`): [`MintingError`](MintingError.md) - -Creates a new instance of the MintingError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`MintingError`](MintingError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:101](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L101) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:94](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L94) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/StorageError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/StorageError.md deleted file mode 100644 index 7a9bbf11..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/StorageError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "StorageError" -title: "Class: StorageError" -sidebar_label: "StorageError" -sidebar_position: 0 -custom_edit_url: null ---- - -Fails storing to a remote resource - -## Hierarchy - -- `Error` - - ↳ **`StorageError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new StorageError**(`message`, `payload?`): [`StorageError`](StorageError.md) - -Creates a new instance of the StorageError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`StorageError`](StorageError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:119](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L119) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:112](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L112) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/UnknownSchemaError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/UnknownSchemaError.md deleted file mode 100644 index 5ccf9796..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/UnknownSchemaError.md +++ /dev/null @@ -1,201 +0,0 @@ ---- -id: "UnknownSchemaError" -title: "Class: UnknownSchemaError" -sidebar_label: "UnknownSchemaError" -sidebar_position: 0 -custom_edit_url: null ---- - -Schema could not be loaded - -## Hierarchy - -- `Error` - - ↳ **`UnknownSchemaError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new UnknownSchemaError**(`message`, `payload?`): [`UnknownSchemaError`](UnknownSchemaError.md) - -Creates a new instance of the UnknownSchemaError class. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | -| `payload.schemaName` | `string` | - | - -#### Returns - -[`UnknownSchemaError`](UnknownSchemaError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:137](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L137) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Type declaration - -| Name | Type | -| :----------- | :------- | -| `schemaName` | `string` | - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:130](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L130) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/UnsupportedChainError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/UnsupportedChainError.md deleted file mode 100644 index 774e83f5..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/UnsupportedChainError.md +++ /dev/null @@ -1,202 +0,0 @@ ---- -id: "UnsupportedChainError" -title: "Class: UnsupportedChainError" -sidebar_label: "UnsupportedChainError" -sidebar_position: 0 -custom_edit_url: null ---- - -This blockchain is not yet supported -Please file an issue - -## Hierarchy - -- `Error` - - ↳ **`UnsupportedChainError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new UnsupportedChainError**(`message`, `payload?`): [`UnsupportedChainError`](UnsupportedChainError.md) - -Creates a new instance of the UnsupportedChainError class. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------------------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | -| `payload.chainID` | `undefined` \| `string` \| `number` | - | - -#### Returns - -[`UnsupportedChainError`](UnsupportedChainError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:174](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L174) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Type declaration - -| Name | Type | -| :-------- | :---------------------------------- | -| `chainID` | `undefined` \| `string` \| `number` | - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:167](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L167) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/_category_.yml b/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/_category_.yml deleted file mode 100644 index 55c7980a..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/classes/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Classes" -position: 3 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/index.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/index.md deleted file mode 100644 index 408b51f2..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/index.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -id: "index" -title: "@hypercerts-org/sdk" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# Hypercert SDK - -## Quickstart Guide - -1. Install the SDK using npm or yarn: - -```bash -npm install @hypercerts-org/sdk -``` - -or - -```bash - yarn add @hypercerts-org/sdk -``` - -2. Import the SDK into your project: - -```bash -import { HypercertClient } from "@hypercerts-org/sdk"; -``` - -3. Create a new instance of the HypercertClient class with your configuration options: - -```js -const client = new HypercertClient({ - chain: { id: 5 } // required - nftStorageToken, - web3StorageToken, -}); -``` - -> **Note** If there's no `walletClient`, `nftStorageToken` or `web3StorageToken` provided, the client will run in -> [read-only mode](#read-only-mode) - -4. Use the client object to interact with the Hypercert network. - -For example, you can use the `client.mintClaim` method to create a new claim: - -```js -const tx = await client.mintClaim( - metaData, - totalUnits, - transferRestriction, - overrides, -); -``` - -This will validate the metadata, store it on IPFS, create a new hypercert on-chain and return a transaction receipt. - -You can also use the client to query the subgraph and retrieve which claims an address owns: - -```js -const claims = await client.indexer.fractionsByOwner(owner), -``` - -For more information on how to use the SDK, check out the -[developer documentation](https://hypercerts.org/docs/developer/) and the -[Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet). - -That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. Don't forget to set your -environment variables for your NFT.storage and web3.storage API keys in your .env file. - -## Config - -HypercertClientConfig is a configuration object used when initializing a new instance of the HypercertClient. It allows -you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide -`chain.id` to initalize the client in `readonly` mode. - -| Field | Type | Description | -| --------------------------- | ------- | ---------------------------------------------------------------------------------------------- | -| `chain` | Object | Partial configuration for the blockchain network. | -| `contractAddress` | String | The address of the deployed contract. | -| `graphUrl` | String | The URL to the subgraph that indexes the contract events. Override for localized testing. | -| `graphName` | String | The name of the subgraph. | -| `nftStorageToken` | String | The API token for NFT.storage. | -| `web3StorageToken` | String | The API token for Web3.storage. | -| `easContractAddress` | String | The address of the EAS contract. | -| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | -| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | -| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | -| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | -| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | - -### Read-only mode - -The SDK client will be in read-only mode if any of the following conditions are true: - -- The client was initialized without a walletprovider. -- The contract address is not set. -- The storage layer is in read-only mode. - -If any of these conditions are true, the readonly property of the HypercertClient instance will be set to true, and a -warning message will be logged indicating that the client is in read-only mode. - -### Logging - -The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level -determines which log messages are printed to the console. By default, the logger is configured to log messages with a -level of info or higher to the console. - -## Client modules - -The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient -has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, -HypercertIndexer, and HypercertMinter classes, respectively. - -```js -const { - client: { storage }, -} = new HypercertClient({ chain: { id: 5 } }); -``` - -The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata on IPFS and -NFT.storage. It is used by the HypercertClient to store metadata when creating new Hypercerts. - -```js -const { - client: { indexer }, -} = new HypercertClient({ chain: { id: 5 } }); -``` - -The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. -It is used by the HypercertClient to retrieve event-based data via the subgraph - -```js -const { - client: { contract }, -} = new HypercertClient({ chain: { id: 5 } }); -``` - -Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used -by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. - -By providing instances of these classes through the storage, indexer, and contract getters, the HypercertClient allows -developers to easily interact with the various components of the Hypercert system. For example, a developer could use -the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based -on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the -contract. diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/CustomError.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/CustomError.md deleted file mode 100644 index a05c1011..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/CustomError.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -id: "CustomError" -title: "Interface: CustomError" -sidebar_label: "CustomError" -sidebar_position: 0 -custom_edit_url: null ---- - -An interface for errors that have a specific type. - -## Implemented by - -- [`ClientError`](../classes/ClientError.md) -- [`ConfigurationError`](../classes/ConfigurationError.md) -- [`ContractError`](../classes/ContractError.md) -- [`FetchError`](../classes/FetchError.md) -- [`InvalidOrMissingError`](../classes/InvalidOrMissingError.md) -- [`MalformedDataError`](../classes/MalformedDataError.md) -- [`MintingError`](../classes/MintingError.md) -- [`StorageError`](../classes/StorageError.md) -- [`UnknownSchemaError`](../classes/UnknownSchemaError.md) -- [`UnsupportedChainError`](../classes/UnsupportedChainError.md) - -## Properties - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Defined in - -[sdk/src/types/errors.ts:10](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L10) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/DuplicateEvaluation.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/DuplicateEvaluation.md deleted file mode 100644 index 4c1a3b98..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/DuplicateEvaluation.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: "DuplicateEvaluation" -title: "Interface: DuplicateEvaluation" -sidebar_label: "DuplicateEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### duplicateHypercerts - -• **duplicateHypercerts**: [`HypercertPointer`](HypercertPointer.md)[] - -#### Defined in - -[sdk/src/types/evaluation.d.ts:22](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L22) - ---- - -### explanation - -• **explanation**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:24](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L24) - ---- - -### realHypercert - -• **realHypercert**: [`HypercertPointer`](HypercertPointer.md) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L23) - ---- - -### type - -• **type**: `"duplicate"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:21](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L21) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/EASEvaluation.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/EASEvaluation.md deleted file mode 100644 index 8e19a07b..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/EASEvaluation.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: "EASEvaluation" -title: "Interface: EASEvaluation" -sidebar_label: "EASEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### chainId - -• **chainId**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:41](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L41) - ---- - -### contract - -• **contract**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:42](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L42) - ---- - -### type - -• **type**: `"EAS"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L40) - ---- - -### uid - -• **uid**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:43](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L43) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClaimdata.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClaimdata.md deleted file mode 100644 index cb04ac04..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClaimdata.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -id: "HypercertClaimdata" -title: "Interface: HypercertClaimdata" -sidebar_label: "HypercertClaimdata" -sidebar_position: 0 -custom_edit_url: null ---- - -Properties of an impact claim - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### contributors - -• **contributors**: `Object` - -Contributors - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:53](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/claimdata.d.ts#L53) - ---- - -### impact_scope - -• **impact_scope**: `Object` - -Scopes of impact - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `excludes?` | `string`[] | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/claimdata.d.ts#L15) - ---- - -### impact_timeframe - -• **impact_timeframe**: `Object` - -Impact time period. The value is UNIX time in seconds from epoch. - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `name?` | `string` | -| `value?` | `number`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:44](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/claimdata.d.ts#L44) - ---- - -### rights - -• `Optional` **rights**: `Object` - -Rights - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `excludes?` | `string`[] | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:62](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/claimdata.d.ts#L62) - ---- - -### work_scope - -• **work_scope**: `Object` - -Scopes of work - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `excludes?` | `string`[] | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:25](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/claimdata.d.ts#L25) - ---- - -### work_timeframe - -• **work_timeframe**: `Object` - -Work time period. The value is UNIX time in seconds from epoch. - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `name?` | `string` | -| `value?` | `number`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/claimdata.d.ts#L35) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientInterface.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientInterface.md deleted file mode 100644 index d11e9857..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientInterface.md +++ /dev/null @@ -1,427 +0,0 @@ ---- -id: "HypercertClientInterface" -title: "Interface: HypercertClientInterface" -sidebar_label: "HypercertClientInterface" -sidebar_position: 0 -custom_edit_url: null ---- - -The interface for the Hypercert client. - -## Hierarchy - -- [`HypercertClientMethods`](HypercertClientMethods.md) - -- [`HypercertClientState`](HypercertClientState.md) - - ↳ **`HypercertClientInterface`** - -## Implemented by - -- [`HypercertClient`](../classes/HypercertClient.md) - -## Properties - -### batchMintClaimFractionsFromAllowlists - -• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `bigint`[], `units`: `bigint`[], `proofs`: (\`0x$\{string}\` \| `Uint8Array`)[][]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimIds`, `units`, `proofs`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Batch mints a claim fraction from an allowlist - -##### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------- | :---------------------------------------------------- | -| `claimIds` | `bigint`[] | Array of the IDs of the claims to mint fractions for. | -| `units` | `bigint`[] | Array of the number of units for each fraction. | -| `proofs` | (\`0x$\{string}\` \| `Uint8Array`)[][] | Array of Merkle proofs for the allowlists. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction receipt - -A Promise that resolves to the transaction hash - -**`Note`** - -The length of the arrays must be equal. - -**`Note`** - -The order of the arrays must be equal. - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[batchMintClaimFractionsFromAllowlists](HypercertClientMethods.md#batchmintclaimfractionsfromallowlists) - -#### Defined in - -[sdk/src/types/client.ts:237](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L237) - ---- - -### batchTransferFractions - -• **batchTransferFractions**: (`fractionIds`: `bigint`[], `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers multiple claim fractions to a new owner. - -##### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------- | -| `fractionIds` | `bigint`[] | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[batchTransferFractions](HypercertClientMethods.md#batchtransferfractions) - -#### Defined in - -[sdk/src/types/client.ts:171](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L171) - ---- - -### burnClaimFraction - -• **burnClaimFraction**: (`fractionId`: `bigint`) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Burns a claim fraction. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------------ | -| `fractionId` | `bigint` | The ID of the claim fraction to burn. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[burnClaimFraction](HypercertClientMethods.md#burnclaimfraction) - -#### Defined in - -[sdk/src/types/client.ts:212](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L212) - ---- - -### contract - -• **contract**: `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[contract](HypercertClientState.md#contract) - -#### Defined in - -[sdk/src/types/client.ts:124](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L124) - ---- - -### createAllowlist - -• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Creates a new allowlist and mints a new claim with the allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[createAllowlist](HypercertClientMethods.md#createallowlist) - -#### Defined in - -[sdk/src/types/client.ts:185](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L185) - ---- - -### getTransferRestrictions - -• **getTransferRestrictions**: (`fractionId`: `bigint`) => `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -Retrieves the TransferRestrictions for a claim. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------- | -| `fractionId` | `bigint` | The ID of the claim to retrieve. | - -##### Returns - -`Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -A Promise that resolves to the applicable transfer restrictions. - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[getTransferRestrictions](HypercertClientMethods.md#gettransferrestrictions) - -#### Defined in - -[sdk/src/types/client.ts:149](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L149) - ---- - -### indexer - -• **indexer**: `HypercertIndexer` - -The indexer used by the client. - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[indexer](HypercertClientState.md#indexer) - -#### Defined in - -[sdk/src/types/client.ts:123](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L123) - ---- - -### mergeFractionUnits - -• **mergeFractionUnits**: (`fractionIds`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Merges multiple claim fractions into a single claim. - -##### Parameters - -| Name | Type | Description | -| :------------ | :--------- | :--------------------------------------- | -| `fractionIds` | `bigint`[] | The IDs of the claim fractions to merge. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[mergeFractionUnits](HypercertClientMethods.md#mergefractionunits) - -#### Defined in - -[sdk/src/types/client.ts:205](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L205) - ---- - -### mintClaim - -• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a new claim. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[mintClaim](HypercertClientMethods.md#mintclaim) - -#### Defined in - -[sdk/src/types/client.ts:138](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L138) - ---- - -### mintClaimFractionFromAllowlist - -• **mintClaimFractionFromAllowlist**: (`claimId`: `bigint`, `units`: `bigint`, `proof`: (\`0x$\{string}\` \| `Uint8Array`)[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimId`, `units`, `proof`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a claim fraction from an allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------- | :------------------------------------------ | -| `claimId` | `bigint` | The ID of the claim to mint a fraction for. | -| `units` | `bigint` | The number of units for the fraction. | -| `proof` | (\`0x$\{string}\` \| `Uint8Array`)[] | The Merkle proof for the allowlist. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[mintClaimFractionFromAllowlist](HypercertClientMethods.md#mintclaimfractionfromallowlist) - -#### Defined in - -[sdk/src/types/client.ts:221](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L221) - ---- - -### readonly - -• **readonly**: `boolean` - -Whether the client is in read-only mode. - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[readonly](HypercertClientState.md#readonly) - -#### Defined in - -[sdk/src/types/client.ts:119](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L119) - ---- - -### splitFractionUnits - -• **splitFractionUnits**: (`fractionId`: `bigint`, `fractions`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `fractions`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Splits a claim into multiple fractions. - -##### Parameters - -| Name | Type | Description | -| :----------- | :--------- | :---------------------------- | -| `fractionId` | `bigint` | The ID of the claim to split. | -| `fractions` | `bigint`[] | - | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[splitFractionUnits](HypercertClientMethods.md#splitfractionunits) - -#### Defined in - -[sdk/src/types/client.ts:198](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L198) - ---- - -### storage - -• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) - -The storage layer used by the client. - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[storage](HypercertClientState.md#storage) - -#### Defined in - -[sdk/src/types/client.ts:121](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L121) - ---- - -### transferFraction - -• **transferFraction**: (`fractionId`: `bigint`, `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers a claim fraction to a new owner. - -##### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `fractionId` | `bigint` | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[transferFraction](HypercertClientMethods.md#transferfraction) - -#### Defined in - -[sdk/src/types/client.ts:158](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L158) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientMethods.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientMethods.md deleted file mode 100644 index a7f5f483..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientMethods.md +++ /dev/null @@ -1,319 +0,0 @@ ---- -id: "HypercertClientMethods" -title: "Interface: HypercertClientMethods" -sidebar_label: "HypercertClientMethods" -sidebar_position: 0 -custom_edit_url: null ---- - -The methods for the Hypercert client. - -## Hierarchy - -- **`HypercertClientMethods`** - - ↳ [`HypercertClientInterface`](HypercertClientInterface.md) - -## Properties - -### batchMintClaimFractionsFromAllowlists - -• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `bigint`[], `units`: `bigint`[], `proofs`: (\`0x$\{string}\` \| `Uint8Array`)[][]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimIds`, `units`, `proofs`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Batch mints a claim fraction from an allowlist - -##### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------- | :---------------------------------------------------- | -| `claimIds` | `bigint`[] | Array of the IDs of the claims to mint fractions for. | -| `units` | `bigint`[] | Array of the number of units for each fraction. | -| `proofs` | (\`0x$\{string}\` \| `Uint8Array`)[][] | Array of Merkle proofs for the allowlists. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction receipt - -A Promise that resolves to the transaction hash - -**`Note`** - -The length of the arrays must be equal. - -**`Note`** - -The order of the arrays must be equal. - -#### Defined in - -[sdk/src/types/client.ts:237](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L237) - ---- - -### batchTransferFractions - -• **batchTransferFractions**: (`fractionIds`: `bigint`[], `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers multiple claim fractions to a new owner. - -##### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------- | -| `fractionIds` | `bigint`[] | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:171](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L171) - ---- - -### burnClaimFraction - -• **burnClaimFraction**: (`fractionId`: `bigint`) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Burns a claim fraction. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------------ | -| `fractionId` | `bigint` | The ID of the claim fraction to burn. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:212](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L212) - ---- - -### createAllowlist - -• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Creates a new allowlist and mints a new claim with the allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:185](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L185) - ---- - -### getTransferRestrictions - -• **getTransferRestrictions**: (`fractionId`: `bigint`) => `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -Retrieves the TransferRestrictions for a claim. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------- | -| `fractionId` | `bigint` | The ID of the claim to retrieve. | - -##### Returns - -`Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -A Promise that resolves to the applicable transfer restrictions. - -#### Defined in - -[sdk/src/types/client.ts:149](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L149) - ---- - -### mergeFractionUnits - -• **mergeFractionUnits**: (`fractionIds`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Merges multiple claim fractions into a single claim. - -##### Parameters - -| Name | Type | Description | -| :------------ | :--------- | :--------------------------------------- | -| `fractionIds` | `bigint`[] | The IDs of the claim fractions to merge. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:205](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L205) - ---- - -### mintClaim - -• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a new claim. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:138](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L138) - ---- - -### mintClaimFractionFromAllowlist - -• **mintClaimFractionFromAllowlist**: (`claimId`: `bigint`, `units`: `bigint`, `proof`: (\`0x$\{string}\` \| `Uint8Array`)[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimId`, `units`, `proof`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a claim fraction from an allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------- | :------------------------------------------ | -| `claimId` | `bigint` | The ID of the claim to mint a fraction for. | -| `units` | `bigint` | The number of units for the fraction. | -| `proof` | (\`0x$\{string}\` \| `Uint8Array`)[] | The Merkle proof for the allowlist. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:221](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L221) - ---- - -### splitFractionUnits - -• **splitFractionUnits**: (`fractionId`: `bigint`, `fractions`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `fractions`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Splits a claim into multiple fractions. - -##### Parameters - -| Name | Type | Description | -| :----------- | :--------- | :---------------------------- | -| `fractionId` | `bigint` | The ID of the claim to split. | -| `fractions` | `bigint`[] | - | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:198](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L198) - ---- - -### transferFraction - -• **transferFraction**: (`fractionId`: `bigint`, `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers a claim fraction to a new owner. - -##### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `fractionId` | `bigint` | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:158](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L158) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientState.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientState.md deleted file mode 100644 index 7f899d66..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertClientState.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -id: "HypercertClientState" -title: "Interface: HypercertClientState" -sidebar_label: "HypercertClientState" -sidebar_position: 0 -custom_edit_url: null ---- - -The state of the Hypercert client. - -## Hierarchy - -- **`HypercertClientState`** - - ↳ [`HypercertClientInterface`](HypercertClientInterface.md) - -## Properties - -### contract - -• **contract**: `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -#### Defined in - -[sdk/src/types/client.ts:124](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L124) - ---- - -### indexer - -• **indexer**: `HypercertIndexer` - -The indexer used by the client. - -#### Defined in - -[sdk/src/types/client.ts:123](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L123) - ---- - -### readonly - -• **readonly**: `boolean` - -Whether the client is in read-only mode. - -#### Defined in - -[sdk/src/types/client.ts:119](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L119) - ---- - -### storage - -• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) - -The storage layer used by the client. - -#### Defined in - -[sdk/src/types/client.ts:121](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L121) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md deleted file mode 100644 index 3f5aafc4..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertEvaluationSchema.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -id: "HypercertEvaluationSchema" -title: "Interface: HypercertEvaluationSchema" -sidebar_label: "HypercertEvaluationSchema" -sidebar_position: 0 -custom_edit_url: null ---- - -Schema for evaluating Hypercerts across different sources and evaluation types - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### creator - -• **creator**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L15) - ---- - -### evaluationData - -• **evaluationData**: [`EvaluationData`](../modules.md#evaluationdata) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:16](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L16) - ---- - -### evaluationSource - -• **evaluationSource**: [`EvaluationSource`](../modules.md#evaluationsource) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:17](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L17) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md deleted file mode 100644 index a1500d48..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertIndexerInterface.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -id: "HypercertIndexerInterface" -title: "Interface: HypercertIndexerInterface" -sidebar_label: "HypercertIndexerInterface" -sidebar_position: 0 -custom_edit_url: null ---- - -## Properties - -### claimById - -• **claimById**: (`id`: `string`) => `Promise`<`undefined` \| [`ClaimByIdQuery`](../modules.md#claimbyidquery)\> - -#### Type declaration - -▸ (`id`): `Promise`<`undefined` \| [`ClaimByIdQuery`](../modules.md#claimbyidquery)\> - -##### Parameters - -| Name | Type | -| :--- | :------- | -| `id` | `string` | - -##### Returns - -`Promise`<`undefined` \| [`ClaimByIdQuery`](../modules.md#claimbyidquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:20](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L20) - ---- - -### claimsByOwner - -• **claimsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`ClaimsByOwnerQuery`](../modules.md#claimsbyownerquery)\> - -#### Type declaration - -▸ (`owner`, `params?`): `Promise`<`undefined` \| [`ClaimsByOwnerQuery`](../modules.md#claimsbyownerquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `owner` | `string` | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`ClaimsByOwnerQuery`](../modules.md#claimsbyownerquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:19](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L19) - ---- - -### firstClaims - -• **firstClaims**: (`params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`RecentClaimsQuery`](../modules.md#recentclaimsquery)\> - -#### Type declaration - -▸ (`params?`): `Promise`<`undefined` \| [`RecentClaimsQuery`](../modules.md#recentclaimsquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`RecentClaimsQuery`](../modules.md#recentclaimsquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:21](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L21) - ---- - -### fractionById - -• **fractionById**: (`fractionId`: `string`) => `Promise`<`undefined` \| [`ClaimTokenByIdQuery`](../modules.md#claimtokenbyidquery)\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<`undefined` \| [`ClaimTokenByIdQuery`](../modules.md#claimtokenbyidquery)\> - -##### Parameters - -| Name | Type | -| :----------- | :------- | -| `fractionId` | `string` | - -##### Returns - -`Promise`<`undefined` \| [`ClaimTokenByIdQuery`](../modules.md#claimtokenbyidquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:24](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L24) - ---- - -### fractionsByClaim - -• **fractionsByClaim**: (`claimId`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`ClaimTokensByClaimQuery`](../modules.md#claimtokensbyclaimquery)\> - -#### Type declaration - -▸ (`claimId`, `params?`): `Promise`<`undefined` \| [`ClaimTokensByClaimQuery`](../modules.md#claimtokensbyclaimquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `claimId` | `string` | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`ClaimTokensByClaimQuery`](../modules.md#claimtokensbyclaimquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:23](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L23) - ---- - -### fractionsByOwner - -• **fractionsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`ClaimTokensByOwnerQuery`](../modules.md#claimtokensbyownerquery)\> - -#### Type declaration - -▸ (`owner`, `params?`): `Promise`<`undefined` \| [`ClaimTokensByOwnerQuery`](../modules.md#claimtokensbyownerquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `owner` | `string` | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`ClaimTokensByOwnerQuery`](../modules.md#claimtokensbyownerquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:22](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L22) - ---- - -### graphClient - -• **graphClient**: `Client` - -#### Defined in - -[sdk/src/types/indexer.ts:18](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L18) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertMetadata.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertMetadata.md deleted file mode 100644 index f6493ef1..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertMetadata.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -id: "HypercertMetadata" -title: "Interface: HypercertMetadata" -sidebar_label: "HypercertMetadata" -sidebar_position: 0 -custom_edit_url: null ---- - -Claim data for hypercert. ERC1155 Metadata compliant - -## Properties - -### allowList - -• `Optional` **allowList**: `string` - -A CID pointer to the merke tree proof json on ipfs - -#### Defined in - -[sdk/src/types/metadata.d.ts:39](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L39) - ---- - -### description - -• **description**: `string` - -Describes the asset to which this token represents - -#### Defined in - -[sdk/src/types/metadata.d.ts:19](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L19) - ---- - -### external_url - -• `Optional` **external_url**: `string` - -An url pointing to the external website of the project - -#### Defined in - -[sdk/src/types/metadata.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L23) - ---- - -### hypercert - -• `Optional` **hypercert**: `HypercertClaimdata` - -#### Defined in - -[sdk/src/types/metadata.d.ts:45](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L45) - ---- - -### image - -• **image**: `string` - -A URI pointing to a resource with mime type image/\* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. - -#### Defined in - -[sdk/src/types/metadata.d.ts:27](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L27) - ---- - -### name - -• **name**: `string` - -Identifies the asset to which this token represents - -#### Defined in - -[sdk/src/types/metadata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L15) - ---- - -### properties - -• `Optional` **properties**: \{ `[k: string]`: `unknown`; `trait_type?`: `string` ; `value?`: `string` }[] - -#### Defined in - -[sdk/src/types/metadata.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L40) - ---- - -### ref - -• `Optional` **ref**: `string` - -Describes the asset to which this token represents - -#### Defined in - -[sdk/src/types/metadata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L35) - ---- - -### version - -• `Optional` **version**: `string` - -The version of Hypercert schema used to describe this hypercert - -#### Defined in - -[sdk/src/types/metadata.d.ts:31](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/metadata.d.ts#L31) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertPointer.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertPointer.md deleted file mode 100644 index 199f6f54..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertPointer.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: "HypercertPointer" -title: "Interface: HypercertPointer" -sidebar_label: "HypercertPointer" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### chainId - -• **chainId**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:28](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L28) - ---- - -### claimId - -• **claimId**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:30](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L30) - ---- - -### contract - -• **contract**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:29](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L29) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertStorageInterface.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertStorageInterface.md deleted file mode 100644 index ff50839f..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/HypercertStorageInterface.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -id: "HypercertStorageInterface" -title: "Interface: HypercertStorageInterface" -sidebar_label: "HypercertStorageInterface" -sidebar_position: 0 -custom_edit_url: null ---- - -The interface for the Hypercert storage layer. - -## Implemented by - -- [`HypercertsStorage`](../classes/HypercertsStorage.md) - -## Properties - -### getData - -• **getData**: (`cidOrIpfsUri`: `string`) => `Promise`<`unknown`\> - -#### Type declaration - -▸ (`cidOrIpfsUri`): `Promise`<`unknown`\> - -Retrieves arbitrary data from IPFS. - -##### Parameters - -| Name | Type | Description | -| :------------- | :------- | :------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | - -##### Returns - -`Promise`<`unknown`\> - -A Promise that resolves to the retrieved data. - -#### Defined in - -[sdk/src/types/client.ts:98](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L98) - ---- - -### getMetadata - -• **getMetadata**: (`cidOrIpfsUri`: `string`) => `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> - -#### Type declaration - -▸ (`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> - -Retrieves the metadata for a Hypercert evaluation. - -##### Parameters - -| Name | Type | Description | -| :------------- | :------- | :----------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | - -##### Returns - -`Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> - -A Promise that resolves to the retrieved metadata. - -#### Defined in - -[sdk/src/types/client.ts:84](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L84) - ---- - -### storeData - -• **storeData**: (`data`: `unknown`) => `Promise`<`CIDString`\> - -#### Type declaration - -▸ (`data`): `Promise`<`CIDString`\> - -Stores arbitrary data on IPFS. - -##### Parameters - -| Name | Type | Description | -| :----- | :-------- | :----------------- | -| `data` | `unknown` | The data to store. | - -##### Returns - -`Promise`<`CIDString`\> - -A Promise that resolves to the CID of the stored data. - -#### Defined in - -[sdk/src/types/client.ts:91](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L91) - ---- - -### storeMetadata - -• **storeMetadata**: (`metadata`: [`HypercertMetadata`](HypercertMetadata.md)) => `Promise`<`CIDString`\> - -#### Type declaration - -▸ (`metadata`): `Promise`<`CIDString`\> - -Stores the metadata for a Hypercert evaluation. - -##### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------------ | :--------------------- | -| `metadata` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata to store. | - -##### Returns - -`Promise`<`CIDString`\> - -A Promise that resolves to the CID of the stored metadata. - -#### Defined in - -[sdk/src/types/client.ts:77](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L77) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/IPFSEvaluation.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/IPFSEvaluation.md deleted file mode 100644 index 1d8c13e2..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/IPFSEvaluation.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -id: "IPFSEvaluation" -title: "Interface: IPFSEvaluation" -sidebar_label: "IPFSEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### cid - -• **cid**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:48](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L48) - ---- - -### type - -• **type**: `"IPFS"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:47](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L47) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md deleted file mode 100644 index 20457082..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/SimpleTextEvaluation.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: "SimpleTextEvaluation" -title: "Interface: SimpleTextEvaluation" -sidebar_label: "SimpleTextEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### hypercert - -• **hypercert**: [`HypercertPointer`](HypercertPointer.md) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L35) - ---- - -### text - -• **text**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:36](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L36) - ---- - -### type - -• **type**: `"simpleText"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:34](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L34) diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/_category_.yml b/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/_category_.yml deleted file mode 100644 index 43bec88c..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/interfaces/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Interfaces" -position: 4 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.0.0/developer/api/sdk/modules.md b/docs/versioned_docs/version-1.0.0/developer/api/sdk/modules.md deleted file mode 100644 index b5d8bab0..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/api/sdk/modules.md +++ /dev/null @@ -1,1226 +0,0 @@ ---- -id: "modules" -title: "@hypercerts-org/sdk" -sidebar_label: "Exports" -sidebar_position: 0.5 -custom_edit_url: null ---- - -## Classes - -- [ClientError](classes/ClientError.md) -- [ConfigurationError](classes/ConfigurationError.md) -- [ContractError](classes/ContractError.md) -- [FetchError](classes/FetchError.md) -- [HypercertClient](classes/HypercertClient.md) -- [HypercertsStorage](classes/HypercertsStorage.md) -- [InvalidOrMissingError](classes/InvalidOrMissingError.md) -- [MalformedDataError](classes/MalformedDataError.md) -- [MintingError](classes/MintingError.md) -- [StorageError](classes/StorageError.md) -- [UnknownSchemaError](classes/UnknownSchemaError.md) -- [UnsupportedChainError](classes/UnsupportedChainError.md) - -## Interfaces - -- [CustomError](interfaces/CustomError.md) -- [DuplicateEvaluation](interfaces/DuplicateEvaluation.md) -- [EASEvaluation](interfaces/EASEvaluation.md) -- [HypercertClaimdata](interfaces/HypercertClaimdata.md) -- [HypercertClientInterface](interfaces/HypercertClientInterface.md) -- [HypercertClientMethods](interfaces/HypercertClientMethods.md) -- [HypercertClientState](interfaces/HypercertClientState.md) -- [HypercertEvaluationSchema](interfaces/HypercertEvaluationSchema.md) -- [HypercertIndexerInterface](interfaces/HypercertIndexerInterface.md) -- [HypercertMetadata](interfaces/HypercertMetadata.md) -- [HypercertPointer](interfaces/HypercertPointer.md) -- [HypercertStorageInterface](interfaces/HypercertStorageInterface.md) -- [IPFSEvaluation](interfaces/IPFSEvaluation.md) -- [SimpleTextEvaluation](interfaces/SimpleTextEvaluation.md) - -## Type Aliases - -### AllowlistEntry - -Ƭ **AllowlistEntry**: `Object` - -Represents an entry in an allowlist. - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | -| `units` | `bigint` | - -#### Defined in - -[sdk/src/types/hypercerts.ts:24](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/hypercerts.ts#L24) - ---- - -### Claim - -Ƭ **Claim**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :-------------------------------------------- | -| `__typename?` | `"Claim"` | -| `allowlist?` | `Maybe`<`Allowlist`\> | -| `contract` | `Scalars`[`"String"`][``"output"``] | -| `creation` | `Scalars`[`"BigInt"`][``"output"``] | -| `creator?` | `Maybe`<`Scalars`[`"Bytes"`][``"output"``]\> | -| `id` | `Scalars`[`"String"`][``"output"``] | -| `owner?` | `Maybe`<`Scalars`[`"Bytes"`][``"output"``]\> | -| `tokenID` | `Scalars`[`"BigInt"`][``"output"``] | -| `totalUnits?` | `Maybe`<`Scalars`[`"BigInt"`][``"output"``]\> | -| `uri?` | `Maybe`<`Scalars`[`"String"`][``"output"``]\> | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:116](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L116) - ---- - -### ClaimByIdQuery - -Ƭ **ClaimByIdQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claim?` | \{ `__typename?`: `"Claim"` ; `contract`: `string` ; `creator?`: `any` \| `null` ; `id`: `string` ; `owner?`: `any` \| `null` ; `tokenID`: `any` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` } \| `null` | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:587](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L587) - ---- - -### ClaimToken - -Ƭ **ClaimToken**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :---------------------------------- | -| `__typename?` | `"ClaimToken"` | -| `claim` | [`Claim`](modules.md#claim) | -| `id` | `Scalars`[`"String"`][``"output"``] | -| `owner` | `Scalars`[`"Bytes"`][``"output"``] | -| `tokenID` | `Scalars`[`"BigInt"`][``"output"``] | -| `units` | `Scalars`[`"BigInt"`][``"output"``] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:129](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L129) - ---- - -### ClaimTokenByIdQuery - -Ƭ **ClaimTokenByIdQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claimToken?` | \{ `__typename?`: `"ClaimToken"` ; `claim`: \{ `__typename?`: `"Claim"` ; `creation`: `any` ; `id`: `string` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` } ; `id`: `string` ; `owner`: `any` ; `tokenID`: `any` ; `units`: `any` } \| `null` | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:636](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L636) - ---- - -### ClaimTokensByClaimQuery - -Ƭ **ClaimTokensByClaimQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :--------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claimTokens` | \{ `__typename?`: `"ClaimToken"` ; `id`: `string` ; `owner`: `any` ; `tokenID`: `any` ; `units`: `any` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:627](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L627) - ---- - -### ClaimTokensByOwnerQuery - -Ƭ **ClaimTokensByOwnerQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claimTokens` | \{ `__typename?`: `"ClaimToken"` ; `claim`: \{ `__typename?`: `"Claim"` ; `creation`: `any` ; `id`: `string` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` } ; `id`: `string` ; `owner`: `any` ; `tokenID`: `any` ; `units`: `any` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:608](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L608) - ---- - -### ClaimsByOwnerQuery - -Ƭ **ClaimsByOwnerQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claims` | \{ `__typename?`: `"Claim"` ; `contract`: `string` ; `creator?`: `any` \| `null` ; `id`: `string` ; `owner?`: `any` \| `null` ; `tokenID`: `any` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:549](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L549) - ---- - -### Deployment - -Ƭ **Deployment**: `Object` - -Represents a deployment of a contract on a specific network. - -#### Type declaration - -| Name | Type | Description | -| :---------------- | :------------------ | :--------------------------------------------------------------------------------------- | -| `chain` | `Partial`<`Chain`\> | - | -| `contractAddress` | `string` | The address of the deployed contract. | -| `graphName` | `string` | - | -| `graphUrl` | `string` | The url to the subgraph that indexes the contract events. Override for localized testing | - -#### Defined in - -[sdk/src/types/client.ts:23](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L23) - ---- - -### DocumentType - -Ƭ **DocumentType**<`TDocumentNode`\>: `TDocumentNode` extends `DocumentNode` ? `TType` : `never` - -#### Type parameters - -| Name | Type | -| :-------------- | :------------------------------------ | -| `TDocumentNode` | extends `DocumentNode`<`any`, `any`\> | - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:53](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/gql.ts#L53) - ---- - -### EvaluationData - -Ƭ **EvaluationData**: [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) \| [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) - -This file was automatically generated by json-schema-to-typescript. -DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -and run json-schema-to-typescript to regenerate this file. - -#### Defined in - -[sdk/src/types/evaluation.d.ts:8](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L8) - ---- - -### EvaluationSource - -Ƭ **EvaluationSource**: [`EASEvaluation`](interfaces/EASEvaluation.md) \| [`IPFSEvaluation`](interfaces/IPFSEvaluation.md) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:9](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/evaluation.d.ts#L9) - ---- - -### FragmentType - -Ƭ **FragmentType**<`TDocumentType`\>: `TDocumentType` extends `DocumentTypeDecoration` ? [`TType`] extends [\{ ` $fragmentName?`: infer TKey }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in TKey]: TType } } : `never` : `never` : `never` - -#### Type parameters - -| Name | Type | -| :-------------- | :---------------------------------------------- | -| `TDocumentType` | extends `DocumentTypeDecoration`<`any`, `any`\> | - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:5](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L5) - ---- - -### HypercertClientConfig - -Ƭ **HypercertClientConfig**: [`Deployment`](modules.md#deployment) & [`HypercertStorageConfig`](modules.md#hypercertstorageconfig) & [`HypercertEvaluatorConfig`](modules.md#hypercertevaluatorconfig) & \{ `publicClient`: `PublicClient` ; `readOnly`: `boolean` ; `readOnlyReason?`: `string` ; `unsafeForceOverrideConfig?`: `boolean` ; `walletClient`: `WalletClient` } - -Configuration options for the Hypercert client. - -#### Defined in - -[sdk/src/types/client.ts:35](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L35) - ---- - -### HypercertClientProps - -Ƭ **HypercertClientProps**: `Object` - -The props for the Hypercert client. - -#### Type declaration - -| Name | Type | Description | -| :-------- | :---------------------------------------------------------------------- | :-------------------------------------------------- | -| `config?` | `Partial`<[`HypercertClientConfig`](modules.md#hypercertclientconfig)\> | The configuration options for the Hypercert client. | - -#### Defined in - -[sdk/src/types/client.ts:104](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L104) - ---- - -### HypercertEvaluatorConfig - -Ƭ **HypercertEvaluatorConfig**: `Omit`<`PartialTypedDataConfig`, `"address"`\> & \{ `easContractAddress`: `string` } - -Configuration options for the Hypercert evaluator. - -**`Note`** - -The signer is required for submitting evaluations. - -#### Defined in - -[sdk/src/types/client.ts:64](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L64) - ---- - -### HypercertStorageConfig - -Ƭ **HypercertStorageConfig**: `Object` - -Configuration options for the Hypercert storage layer. - -**`Note`** - -The API tokens are optional, but required for storing data on NFT.storage and Web3.storage. - -#### Type declaration - -| Name | Type | Description | -| :------------------ | :------- | :------------------------------ | -| `nftStorageToken?` | `string` | The API token for NFT.storage. | -| `web3StorageToken?` | `string` | The API token for Web3.storage. | - -#### Defined in - -[sdk/src/types/client.ts:53](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L53) - ---- - -### HypercertsSdkError - -Ƭ **HypercertsSdkError**: [`ConfigurationError`](classes/ConfigurationError.md) \| [`FetchError`](classes/FetchError.md) \| [`InvalidOrMissingError`](classes/InvalidOrMissingError.md) \| [`MalformedDataError`](classes/MalformedDataError.md) \| [`MintingError`](classes/MintingError.md) \| [`StorageError`](classes/StorageError.md) \| [`UnsupportedChainError`](classes/UnsupportedChainError.md) \| [`UnknownSchemaError`](classes/UnknownSchemaError.md) - -#### Defined in - -[sdk/src/types/errors.ts:195](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/errors.ts#L195) - ---- - -### QueryParams - -Ƭ **QueryParams**: `Object` - -#### Index signature - -▪ [key: `string`]: `string` \| `number` \| `undefined` - -#### Type declaration - -| Name | Type | -| :---------------- | :------------------ | -| `first` | `number` | -| `orderDirections` | `"asc"` \| `"desc"` | -| `skip` | `number` | - -#### Defined in - -[sdk/src/types/indexer.ts:10](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/indexer.ts#L10) - ---- - -### RecentClaimsQuery - -Ƭ **RecentClaimsQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claims` | \{ `__typename?`: `"Claim"` ; `contract`: `string` ; `creator?`: `any` \| `null` ; `id`: `string` ; `owner?`: `any` \| `null` ; `tokenID`: `any` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:569](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/graphql.ts#L569) - ---- - -### SupportedChainIds - -Ƭ **SupportedChainIds**: `5` \| `10` \| `42220` \| `11155111` - -#### Defined in - -[sdk/src/types/client.ts:13](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L13) - ---- - -### SupportedOverrides - -Ƭ **SupportedOverrides**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `gasLimit?` | `bigint` | -| `gasPrice?` | `bigint` | -| `value?` | `bigint` | - -#### Defined in - -[sdk/src/types/client.ts:14](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/client.ts#L14) - ---- - -### TransferRestrictions - -Ƭ **TransferRestrictions**: typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)[keyof typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)] - -#### Defined in - -[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/hypercerts.ts#L9) - -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/hypercerts.ts#L15) - -## Variables - -### HypercertExchangeAbi - -• **HypercertExchangeAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_owner"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = "length"; `type`: `string` = "uint256" }[] ; `name`: `string` = "MerkleProofTooLarge"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: (\{ `components`: \{ `internalType`: `string` = "bytes32"; `name`: `string` = "orderHash"; `type`: `string` = "bytes32" }[] ; `indexed`: `boolean` = false; `internalType`: `string` = "struct ILooksRareProtocol.NonceInvalidationParameters"; `name`: `string` = "nonceInvalidationParameters"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "askUser"; `type`: `string` = "address" })[] ; `name`: `string` = "TakerAsk"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: (\{ `components?`: `undefined` ; `internalType`: `string` = "bytes[]"; `name`: `string` = "makerSignatures"; `type`: `string` = "bytes[]" } \| \{ `components`: (\{ `components?`: `undefined` ; `internalType`: `string` = "bytes32"; `name`: `string` = "root"; `type`: `string` = "bytes32" } \| \{ `components`: \{ `internalType`: `string` = "bytes32"; `name`: `string` = "value"; `type`: `string` = "bytes32" }[] ; `internalType`: `string` = "struct OrderStructs.MerkleTreeNode[]"; `name`: `string` = "proof"; `type`: `string` = "tuple[]" })[] ; `internalType`: `string` = "struct OrderStructs.MerkleTree[]"; `name`: `string` = "merkleTrees"; `type`: `string` = "tuple[]" })[] ; `name`: `string` = "executeMultipleTakerBids"; `outputs`: `never`[] = []; `stateMutability`: `string` = "payable"; `type`: `string` = "function" } \| \{ `anonymous?`: `undefined` = false; `inputs`: (\{ `components`: \{ `internalType`: `string` = "address"; `name`: `string` = "recipient"; `type`: `string` = "address" }[] ; `internalType`: `string` = "struct OrderStructs.Taker"; `name`: `string` = "takerBid"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "address"; `name`: `string` = "sender"; `type`: `string` = "address" })[] ; `name`: `string` = "restrictedExecuteTakerBid"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = "protocolFeeAmount"; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.0.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:1524 - ---- - -### HypercertMinterAbi - -• **HypercertMinterAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.0.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:352 - ---- - -### TransferRestrictions - -• `Const` **TransferRestrictions**: `Object` - -Represents the possible transfer restrictions of a claim matching the hypercerts protocol. - -#### Type declaration - -| Name | Type | -| :---------------- | :--- | -| `AllowAll` | `0` | -| `DisallowAll` | `1` | -| `FromCreatorOnly` | `2` | - -#### Defined in - -[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/hypercerts.ts#L9) - -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/types/hypercerts.ts#L15) - ---- - -### deployments - -• `Const` **deployments**: \{ [key in SupportedChainIds]: Partial } - -#### Defined in - -[sdk/src/constants.ts:10](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/constants.ts#L10) - ---- - -### logger - -• `Const` **logger**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :-------------------------------------------------------------------------- | -| `debug` | (`message`: `string`, `label?`: `string`, ...`data`: `unknown`[]) => `void` | -| `error` | (`error`: `Error`, `label?`: `string`) => `void` | -| `info` | (`message`: `string`, `label?`: `string`, ...`data`: `unknown`[]) => `void` | -| `warn` | (`message`: `string`, `label?`: `string`, ...`data`: `unknown`[]) => `void` | - -#### Defined in - -[sdk/src/utils/logger.ts:24](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/logger.ts#L24) - -## Functions - -### formatHypercertData - -▸ **formatHypercertData**(`«destructured»`): `FormatResult` - -Formats input data to an object containing HypercertMetadata including appropriate labels - -#### Parameters - -| Name | Type | -| :----------------------- | :------------------------------------------------ | -| `«destructured»` | `Object` | -| › `contributors` | `string`[] | -| › `description` | `string` | -| › `excludedImpactScope` | `string`[] | -| › `excludedRights` | `string`[] | -| › `excludedWorkScope` | `string`[] | -| › `external_url?` | `string` | -| › `image` | `string` | -| › `impactScope` | `string`[] | -| › `impactTimeframeEnd` | `number` | -| › `impactTimeframeStart` | `number` | -| › `name` | `string` | -| › `properties?` | \{ `trait_type`: `string` ; `value`: `string` }[] | -| › `rights` | `string`[] | -| › `version` | `string` | -| › `workScope` | `string`[] | -| › `workTimeframeEnd` | `number` | -| › `workTimeframeStart` | `number` | - -#### Returns - -`FormatResult` - -#### Defined in - -[sdk/src/utils/formatter.ts:27](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/formatter.ts#L27) - ---- - -### getFromIPFS - -▸ **getFromIPFS**(`cidOrIpfsUri`, `timeout?`): `Promise`<`unknown`\> - -Fetches data from IPFS using either the NFT Storage gateway or the Web3 Storage gateway. - -This function attempts to fetch data from the NFT Storage gateway first. If the request times out, it then tries to fetch the data from the Web3 Storage gateway. -If the data cannot be fetched from either gateway, it throws a `StorageError`. - -#### Parameters - -| Name | Type | Default value | Description | -| :------------- | :------- | :------------ | :---------------------------------------------------------------------- | -| `cidOrIpfsUri` | `string` | `undefined` | The CID or IPFS URI of the data to fetch. | -| `timeout?` | `number` | `10000` | The timeout for the fetch request in milliseconds. Defaults to 10000ms. | - -#### Returns - -`Promise`<`unknown`\> - -The data fetched from IPFS. - -**`Throws`** - -Will throw a `StoragjeError` if the data cannot be fetched from either gateway. - -**`Async`** - -#### Defined in - -[sdk/src/utils/fetchers.ts:17](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/fetchers.ts#L17) - ---- - -### getProofsFromAllowlist - -▸ **getProofsFromAllowlist**(`cidOrIpfsUri`, `account`): `Promise`<`undefined` \| \{ `proof`: `string`[] ; `root`: `string` = tree.root }\> - -This function retrieves proofs from an allowlist. - -It fetches a Merkle tree from IPFS using a given CID or IPFS URI, then iterates over the tree to find an account. -When the account is found, it generates a proof for that account and logs the account, index, and proof as debug. -It returns the proof and the root of the Merkle tree. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------- | :------------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI to fetch the Merkle tree from. | -| `account` | \`0x$\{string}\` | The account to find in the Merkle tree. | - -#### Returns - -`Promise`<`undefined` \| \{ `proof`: `string`[] ; `root`: `string` = tree.root }\> - -An object containing the proof for the account and the root of the Merkle tree. - -**`Throws`** - -Will throw an error if the Merkle tree cannot be fetched. - -**`Async`** - -#### Defined in - -[sdk/src/utils/allowlist.ts:35](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/allowlist.ts#L35) - ---- - -### graphql - -▸ **graphql**(`source`): `unknown` - -The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - -#### Parameters - -| Name | Type | -| :------- | :------- | -| `source` | `string` | - -#### Returns - -`unknown` - -**`Example`** - -```ts -const query = graphql( - ` - query GetUser($id: ID!) { - user(id: $id) { - name - } - } - `, -); -``` - -The query argument is unknown! -Please regenerate the types. - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:34](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/gql.ts#L34) - -▸ **graphql**(`source`): typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"``] - -The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - -#### Parameters - -| Name | Type | -| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `source` | `"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"` | - -#### Returns - -typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"``] - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:39](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/gql.ts#L39) - -▸ **graphql**(`source`): typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"``] - -The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - -#### Parameters - -| Name | Type | -| :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `source` | `"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"` | - -#### Returns - -typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"``] - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:45](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/gql.ts#L45) - ---- - -### handleContractError - -▸ **handleContractError**(`data`): [`ContractError`](classes/ContractError.md) - -#### Parameters - -| Name | Type | -| :----- | :--------------- | -| `data` | \`0x$\{string}\` | - -#### Returns - -[`ContractError`](classes/ContractError.md) - -#### Defined in - -[sdk/src/utils/errors.ts:39](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/errors.ts#L39) - ---- - -### handleSdkError - -▸ **handleSdkError**(`err`): `void` - -Method to catch errors and log them - -#### Parameters - -| Name | Type | Description | -| :---- | :---------------------------------------------------- | :-------------------------------------------- | -| `err` | [`HypercertsSdkError`](modules.md#hypercertssdkerror) | Error to handle defined in HypercertsSdkError | - -#### Returns - -`void` - -#### Defined in - -[sdk/src/utils/errors.ts:22](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/errors.ts#L22) - ---- - -### isFragmentReady - -▸ **isFragmentReady**<`TQuery`, `TFrag`\>(`queryNode`, `fragmentNode`, `data`): data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never - -#### Type parameters - -| Name | -| :------- | -| `TQuery` | -| `TFrag` | - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `queryNode` | `DocumentTypeDecoration`<`TQuery`, `any`\> | -| `fragmentNode` | `TypedDocumentNode`<`TFrag`, \{ `[key: string]`: `any`; }\> | -| `data` | `undefined` \| `null` \| [`Incremental`<`TFrag`\>] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: Object } } : `never` : `never` | - -#### Returns - -data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:51](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L51) - ---- - -### makeFragmentData - -▸ **makeFragmentData**<`F`, `FT`\>(`data`, `_fragment`): [`FragmentType`](modules.md#fragmenttype)<`F`\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------- | -| `F` | extends `DocumentTypeDecoration`<`any`, `any`\> | -| `FT` | extends `any` | - -#### Parameters - -| Name | Type | -| :---------- | :--- | -| `data` | `FT` | -| `_fragment` | `F` | - -#### Returns - -[`FragmentType`](modules.md#fragmenttype)<`F`\> - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:45](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L45) - ---- - -### publicClientToProvider - -▸ **publicClientToProvider**(`publicClient`): `undefined` \| `FallbackProvider` \| `JsonRpcProvider` - -This function converts a `PublicClient` instance to an ethers.js `Provider` to faciliate compatibility between ethers and viem. - -It extracts the chain and transport from the `PublicClient` and creates a network object. -If no chain is found in the `PublicClient`, it logs a warning and stops the signature request. -If the transport type is "fallback", it creates a `FallbackProvider` with multiple transports. -Otherwise, it creates a `JsonRpcProvider` with a single transport. - -Ref: https://viem.sh/docs/ethers-migration.html - -#### Parameters - -| Name | Type | Description | -| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `publicClient` | `Object` | The `PublicClient` instance to convert. | -| `publicClient.account` | `undefined` | The Account of the Client. | -| `publicClient.batch?` | `Object` | Flags for batch settings. | -| `publicClient.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `publicClient.call` | (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> | Executes a new message call immediately without submitting a transaction to the network. - Docs: https://viem.sh/docs/actions/public/call.html - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) ` | -| `publicClient.chain` | `undefined` \| `Chain` | Chain for the client. | -| `publicClient.createBlockFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> | Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter) **`Example`** `ts import { createPublicClient, createBlockFilter, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await createBlockFilter(client) // { id: "0x345a6572337856574a76364e457a4366", type: 'block' } ` | -| `publicClient.createContractEventFilter` | (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html). - Docs: https://viem.sh/docs/contract/createContractEventFilter.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), }) ` | -| `publicClient.createEventFilter` | (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> | Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createEventFilter.html - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', }) ` | -| `publicClient.createPendingTransactionFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> | Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' } ` | -| `publicClient.estimateContractGas` | (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas.html **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gas = await client.estimateContractGas({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), functionName: 'mint', account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | -| `publicClient.estimateFeesPerGas` | (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> | Returns an estimate for the fees per gas for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateFeesPerGas() // { maxFeePerGas: ..., maxPriorityFeePerGas: ... } ` | -| `publicClient.estimateGas` | (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas.html - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) **`Example`** `ts import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasEstimate = await client.estimateGas({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }) ` | -| `publicClient.estimateMaxPriorityFeePerGas` | (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> | Returns an estimate for the max priority fee per gas (in wei) for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() // 10000000n ` | -| `publicClient.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> | - | -| `publicClient.getBalance` | (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> | Returns the balance of an address in wei. - Docs: https://viem.sh/docs/actions/public/getBalance.html - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance) **`Remarks`** You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html). `ts const balance = await getBalance(client, { address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', blockTag: 'safe' }) const balanceAsEther = formatEther(balance) // "6.942" ` **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const balance = await client.getBalance({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) // 10000000000000000000000n (wei) ` | -| `publicClient.getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getBlock() ` | -| `publicClient.getBlockNumber` | (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> | Returns the number of the most recent block seen. - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blockNumber = await client.getBlockNumber() // 69420n ` | -| `publicClient.getBlockTransactionCount` | (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of Transactions at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html - JSON-RPC Methods: - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const count = await client.getBlockTransactionCount() ` | -| `publicClient.getBytecode` | (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> | Retrieves the bytecode at an address. - Docs: https://viem.sh/docs/contract/getBytecode.html - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getBytecode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', }) ` | -| `publicClient.getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const chainId = await client.getChainId() // 1 ` | -| `publicClient.getContractEvents` | (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents.html - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { wagmiAbi } from './abi' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getContractEvents(client, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: wagmiAbi, eventName: 'Transfer' }) ` | -| `publicClient.getEnsAddress` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAddress = await client.getEnsAddress({ name: normalize('wagmi-dev.eth'), }) // '0xd2135CfB216b74109775236E36d4b433F1DF507B' ` | -| `publicClient.getEnsAvatar` | (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAvatar = await client.getEnsAvatar({ name: normalize('wagmi-dev.eth'), }) // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio' ` | -| `publicClient.getEnsName` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensName = await client.getEnsName({ address: '0xd2135CfB216b74109775236E36d4b433F1DF507B', }) // 'wagmi-dev.eth' ` | -| `publicClient.getEnsResolver` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> | Gets resolver for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const resolverAddress = await client.getEnsResolver({ name: normalize('wagmi-dev.eth'), }) // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41' ` | -| `publicClient.getEnsText` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const twitterRecord = await client.getEnsText({ name: normalize('wagmi-dev.eth'), key: 'com.twitter', }) // 'wagmi_sh' ` | -| `publicClient.getFeeHistory` | (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> | Returns a collection of historical gas information. - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const feeHistory = await client.getFeeHistory({ blockCount: 4, rewardPercentiles: [25, 75], }) ` | -| `publicClient.getFilterChanges` | (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called. - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) **`Remarks`** A Filter can be created from the following actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) Depending on the type of filter, the return value will be different: - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs. - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes. - If the filter was created with `createBlockFilter`, it returns a list of block hashes. **`Example`** `ts // Blocks import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createBlockFilter() const hashes = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Contract Events import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), eventName: 'Transfer', }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Raw Events import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Transactions import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() const hashes = await client.getFilterChanges({ filter }) ` | -| `publicClient.getFilterLogs` | (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs since the filter was created. - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) **`Remarks`** `getFilterLogs` is only compatible with **event filters**. **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterLogs({ filter }) ` | -| `publicClient.getGasPrice` | () => `Promise`<`bigint`\> | Returns the current price of gas (in wei). - Docs: https://viem.sh/docs/actions/public/getGasPrice.html - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasPrice = await client.getGasPrice() ` | -| `publicClient.getLogs` | (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs matching the provided parameters. - Docs: https://viem.sh/docs/actions/public/getLogs.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getLogs() ` | -| `publicClient.getProof` | (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> | Returns the account and storage values of the specified account including the Merkle-proof. - Docs: https://viem.sh/docs/actions/public/getProof.html - JSON-RPC Methods: - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getProof({ address: '0x...', storageKeys: ['0x...'], }) ` | -| `publicClient.getStorageAt` | (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> | Returns the value from a storage slot at a given address. - Docs: https://viem.sh/docs/contract/getStorageAt.html - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getStorageAt } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getStorageAt({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', slot: toHex(0), }) ` | -| `publicClient.getTransaction` | (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transaction = await client.getTransaction({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.getTransactionConfirmations` | (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> | Returns the number of blocks passed (confirmations) since the transaction was processed on a block. - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const confirmations = await client.getTransactionConfirmations({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.getTransactionCount` | (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionCount = await client.getTransactionCount({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `publicClient.getTransactionReceipt` | (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> | Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.getTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.key` | `string` | A key for the client. | -| `publicClient.multicall` | (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall). - Docs: https://viem.sh/docs/contract/multicall.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const abi = parseAbi([ 'function balanceOf(address) view returns (uint256)', 'function totalSupply() view returns (uint256)', ]) const result = await client.multicall({ contracts: [ { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'totalSupply', }, ], }) // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }] ` | -| `publicClient.name` | `string` | A name for the client. | -| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `publicClient.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `publicClient.readContract` | (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts **`Remarks`** A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' import { readContract } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.readContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function balanceOf(address) view returns (uint256)']), functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }) // 424122n ` | -| `publicClient.request` | `EIP1193RequestFn`<`PublicRpcSchema`\> | Request function wrapped with friendly error handling | -| `publicClient.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `publicClient.simulateContract` | (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> | Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions. - Docs: https://viem.sh/docs/contract/simulateContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts **`Remarks`** This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32) view returns (uint32)']), functionName: 'mint', args: ['69420'], account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `publicClient.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `publicClient.type` | `string` | The type of client. | -| `publicClient.uid` | `string` | A unique ID for the client. | -| `publicClient.uninstallFilter` | (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> | Destroys a Filter that was created from one of the following Actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { createPendingTransactionFilter, uninstallFilter } from 'viem/public' const filter = await client.createPendingTransactionFilter() const uninstalled = await client.uninstallFilter({ filter }) // true ` | -| `publicClient.verifyMessage` | (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> | - | -| `publicClient.verifyTypedData` | (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> | - | -| `publicClient.waitForTransactionReceipt` | (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> | Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed. - If a Transaction has been replaced: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions - Checks if one of the Transactions is a replacement - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt). **`Remarks`** The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions). Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce. There are 3 types of Transaction Replacement reasons: - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`) - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`) - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.waitForTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.watchBlockNumber` | (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` | Watches and returns incoming block numbers. - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlockNumber({ onBlockNumber: (blockNumber) => console.log(blockNumber), }) ` | -| `publicClient.watchBlocks` | (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` | Watches and returns information for incoming blocks. - Docs: https://viem.sh/docs/actions/public/watchBlocks.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlocks({ onBlock: (block) => console.log(block), }) ` | -| `publicClient.watchContractEvent` | (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent.html **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchContractEvent({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']), eventName: 'Transfer', args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, onLogs: (logs) => console.log(logs), }) ` | -| `publicClient.watchEvent` | (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent.html - JSON-RPC Methods: - **RPC Provider supports `eth_newFilter`:** - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize). - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - **RPC Provider does not support `eth_newFilter`:** - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval. **`Remarks`** This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchEvent({ onLogs: (logs) => console.log(logs), }) ` | -| `publicClient.watchPendingTransactions` | (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` | Watches and returns pending transaction hashes. - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html - JSON-RPC Methods: - When `poll: true` - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter. - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event. **`Remarks`** This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchPendingTransactions({ onTransactions: (hashes) => console.log(hashes), }) ` | - -#### Returns - -`undefined` \| `FallbackProvider` \| `JsonRpcProvider` - -An ethers.js `Provider` instance, or `undefined` if no chain is found in the `PublicClient`. - -#### Defined in - -[sdk/src/utils/adapters.ts:19](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/adapters.ts#L19) - ---- - -### useFragment - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never` | - -#### Returns - -`TType` - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:15](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L15) - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` \| `null` \| `undefined` - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | `undefined` \| `null` \| [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never` | - -#### Returns - -`TType` \| `null` \| `undefined` - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:20](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L20) - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | readonly [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never`[] | - -#### Returns - -`ReadonlyArray`<`TType`\> - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:25](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L25) - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> \| `null` \| `undefined` - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | `undefined` \| `null` \| readonly [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never`[] | - -#### Returns - -`ReadonlyArray`<`TType`\> \| `null` \| `undefined` - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:30](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/indexer/gql/fragment-masking.ts#L30) - ---- - -### validateAllowlist - -▸ **validateAllowlist**(`data`, `units`): `ValidationResult` - -Validates an array of allowlist entries. - -This function checks that the total units in the allowlist match the expected total units, that the total units are greater than 0, -and that all addresses in the allowlist are valid Ethereum addresses. It returns an object that includes a validity flag and any errors that occurred during validation. - -#### Parameters - -| Name | Type | Description | -| :------ | :---------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | -| `data` | [`AllowlistEntry`](modules.md#allowlistentry)[] | The allowlist entries to validate. Each entry should be an object that includes an address and a number of units. | -| `units` | `bigint` | The expected total units in the allowlist. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. The keys in the errors object are the names of the invalid properties, and the values are the error messages. - -#### Defined in - -[sdk/src/validator/index.ts:108](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L108) - ---- - -### validateClaimData - -▸ **validateClaimData**(`data`): `ValidationResult` - -Validates Hypercert claim data. - -This function uses the AJV library to validate the claim data. It first retrieves the schema for the claim data, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------- | :------------------------------------------------------------------------------------------------- | -| `data` | `unknown` | The claim data to validate. This should be an object that conforms to the HypercertClaimdata type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:77](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L77) - ---- - -### validateDuplicateEvaluationData - -▸ **validateDuplicateEvaluationData**(`data`): `ValidationResult` - -Validates duplicate evaluation data. - -This function uses the AJV library to validate the duplicate evaluation data. It first retrieves the schema for the duplicate evaluation data, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :--------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | -| `data` | [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) | The duplicate evaluation data to validate. This should be an object that conforms to the DuplicateEvaluation type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:139](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L139) - ---- - -### validateMetaData - -▸ **validateMetaData**(`data`): `ValidationResult` - -Validates Hypercert metadata. - -This function uses the AJV library to validate the metadata. It first retrieves the schema for the metadata, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------- | :---------------------------------------------------------------------------------------------- | -| `data` | `unknown` | The metadata to validate. This should be an object that conforms to the HypercertMetadata type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:46](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L46) - ---- - -### validateSimpleTextEvaluationData - -▸ **validateSimpleTextEvaluationData**(`data`): `ValidationResult` - -Validates simple text evaluation data against a predefined schema. - -This function uses the AJV library to validate the simple text evaluation data. It first retrieves the schema for the simple text evaluation data, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :----------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------- | -| `data` | [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) | The simple text evaluation data to validate. This should be an object that conforms to the SimpleTextEvaluation type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:169](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L169) - ---- - -### verifyMerkleProof - -▸ **verifyMerkleProof**(`root`, `signerAddress`, `units`, `proof`): `void` - -Verifies a Merkle proof for a given root, signer address, units, and proof. - -This function first checks if the signer address is a valid Ethereum address. If it's not, it throws a `MintingError`. -It then verifies the Merkle proof using the `StandardMerkleTree.verify` method. If the verification fails, it throws a `MintingError`. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :--------- | :----------------------------- | -| `root` | `string` | The root of the Merkle tree. | -| `signerAddress` | `string` | The signer's Ethereum address. | -| `units` | `bigint` | The number of units. | -| `proof` | `string`[] | The Merkle proof to verify. | - -#### Returns - -`void` - -**`Throws`** - -Will throw a `MintingError` if the signer address is invalid or if the Merkle proof verification fails. - -#### Defined in - -[sdk/src/validator/index.ts:201](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L201) - ---- - -### verifyMerkleProofs - -▸ **verifyMerkleProofs**(`roots`, `signerAddress`, `units`, `proofs`): `void` - -Verifies multiple Merkle proofs for given roots, a signer address, units, and proofs. - -This function first checks if the lengths of the roots, units, and proofs arrays are equal. If they're not, it throws a `MintingError`. -It then iterates over the arrays and verifies each Merkle proof using the `verifyMerkleProof` function. If any verification fails, it throws a `MintingError`. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :----------- | :----------------------------- | -| `roots` | `string`[] | The roots of the Merkle trees. | -| `signerAddress` | `string` | The signer's Ethereum address. | -| `units` | `bigint`[] | The numbers of units. | -| `proofs` | `string`[][] | The Merkle proofs to verify. | - -#### Returns - -`void` - -**`Throws`** - -Will throw a `MintingError` if the lengths of the input arrays are not equal or if any Merkle proof verification fails. - -#### Defined in - -[sdk/src/validator/index.ts:224](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/validator/index.ts#L224) - ---- - -### walletClientToSigner - -▸ **walletClientToSigner**(`walletClient`): `undefined` \| `Signer` & `TypedDataSigner` - -This function converts a `WalletClient` instance to an ethers.js `Signer` to faciliate compatibility between ethers and viem. - -It extracts the account, chain, and transport from the `WalletClient` and creates a network object. -If no chain is found in the `WalletClient`, it logs a warning and stops the signature request. -It then creates a `Web3Provider` with the transport and network, and gets a `Signer` from the provider using the account's address. - -Ref: https://viem.sh/docs/ethers-migration.html - -#### Parameters - -| Name | Type | Description | -| :--------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `walletClient` | `Object` | The `WalletClient` instance to convert. | -| `walletClient.account` | `undefined` \| `Account` | The Account of the Client. | -| `walletClient.addChain` | (`args`: `AddChainParameters`) => `Promise`<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain.html - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism }) ` | -| `walletClient.batch?` | `Object` | Flags for batch settings. | -| `walletClient.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `walletClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `walletClient.chain` | `undefined` \| `Chain` | Chain for the client. | -| `walletClient.deployContract` | (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts **`Example`** `ts import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', }) ` | -| `walletClient.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> | - | -| `walletClient.getAddresses` | () => `Promise`<`GetAddressesReturnType`\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses() ` | -| `walletClient.getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1 ` | -| `walletClient.getPermissions` | () => `Promise`<`GetPermissionsReturnType`\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions() ` | -| `walletClient.key` | `string` | A key for the client. | -| `walletClient.name` | `string` | A name for the client. | -| `walletClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `walletClient.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `walletClient.request` | `EIP1193RequestFn`<`WalletRpcSchema`\> | Request function wrapped with friendly error handling | -| `walletClient.requestAddresses` | () => `Promise`<`RequestAddressesReturnType`\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses() ` | -| `walletClient.requestPermissions` | (`args`: \{ [x: string]: Record; eth_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} }) ` | -| `walletClient.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `walletClient.sendTransaction` | (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` | -| `walletClient.signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage.html - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signMessage({ message: 'hello world', }) ` | -| `walletClient.signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` | -| `walletClient.signTypedData` | (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` | -| `walletClient.switchChain` | (`args`: `SwitchChainParameters`) => `Promise`<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id }) ` | -| `walletClient.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `walletClient.type` | `string` | The type of client. | -| `walletClient.uid` | `string` | A unique ID for the client. | -| `walletClient.watchAsset` | (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, }) ` | -| `walletClient.writeContract` | (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract.html - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.** **`Example`** `ts import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], }) ` **`Example`** `ts // With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request) ` | - -#### Returns - -`undefined` \| `Signer` & `TypedDataSigner` - -An ethers.js `Signer` instance, or `undefined` if no chain is found in the `WalletClient`. - -#### Defined in - -[sdk/src/utils/adapters.ts:51](https://github.com/hypercerts-org/hypercerts/blob/0793659/sdk/src/utils/adapters.ts#L51) diff --git a/docs/versioned_docs/version-1.0.0/developer/burning.md b/docs/versioned_docs/version-1.0.0/developer/burning.md deleted file mode 100644 index 331ebc52..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/burning.md +++ /dev/null @@ -1,12 +0,0 @@ -# Burning - -> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. - -## Burning fraction tokens - -You can only burn fraction tokens that you own. Hypercert claims cannot be burned once minted. -You can get a list of all fraction tokens you own with [this query](./querying.md#claimtokensbyowner). - -```js -const txHash = await hypercerts.burnClaimFraction({ claimId }); -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/config.md b/docs/versioned_docs/version-1.0.0/developer/config.md deleted file mode 100644 index e69050c3..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/config.md +++ /dev/null @@ -1,97 +0,0 @@ -# Hypercert Client Configuration - -The client provides a high level interface that communicates with the Graph, IPFS and the evm. For easy setup we harmonised the configuration into a flow that allows for configuration with different levels of specificity. - -## Configuration - -### Setup - -The SDK allows for minimal configuration, explicit overrides and defining values in environment variables. We apply the following hierarchy: - -1. Overrides declared in `Partial` - -Based on the chainID (either 5 or 10) we load the default config for Goerli or Optimism. - -We then process the rest of the overrides and possible environment variables to customise the default configuration. - -To get started quickly you can either: - -- initialize a new client by calling `new HypercertClient({chain: {id: 5})` (or 10) - -Using either of the options above will launch the client in `read only` mode using the defaults in [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) - -### Read-only mode - -The SDK client will be in read-only mode if any of the following conditions are true: - -- The client was initialized without an operator. -- The client was initialized with an operator without signing abilities. -- The contract address is not set. -- The storage layer is in read-only mode. - -If any of these conditions are true, the read-only property of the `HypercertClient` instance will be set to true, and a warning message will be logged indicating that the client is in read-only mode. - -### Defaults - -The [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) file defines various defaults constants that are used throughout the Hypercert system. - -`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object -contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. - -For example: - -```json -{ - "5": { - "contractAddress": "0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07", - "graphName": "hypercerts-testnet", - "graphUrl": "https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-testnet" - } -} -``` - -You can select which deployment to use by passing in a `chainId` configuration parameter. We also allow for `overrides` -when creating the SDK by passing configuration variables. - -### Client config properties - -HypercertClientConfig is a configuration object used when initializing a new instance of the HypercertClient. It allows -you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide -`chain.id` to initalize the client in `readonly` mode. - -| Field | Type | Description | -| --------------------------- | ------- | ---------------------------------------------------------------------------------------------- | -| `chain` | Object | Partial configuration for the blockchain network. | -| `contractAddress` | String | The address of the deployed contract. | -| `graphUrl` | String | The URL to the subgraph that indexes the contract events. Override for localized testing. | -| `graphName` | String | The name of the subgraph. | -| `nftStorageToken` | String | The API token for NFT.storage. | -| `web3StorageToken` | String | The API token for Web3.storage. | -| `easContractAddress` | String | The address of the EAS contract. | -| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | -| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | -| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | -| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | -| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | - -- [Get an NFT.Storage API token](https://nft.storage/docs/#get-an-api-token) -- [Get a web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/) - -### Logging - -The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level -determines which log messages are printed to the console. By default, the logger is configured to log messages with a -level of info or higher to the console. - -In your `.env` file: - -```bash -LOG_LEVEL="info" -``` - -The SDK logger supports four log levels: `error`, `warn`, `info`, and `debug`. - -- The `error` log level is used to log errors that occur in the SDK. -- The `warn` log level is used to log warnings that do not necessarily indicate an error, but may be important to investigate. -- The `info` log level is used to log general information about the SDK's state or behavior. -- The `debug` log level is used to log detailed information that is useful for debugging purposes. diff --git a/docs/versioned_docs/version-1.0.0/developer/errors.md b/docs/versioned_docs/version-1.0.0/developer/errors.md deleted file mode 100644 index 291bb9f0..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/errors.md +++ /dev/null @@ -1,20 +0,0 @@ -# Errors in the SDK - -Generally, we follow the pattern of throwing on errors and letting those surface to the application. This allows for developers to handle any (un)expected errors in a manner they find suitable. - -### Handling Errors - -To support debugging we've implemented some custom errors. - -| Error | Description | Payload | -| ----------------------- | ---------------------------------------------------- | ---------------------------- | -| `ClientError` | An error that is caused by a problem with the client | `{ "key": "value" }` | -| `ContractError` | An error that is returned by the contract | \`{ "data": "BaseError | -| `FetchError` | Fails fetching a remote resource | `{ "key": "value" }` | -| `InvalidOrMissingError` | The provided value was undefined or empty | `{ "key": "value" }` | -| `MintingError` | Minting transaction failed | `{ "key": "value" }` | -| `StorageError` | Fails storing to a remote resource | `{ "key": "value" }` | -| `UnknownSchemaError` | Schema could not be loaded | `{ "schemaName": "string" }` | -| `MalformedDataError` | Data doesn't conform to expectations | `{ "key": "value" }` | -| `UnsupportedChainError` | This blockchain is not yet supported | \`{ "chainID": "string | -| `ConfigurationError` | The configuration was invalid | `{ "key": "value" }` | diff --git a/docs/versioned_docs/version-1.0.0/developer/index.md b/docs/versioned_docs/version-1.0.0/developer/index.md deleted file mode 100644 index 1baebcca..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/index.md +++ /dev/null @@ -1,49 +0,0 @@ -# Developer Documentation for Hypercerts - -Welcome to the developer documentation for Hypercerts! This guide will provide you with all the information you need to get started with developing applications using Hypercerts. - -## API Documentation - -The API documentation section contains detailed information about the hypercerts SDK and contracts. You will find everything you need to integrate Hypercerts into your applications. - -## NPM packages - -We provide the following NPM packages for you to use in your applications: - -- [SDK](https://www.npmjs.com/package/@hypercerts-org/sdk) -- [Contracts](https://www.npmjs.com/package/@hypercerts-org/contracts) - -## Starter app - -The starter app repo contains a sample application that demonstrates how to use the Hypercerts SDK to create a simple web application based on Next.js, Chakra UI, and the Hypercerts SDK. - -[Starter app repository](https://github.com/hypercerts-org/hypercert-nextjs-chakra-starter) - ---- - -**NOTE** - -The starter app is a template to feel free to fork it and get started quickly. - ---- - -## Demo Apps - -In the demo apps repo, you will find a collection of sample applications that show the bare minimum to implement hypercerts. These apps serve as a starting point for your own development and can be used as a reference to understand how to implement the SDK. - -[Demo apps repository](https://github.com/hypercerts-org/demo-apps) - -## Issue Tracking - -If you encounter any issues or have questions while working with hypercerts, the issue tracking is the place to go. Here, you can find a list of known issues, report new issues, and participate in discussions with the hypercerts community. - -[Issues on GitHub](https://github.com/hypercerts-org/hypercerts/issues) - -## Quickstarts - -The quickstarts section provides step-by-step guides to help you quickly get up and running with Hypercerts. Whether you are a beginner or an experienced developer, these guides will walk you through the process of setting up your development environment and creating your first Hypercerts application. - -[Quickstart Javascript](./quickstart-javascript.md) -[Quickstart Solidity](./quickstart-solidity.md) - -We hope you find this developer documentation helpful in your journey with Hypercerts. Happy coding! diff --git a/docs/versioned_docs/version-1.0.0/developer/minting.md b/docs/versioned_docs/version-1.0.0/developer/minting.md deleted file mode 100644 index 0acd42f0..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/minting.md +++ /dev/null @@ -1,57 +0,0 @@ -# Minting - -## Token design - -Hypercerts are semi-fungible tokens. -Thus, each hypercert is represented on-chain by a group of fraction tokens, -each representing a fraction of ownership over the hypercert. -If you want to split your fraction token, or merge multiple tokens into one, -check out the section on [splitting and merging](./split-merge.md). - -## Minting your first hypercert - -To mint a hypercert you need to provide the `metadata`, total amount of `units` and the preferred `TransferRestrictions`. -The resulting hypercert will be wholly owned by the creator. - -```js -import { TransferRestrictions, formatHypercertData } from "@hypercerts-org/sdk" - -const { metadata } = formatHypercertData(...); -const totalUnits = 10000n; - -const txHash = await hypercerts.mintClaim({ - metadata, - totalUnits, - transferRestrictions: TransferRestrictions.FromCreatorOnly, -}); -``` - -> **Note** If you did not initialize your HypercertsClient with an `operator`, `nftStorageToken` and `web3StorageToken`, the client will run in [read-only mode](#read-only-mode) and this will fail. - -Let's see what happens under the hood: - -First, `mintClaim` checks that the client is not `read only` and that the operator is a `Signer`. If not, it throws an `InvalidOrMissingError`. - -Next, the function validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. The function then stores the metadata on `IPFS` using the `storeMetadata` method and returns the `CID` for the metadata. - -Finally, we call the mintClaim function on the contract with the signer `address`, total `units`, `CID`, and `transfer restriction` as parameters. If `overrides` are provided, the function uses them to send the transaction. Otherwise, it sends the transaction without overrides. - -## Transfer restrictions - -When minting a Hypercert, you must pass in a `TransferRestriction` policy. For now there are only 3 implemented policies: - -```js -enum TransferRestrictions { - // Unrestricted - AllowAll, - // All transfers disabled after minting - DisallowAll, - // Only the original creator can transfer - FromCreatorOnly -} -``` - -## Reference - -See the [code](https://github.com/hypercerts-org/hypercerts/tree/main/sdk/src/client.ts) -for more details on how we implement minting. diff --git a/docs/versioned_docs/version-1.0.0/developer/querying.md b/docs/versioned_docs/version-1.0.0/developer/querying.md deleted file mode 100644 index 760c34c8..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/querying.md +++ /dev/null @@ -1,273 +0,0 @@ -# Querying - -## Overview - -The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient -has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, -HypercertIndexer, and HypercertMinter classes, respectively. - -```js -const { - client: { storage }, -} = new HypercertClient({ chain: { id: 5 } }); -``` - -The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata off-chain on IPFS. It is used by the HypercertClient to store metadata when creating new Hypercerts. - -```js -const { - client: { indexer }, -} = new HypercertClient({ chain: { id: 5 } }); -``` - -The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. -It is used by the HypercertClient to retrieve event-based data via the subgraph. - -```js -const { - client: { contract }, -} = new HypercertClient({ chain: { id: 5 } }); -``` - -Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used -by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. - -By providing instances of these classes through the `storage`, `indexer`, and `contract` getters, the HypercertClient allows developers to easily interact with the various components of the Hypercert system directly. -For example, a developer could use the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the contract. - -## Indexer - -For indexing purposes, we rely on the [Graph](https://thegraph.com/docs/en/) to index Hypercert events. To make the subgraph easily accessible with typed methods and object we provide a client that wraps [urql](https://formidable.com/open-source/urql/) into an opiniated set of queries. - -### Live graph playground - -To inspect the subgraph and explore queries, have a look at the Graph playground for Goerli testnet and Optimism mainnet: - -- [Goerli dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet) -- [Optimism dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet) - -### Graph client - -Since the client is fully typed, it's easy to explore the functionalities using code completion in IDEs. - -Here's one example from our frontend where we let [react-query](https://www.npmjs.com/package/%2540tanstack/react-query) frequently update the call to the graph: - -```js -import { useHypercertClient } from "./hypercerts-client"; -import { useQuery } from "@tanstack/react-query"; - -export const useFractionsByOwner = (owner: `0x${string}`) => { - const { - client: { indexer }, - } = useHypercertClient(); - - return useQuery( - ["hypercerts", "fractions", "owner", owner], - () => indexer.fractionsByOwner(owner), - { enabled: !!owner, refetchInterval: 5000 }, - ); -}; -``` - -### Queries: Claims - -These tables show the input parameters and output fields for each of the GraphQL queries in [claims.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/claims.graphql). -A claim represents 1 Hypercert and all of the common data across all claim/fraction tokens. - -#### `ClaimsByOwner` - -The `ClaimsByOwner` query retrieves an array of claims that belong to a specific owner. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | -------------------------------------------------- | ------------- | -| `owner` | `Bytes` | The address of the owner whose claims to retrieve. | "" | -| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | -| `first` | `Int` | The number of claims to retrieve. | `100` | -| `skip` | `Int` | The number of claims to skip. | `0` | - -##### Output - -The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------ | -| `contract` | `Bytes` | The address of the contract. | -| `tokenID` | `String` | The token ID. | -| `creator` | `Bytes` | The address of the creator. | -| `id` | `ID` | The ID of the claim. | -| `owner` | `Bytes` | The address of the owner. | -| `totalUnits` | `BigInt` | The total number of units. | -| `uri` | `String` | The URI of the claim metadata. | - -#### `RecentClaims` - -The RecentClaims query retrieves an array of the most recent claims on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | ---------------------------------- | ------------- | -| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | -| `first` | `Int` | The number of claims to retrieve. | `100` | -| `skip` | `Int` | The number of claims to skip. | `0` | - -##### Output - -The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------ | -| `contract` | `Bytes` | The address of the contract. | -| `tokenID` | `String` | The token ID. | -| `creator` | `Bytes` | The address of the creator. | -| `id` | `ID` | The ID of the claim. | -| `owner` | `Bytes` | The address of the owner. | -| `totalUnits` | `BigInt` | The total number of units. | -| `uri` | `String` | The URI of the claim metadata. | - -#### `ClaimByID` - -The ClaimById query retrieves a single claim by its ID on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | -| --------- | ----- | -------------------------------- | -| `id` | `ID!` | The ID of the claim to retrieve. | - -##### Output - -The query returns a claim object that matches the input parameter. The claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------ | -| `contract` | `Bytes` | The address of the contract. | -| `tokenID` | `String` | The token ID. | -| `creator` | `Bytes` | The address of the creator. | -| `id` | `ID` | The ID of the claim. | -| `owner` | `Bytes` | The address of the owner. | -| `totalUnits` | `BigInt` | The total number of units. | -| `uri` | `String` | The URI of the claim metadata. | - -### Queries: Fractions - -These tables show the input parameters and output fields for each of the GraphQL queries in [fractions.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/fractions.graphql). -A claim token represents a fraction of ownership of a Hypercert. - -#### `ClaimTokensByOwner` - -The `ClaimTokensByOwner` query retrieves an array of claim tokens that belong to a specific owner on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | -| `owner` | `Bytes` | The address of the owner whose claim tokens to retrieve. | "" | -| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | -| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | -| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | - -##### Output - -The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: - -| Field | Type | Description | -| --------- | -------- | ------------------------------------------ | -| `id` | `ID` | The ID of the claim token. | -| `owner` | `Bytes` | The address of the owner. | -| `tokenID` | `String` | The token ID. | -| `units` | `BigInt` | The number of units. | -| `claim` | `Claim` | The claim associated with the claim token. | - -The Claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------------ | -| `id` | `ID` | The ID of the claim. | -| `creation` | `Int` | The timestamp of the claim creation. | -| `uri` | `String` | The URI of the claim metadata. | -| `totalUnits` | `BigInt` | The total number of units. | - -#### `ClaimTokensByClaim` - -The `ClaimTokensByClaim` query retrieves an array of claim tokens that belong to a specific claim on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | -| `claimId` | `String!` | The ID of the claim whose claim tokens to retrieve. | None | -| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | -| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | -| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | - -##### Output - -The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: - -| Field | Type | Description | -| --------- | -------- | -------------------------- | -| `id` | `ID` | The ID of the claim token. | -| `owner` | `Bytes` | The address of the owner. | -| `tokenID` | `String` | The token ID. | -| `units` | `BigInt` | The number of units. | - -#### `ClaimTokenById` Query - -The `ClaimTokenById` query retrieves a single claim token by its ID on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | -| --------- | ----- | -------------------------------------- | -| `id` | `ID!` | The ID of the claim token to retrieve. | - -##### Output - -The query returns a claim token object that matches the input parameter. The claim token object has the following fields: - -| Field | Type | Description | -| --------- | -------- | ------------------------------------------ | -| `id` | `ID` | The ID of the claim token. | -| `owner` | `Bytes` | The address of the owner. | -| `tokenID` | `String` | The token ID. | -| `units` | `BigInt` | The number of units. | -| `claim` | `Claim` | The claim associated with the claim token. | - -The Claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------------ | -| `id` | `ID` | The ID of the claim. | -| `creation` | `Int` | The timestamp of the claim creation. | -| `uri` | `String` | The URI of the claim metadata. | -| `totalUnits` | `BigInt` | The total number of units. | - -## Storage - -### Hypercert Metadata - -Currently, all metadata is stored off-chain in IPFS. Use the `storage` client to retrieve the metadata - -```js -const claimId = "0x822f17a9a5eecfd...85254363386255337"; -const { indexer, storage } = hypercertsClient; -// Get the on-chain claim -const claimById = await indexer.claimById(claimId); -// Get the off-chain metadata -const metadata = await storage.getMetadata(claimById.claim.uri); -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/quickstart-javascript.md b/docs/versioned_docs/version-1.0.0/developer/quickstart-javascript.md deleted file mode 100644 index eee1f333..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/quickstart-javascript.md +++ /dev/null @@ -1,106 +0,0 @@ -# Getting started with JavaScript - -The Hypercerts SDK makes it easy to integrate Hypercerts into your application or backend with JavaScript/TypeScript. - -## Installation - -Install the SDK using npm or yarn: - -```bash -npm install @hypercerts-org/sdk -# OR yarn add @hypercerts-org/sdk -``` - -## Get storage credentials (only required for minting) - -For now, we store all metadata (e.g. Hypercert claim data) on IPFS using [NFT.Storage](https://nft.storage/) and [web3.storage](https://web3.storage/). - -In order to mint a Hypercert, you will need to create API tokens for both services, which you can learn more about from their respective guides: - -- [Get an NFT.Storage API token](https://nft.storage/docs/#get-an-api-token) -- [Get a web3.storage API token](https://web3.storage/docs/how-tos/generate-api-token/) - -_Note: In the future, we want to also support other mechanisms for storing off-chain data._ - -## Initialize - -Import the SDK into your project and create a new instance of `HypercertClient` with your configuration options: - -```js -import { HypercertClient } from "@hypercerts-org/sdk"; -import { createWalletClient, custom } from "viem"; -import { mainnet } from "viem/chains"; - -const walletClient = createWalletClient({ - chain: mainnet, - transport: custom(window.ethereum), -}); - -// NOTE: you should replace this with your own JSON-RPC provider to the network -// This should have signing abilities and match the `chainId` passed into HypercertClient - -const client = new HypercertClient({ - chainId: 5, // goerli testnet - walletClient, - nftStorageToken, - web3StorageToken, -}); -``` - -Hypercerts is a multi-chain protocol. -See [here](./supported-networks.md) for a list of currently supported networks. - -> **Note** If there's no `walletClient`, `nftStorageToken` or `web3StorageToken` provided, the client will run in [read-only mode](#read-only-mode). - -## Make a Hypercert - -Use the client object to interact with the Hypercert network. For example, you can use the `client.mintClaim` method to create a new claim: - -```js -import { - formatHypercertData, - TransferRestrictions, -} from "@hypercerts-org/sdk"; - -// Validate and format your Hypercert metadata -const { data: metadata, valid, errors } = formatHypercertData({ - name, - ... -}) - -// Check on errors -if (!valid) { - return console.error(errors); -} - -// Set the total amount of units available -const totalUnits: bigint = 10000n - -// Define the transfer restriction -const transferRestrictions: TransferRestrictions = TransferRestrictions.FromCreatorOnly - -// Mint your Hypercert! -const tx = await client.mintClaim( - metadata, - totalUnits, - transferRestrictions, -); -``` - -For guidance on how to specify your metadata, see the [minting guide](../minting-guide/step-by-step.md). -This will validate the metadata, store claim metadata on IPFS, create a new hypercert on-chain, and return a transaction receipt. - -For more details, check out the [Minting Guide](./minting.md). - -## Query for Hypercerts - -You can also use the client to query the subgraph and retrieve which claims an address owns: - -```js -const claims = await client.indexer.fractionsByOwner(owner), -``` - -For more details, checkout the [Querying guide](./querying.md) -and our [Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet). - -That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. diff --git a/docs/versioned_docs/version-1.0.0/developer/quickstart-solidity.md b/docs/versioned_docs/version-1.0.0/developer/quickstart-solidity.md deleted file mode 100644 index 409a1e9d..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/quickstart-solidity.md +++ /dev/null @@ -1,41 +0,0 @@ -# Getting started with Solidity - -> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. - -If you need the Solidity contracts or interfaces exported from the SDK, -please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). - -## Hypercerts deployments - -Hypercerts is a multi-chain protocol and we want to support any network that wants to make positive impact. -We plan to support at most 1 canonical contract deployment per network. -For a complete list of deployments and their contract addresses, see [Supported Networks](./supported-networks.md). - -## Installing the Hypercert contracts - -```bash -npm install @hypercerts-org/contracts -# or yarn add @hypercerts-org/contracts -``` - -## Using the Solidity interface - -If you want to call the Hypercerts contract on your network directly from Solidity, -we export the interface/ABI for you to use from your contract. - -```js -import { IHypercertToken } from "@hypercerts-org/contracts/IHypercertMinter.sol"; - -contract MyContract { - IHypercertToken hypercerts; - - function initialize(address _addr) public virtual initializer { - hypercerts = IHypercertToken(_addr); - } - - function uri(uint256 tokenID) public view returns (string memory _uri) { - _uri = hypercerts.uri(tokenID); - } -} - -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/split-merge.md b/docs/versioned_docs/version-1.0.0/developer/split-merge.md deleted file mode 100644 index 1335884f..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/split-merge.md +++ /dev/null @@ -1,15 +0,0 @@ -# Split and Merge - -> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. - -## By Token Value - -### Split / merge token values - -```js -const { tokenIds } = await hypercerts.splitFractionUnits({ - fractionId, - units: [10n, 12n, 15n], -}); -const { tokenId } = await hypercerts.mergeFractionUnits({ fractionIds }); -``` diff --git a/docs/versioned_docs/version-1.0.0/developer/supported-networks.md b/docs/versioned_docs/version-1.0.0/developer/supported-networks.md deleted file mode 100644 index e8585291..00000000 --- a/docs/versioned_docs/version-1.0.0/developer/supported-networks.md +++ /dev/null @@ -1,15 +0,0 @@ -# Supported networks - -Hypercerts is developed in public and released under [dual MIT and Apache license](https://github.com/hypercerts-org/hypercerts/blob/main/LICENSE). The Hypercert Foundation currently rolled out on two networks: `Goerli` and `Sepolia` for testing, `Optimism` and `Celo` as the production deployment. - -We want to support every network that wants to support positive impact! -If you want to see Hypercerts deployed on another network, please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). - -## Overview - -| Network | HypercertMinter (UUPS Proxy) | Safe | -| -------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| Goerli | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://goerli.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x8CD35a62fF56A91485eBF97491612F1552dbc1c9](https://goerli.etherscan.io/address/0x8CD35a62fF56A91485eBF97491612F1552dbc1c9) | -| Sepolia | [0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941](https://goerli.etherscan.io/address/0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941) | TBD | -| Celo | [0x16bA53B74c234C870c61EFC04cD418B8f2865959](https://celoscan.io/address/0x16bA53B74c234C870c61EFC04cD418B8f2865959) | TBD | -| Optimism | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x560adA72a80b4707e493cA8c3B7B7528930E7Be5](https://optimistic.etherscan.io/address/0x560adA72a80b4707e493cA8c3B7B7528930E7Be5) | diff --git a/docs/versioned_docs/version-1.0.0/devops/deploy-proxy.md b/docs/versioned_docs/version-1.0.0/devops/deploy-proxy.md deleted file mode 100644 index 4ed58fc0..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/deploy-proxy.md +++ /dev/null @@ -1,138 +0,0 @@ -# Deploy a new proxy contract - -This should be done only on rare occasions. For example, when: - -- We want to deploy to a new network -- We have updated the contract in a way that is _NOT_ backwards-compatible. - - For most upgrades, please use UUPS [upgrades](./upgrade.md). - -## Smart Contracts - -### Setup the `contracts/` environment - -Navigate to `contracts/`. Configure your `.env` file by following the instructions in the -[README](https://github.com/hypercerts-org/hypercerts/tree/main/contracts#setup). - -### Build and deploy the smart contracts - ---- - -**NOTE** - -While we use foundry for developement and testing, we use hardhat for deployment. This is because hardhat is more flexible and allows us to easily integrate with OpenZeppelin tools for upgradeable contracts. - ---- - -If you are deploying on a new network, configure `contracts/hardhat.config.ts` to support the new network under the `networks` key. - -```javascript - "sepolia": getChainConfig("sepolia"), -``` - -Build the contracts and deploy. Specify the network to match the key used in `hardhat.config.ts`. - -```sh -# Run in contracts/ -yarn build:hardhat -yarn hardhat deploy --network NETWORK -``` - -This will output the new proxy address. Update the root `README.md` with this new address. - -Now transfer ownership over the proxy contract to the multisig: - -```sh -yarn hardhat transfer-owner --network NETWORK --proxy PROXY_CONTRACT_ADDRESS --owner MULTISIG_ADDRESS -``` - -## Subgraph - -### Setup the `graph/` environment - -Navigate to `graph/`. Follow the instructions in the -[README](https://github.com/hypercerts-org/hypercerts/tree/main/graph#setup) -to get set up. - -### Deploy the subgraph - -Update `graph/networks.json` with the new proxy address. To speed up indexing, you set the `startBlock` to the block containing the contract creation. We can add multiple networks that are monitored by the same subgraph. For more details, see the [Graph documentation](https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#deploying-the-subgraph-to-multiple-ethereum-networks). - -To separate test from production, we use a different subgraph for each network. This means that we need to deploy a new subgraph for each network; but we group the deployments in the scripts. - -- Create a new deploy script for the network in the `package.json` of the `graph/` directory. For example, if you are deploying to the `sepolia` network, you would add the following script: - -````json - "deploy:sepolia": "graph deploy --node https://api.thegraph.com/deploy/ --network sepolia hypercerts-admin/hypercerts-sepolia" - ``` - -* Add the deploy script to `deploy:test` or `deploy:prod` depending on whether you are deploying to a test or production network. - -* Now deploy the subgraph - -```sh -# Run in graph/ -yarn build -yarn deploy:test -```` - -## OpenZeppelin Defender - -### Create a new Supabase table - -Log into the [Supabase dashboard](https://app.supabase.com/). -We store all data in a single project, but use different tables for each network. -The table name should be suffixed by the network (e.g. `allowlistCache-goerli`). -If you are deploying to a new network, create a new table. You can copy the table schema and RLS policy from another pre-existing table. - -If you are deploying a new proxy contract to a network for which you already have another deployment, you'll have to make a judgement call as to whether you can reuse the existing table, whether you need to clear the existing table, or create another table. - -Note: We want to merge all the tables in this [issue](https://github.com/hypercerts-org/hypercerts/issues/477). - -### Update the OpenZeppelin Defender scripts - -Modify the Defender scripts to support the new network in `defender/src/networks.ts`. - -If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. - -Note: The entry point for deployment is in `defender/src/setup.ts`. - -### Setup the `defender/` environment - -Navigate to `defender/`. Follow the instructions in the -[README](https://github.com/hypercerts-org/hypercerts/tree/main/defender#setup) -to get set up. - -### Deploy defender scripts - -Deploy to OpenZeppelin Defender via - -```sh -# Run in defender/ -yarn deploy -``` - -## Hypercerts SDK - -TODO: Flesh this out - -Run the build in `contracts/`. - -(Soon to be deprecated) Publish `contracts/` to npm - -Configure the SDK to support the new network via the graphclient. - -Publish SDK to npm - -## Deploy the Dapp frontend - -Each frontend build is configured to run on a different network (e.g. `https://testnet.hypercerts.org`). You can use any CDN to serve the site (e.g. Netlify, Vercel, GitHub Pages, Cloudflare Pages, Fleek, Firebase Hosting). - -1. Configure your build environment with the environment variables specified in `frontend/.env.local.example`. - -2. Configure your builds to the following settings: - -- Build command: `yarn build:site` -- Build output directory: `/build` -- Root directory: `/` - -3. Configure the domain that you want for your build. diff --git a/docs/versioned_docs/version-1.0.0/devops/errors.md b/docs/versioned_docs/version-1.0.0/devops/errors.md deleted file mode 100644 index 05dc5b0c..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/errors.md +++ /dev/null @@ -1,45 +0,0 @@ -# Errors - -## Deploying - -### Artifact for contract "HypercertMinter" not found - -#### Error message - -`Error HH700: Artifact for contract "HypercertMinter" not found.` - -#### Cause - -Attempting to deploy a contract with `npx hardhat deploy` before the contract has been compiled by hardhat. Contracts compiled by forge are currently not visible to hardhat (this could be a configuration problem). - -### insufficient funds for intrinsic transaction cost - -#### Error message - -`Error: insufficient funds for intrinsic transaction cost` - -#### Cause - -The environment variable `MNEMONIC` is not configured correctly. - -Alternatively, the wallet may not have enough funds for the selected network - -Causing pause twice - -Error: cannot estimate gas; transaction may fail or may require manual gas limit - -reason: 'execution reverted: Pausable: paused', - -#### Etherscan API - -Note: It can take between 5-10 minutes before a newly created etherscan API key becomes valid for queries to goerli. - -When using an etherscan API key that was too recently created, hardhat tasks using etherscan to verify transactions will exit with an error message: - -`Etherscan returned with message: NOTOK, reason: Invalid API Key` - -Despite this error the transaction may have succeeded, the hardhat task just can't confirm it. - -It is unknown if this is a problem for queries to mainnet as well. - -Metamask makes it very difficult to have multiple wallets. diff --git a/docs/versioned_docs/version-1.0.0/devops/index.md b/docs/versioned_docs/version-1.0.0/devops/index.md deleted file mode 100644 index 9b208595..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# DevOps - -We use this playbook to encapsulate our practices and current setup. - -## Setup dev environment - -- [Setup guide](./setup.md) -- [Plasmic setup](./plasmic.md) - -## Tasks - -- [Deploy new proxy contract](./deploy-proxy.md) -- [Upgrade contract](./upgrade.md) -- [Pause contract](./pause.md) - -## FAQ - -- [Common errors](./errors.md) diff --git a/docs/versioned_docs/version-1.0.0/devops/pause.md b/docs/versioned_docs/version-1.0.0/devops/pause.md deleted file mode 100644 index 2668f51e..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/pause.md +++ /dev/null @@ -1,29 +0,0 @@ -# Pause / Unpause - -## Pause - -### Contract owned by an address - -Make sure you have set up your wallets and config from the [setup guide](./setup.md). - -To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: - -```sh -yarn hardhat pause --network NETWORK --address CONTRACT_ADDRESS -``` - -### Contract owned by a multi-sig - -If we transferred ownership to a multisig, we can use -[OpenZeppelin Defender Admin](https://defender.openzeppelin.com/#/admin) -to propose a pause to be approved by the multisig. - -## Unpause - -Make sure you have set up your wallets and config from the [setup guide](./setup.md). - -To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: - -```sh -yarn hardhat unpause --network NETWORK --address CONTRACT_ADDRESS -``` diff --git a/docs/versioned_docs/version-1.0.0/devops/plasmic.md b/docs/versioned_docs/version-1.0.0/devops/plasmic.md deleted file mode 100644 index 10e52f5b..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/plasmic.md +++ /dev/null @@ -1,76 +0,0 @@ -# Plasmic setup - -## HypercertImage - -### Props - -hideImpact - -``` -$ctx.currentForm.impactTimeEnd === "indefinite" && ($ctx.currentForm.impactScopes.length === 0 || ($ctx.currentForm.impactScopes.length === 1 && $ctx.currentForm.impactScopes[0] === "all")) -``` - -color - -``` -$ctx.currentForm.backgroundColor -``` - -vectorart - -``` -$ctx.currentForm.backgroundVectorArt -``` - -### Slots - -logoImage Image URL - -``` -$ctx.currentForm.logoUrl -``` - -title Content - -``` -$ctx.currentForm.name -``` - -workPeriod Content - -``` -`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.workTimeEnd.format ? $ctx.currentForm.workTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.workTimeEnd}` -``` - -bannerImage Image URL - -``` -$ctx.currentForm.bannerUrl -``` - -impactPeriod Content - -``` -`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.impactTimeEnd.format ? $ctx.currentForm.impactTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.impactTimeEnd}` -``` - -#### workScopes: repeated ScopeChip - -Collection - -``` -$ctx.currentForm.workScopes.split(/[,\n]/).map(i => i.trim()).filter(i => !!i) -``` - -Element name: `currentWorkScope` -Index name: `currentIndex` -Color variant: `$ctx.currentForm.backgroundColor` -Content: `currentWorkScope` - -#### impactScopes: repeated ScopeChip - -Collection: `$ctx.currentForm.impactScopes` -Element name: `currentImpactScope` -Index name: `currentIndex` -Color variant: `$ctx.currentForm.backgroundColor` -Content: `currentImpactScope` diff --git a/docs/versioned_docs/version-1.0.0/devops/setup.md b/docs/versioned_docs/version-1.0.0/devops/setup.md deleted file mode 100644 index afb95296..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/setup.md +++ /dev/null @@ -1,41 +0,0 @@ -# Setup - -## Pre-requisites - -1. Install [NodeJS](https://nodejs.org/en/) and [git](https://git-scm.com/) -2. Install [yarn](https://classic.yarnpkg.com/) - -```sh -npm install --global yarn -``` - -3. Clone the repository: - -``` -git clone git@github.com:hypercerts-org/hypercerts.git -cd hypercerts -``` - -4. Install dependancies: - -To install dependencies across all projects in the monorepo workspace: - -```sh -yarn install -``` - -## Setup your wallets - -We need 2 wallets: a multi-sig for administering the contracts, and a hot wallet for setting everything up. - -1. We use a [Gnosis Safe](https://app.safe.global/) multisig for managing and administering the contracts. Set one up with your desired confirmation threshold (e.g. 2 of 3). This wallet will not require any balance. -2. Separately, set up a wallet that we'll use in our developer scripts. - -- If you don't have one, you can goto `contracts/` and run `yarn hardhat generate-address`. -- Make sure there is enough balance in this account to deploy the contract and transfer ownership to the multisig - - [Goerli Faucet](https://goerlifaucet.com/) - - [Optimism Bridge](https://app.optimism.io/bridge/deposit) - -## Next Steps - -Depending on what you want to do (e.g. in `./sdk/` or `./frontend/`), there will be further setup instructions in the respective `README.md` file. diff --git a/docs/versioned_docs/version-1.0.0/devops/upgrade.md b/docs/versioned_docs/version-1.0.0/devops/upgrade.md deleted file mode 100644 index 820255e7..00000000 --- a/docs/versioned_docs/version-1.0.0/devops/upgrade.md +++ /dev/null @@ -1,35 +0,0 @@ -# Upgrading the contract - -## Validate upgrade - -Validate contract upgradeability against deployment. - -For example, for the `goerli` deployment: - -```sh -yarn hardhat validate-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS -``` - -## Propose Upgrade - -Propose an upgrade via OpenZeppelin Defender. For more information, see this -[guide](https://docs.openzeppelin.com/defender/guide-upgrades) - -For example, for the `goerli` deployment: - -```sh -yarn build:hardhat -yarn hardhat propose-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESS -``` - -This will output an OpenZeppelin URL that multi-sig members can use to approve/reject the upgrade. - -## Publish to npm - -After you update the contracts, deploy the `contracts/` package to npm. - -TODO - -Update the dependencies in `frontend/package.json` and `sdk/package.json`. - -If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. diff --git a/docs/versioned_docs/version-1.0.0/faq.md b/docs/versioned_docs/version-1.0.0/faq.md deleted file mode 100644 index b9659b5a..00000000 --- a/docs/versioned_docs/version-1.0.0/faq.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Frequently Asked Questions -id: faq ---- - -# FAQs - -### How do I create a hypercert? - -We've created a step-by-step guide in the documents, which you can find [here](minting-guide/minting-guide-start). - -### Who gets to claim my hypercert? - -There are currently two types of users who are eligible to claim your hypercert. - -1. You as the creator of the hypercert are eligible to claim your hypercert. For projects with an allow list, you are eligible to claim 50% of the total tokens. For projects with no allow list, you will receive 100% of the tokens automatically and can do whatever you like with them. - -2. Anyone on the hypercert's allow list will be eligible to claim your hypercert. The allow list is stored and the time of minting and allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions through a separate contract interaction. Creators often use allow lists be used to allocate fractions to previous funders and contributors. - -### How do I claim a hypercert? Can I claim all of the ones I’m eligible for at once? - -After you connect your wallet, you will see a dashboard of hypercerts that you can claim. You can either claim them individually or in a batch transaction. Note that if you perform the batch transaction you will automatically claim _all_ hypercerts you are allow-listed for. (You still pay a gas fee for each claim, however.) If you don't want to claim _all_ at once, then you should claim them one-by-one. - -### What token standard do hypercerts utilize? - -The interface supports both ERC-1155s and 721s. Our current implementation makes use of [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) (a semi-fungible token). - -### What are the required fields to generate a hypercert? - -There are six required fields: - -1. Set of contributors: An ordered list of all contributors, who claim to do or have done the work described by this hypercert. -2. Scope of work: A conjunction of potentially-negated work scope tags, where an empty string means “all”. -3. Time of work: A date range, from the start to the end of the work being claimed by this hypercert. -4. Scope of impact: A conjunction of potentially-negated impact scope tags, where an empty string means “all”. -5. Time of impact: Date ranges from the start to the end of the impact. -6. Rights of the owners: An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. - -Hypercerts also need a name and description. - -### What should I put for my hypercert's work scope? - -For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. - -If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. - -### Are hypercerts the same as impact evaluations? - -No. A hypercert is a claim over a discrete piece of work and the impact that may result from that work. It has no opinion about the legitimacy or quality of the claim. - -An impact evaluation is an opinionated assessment about the legitimacy or quality of a claim. - -For example, a hypercert might represent "Planting trees in the Amazon in 2022". An impact evaluation might point to that hypercert and assert the percent of trees that survived, the amount of CO2 removed by the trees, or the income change among people living around the project. - -Over time, the expectation is that hypercerts that attract multiple, high quality, credibly neutral impact evaluations will be more relevant than ones that do not. - -### What can I do with my hypercert? - -The `rights` dimension specific what an owner can do with their hypercert. Currently, the only `right` that owners have is "Public Display". Over time, we hope the protocol can support various `rights` including transfers, intellectual property, tax-deductibility, carbon offsets, ESG reporting, and more. - -### How is a hypercert different than a POAP or Impact NFT? - -Hypercerts have some things in common with certain POAPs or Impact NFTs, but also a number of crucial differences. - -First, all POAPs and most Impact NFTs are implemented as non-fungible tokens (ERC-721s). Hypercerts are currently being implemented as semi-fungible tokens (ERC-1155s), meaning it is possible to own more than one unit or fraction of a given hypercert. This makes it easy and intuitive to display the share of hypercerts that a given owner has. - -Second, hypercerts have specific metadata requirements and interpretation logic. These include a standard schema for how the six required hypercert dimensions are defined and captured (i.e., work scopes, impact scopes, timeframes, contributors, etc) as well as logic for how to interpret different inputs (e.g., how to include or exclude certain work scopes, create an indefinite time period, etc). POAPs have a completely different schema. Although there is no standard schema for Impact NFTs, an Impact NFT project could choose to adopt the hypercert standard and token interface and thereby achieve compatibility. - -Third, the hypercerts token interface is intended to support several functions that are not possible out of the box with other token standards, chiefly, atomic split and merge capabilities. We also expect other protocols to work with hypercerts for the purposes of prospective and retrospective funding, contributor verification, and impact evaluation. - -For certain use cases, POAPs may be better suited for projects as hypercerts are focused on the funding aspect of impactful work. - -### Where can I purchase a hypercert? - -Currently, it is only possible to purchase a hypercert from a creator or project. This can be facilitated directly by the project or via a third-party marketplace like OpenSea. Currently, hypercerts cannot be resold on secondary markets. - -### What chain(s) is hypercerts running on? - -The hypercerts smart contracts have been deployed on Optimism and Goerli Testnet. We plan to support various EVM chains in the near future. - -### How do I bridge to Optimism? - -There are various bridging services including the official [Optimism Bridge](https://app.optimism.io/bridge/deposit). Note that bridging assets from Ethereum to Optimism will incur a gas fee. - -### How much gas will it cost to create or claim a hypercert? - -In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). Claiming a hypercert should be below 0.0001 ETH or less than $0.10 on Optimism. - -### How do I create a hypercert from a multisig? - -If you are creating a hypercert on Optimism, then you will need an Optimism-based multisig. (Unfortunately, Safe wallets created on Ethereum won't work on Optimism.) - -### Have the smart contracts been audited? - -Yes. The auditor's security report is available [here](https://github.com/pashov/audits/blob/master/solo/Hypercerts-security-review.md). - -### How is the allow list generated? - -For Gitcoin projects, an allow list is generated from a snapshot of all of the on-chain funding received by the project. - -The queries used to generate the allow lists can be viewed here: - -- ETH Infra: https://dune.com/queries/1934656 -- Climate: https://dune.com/queries/1934689 -- OSS: https://dune.com/queries/1934969 - -Once the snapshot is taken, the formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. - -For example: - -- $5.60 donated --> 5 fractions -- $5.20 donated --> 5 fractions -- $0.96 donated --> 1 fraction -- $0.52 donated --> 0 fractions - -### Why am I not on the allow list even though I contributed to the project? - -If you contributed less than $1 DAI to a project, then you will not be eligible to claim a hypercert fraction. - -### I supported a project. Why I don't I see the hypercert in my dashboard? - -In order to your hypercert to appear as "claimable", the project needs to mint the hypercert first. If the project has not minted its hypercert yet, then you will not be able to claim it. We suggest you check back in a few days to see if the project has created the hypercert and is now claimable. - -If the project has created its hypercert, then please try the following solutions: - -1. Confirm the wallet address is correct (some users have multiple wallet addresses and forget which one they donated with) -2. Check that your wallet is included in the Dune Dashboards for each Gitcoin Round - -- ETH Infra: https://dune.com/queries/1934656 -- Climate: https://dune.com/queries/1934689 -- OSS: https://dune.com/queries/1934969 - -3. Confirm you donated more than $1 DAI to the project. - -If the project has created its hypercert, and you have confirmed items 1-3, then please send us a DM over Twitter or Telegram with your wallet address and we will get back to you promptly. - -### How do I retire a hypercert? - -We don't yet have a frontend for retiring hypercerts but you can do this by interacting directly with the smart contract on Etherscan. diff --git a/docs/versioned_docs/version-1.0.0/further-resources.md b/docs/versioned_docs/version-1.0.0/further-resources.md deleted file mode 100644 index 86c25331..00000000 --- a/docs/versioned_docs/version-1.0.0/further-resources.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Further Resources -id: further-resources ---- - -# Papers, Articles, Presentations - -## Writings - -- Feb 14, 2023, Whitepaper draft by [@hypercerts](http://twitter.com/hypercerts): [Hypercerts: A new primitive for impact funding systems (draft v0)](../static/pdf/hypercerts_whitepaper_v0.pdf) -- Aug 24, 2022, Blogpost by [@holkeb](https://twitter.com/holkeb): [Hypercerts: A new primitive for public goods funding](https://protocol.ai/blog/hypercert-new-primitive/) -- Jun 2022, Tech report (draft) by [@davidad](https://twitter.com/davidad): [Hypercerts; an Interoperable Datalayer for Impact-Funding Mechanisms](../static/pdf/hypercerts_Tech_Report_draft.pdf) - -## Talks - -#### Jun 24, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Hypercerts: on-chain primitives for impact markets](https://youtu.be/2hOhOdCbBlU) - - - -#### Jun 23, 2022, Conversation between [@emiyazono](http://twitter.com/emiyazono) and [@owocki](http://twitter.com/owocki) at GreenPill Podcast: [Impact Certificates | Evan Miyazono, Head of Research at Protocol Labs | Green Pill #21](https://youtu.be/kyo5SxtSJ9U) - - - -#### Mar 4, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Interoperable mechanisms for non-rival goods (Hypercerts)](https://youtu.be/acbBeGcevok) - - - -## Other resources - -Overview of some previous writings on impact certificates, retrospective funding and impact markets: - -- Christiano, Paul (2014) Certificates of impact, Rational Altruist, [https://rationalaltruist.com/2014/11/15/certificates-of-impact/](https://rationalaltruist.com/2014/11/15/certificates-of-impact/) -- Christiano, Paul & Katja Grace (2015) The Impact Purchase, [https://impactpurchase.org/why-certificates/](https://impactpurchase.org/why-certificates/) -- Optimism & Buterin, Vitalik (2021) Retroactive Public Goods Funding, [https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c) -- Cotton-Barratt, Owen (2021), Impact Certificates and Impact Markets, Funding the Commons November 2021, [https://youtu.be/ZiDV56o5M7Q](https://youtu.be/ZiDV56o5M7Q) -- Drescher, Denis (2022) Towards Impact Markets, [https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1](https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1) -- Ofer & Cotton-Barratt, Owen (2022) Impact markets may incentivize predictably net-negative projects, [https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6](https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6) diff --git a/docs/versioned_docs/version-1.0.0/implementation/glossary.md b/docs/versioned_docs/version-1.0.0/implementation/glossary.md deleted file mode 100644 index b35d4405..00000000 --- a/docs/versioned_docs/version-1.0.0/implementation/glossary.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Glossary -id: glossary -sidebar_position: 3 ---- - -# Glossary of Hypercerts Terms - -## Main Terms - -### Allowlist - -A list that determines how fractions of hypercerts will be allocated to new owners. The current implementation requires a project to specify an allowlist at the time of minting its hypercert. Based on allowlists, designated new owners are able to claim their fractions. - -### Claiming a fraction - -Transferring the ownership of a fraction of a hypercert to a (new) owner. Generally 'claiming' implies minting a new token that represents said fraction by the new owner. - -### Contributor - -An individual or organization that performs some or all of the work described in a hypercert. - -### Creating a hypercert - -Synonymous to minting a hypercert. - -### Fraction - -A token that represents a quantified proportion of a hypercert denominated in units. - -### Funder - -Individual, organization, or algorithm that funds work. There are generally two types: (1) **prospective** funders, who fund work _before_ it is done, and (2) **retrospective** funders, who fund work _after_ it is done. - -### Hypercert - -A token that (1) accounts for work by specified contributors that is supposed to be impactful, (2) represents the – potentially explicitly specified – impact of this work, and (3) assigns right over this work to its owners. If a hypercert is split into multiple fractions, the hypercert refers to the sum of all of its fractions. The term `hypercert` may also refer to an implementation of the hypercert interface and standard. - -### Hypercerts interface - -The hypercerts [contract interface](https://github.com/hypercerts-org/hypercerts/blob/main/contracts/src/protocol/interfaces/IHypercertToken.sol), which declares the required functionality for a hypercert token. The current interface includes functions for minting, burning, splitting, and merging of hypercert tokens. - -### Hypercerts implementation - -An implementation that builds on top of the hypercerts interface and conforms to the hypercerts standard. For instance, our initial implementation uses an [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) token. The first 128 bits of the 256-bit token ID identifies the hypercert, the latter 128 bits identifies the specific fraction. Other implementations are possible (e.g., based on ERC-721) as long as they also conform to the data standard and use the hypercerts interface to support capabilities like splitting and merging of values. - -### Hypercerts standard - -A data standard for hypercerts. It requires the following fields to be defined in the metadata of the token: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. - -### Impact - -Value that is created or destroyed by work. It mostly refers to positive impact, i.e., value that is created. If work destroys value, it is referred to as negative impact. - -### Impact evaluation - -A claim that a specified impact has or will occur – potentially claiming which work was responsible for the impact. - -### Impact Funding System (IFS) - -A system of actors (contributors, evaluators, funders) that interact according to a set of rules (funding mechanisms, coordination mechanisms) to maximize the domain-specific impact. - -### Impact space - -A geometrical space representing all possible work with its associated impact and rights. The space is spanned by the six fields specified in the hypercerts data standard: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. - -### Merging hypercerts - -An operation to combine two or more hypercerts, such that the resulting, merged hypercert covers the exact same region in the impact space that the individual hypercerts covered. - -### Minting a hypercert - -Creating a new record for a hypercert on a blockchain. The properties of the hypercert (e.g., its timeframe and scope of work) are retrievable via this record. - -### Project - -Work by one or more contributors to achieve a goal. A project does not always need to be represented by one hypercert; it can be represented by multiple hypercerts (e.g., one hypercert per phase or milestone of a project). A hypercert can also represent multiple projects or even parts of multiple projects. - -### Prospective funder - -Individual, organization, or algorithm that fund work before it is done. - -### Retrospective funder - -Individual, organization, or algorithm that fund work after it is done. - -### Rights - -An unordered list of usage rights tags, which define the rights of the owners of a hypercert over the work being claimed by a hypercert. One of the axis of the impact space and part of the required fields in the hypercerts data standard. - -### Set of contributors - -An ordered list of all contributors, who claim to do or have done the work described by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Scope of impact - -A conjunction of potentially-negated impact scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Scope of work - -A conjunction of potentially-negated work scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Splitting hypercerts - -An operation to split one hypercert into two or more separate hypercerts, such that the resulting, separated hypercerts cover the exact same region in the impact space that the previous hypercert covered. - -### Time of impact - -Date ranges from the start to the end of the impact being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Time of work - -A date range, from the start to the end of the work being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Unit - -The smallest possible fraction of a claim. Generally units are grouped in fractions. - -### Work - -Activities that produce impact. - -## Additional Impact Evaluation Terms - -### Auditor - -Individual, organization, or algorithm that evaluates the impact of work after it is done. - -### Beneficiaries - -People or objects that are impacted by work. - -### Evaluator - -Individual, organization, or algorithm that evaluates the impact of work. There are two types: Scouts evaluate the potential impact before it is done, auditors evaluate the impact after it is done. - -### Scout - -Individual, organization, or algorithm that evaluates the potential impact of work before it is done. diff --git a/docs/versioned_docs/version-1.0.0/implementation/metadata.md b/docs/versioned_docs/version-1.0.0/implementation/metadata.md deleted file mode 100644 index 08eb9fcb..00000000 --- a/docs/versioned_docs/version-1.0.0/implementation/metadata.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: Metadata Standard -id: metadata -sidebar_position: 2 ---- - -# Hypercert Metadata Structure - -Hypercerts are represented as [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) tokens. All token instances of a hypercert must share the same ERC-1155 metadata. For sites like OpenSea to pull in off-chain metadata for ERC-1155 assets, your hypercert contract will need to return an IPFS URI that contains all necessary hypercert metadata. - -The hypercert metadata schema follows the [Enjin recommendation](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md#erc-1155-metadata-uri-json-schema) for ERC-1155 metadata. It also includes **six required dimensions** that are necessary to clearly and unambiguously identify the hypercert's impact claim. - -The following are standard ERC-1155 metadata fields. - -## ERC-1155 fields - -| Property | Description | -| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | Name or title of the hypercert. Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. | -| `description` | A human readable description of the hypercert. Markdown is supported. Additional external URLs can be added. | -| `image` | A URI pointing to a resource with mime type image/\* that represents the hypercert's artwork, i.e., `ipfs://`. We recommend images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. | -| `external_url` | [optional] A URL that can be displayed next to the hypercert on webpages like OpenSea and links users to a page that has more information about the project or impact claim. | -| `properties` | [optional] Additional properties (aka attributes) that may be helpful for discovery and curation of hypercerts. Marketplaces like OpenSea will display these properties in the same way as they display rarity traits of NFTs. | - -In order to perform hypercert-specific operations, including split and merge functions, and for your hypercert to robustly claim a set of coordinates in the impact space, there are six additional dimensions that must be included in your metadata. - -## Required Hypercert dimensions - -| Property | Description | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `work_scope` | An _ordered list_ of work scope tags. Work scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any work scope that is explicitly excluded from the claim. | -| `work_timeframe` | Date range from the start to the end of the work in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). | -| `impact_scope` | An _ordered list_ of impact scope tags. Impact scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any impact scope that is explicitly excluded from the claim. The default claim is to "all" impact, giving the owner rights to claim all potential impact created by the work that is represented by the hypercert. | -| `impact_timeframe` | Date range from the start to the end of the impact in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). The default claim is from the start date of work until `indefinite` (i.e., the impact may occur at any point in time in the future). | -| `contributors` | An _ordered list_ of all contributors. Contributors should be itemized as wallet addresses or ENS names, but may be names / pseudonyms. The default claim is to the wallet address that created the hypercert contract. A multisig wallet can be used to represent a group of contributors. | -| `rights` | An _unordered list_ of usage rights tags. The default claim is solely to "public display" of the hypercert, i.e., all other rights remain with the contributors. | - -## Examples - -### Example 1: hypercert with minimal bounds - -Here is an example of hypercert dimensions for work on IPFS with minimal bounds: - -``` -"hypercert": { - "work_scope": { - "name": "Work Scope", - "value": ["IPFS"], - "excludes": [], - "display_value": "IPFS" - }, - "impact_scope": { - "name": "Impact Scope", - "value": ["All"], - "excludes": [], - "display_value": "All" - }, - "work_timeframe": { - "name": "Work Timeframe", - "value": [1380585600, 1388534399], - "display_value": "2013-10-01 -> 2013-12-31" - }, - "impact_timeframe": { - "name": "Impact Timeframe", - "value": [1380585600, 0], - "display_value": "2013-10-01 -> Indefinite" - }, - "contributors": { - "name": "Contributors", - "value": ["Protocol Labs"], - "display_value": "Protocol Labs" - }, - "rights": { - "name": "Rights", - "value": ["Public Display"], - "display_value": "Public Display" - } -} -``` - -### Example 2: hypercert with bounded impact claims - -This hypercert is for a carbon removal project that provides a bounded impact scope. - -``` -"hypercert": { - "work_scope": { - "name": "Work Scope", - "value": ["Protecting Trees in Amazon"], - "excludes": [], - "display_value": "Protecting Trees in Amazon" - }, - "impact_scope": { - "name": "Impact Scope", - "value": ["CO2 in Atmosphere"], - "excludes": [], - "display_value": "CO2 in Atmosphere" - }, - "work_timeframe": { - "name": "Work Timeframe", - "value": [1356998400, 1388534399], - "display_value": "2013-01-01 -> 2013-12-31" - }, - "impact_timeframe": { - "name": "Impact Timeframe", - "value": [1356998400, 0], - "display_value": "2013-01-01 -> Indefinite" - }, - "contributors": { - "name": "Contributors", - "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], - "display_value": "0xa1f...000, Project Forest Conservation" - }, - "rights": { - "name": "Rights", - "value": ["Public Display"], - "display_value": "Public Display" - } -} -``` - -### Example 3: hypercert with excluded impact claims - -Here is an example that explicitly excludes an impact scope to generate a more fine-grained claim. - -``` -"hypercert": { - "work_scope": { - "name": "Work Scope", - "value": ["Protecting Trees in Amazon"], - "excludes": [], - "display_value": "Protecting Trees in Amazon" - }, - "impact_scope": { - "name": "Impact Scope", - "value": ["All"], - "excludes": ["CO2 in Atmosphere"], - "display_value": "All ∧ ¬CO2 in Atmosphere" - }, - "work_timeframe": { - "name": "Work Timeframe", - "value": [1356998400, 1388534399], - "display_value": "2013-01-01 -> 2013-12-31" - }, - "impact_timeframe": { - "name": "Impact Timeframe", - "value": [1356998400, 0], - "display_value": "2013-01-01 -> Indefinite" - }, - "contributors": { - "name": "Contributors", - "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], - "display_value": "0xa1f...000, Project Forest Conservation" - }, - "rights": { - "name": "Rights", - "value": ["Public Display"], - "display_value": "Public Display" - } -} -``` - -### Additional guidelines - -Here are some additional guidelines for defining hypercert dimensions. - -- For most hypercerts, the `work_scope` is best represented as the name of the project or activity. Other information contained in the hypercert, namely, the `contributors` and the `work_timeframe` should provide sufficient context to disambiguate multiple claims from the same project. -- Similarly, for most hypercerts, the `impact_scope` will be most clearly represented as "all" (with an indefinite upper bound on the `impact_timeframe` dimensions). This gives the hypercert creator and its owners the flexibility to make claims about impact that may not have been observable or well-understood when the hypercert was created. - -- It is recommended to browse the `impact_scope` and `work_scope` tags that have already been created and are in use by your or other projects. (We are building a catalog to be available at [hypercerts.org](https://hypercerts.org).) Picking established tags can make it easier for users to discover, curate, and interact with your hypercert. In the long-run, we expect different ontologies to emerge in domains like climate solutions, open source software, etc, and picking more established tags will help prevent overlapping or duplicate claims. -- Tags for work scopes and impact scopes are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. -- Scopes that are explicitly excluded from the hypercert claim are enumerated separately and displayed with the `¬` prefix in the tag. Excluded scopes are not currently displayed on hypercert artwork. -- The order of tags matters only for display purposes. The hypercert artwork will only display a limited number of tags in the `impact_scope` and `work_scope` arrays due to image size and stylistic constraints. -- A `contributor` can be identified using any human-readable string. The base case is to set the `contributors` to the wallet address used to create the hypercert. A multisig wallet can be used to represent a group of contributors. - -### Assigning `rights` - -In version 1.0 of the protocol, only one `rights` tag will be enabled: - -> **Public Display**: owners of the hypercert have the right to publicly display and receive social utility from their hypercert. - -This means that any other rights regarding the work described by the hypercert either remain with the original contributors or are governed by other agreements. - -Additional `rights` including the potential for certain types of transfers to be explicitly enabled will be released in subsequent versions. - -## Optional hidden properties - -Creators may wish to add other fields in their metadata that are not a part of the hypercert claim and are not for display on third-party marketplaces like OpenSea. These can be added by creating a `hidden_properties` field in the metadata. diff --git a/docs/versioned_docs/version-1.0.0/implementation/token-standard.md b/docs/versioned_docs/version-1.0.0/implementation/token-standard.md deleted file mode 100644 index a767c670..00000000 --- a/docs/versioned_docs/version-1.0.0/implementation/token-standard.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Token Standard -id: token-standard -sidebar_position: 1 ---- - -### Hypercerts as a semi-fungible token - -In order to make the token identifiable, traceable, and transferable, hypercerts are represented as [ERC-1155 tokens](https://eips.ethereum.org/EIPS/eip-1155). The ERC-1155 standard enables a single deployed contract to store many hypercerts, facilitating simpler creation, transfers, as well as splitting and merging of hypercerts within a single namespace. As a semi-fungible token, each unique token represents a fraction of ownership of a hypercert. Hypercerts are then represented as a group of tokens, where the total ownership sums to 100%. In order to easily identify which hypercert a token belongs to, we utilize the upper 128 bits of a 256-bit token ID to identify the hypercert. All tokens within the same hypercert group should share the same [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). - -![hypercert id](../../static/img/hypercert_id.png) - -For illustrative purposes, let us assume that token IDs are just 2 bytes long, where the first byte represents the hypercert ID and the last byte represents which fraction of ownership. Alice could create a new hypercert token 0x2301, representing 100% of hypercert 0x23. If Alice wanted to transfer 20% to Bob, Alice could perform a split operation by minting token 0x2302 and transferring 20% of value to it, such that tokens 0x2301 and 0x2302 represent 80% and 20% ownership respectively of hypercert 0x23. Then Alice transfers token 0x2302 to Bob. Similarly, they could merge these 2 tokens together, back to form a token that represented 100% ownership. In this case, the value of 0x2301 would be transferred to 0x2302, and then 0x2301 is subsequently burned. - -Alice can also choose to split or merge hypercerts along some dimension of the impact space. For example, Alice may split hypercert 0x23 into two new hypercerts — 0x24 representing work done before the year 2000, and 0x25 representing work done after 2000. The original hypercert 0x23 is burned and the two new hypercerts store a reference to the previous hypercert. When the history of splits and merges are indexed, we can easily trace through the provenance of any individual hypercert. - -### Claim Data - -Hypercert claim data, such as scope of work and the contributor list, is encoded in JSON format into the [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). Claim data can be stored on-chain alongside the token, or in off-chain storage such as IPFS. For details on the JSON schema and how off-chain storage can be utilized, see the [hypercerts-sdk repository](https://github.com/hypercerts-org/hypercerts/tree/main/sdk). - -When considering whether to store hypercert metadata on-chain or off-chain, we can consider the different trade-offs to the user experience and cost, which may differ depending on which blockchain is being used. Storing data off-chain saves on costs, but could lead to on-chain claims without the metadata. Storing data on-chain adds additional security that the claims will not be forgotten but can lead to higher gas fees. - -Beyond the standard fields of hypercerts that locate the hypercert in the impact space, additional fields can be added. This allows for different templates in different impact areas, such as AI safety or biodiversity, as different additional information will be useful. Importantly, however, all hypercerts will be located in a single impact space – the additional fields do not change that. - -### Multi-chain support - -We expect hypercerts to exist in a multi-chain ecosystem, where the local deployment can be used to support the unique funding systems of that community. In order to visualize a single global impact space, we index the different contract deployments across chains and surface any potential hypercert claim conflicts. Because different blockchains support different subsets of programming languages, we do expect different implementations of the hypercert protocol to exist. However, they must adhere to the same hypercert data model to be indexed into the impact space. - -In order to decide which deployments to index into the hypercerts impact space, decentralized governance institutions will be used to govern the list of contract addresses used across all blockchains. diff --git a/docs/versioned_docs/version-1.0.0/intro.md b/docs/versioned_docs/version-1.0.0/intro.md deleted file mode 100644 index 0c4d7ca3..00000000 --- a/docs/versioned_docs/version-1.0.0/intro.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: What Are Hypercerts? -id: intro ---- - -# What are hypercerts? - -### Hypercerts are a new token standard for tracking and rewarding positive impact. - -Each hypercert represents a unique impact claim capturing the following information: - -- a scope of work and its corresponding scope of impact -- a set of time frames for both the work and its impact -- a set of contributors – the organization or people behind the work -- a set of rights you get by owning a hypercert - -The hypercert itself is an ERC-1155 semi-fungible token with the information above stored as metadata on IPFS. Here’s an example. - -### Hypercert example - -#### Graphic representation - -![hypercert design example](../static/img/hypercert_example.png) - -#### Supplementary information (metadata) - -- **Title of hypercert:** Invention of the InterPlanetary Filesystem (IPFS) -- **Description:** The InterPlanetary File System (IPFS) is a set of composable, peer-to-peer protocols for addressing, routing, and transferring content-addressed data in a decentralized file system. -- **Link:** ipns://ipfs.tech/ - -#### Hypercert dimensions (metadata) - -- **Set of contributors:** 0xb794f5ea0ba39494ce839613fffba74279579268 _(example Ethereum address)_ -- **Scope of work:** IPFS ∧ ¬ go-ipfs -- **Time of work:** 2013-01-01 --> 2013-12-31 -- **Scope of impact:** All -- **Time of impact:** 2013-01-01 --> indefinite -- **Rights:** Public display - -### Why should you care? - -We spend trillions of dollars every year on public goods via governmental agencies, foundations, private donations and corporate spendings; however, we don’t effectively track this work – leaving us in the dark, hoping that it actually has the intended positive impact. - -We believe we can do better: - -- We should start by tracking this work consistently – this is what hypercerts are for. -- We should evaluate how impactful that work was – this is what the open evaluation system of hypercerts supports. -- We should reward the work that was exceptionally impactful – this is what the public display of hypercerts and retrospective funding is for. - -Doing this would unfold powerful incentives. Retrospective funding 1) provides incentives for creators to take on public goods projects with a potentially high, but uncertain, impact, 2) enables feedback loops to learn from successes and failures, and 3) attracts more talent to the public goods sector by improving performance-based compensation. - -While we are excited about the prospects of retrospective funding, hypercerts do not impose any specific funding mechanisms, but start with tracking the work that is supposed to be impactful. As a database for many funding mechanisms this facilitates experimentation and interoperability between funding mechanisms. - -### Next - -Curious and want to learn more? Head over to the [whitepaper](whitepaper/whitepaper-intro.md) to dive deeper into the world of hypercerts. - -Or do you want to get started right away? Head to the [minting guide](minting-guide/minting-guide-start.md). diff --git a/docs/versioned_docs/version-1.0.0/minting-guide/gitcoin-round.md b/docs/versioned_docs/version-1.0.0/minting-guide/gitcoin-round.md deleted file mode 100644 index 1ad2310a..00000000 --- a/docs/versioned_docs/version-1.0.0/minting-guide/gitcoin-round.md +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: Gitcoin Alpha Round Instructions -id: gitcoin-round -sidebar_position: 3 ---- - -# Gitcoin Alpha Round Instructions - -## Overview - -- all projects in the Gitcoin Alpha Round are invited to mint a hypercert for their work -- anyone who gave over $1 to a project is automatically allowlisted for that project’s hypercert -- 50% of each hypercert is distributed to the funders, 50% is kept by the project and can be transferred later -- each project has a custom URL to make minting super easy (the link is sent directly to each project) -- everything runs on Optimism (users only need to pay L2 gas costs) - -:::info -If your project participated in the Gitcoin Alpha Round, but you didn't get a message with a custom URL, please reach out to team[at]hypercert.org. -::: - -## Hypercerts x Gitcoin Alpha Round - -Now that Gitcoin’s Alpha Round has officially closed and the funding distribution is finalized, we are inviting all eligible projects that participated to mint a hypercert for their past work and to allocate fractions of their hypercert to a list of supporters. - -We’ve created a dApp that pulls all of the data required to mint your hypercert directly from Gitcoin’s Grant Protocol. You can fine-tune the properties, tweak your artwork, and review the distribution mechanism. Once you’re ready, hit the create button and your hypercert will be released into the ethers! - -Once your hypercert has been minted, the people who supported your project with a contribution of at least $1 DAI on Gitcoin’s Alpha Round will be able to connect and claim their fractions. - -A few important notes about the Alpha Round: - -- The total units of a hypercert is based on the total donations; each funder get awarded units proportional to their donations. -- Transfers will be restricted to one transfer from the project to the supporters. -- There will be no additional rights awarded to the funders except the right to "public display" their support for the project. - -## Instructions - -The following guidance is only for projects that receive a custom URL that pre-populates the hypercerts form based on their Gitcoin Grants' data. - -It explains the default settings in the form and recommends fields that the creator may choose to update or edit. - -:::note -Gitcoin Grant hypercerts are for retrospective work, i.e., they are intended to capture work that happened between Gitcoin Grants Round 15 (September 2022) and the Alpha Round (January 2023). Therefore, the work time period is always set to past dates. (You might need to adjust the name and description to also refer to past work only.) We are focusing solely on retrospective hypercerts for this round as part of broader efforts to promote retrospective funding; you can read more about it [in the whitepaper](whitepaper/retrospective-funding.md). -::: - -### General Fields - -#### Name of Hypercert - -This field is set by default to the name of your project on Gitcoin Grants. You can edit this to be more specific. Given that your project may create numerous hypercerts over time, consider giving each hypercert a name that represents a more discrete phase or output. - -#### Logo - -This field is set to the icon artwork provided for your project on Gitcoin Grants. If there was an error accessing your icon, you will see a generic icon. - -You can update this by providing a new URL and the hypercert artwork should update automatically. - -Logo images look best with an aspect ratio of 1.0 (square-shaped). - -#### Background Banner Image - -This field is set to the banner artwork provided for your project on Gitcoin Grants. If there was an error accessing your banner, you will see a generic Gitcoin banner. - -You can update this by providing a new URL and the hypercert artwork should update automatically. - -Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. - -#### Project Description - -This field is set by default to the description of your project on Gitcoin Grants. Review closely -- a long project description in your Gitcoin Grant description will be truncated. - -You may edit this to provide more details about your work and to remove information that is targeted solely at Gitcoin Grants users. This is also a good place to provide other links, such as Github repos or social media accounts, where the general public can learn more about the work. Please aim for a project description that is less than 500 characters. - -:::note -The project description should refer to **past work**, not future work that you would like to do with additional funding. -::: - -#### Link - -This field is set to the first external URL provided for your project on Gitcoin Grants. You can update this. - -### Hypercert Fields - -#### Work Scope - -This field is set by default to a **shortened version** of the name of your project on Gitcoin Grants. You may edit or add additional work scope tags. - -For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. - -If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. - -#### Work Start/End Dates - -The start date has been set by default to the `2022-09-22` for all projects on Gitcoin Grants. This date coincides with the end of Gitcoin Grants Round 15. - -The end date references the last update to your grant page on Gitcoin Grants. - -You may edit or update these fields, however, the end date may not extend beyond `2023-01-31` (the close of the funding round) as all hypercerts will be retrospective in this round. - -#### Set of Contributors - -This field is set by default to the wallet address that is set as the recipient address for receiving Gitcoin Grants funding. - -:::note -You should review this field closely and – if applicable – provide the addresses of additional contributors. -::: - -### Advanced Fields - -#### Impact Scope - -This field is set by default to `all`. - -Updates are currently disabled on the frontend because funding decisions on Gitcoin Grants were not specific to an impact scope or impact time period. - -#### Impact Start/End Dates - -This field is set by default to the work start date of `2022-09-22` (see above) and a work end date of `indefinite`. Updates are currently disabled on the frontend. - -#### Rights - -This field is set by default to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. - -Updates are currently disabled on the frontend. - -### Distribution - -#### Allowlist - -This field is set by default to a custom allowlist generated for each project based on the funding it received on the Gitcoin Grants Alpha Round. You should not need to update this field. If there is a problem with your allowlist, please contact us. - -50% of the hypercert will be allocated according to this allowlist. The other 50% will be kept by the project, i.e. it is allocated to the address that mints the hypercert. You will be able to transfer or sell these fractions later as long as they are owned by the minter. This means that they can only be transferred or sold once. - -The formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. - -For example: - -- $5.60 donated --> 5 fractions -- $5.20 donated --> 5 fractions -- $0.96 donated --> 1 fraction -- $0.52 donated --> 0 fractions - -The queries used to generate the allowlists can be viewed here: - -- ETH Infra: https://dune.com/queries/1934656 -- Climate: https://dune.com/queries/1934689 -- OSS: https://dune.com/queries/1934969 - -Donors who contributed to the matching pool for each round are also eligible to claim hypercerts. - -:::note -You are free to edit your allowlist. You can do this by following the step-by-step instructions [here](minting-guide/step-by-step.md). Just remember that you will need to upload the new allowlist in a CSV format to a storage site like [web3.storage](https://web3.storage) and then update the link in the allowlist field. Contact team[at]hypercerts.org if you need help. -::: - -### Confirmations - -#### Contributors' permission - -Every contributor needs to agree to have their contribution be represented by a hypercert. This is why the person minting the hypercert has to confirm to have the permission of all listed contributors. - -#### Terms & Conditions - -The terms & Conditions can be found [here](https://hypercerts.org/terms). - -### Final step: Click "Create" - -Make sure your Optimism wallet or multi-sig is connected. Click on "create" and wait for your hypercert to be created. Congratulations! diff --git a/docs/versioned_docs/version-1.0.0/minting-guide/minting-guide-start.md b/docs/versioned_docs/version-1.0.0/minting-guide/minting-guide-start.md deleted file mode 100644 index 47e8ad7c..00000000 --- a/docs/versioned_docs/version-1.0.0/minting-guide/minting-guide-start.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Getting Started -id: minting-guide-start -sidebar_position: 1 ---- - -# Getting started - -### How to create a hypercert - -Creating a hypercert is similar to creating an NFT on sites like OpenSea or Zora. - -In this article, we’ll walk through the steps one by one and explain exactly what you need to do to create your first hypercert. - -There are typically two ways of creating a hypercert: - -1. As a project affiliated with a specific funding network (e.g., Gitcoin Grants): In this case, you should receive a custom URL from the funding network that pre-populates most of your hypercert fields. You will still be able to change most of these, so you should review and adjust them as needed to better describe your hypercert. Guidance on how to do so (for Gitcoin Grants projects) is provided at the end of this doc. -2. As a project not affiliated with a specific funding network: In this case, you will be creating a hypercert from scratch and filling in each field on your own. Read on below. - -### Who can create a hypercert? - -Anyone doing work that is intended to have a positive impact can create a hypercert. Your hypercert can be as simple as "I did X on this date and want to claim all future impact from it". - -It can also represent something more, such as a phase in an ongoing team project, an invention or discovery, a research publication, or an important software release. - -Critically, if the work was done by more than one person, then each person should be listed as a contributor to the hypercert and approve the creation of the hypercert. - -_Note: In the future, the approval of each contributor will be verified on-chain._ - -### What do I need to create a hypercert? - -You will need to prepare all of the information required in the form builder (see **Step-by-step instructions for creating a hypercert** below). This includes important metadata, such as a description of the project and the dimensions of your impact claim, as well as a project artwork. You may also want to include an allowlist of wallets that are approved to claim one or more fractions of the hypercert. - -In addition to the information regarding the hypercert itself, you’ll need a crypto wallet to mint your hypercert. “Minting” a hypercert is the process of writing an impact claim to the blockchain. This establishes its immutable record of authenticity and ownership. - -Next, choose a blockchain on which to mint your hypercert. The hypercerts protocol is available on Ethereum, Goerli (testnet), and Optimism. Each of these blockchains has different gas fees associated with transactions on their networks. To reduce gas fees we recommend Optimism for most projects. - -Finally, go ahead and create your hypercert. - -### How much does it cost to create a hypercert? - -You will need enough Ethereum in your wallet to cover gas fees. In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). - -The protocol currently does not offer gas-free or "lazy" minting. diff --git a/docs/versioned_docs/version-1.0.0/minting-guide/step-by-step.md b/docs/versioned_docs/version-1.0.0/minting-guide/step-by-step.md deleted file mode 100644 index 9f3b6303..00000000 --- a/docs/versioned_docs/version-1.0.0/minting-guide/step-by-step.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: Step-by-step Instructions -id: step-by-step -sidebar_position: 2 ---- - -# Step-by-step instructions - -First, go to the [Create Hypercert](https://hypercerts.org/app/create) site with a wallet-enabled browser or follow the custom URL you received to access a prepopulated form. - -Although the site works on mobile, it is easier to use on desktop because the browser will display a dynamic preview of the hypercert while you fill out the Create form. - -Next, connect your wallet. You will be prompted to switch to the Ethereum or Optimism network. - -Once you've connected, you will see an empty form for creating a hypercert. - -### General fields - -#### Name of Hypercert - -Enter the name or title of the hypercert. This is the place to be verbose and specific about what the project is doing. You'll see on the preview when your title becomes too long. - -Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. - -Names are restricted to 100 characters but may include emojis (:smile:), accents (é), non-Latin scripts (表情), and other Unicode characters. - -#### Project Description - -Enter a human readable description of the hypercert. This is the place to share more details about the work and the team or individual behind the work. - -The description field supports [Markdown syntax](https://www.markdownguide.org/cheat-sheet/) and has a limit of 10,000 characters. - -In addition to the main link (see next field) you can add further links in the markdown to help others to understand the work of the project. - -#### Link - -A valid URL for the project, beginning with https:// - -This will be displayed next to the hypercert on webpages like OpenSea and should link users to a page that has more information about the project or impact claim. - -#### Logo - -An icon for the top left part of the card. This could be your project logo. It will be automatically masked to the shape of a circle. - -Logo images look best with an aspect ratio of 1.0 (square-shaped). - -The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. - -#### Background Banner Image - -A background image that will extend across the upper half of the artwork. This could be your project masthead or a unique piece of art. - -Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. - -Currently we don't support zoom / cropping, so you will need to test the look and feel on your own. - -The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. - -### Work Scope fields - -#### Work Scope - -One or multiple tags describe the work that the hypercert represents. This work scope will be used to identify the work that is included in the hypercerts and the work that is not included. - -Multiple tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. - -For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. - -_Note: In the future, you will be able to specifically exclude work from the hypercert._ - -#### Start and End Date of Work - -The work time period defines when the work was done that the hypercert represents, i.e., only the work in this time period is included in the hypercert. - -The time period of work doesn't need to be the start and end date of a project, but it can be. One project can be split up into multiple hypercerts, e.g. all hypercerts can have the same `work scope`, but different time periods of work. Of course, the time periods are not allowed to overlap. - -### Impact scope fields - -#### Impact Scope - -The impact scope can be used to limit the impact that a hypercert represents, e.g. for the work scope `Planting trees` a hypercert can represent _only_ the impact on biodiversity by including the impact scope tag `Biodiversity`. This would exclude all other impacts, including the impact on CO2 in the atmosphere, which can be useful if that impact is already captured by a carbon credit. - -By default this is set to "`all`" and we strongly recommend keeping it that way. - -Just like the work scope, multiple impact scope tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction). - -#### Start and End Date of Impact - -The impact time period is another way to limit the impact that a hypercert represents, e.g. inventing a new medical treatment has a positive impact over many years, but we might want to capture the positive impact separately for each year. - -By default the `impact start date` is the same as the `work start date` and the `impact end date` is "`indefinite`", i.e., the impact is not restricted time-wise. We strongly recommend keeping it that way. - -### Set of Contributors - -Provide a list of contributors, one per line, or comma-separated. - -The list should include _all_ contributors that performed the described work. - -Contributors are generally itemized as wallet addresses or ENS names, but can also be names / pseudonyms. Groups of contributors can be represented by a multisig or name of an organization. - -### Owners - -#### Allowlist - -The allowlist allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions afterwards. For example, it can be used to allocate fractions to previous funders and contributors. - -The allowlist is implemented as a CSV file specifying `index,address,price,fractions` headers. - -| index | address | price | fractions | -| ----- | ------------------------------------------ | ----- | --------- | -| 0 | 0x5dee7b340764c49a827c60d2b8729e49405fbefc | 0.0 | 100 | -| 1 | 0x1e2dbb9ca3f6d48e085384a821b7259abfdc7d65 | 0.0 | 50 | -| ... | ... | ... | ... | -| 999 | 0x436bad18642f45d3fa5fcaad0a2d81764a9cba85 | 0.0 | 1 | - -The `price` field is denominated in ETH. This should remain at 0.0 for all hypercerts, as primary sales are not currently supported through the app and the secondary sale/transfer of hypercerts is currently not allowed. - -You can store your allowlists on IPFS using [web3.storage](https://web3.storage/). - -:::note -If your allowlist is not properly formatted, you will be unable to mint your hypercert. If you do not include an allowlist, then the creator of the hypercert will receive 100% of the hypercert (set to a default of 10,000 units), which you can then sell or transfer to another wallet a maximum of one time. -::: - -#### Rights - -This field defines the rights that owners of the hypercert have over the work being claimed by this hypercert. - -By default this is set to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. - -_Note: In the future, additional rights can be included for different hypercerts._ diff --git a/docs/versioned_docs/version-1.0.0/whitepaper/evaluation.md b/docs/versioned_docs/version-1.0.0/whitepaper/evaluation.md deleted file mode 100644 index 87fb9194..00000000 --- a/docs/versioned_docs/version-1.0.0/whitepaper/evaluation.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Open Impact Evaluations -id: evaluation -sidebar_position: 5 ---- - -A key design element is that hypercerts themselves do not make a claim about the size of the impact, but only account for the work that is supposed to be impactful. The figure below shows this contrast in a simplified illustration of the example that we introduced above. The open evaluation system allows multiple evaluations to point at the same area of the impact space that a hypercert claims. The evaluations can include self-evaluation from the contributors themselves. Funders observe these and make their funding decisions based on this richer set of information. - -![hypercert evaluations](../../static/img/hypercert_evaluations.png) - -The open evaluation system is also used to provide additional information, e.g. an evaluator or the project itself provides information about the health of the trees. This information can then be used transparently by other evaluators to evaluate the impact on CO2 in the atmosphere. - -An important feature is that the evaluations do not directly point at a hypercert, but rather at an area in the impact space. In practice this area will mostly be the exact same area that a hypercert claims, such that it can be considered an evaluation of the hypercert, but it does not have to. This feature ensures that, if hypercerts are merged or split, previous evaluations will continue to be linked appropriately. - -The form of evaluations can be standardized to simplify handling and comparing multiple evaluations from multiple evaluators. The open evaluation system allows for templates to be created and used by any evaluators. Similar to the emerging ontologies, these are not enforced centrally, but should emerge as useful standards – potentially steered by decentralized governance institutions. - -Important characteristics of the open evaluation system are: - -- Evaluators can submit multiple evaluations of the same area in the impact space as more information becomes available -- Evaluations can challenge other evaluations -- Evaluation methodologies can evolve over time - -These features allow the whole evaluation system to be dynamically improved by each actor. The relevant incentives for this improvement will stem from the funders who will value the signals from some evaluators more than others and evaluators are able to build up reputation. diff --git a/docs/versioned_docs/version-1.0.0/whitepaper/hypercerts-intro.md b/docs/versioned_docs/version-1.0.0/whitepaper/hypercerts-intro.md deleted file mode 100644 index 8acc11d1..00000000 --- a/docs/versioned_docs/version-1.0.0/whitepaper/hypercerts-intro.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Hypercerts: a New Primitive for Impact Funding Systems" -id: hypercerts-intro -sidebar_position: 3 ---- - -### Defining hypercerts - -A hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and represents all or parts of that impact. A hypercert has the following fields (one for each dimension): - -1. **Set of contributors:** An ordered list of all contributors, who claim to do or have done the work described by this hypercert. -2. **Scope of work:** A conjunction of potentially-negated work scope tags, where an empty string means “all”: - -``` - ::= AND | " " - ::= | NOT -``` - -3. **Time of work:** A date range, from the start to the end of the work being claimed by this hypercert. -4. **Scope of impact:** A conjunction of potentially-negated impact scope tags, where an empty string means “all”: - -``` - ::= AND | " " - ::= | NOT -``` - -5. **Time of impact:** Date ranges from the start to the end of the impact. -6. **Rights of the owners:** An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. - -Implementing hypercerts as a semi-fungible token allows multiple contributors and funders to own parts of hypercerts. For instance the original contributors can award 10% of a hypercert to a funder, while keeping 90%, which they can award to other funders later. This is why hypercerts are fractionalizable. - -### Examples - -In the simplest cases of hypercerts, the scope of work and impact as well as the time of impact are not restricted and no rights are transferred to owners of the hypercerts, i.e. the hypercerts just define the who (set of contributors) and when (time of work) of the claimed work. Scope of work and impact would be set to all, time of impact to “indefinite” and the rights to only “public display of support”. The latter is always included as the hypercert is a public record, such that owners will always automatically display their support of the work. - -Take for example hypercert 1 below: It represents all work that contributor 1 has performed in 2013 with all the impact that the work had from the beginning of the work; the hypercert doesn’t give any additional rights to the owners of the hypercert. - -The other fields – except the rights field – can be used to limit the work or impact that is represented by the hypercert. Hypercert 2 limits this to the work on IPFS in 2013, i.e. any other work besides IPFS that contributor 1 performed is not included. Hypercert 3 limits it even further as it excludes a specific aspect of IPFS, the go-ipfs implementation. - -| | **Hypercert 1** | **Hypercert 2** | **Hypercert 3** | -| ----------------------- | ------------------------- | ------------------------- | ------------------------- | -| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | -| **Scope of work** | all | IPFS | IPFS ∧ ¬ go-ipfs | -| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | -| **Scope of impact** | all | all | all | -| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → 2013-12-31 | -| **Rights** | Public display of support | Public display of support | Public display of support | - -In the table below we illustrate a use case for limiting the scope of impact. Suppose contributor 1 protects trees in a certain area. This work has positive effects on the CO2 in the atmosphere and could turn into carbon credits; however, the trees have additional positive impacts, such as protecting biodiversity. Instead of including all positive impacts in one hypercert (hypercert 4), the impact can be split between the impact on CO2 in the atmosphere (hypercert 5) and all other positive impacts (hypercert 6). If funders are willing to pay for biodiversity, this would be a new income opportunity. And it would account for the additional positive impact that other methods of reducing CO2 might not have, like industrial carbon capture. Importantly, negative impacts can not be excluded from a hypercert. - -| | **Hypercert 4** | **Hypercert 5** | **Hypercert 6** | -| ----------------------- | -------------------------- | -------------------------- | -------------------------- | -| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | -| **Scope of work** | Protecting trees in area X | Protecting trees in area X | Protecting trees in area X | -| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | -| **Scope of impact** | all | CO2 in atmosphere | all ∧ ¬ CO2 in atmosphere | -| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → indefinite | -| **Rights** | Public display of support | Public display of support | Public display of support | - -Importantly a hypercert does not specify the “size” of the impact, e.g. a hypercert does not state “5 tons of CO2 removed from the atmosphere.” Instead the hypercert only defines the work, e.g. “200 trees protected” (scope of work) in 2022 (time of work). The size of the impact is then left to the evaluations of the “CO2 in the atmosphere” (scope of impact) in 2022 (time of impact) that point towards the covered region of the hypercert. For instance: This allows a self evaluation to claim that 5 tons of CO2 were removed in a given year as well as one or multiple evaluations from independent auditors to confirm or challenge how much CO2 has been removed. An evaluator could detect that some of the trees were not healthy and hence only 4 tons of CO2 were removed. Allowing for multiple evaluation is a defining characteristic of the open evaluation system. - -### Functions of hypercerts - -#### 1. Identifiability - -Hypercerts clearly define the work that is supposed to be impactful by creating a record of who (set of contributors) claims to do or have done what (scope of work) in what time period (time of work). They also allow the creation of multiple records of the same work to identify separate impacts that this work had or will have (scope of impact) over specified time periods (time of impact). - -#### 2. Traceability - -As these records are public and logically monotonic (immutable, except to split or merge hypercerts), records are durable and permanent. - -#### 3. Transferability - -The records are a digital object that can be owned and ownership can be transferred (under specific conditions). As hypercerts can be created as fractionalizable, it is also possible to transfer only a specified fraction of the hypercert. Each hypercert defines the rights over the defined work that owners have, such as rights to retrospective rewards, rights to public display of the support (“bragging rights”) or rights to passive income from intellectual property. - -:::note Transferability restrictions - -Hypercerts are generally transferable. However, there are use cases, in which minters of hypercerts want to restrict how their hypercerts can be transferred. The protocol allows the minter to restrict who can transfer the hypercert and/or to whom the hypercert can be transferred. For instance, by specifying that only the original owner can transfer the hypercert, any future owner is prohibited from selling it, i.e. a secondary market would not exist for this hypercert. - -::: - -### Merging hypercerts - -Besides the fungible dimension, hypercerts can be merged and split on any of the six dimensions as shown in box 1. Let us take the hypercert 1 from the section "Hypercerts definition" and focus only on two of the dimensions, scope of work and time of work. These two dimensions create a simplified impact space. The figure below shows how work on IPFS (InterPlanetary File System) could have been minted over time in separate hypercerts, one for each quarter of work. - -![minting hypercerts example](../../static/img/creating.png) - -We created five hypercerts, one for each quarter of work. As the resulting work of all of these together is IPFS 0.1, the merged hypercert in total is more meaningful and more valuable than just the five individual hypercerts. In this case the proverb is true, the whole is greater than the sum of its parts. Hence, we want to merge them as shown in the next figure. - -![merging hypercerts example](../../static/img/merging.png) - -### Splitting hypercerts - -Conversely, splitting can increase the meaningfulness and value of hypercerts as well. We can split the work on IPFS 0.1 into the conceptual work “invention of IPFS” and the implementation via “go-ipfs 0.1” as shown in the next figure. - -![splitting hypercerts examples](../../static/img/splitting.png) - -Other use cases are where multiple contributors want to combine their work on the same scope of work (merging) or disentangle their work (splitting). Ultimately, splitting and merging allows users to repackage the digital representation of their work and impact. - -Importantly, splitting and merging are the only operations that are permitted to change hypercerts. Once an area in the impact space is claimed, it can not be unclaimed. This ensures that claims are never forgotten. - -### Retiring hypercerts - -While a claim in the impact space can not be unclaimed, it can be retired. Retiring a hypercert means that owners can not transfer and sell it anymore. This way owners prove that they are the final buyers of the impact. Technically retiring hypercerts means that they are sent to a specific null address, which ensures that the retired hypercerts are recorded and traceable. diff --git a/docs/versioned_docs/version-1.0.0/whitepaper/ifs.md b/docs/versioned_docs/version-1.0.0/whitepaper/ifs.md deleted file mode 100644 index 6f71ac50..00000000 --- a/docs/versioned_docs/version-1.0.0/whitepaper/ifs.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: The Need for Interoperable Impact Funding Systems (IFSs) -id: ifs ---- - -# The Need for Interoperable Impact Funding Systems (IFSs) - -### An IFS consists of - -- **Actors:** Contributors, funders, evaluators, and beneficiaries -- **Funding mechanisms:** Grants, bounties, retrospective funding, etc. -- **Coordination mechanisms:** Roadmapping, communication forums, etc. -- **A goal:** Maximize the domain-specific positive value created (impact) - -The goal will be specific to the impact area, e.g. prevent existential risks from artificial intelligence (AI) would be the goal for the impact area “AI safety.” To achieve these goals, skilled contributors must work with high effort on promising projects. Additionally, for those projects that create impact continuously, sufficient income streams are necessary to cover both their ongoing operating expenses and contributors’ upside incentives. - -#### Actors in IFSs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeSubtypeDescription
ContributorsPeople or organizations who do the work
FundersProspective fundersPeople or organizations who fund work before it is done
Retrospective fundersPeople or organizations who fund work after it is done
EvaluatorsScoutsPeople or organizations who evaluate the potential impact of work before it is done
AuditorsPeople or organizations who evaluate the impact of work after it is done
BeneficiariesPeople or objects that are impacted by the work
- -### Guiding questions for designing IFSs - -1. **Projects:** How can we improve the chances that the most promising projects are worked on? -2. **Talent & resources:** How can we attract top talent to contribute to the most promising projects and provide them with the necessary resources? -3. **Effort:** How can we reward contributors for their impact on outcomes? -4. **Sustainable income:** How can we create recurring income streams and financial sustainability for impactful projects? - -Markets have been proven very powerful in answering these questions if they are directed towards maximizing profits. As we are directing systems towards maximizing impact, these answers become more challenging. In particular, in an IFS we are facing coordination and incentive problems in funding impact, such as the free-rider problem. - -### Example dynamics between actors in an IFS - -In order for impact funding systems to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources and (3) evaluations. In the diagram below you see a potential dynamic between the actors of an IFS. In that scenario hypercerts can account for the prospective funding (steps 2-3) as well as for the retrospective funding (steps 8-9) from different funders. Evaluations are made public and can be discovered through the hypercerts for all funders (steps 5-7). Retrospective funders can reward not only the contributors but also the prospective funders (steps 10-11). - -```mermaid -sequenceDiagram - autonumber - participant Beneficiaries - participant Contributors - participant Prospective funders - participant Retrospective funders - participant Evaluators - Contributors ->> Contributors: Mint hypercerts - Prospective funders ->> Contributors: Award funding - Contributors ->> Prospective funders: Award fractions of
the hypercert - Contributors ->> Beneficiaries: Create impact - Retrospective funders ->> Evaluators: Fund evaluation - Evaluators ->> Beneficiaries: Evaluate impact on beneficiaries - Evaluators ->> Retrospective funders: Make evaluations public,
esp. for retrospective
funders - Retrospective funders ->> Contributors: Award funding - Contributors ->> Retrospective funders: Award fractions of hypercerts - opt - Retrospective funders ->> Prospective funders: Award funding - Prospective funders ->> Retrospective funders: Transfer fractions
of hypercert - end -``` - -### Hypercerts as a data layer for IFSs - -By serving as a single, open, shared, decentralized database hypercerts lower the transaction costs to coordinate and fund impactful work together. This is important because the optimal funding decisions of a single funder depends on the funding decision of all other funders. For instance, some work is only impactful if a minimum funding is provided: The impact is non-linear in the funding amount, e.g. half a bridge is not half as impactful as a full bridge. Other work might be over-funded, i.e. the impact of an additional dollar is basically zero. Ultimately, funders want to find the highest impact for each additional dollar spend (cf. S-process as in Critch, 2021). Today multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Through hypercerts the funding becomes more transparent and the credits for funding impactful work can be easily shared. Coordinating funding becomes easier. - -Hypercerts don’t solve this coordination problem by themselves, but build the basis for different decision and funding mechanisms as shown below. Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. Hypercerts do not lock in any particular decision-making scheme for funders. - -![Hypercerts as a data layer for an IFS](../../static/img/hypercert_data_layer.png) - -Looking farther into the future: If a large majority of funding across an entire IFS ends up flowing through hypercerts, funders have created the transparency that enables each of them to make the best decisions given the funding decision of everyone else. diff --git a/docs/versioned_docs/version-1.0.0/whitepaper/impact-space.md b/docs/versioned_docs/version-1.0.0/whitepaper/impact-space.md deleted file mode 100644 index f8fed762..00000000 --- a/docs/versioned_docs/version-1.0.0/whitepaper/impact-space.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: A Consistent Impact Space -id: impact-space -sidebar_position: 4 ---- - -Every hypercert represents a claim in the impact space, which itself represents all possible claims. Above we illustrated the impact space with two dimensions, scope and time of work. The complete impact space is spanned by the six dimensions introduced in the definition of hypercerts. - -### Consistency of the impact space - -Every point in the impact space should either be claimed or not be claimed. No point must be claimed twice, or equivalently: - -- If the impact of some work is represented in one hypercert, it must not be part of any other hypercert. -- Hypercerts must not overlap with each other. - -The table below shows two hypercerts that were illustrated in the section on "Hypercerts operations", but now with all six fields. The two hypercerts can represent the exact same work by the same contributor, but they do not overlap because of the difference in the time of work. - -| | **Hypercert 7** | **Hypercert 8** | -| ----------------------- | ------------------------ | ------------------------ | -| **Set of contributors** | Contributor 1 | Contributor 1 | -| **Scope of work** | IPFS | IPFS | -| **Time of work** | 2013-10-01 to 2013-12-31 | 2014-01-01 to 2014-03-31 | -| **Scope of impact** | all | all | -| **Time of impact** | 2013-10-01 → indefinite | 2014-01-01 → indefinite | -| **Rights** | None | None | - -The consistency of the impact space is crucial as it ensures that no rights to an impact claim are sold twice. If for example someone owns the right to retrospective rewards for the impact of some work, the owners must be identifiable unambiguously. - -Because users can create hypercerts with arbitrary data on any chain, on which a hypercert contract is deployed, we provide ways to help users detect collisions in the impact space. For example, if one hypercert on Ethereum points to the work on “IPFS”, and another hypercert on Filecoin points to the work on “https://github.com/ipfs/go-ipfs” both with the same contributor and time of work, which of these overlapping hypercerts is the correct one to support? To surface such overlapping hypercerts, the hypercerts protocol and SDK will support mechanisms to index, search, and visualize neighbors in the impact space. With these tools evaluators can quickly detect potential conflicts and submit the results as evaluations to help disambiguate proper credit and attribution. - -### Emerging ontologies - -Common ontologies for the scope of work and scope of impact are useful to create transparency and improve discoverability. Such ontologies need to be created from the practices and should be adapted over time. They are like emerging norms, instead of fixed rules. However, some larger players or a group of smaller players could enforce certain ontologies, e.g. if multiple funders agree that they only fund projects that follow a specified ontology. - -As some ontologies might be more useful than others, we would ideally see a consensus emerge between participants and experts in each impact area. Decentralized governance institutions can help facilitate this; however, further details on the design are out of the scope of this paper and are left for future work. diff --git a/docs/versioned_docs/version-1.0.0/whitepaper/retrospective-funding.md b/docs/versioned_docs/version-1.0.0/whitepaper/retrospective-funding.md deleted file mode 100644 index 57444581..00000000 --- a/docs/versioned_docs/version-1.0.0/whitepaper/retrospective-funding.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: Retrospective Impact Funding -id: retrospective-funding -sidebar_position: 6 ---- - -### Introducing retrospective funding - -While hypercerts do not impose any specific funding mechanisms, they are especially useful for retrospective funding. The core idea, from the perspective of contributors building impactful goods, is this: if you can reasonably expect to get funded retrospectively for your work once you produce a positive impact, then you can work now, in expectation of a probabilistic future cash flow. In another conception, you are effectively “borrowing” money from this anticipated future cash flow to fund the work in the first place; the expectation of future funding “retro-causes” the impactful work. Retrospective funding may be able to 1) provide incentives for contributors to take on impactful goods projects with a potentially high, but uncertain, impact and 2) create a more efficient IFS by back-propagating signals on what outcomes were impactful post-hoc. - -In addition, contributors are able to receive fair compensation by providing outsized impact that will be highly valued. It incentivizes you to create a positive impact, beyond your intrinsic motivation. This does not mean that the most successful contributors to impactful goods automatically have potential upside comparable to some for-profit startup founders (or that they should), just that their potential upside does depend on how much funders later value their past work. This will attract more talent to the impact sector by improving performance-based compensation. - -The crucial aspect for this to work: funders need to retrospectively fund impact, and send credible signals that they will do so in the future. Based on these signals contributors form expectations about future retrospective rewards and can start working today to receive them in the future. - -Hypercerts facilitate retrospective funding as the impact claims are identifiable, traceable and transferable. Contributors can sell parts of their hypercerts to prospective funders to receive the necessary funding for their project (“activity” in the figure below). The project delivers impact to a larger group (“beneficiaries”), which retrospectively buys the hypercerts from the prospective funder, and from the contributors if they retained some fraction of their hypercerts (the latter is not represented in the figure). - -![Retrospective funding with hypercerts](../../static/img/retrospective_funding.png) - -### Increasing rewards - -Retrospective funding allows us to increase rewards as more impact is created because impact is easier to observe, measure and prove retrospectively. Increasing rewards – as shown in the next figure – incentivizes contributors to put in their highest effort to produce impact and enables contributors to be rewarded for their talent. Moreover, prospective funders are incentivized to select, fund and support the projects with the highest expected impact, if they also receive retrospective rewards. - -![Increasing rewards](../../static/img/increasing_rewards.png) - -Note that retrospective funding should not be used in cases where a significant negative impact is possible since a nongovernmental, permissionless framework can not impose retrospective penalties for negative externalities. See Ofer & Cotton-Barratt (2022) for a discussion of this limitation of retrospective funding. - -In some cases we do not expect the retrospective evaluation to be any different than the prospective evaluation, i.e. there is no uncertainty resolved over time as the impact of an activity is already “known” prospectively. In these cases retrospective funding would only complicate the funding mechanism and funding via grants or milestone bounties would be preferable. Retrospective funding is preferable only if uncertainty is resolved over time. - -### Impact evaluations - -The relevance of impact evaluations will depend on how much their signals influence the funding decisions of retrospective funders (see the potential dynamics in the section on "IFSs"). This is a critical difference to many impact reports today: If a project was funded by a grant, the funders as well as the project want to receive a positive evaluation. If, however, the funding decisions of the retrospective funders are outstanding, they are interested in truthful signals about the impact. Hence, funders value improvements in evaluation methodologies and can fund independent evaluators. Evaluators in turn would build up a reputation for their evaluation methodologies and improve the strength of their signals to retrospective funders. - -Impact evaluators can take on a range of forms ranging forms, such as - -- Voting by relevant communities or beneficiaries -- Expert panels -- Professional evaluators similar to financial rating agencies -- Automatic monitoring and data collection by sensors and oracles - -The most useful form or combinations thereof will depend on the specific requirements of the impact area. For a generalized framework on impact evaluators see Protocol Labs (2023). - -While retrospective funding makes impact evaluations financially relevant for funders and contributors, hypercerts enable to pre-commit funding for those evaluations: As impact claims are never forgotten, any actor can at any time commit funding to a future evaluation of these claims. diff --git a/docs/versioned_docs/version-1.0.0/whitepaper/whitepaper-intro.md b/docs/versioned_docs/version-1.0.0/whitepaper/whitepaper-intro.md deleted file mode 100644 index 4d4648ba..00000000 --- a/docs/versioned_docs/version-1.0.0/whitepaper/whitepaper-intro.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Introduction -id: whitepaper-intro ---- - -# Vision & Whitepaper - -:::note - -If you prefer to read the draft whitepaper (v0) as a pdf, you can find it [here](../../static/pdf/hypercerts_whitepaper_v0.pdf). The content is mostly identical to the following pages. - -::: - -#### The world faces unprecedented challenges, from climate change to safe artificial intelligence, that require billions to trillions of dollars of public goods funding. - -High-upside/high-uncertainty endeavors are often overlooked due to the absence of strong incentives to pursue them in the dominant public goods funding framework of at-cost grants or even a milestone-bounty framework (which directly exposes small contributors to aversive risk levels). Yet these should be pursued when the expected positive value is very high, as it often is. New impact funding mechanisms can address this. One such mechanism is retrospective funding, which rewards projects based on the impact they create after the impact is observable. If projects can reasonably expect such retrospective rewards, they are incentivized to maximize their impact and – together with prospective funders – take risky bets when the expected positive value is high. - -#### In order for Impact Funding Systems (IFSs) to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources, and (3) evaluations. - -Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. We do not wish to lock in any particular decision-making scheme for funders. Without mechanisms like these, multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Funders should be able to easily collaborate with other funders or to intentionally fund different projects to diversify the funded approaches. Evaluators should be able to evaluate the same impact with different methodologies – potentially with conflicting results, to foster rigor and progress of evaluation methodologies. - -#### Hypercerts create this interoperability by serving as a single, open, shared, decentralized database for impact funding mechanisms. - -A single hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and whose ownership is fractionizable and transferable (under specific conditions). Hypercerts do not impose any specific funding mechanisms but provide baseline invariant guarantees such that claims will not be forgotten as different mechanisms come into and out of fashion. This is also why hypercerts are especially useful for any retrospective funding mechanisms – funding can be applied to claims of the past. diff --git a/docs/versioned_docs/version-1.4.1/about.md b/docs/versioned_docs/version-1.4.1/about.md deleted file mode 100644 index e2d4eb79..00000000 --- a/docs/versioned_docs/version-1.4.1/about.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: The Hypercerts Foundation -id: about ---- - -# The Hypercerts Foundation - -### Mission - -The mission of the Hypercerts Foundation is to advance the development and adoption of open-source protocols for funding and rewarding positive impact. - -### Organization - -The Hypercerts Foundation is a fully independent organisation working closely with stakeholders in the open source, scientific research, and cryptography communities to develop and promote additional protocols that are decentralized, secure, and transparent. The Foundation will also provide support and resources to help drive the wider adoption of these protocols. - -### History - -Research on hypercerts was first presented to the public by David A. Dalrymple at the conference series Funding the Commons in March 2022. However, the concept of “impact certificates” has been a recurring theme at conferences and in online discussion forums since at least 2014. In late 2022, a small team of research scientists, developers, and practitioners began implementing hypercerts as a set of Ethereum-based smart contracts that could be used to assert and fund impact claims. The Hypercerts Foundation will now serve as the long-term home for this work. - -The new foundation is supported in part by Protocol Labs and is part of the broader Protocol Labs Network of hundreds of companies and organizations. The Foundation will complement Protocol Labs Network’s mission of enabling a more secure, open, and accessible internet. The Hypercerts Foundation, however, is fully independent and will focus on protocol development and cultivating a community of developers and impact entrepreneurs well beyond the Protocol Labs Network. - -### Further links - -Read the full [announcement of the Hypercerts Foundation](https://hypercerts.notion.site/Introducing-the-Hypercerts-Foundation-d956203fe0fc4792980da138015e770a). diff --git a/docs/versioned_docs/version-1.4.1/announcements/2024_01_16_An_Impactful_Year.md b/docs/versioned_docs/version-1.4.1/announcements/2024_01_16_An_Impactful_Year.md deleted file mode 100644 index 3ec4a3d1..00000000 --- a/docs/versioned_docs/version-1.4.1/announcements/2024_01_16_An_Impactful_Year.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: An Impactful Year -id: an-impactful-year.md ---- - -# Announcements - -### Hypercerts are a new token standard for tracking and rewarding positive impact. - -Gm gm. We’re wishing you an impactful 2024. We’re excited for the things ahead! - -2023 has been a year of maturing the foundations laid by the release of the protocol. Together with Grants Stack, Funding the Commons, da0, Zuzalu and many other partners, we’ve successfully run a set of hypercerts pilots. We are grateful for our partners and the enthusiasm of their communities about hypercerts. At every event, we feel the positive energy about hypercerts and about the value mechanism they can unlock. - -At the end of the year, we started developing the hypercert marketplace, which will be released on Sepolia later this week. The marketplace is a fork of LooksRare with modifications to add native support for hypercerts. Thanks to their high quality open source code we were able to use both their exchange contracts as well as the SDK. Special credits go to [Trust Security](https://x.com/trust__90) for not only thoroughly reviewing the changes we’ve made to the stack, but also for going beyond their scope to help us improve our protocol. - -To help developers get onboarded with our tec,h we’ve released a [Next.JS starter app](https://github.com/hypercerts-org/hypercert-nextjs-chakra-starter), a repo with minimal [demo apps](https://github.com/hypercerts-org/demo-apps) for JS, TS on both server and client side, and of course, the [hypercerts SDK v1](https://www.npmjs.com/package/@hypercerts-org/sdk). The SDK provides methods and utilities for minting and claiming hypercerts, validating datasets, and uploading to and fetching from IPFS. - -All of this work is supported by GG19, the first Octant epoch, Optimism’s retroPGF and of course Protocol Labs. A big thank you to all supporters. - -In the next months, we’ll work with close collaborators to build out the evaluation functionalities and provide support to projects that want to integrate hypercerts into their funding systems (similar to how we are integrating hypercerts with Gitcoin) or want to build new applications using hypercerts. If you want to build on top of the hypercerts protocol, please get in contact with us. - -Excited and grateful, - -The hypercerts team diff --git a/docs/versioned_docs/version-1.4.1/developer/allowlists.md b/docs/versioned_docs/version-1.4.1/developer/allowlists.md deleted file mode 100644 index 61200236..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/allowlists.md +++ /dev/null @@ -1,101 +0,0 @@ -# Allowlists - -Allowlists are an efficient way to enable distribution of hypercert fractions amongst a group. -First, the creator will create the hypercert with the metadata and an immutable allowlist. -With the `claimId`, every account specified in the allowlist can later mint their fraction token from that allowlist. - -## Create an allowlist - -First specify an allowlist, mapping addresses to the number of units they should receive. - -```js -import { - TransferRestrictions, - formatHypercertData, - Allowlist, -} from "@hypercerts-org/sdk"; - -const allowlist: Allowlist = [ - { address: "0x123....asfcnaes", units: 100n }, - { address: "0xabc....w2dwqwef", units: 100n }, -]; -``` - -Then, call `createAllowlist` with the metadata and allowlist. - -```js -const { metadata } = formatHypercertData(...); -const totalUnits = 10000n; -const transferRestrictions = TransferRestrictions.FromCreatorOnly - -const txHash = await hypercerts.createAllowlist({ - allowList, - metaData, - totalUnits, - transferRestrictions: TransferRestrictions.FromCreatorOnly, -}); -``` - -> **note** We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree generation and data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree) - -It first checks if the client is writable and if the operator is a signer. If the operator is not a signer, it throws an `InvalidOrMissingError`. - -Next, it validates the allowlist and metadata by calling the `validateAllowlist` and `validateMetaData` functions respectively. If either the allowlist or metadata is invalid, it throws a `MalformedDataError`. - -Once the allowlist and metadata are validated, the method creates a Merkle tree from the allowlist and stores it on IPFS. It then stores the metadata on IPFS as well. - -Finally, the method invokes the `createAllowlist` function on the contract with the signer's `address`, the total number of `units`, the Merkle tree `root`, the metadata `CID`, and the `transfer restrictions`. If the method is called with `overrides`, it passes them to the createAllowlist function. - -## Claiming a fraction token - -Users can claim their fraction tokens for many hypercerts at once using `mintClaimFractionFromAllowlist`. To determine the input the following information is required: - -| Variable | Type | Source | -| -------- | ------ | ------------- | ----------- | -| claimId | bigint | Hypercert ID | -| units | bigint | Allowlist | -| proof | `(Hex | ByteArray)[]` | Merkle tree | - -We store the allowlist and the Merkle tree in the metadata of the Hypercert. To understand the Merkle tree data structures, check out the [OpenZeppelin merkle tree library](https://github.com/OpenZeppelin/merkle-tree). You can get the `proof` and `units` by traversing the merkle tree. - -Then, call `mintClaimFractionFromAllowlist` with the required data. The contracts will also verify the proofs. However, when providing the `root` in the function input, the proofs will be verified before a transaction is submitted. - -```js -import { StandardMerkleTree } from "@openzeppelin/merkle-tree"; - -const claimId = "0x822f17a9a5eecfd...85254363386255337"; -const address = "0xc0ffee254729296a45a3885639AC7E10F9d54979"; - -const { indexer, storage } = hypercertsClient; -const claimById = await indexer.claimById(claimId); -const { uri, tokenID: _id } = claimById.claim; -const metadata = await storage.getMetadata(uri || ""); -const treeResponse = await storage.getData(metadata.allowList); -const tree = StandardMerkleTree.load(JSON.parse(treeResponse)); - -let args; -// Find the proof in the allowlist -for (const [leaf, value] of tree.entries()) { - if (value[0] === address) { - args = { - proofs: tree.getProof(leaf), - units: Number(value[1]), - claimId: _id, - }; - break; - } -} - -// Mint fraction token -const tx = await hypercerts.mintClaimFractionFromAllowlist({ - ...args, -}); -``` - -Let's see what happens under the hood: - -First, the method checks that the client is not `read only` and that the operator is a signer. If not, it throws an `InvalidOrMissingError`. - -Next, the method verifies the Merkle `proof` using the OpenZeppelin Merkle tree library. If a `root` is provided, the method uses it to verify the proof. If the proof is invalid, it throws an error. - -Finally, the method calls the `mintClaimFromAllowlist` function on the contract with the signer `address`, Merkle `proof`, `claim ID`, and number of `units` as parameters. If overrides are provided, the method uses them to send the transaction. Otherwise, it sends the transaction without overrides. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md deleted file mode 100644 index 4cb96bfc..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/BatchOrderTypehashRegistry.md +++ /dev/null @@ -1,46 +0,0 @@ -# BatchOrderTypehashRegistry - -_LooksRare protocol team (👀,💎)_ - -> BatchOrderTypehashRegistry - -The contract generates the batch order hash that is used to compute the digest for signature verification. - -## Methods - -### hashBatchOrder - -```solidity -function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) -``` - -This function returns the hash of the concatenation of batch order type hash and merkle root. - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ------------------- | -| root | bytes32 | Merkle root | -| proofLength | uint256 | Merkle proof length | - -#### Returns - -| Name | Type | Description | -| -------------- | ------- | -------------------- | -| batchOrderHash | bytes32 | The batch order hash | - -## Errors - -### MerkleProofTooLarge - -```solidity -error MerkleProofTooLarge(uint256 length) -``` - -It is returned if the length of the merkle proof provided is greater than tolerated. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ------------ | -| length | uint256 | Proof length | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md deleted file mode 100644 index a32aef65..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRebates.md +++ /dev/null @@ -1,76 +0,0 @@ -# CreatorFeeManagerWithRebates - -_LooksRare protocol team (👀,💎)_ - -> CreatorFeeManagerWithRebates - -This contract returns the creator fee address and the creator rebate amount. - -## Methods - -### STANDARD_ROYALTY_FEE_BP - -```solidity -function STANDARD_ROYALTY_FEE_BP() external view returns (uint256) -``` - -Standard royalty fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### royaltyFeeRegistry - -```solidity -function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) -``` - -Royalty fee registry interface. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | contract IRoyaltyFeeRegistry | undefined | - -### viewCreatorFeeInfo - -```solidity -function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) -``` - -This function returns the creator address and calculates the creator fee amount. - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | -| itemIds | uint256[] | Array of item ids | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ------------------ | -| creator | address | Creator address | -| creatorFeeAmount | uint256 | Creator fee amount | - -## Errors - -### BundleEIP2981NotAllowed - -```solidity -error BundleEIP2981NotAllowed(address collection) -``` - -It is returned if the bundle contains multiple itemIds with different creator fee structure. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md deleted file mode 100644 index 41cab900..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CreatorFeeManagerWithRoyalties.md +++ /dev/null @@ -1,64 +0,0 @@ -# CreatorFeeManagerWithRoyalties - -_LooksRare protocol team (👀,💎)_ - -> CreatorFeeManagerWithRoyalties - -This contract returns the creator fee address and the creator fee amount. - -## Methods - -### royaltyFeeRegistry - -```solidity -function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry) -``` - -Royalty fee registry interface. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | contract IRoyaltyFeeRegistry | undefined | - -### viewCreatorFeeInfo - -```solidity -function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) -``` - -This function returns the creator address and calculates the creator fee amount. - -_There are two on-chain sources for the royalty fee to distribute. 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined for all items of a collection. 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection. The on-chain logic looks up the registry first. If it does not find anything, it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId. For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient differ among the itemIds part of the bundle, the trade reverts. This contract DOES NOT enforce any restriction for extremely high creator fee, nor verifies the creator fee fetched is inferior to the total price. If any contract relies on it to build an on-chain royalty logic, it should implement protection against: (1) high royalties (2) potential unexpected royalty changes that can occur after the creation of the order._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | -| itemIds | uint256[] | Array of item ids | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ------------------ | -| creator | address | Creator address | -| creatorFeeAmount | uint256 | Creator fee amount | - -## Errors - -### BundleEIP2981NotAllowed - -```solidity -error BundleEIP2981NotAllowed(address collection) -``` - -It is returned if the bundle contains multiple itemIds with different creator fee structure. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CurrencyManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CurrencyManager.md deleted file mode 100644 index 9ff1c0fc..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/CurrencyManager.md +++ /dev/null @@ -1,250 +0,0 @@ -# CurrencyManager - -_LooksRare protocol team (👀,💎)_ - -> CurrencyManager - -This contract manages the list of valid fungible currencies. - -## Methods - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -## Errors - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/ExecutionManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/ExecutionManager.md deleted file mode 100644 index 83eefc37..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/ExecutionManager.md +++ /dev/null @@ -1,751 +0,0 @@ -# ExecutionManager - -_LooksRare protocol team (👀,💎); bitbeckers;_ - -> ExecutionManager - -This contract handles the execution and resolution of transactions. A transaction is executed on-chain when an off-chain maker order is matched by on-chain taker order of a different kind. For instance, a taker ask is executed against a maker bid (or a taker bid against a maker ask). - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -Creator fee manager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint16) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | uint16 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### protocolFeeRecipient - -```solidity -function protocolFeeRecipient() external view returns (address) -``` - -Protocol fee recipient. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### updateCreatorFeeManager - -```solidity -function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable -``` - -This function allows the owner to update the creator fee manager address. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ---------------------------------- | -| newCreatorFeeManager | address | Address of the creator fee manager | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateMaxCreatorFeeBp - -```solidity -function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable -``` - -This function allows the owner to update the maximum creator fee (in basis point). - -_The maximum value that can be set is 25%. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------ | ---------------------------------------- | -| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | - -### updateProtocolFeeRecipient - -```solidity -function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable -``` - -This function allows the owner to update the protocol fee recipient. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ---------------------------------- | -| newProtocolFeeRecipient | address | New protocol fee recipient address | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| creatorFeeManager | address | undefined | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| maxCreatorFeeBp | uint256 | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| protocolFeeRecipient | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -## Errors - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/InheritedStrategy.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/InheritedStrategy.md deleted file mode 100644 index 022cce57..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/InheritedStrategy.md +++ /dev/null @@ -1,9 +0,0 @@ -# InheritedStrategy - -_LooksRare protocol team (👀,💎)_ - -> InheritedStrategy - -This contract handles the verification of parameters for standard transactions. It does not verify the taker struct's itemIds and amounts array as well as minPrice (taker ask) / maxPrice (taker bid) because before the taker executes the transaction and the maker itemIds/amounts/price should have already been confirmed off-chain. - -_A standard transaction (bid or ask) is mapped to strategyId = 0._ diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/LooksRareProtocol.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/LooksRareProtocol.md deleted file mode 100644 index 66bb61e8..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/LooksRareProtocol.md +++ /dev/null @@ -1,1186 +0,0 @@ -# LooksRareProtocol - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> LooksRareProtocol - -This contract is the core smart contract of the LooksRare protocol ("v2"). It is the main entry point for users to initiate transactions with taker orders and manage the cancellation of maker orders, which exist off-chain. ~~~~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~- ~~~~~~~~ ~~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~~~ ~~~~ ~~~ ~~~ ~~~~~ ~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~ ~~~~~ ~~~ ~~~~~~ ~~~~~~ ~~~ ~~~~~ ~~~ ~~~ ~~~~~~~~~~ ~~~ ~~~ ~~ ~~~ ~~~ ~~~ ~~~ ~~~~~~~~~~~ ~~~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~ ~~~~ ~~~~~~~~ ~~~~ ~~~ ~~~~~~~ ~~~~~~~ ~~~ ~~~ ~~~~~~~~ ~~~~ ~~~~ ~~~~~~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~~~~~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~~ ~~~~ ~~~~~~ - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### WETH - -```solidity -function WETH() external view returns (address) -``` - -Wrapped ETH. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### \_getUnitsHeldByHypercertFractions - -```solidity -function _getUnitsHeldByHypercertFractions(address collection, uint256[] itemIds) external view returns (uint256 unitsHeldByItems) -``` - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ----------- | -| collection | address | undefined | -| itemIds | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ----------- | -| unitsHeldByItems | uint256 | undefined | - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### chainId - -```solidity -function chainId() external view returns (uint256) -``` - -Current chainId. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -Creator fee manager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### domainSeparator - -```solidity -function domainSeparator() external view returns (bytes32) -``` - -Current domain separator. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### executeMultipleTakerBids - -```solidity -function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable -``` - -#### Parameters - -| Name | Type | Description | -| --------------- | ------------------------- | ----------- | -| takerBids | OrderStructs.Taker[] | undefined | -| makerAsks | OrderStructs.Maker[] | undefined | -| makerSignatures | bytes[] | undefined | -| merkleTrees | OrderStructs.MerkleTree[] | undefined | -| isAtomic | bool | undefined | - -### executeTakerAsk - -```solidity -function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -### executeTakerBid - -```solidity -function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -### hashBatchOrder - -```solidity -function hashBatchOrder(bytes32 root, uint256 proofLength) external pure returns (bytes32 batchOrderHash) -``` - -This function returns the hash of the concatenation of batch order type hash and merkle root. - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ------------------- | -| root | bytes32 | Merkle root | -| proofLength | uint256 | Merkle proof length | - -#### Returns - -| Name | Type | Description | -| -------------- | ------- | -------------------- | -| batchOrderHash | bytes32 | The batch order hash | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint16) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | uint16 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### protocolFeeRecipient - -```solidity -function protocolFeeRecipient() external view returns (address) -``` - -Protocol fee recipient. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### restrictedExecuteTakerBid - -```solidity -function restrictedExecuteTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, address sender, bytes32 orderHash) external nonpayable returns (uint256 protocolFeeAmount) -``` - -#### Parameters - -| Name | Type | Description | -| --------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | -| sender | address | undefined | -| orderHash | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| protocolFeeAmount | uint256 | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### transferManager - -```solidity -function transferManager() external view returns (contract TransferManager) -``` - -Transfer manager for ERC721, ERC1155 and Hypercerts. - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------ | ----------- | -| \_0 | contract TransferManager | undefined | - -### updateCreatorFeeManager - -```solidity -function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable -``` - -This function allows the owner to update the creator fee manager address. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ---------------------------------- | -| newCreatorFeeManager | address | Address of the creator fee manager | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateDomainSeparator - -```solidity -function updateDomainSeparator() external nonpayable -``` - -This function allows the owner to update the domain separator (if possible). - -_Only callable by owner. If there is a fork of the network with a new chainId, it allows the owner to reset the domain separator for the new chain id._ - -### updateETHGasLimitForTransfer - -```solidity -function updateETHGasLimitForTransfer(uint256 newGasLimitETHTransfer) external nonpayable -``` - -This function allows the owner to update the maximum ETH gas limit for a standard transfer. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------ | -| newGasLimitETHTransfer | uint256 | New gas limit for ETH transfer | - -### updateMaxCreatorFeeBp - -```solidity -function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable -``` - -This function allows the owner to update the maximum creator fee (in basis point). - -_The maximum value that can be set is 25%. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------ | ---------------------------------------- | -| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | - -### updateProtocolFeeRecipient - -```solidity -function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable -``` - -This function allows the owner to update the protocol fee recipient. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ---------------------------------- | -| newProtocolFeeRecipient | address | New protocol fee recipient address | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| creatorFeeManager | address | undefined | - -### NewDomainSeparator - -```solidity -event NewDomainSeparator() -``` - -It is emitted if there is a change in the domain separator. - -### NewGasLimitETHTransfer - -```solidity -event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) -``` - -It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). - -#### Parameters - -| Name | Type | Description | -| ------------------- | ------- | ----------- | -| gasLimitETHTransfer | uint256 | undefined | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| maxCreatorFeeBp | uint256 | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| protocolFeeRecipient | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -### TakerAsk - -```solidity -event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker ask transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | -| askUser | address | undefined | -| bidUser | address | undefined | -| strategyId | uint256 | undefined | -| currency | address | undefined | -| collection | address | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| feeRecipients | address[2] | undefined | -| feeAmounts | uint256[3] | undefined | - -### TakerBid - -```solidity -event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker bid transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | undefined | -| bidUser | address | undefined | -| bidRecipient | address | undefined | -| strategyId | uint256 | undefined | -| currency | address | undefined | -| collection | address | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| feeRecipients | address[2] | undefined | -| feeAmounts | uint256[3] | undefined | - -## Errors - -### CallerInvalid - -```solidity -error CallerInvalid() -``` - -It is returned if the function cannot be called by the sender. - -### ChainIdInvalid - -```solidity -error ChainIdInvalid() -``` - -It is returned if the domain separator should change. - -### CollectionTypeInvalid - -```solidity -error CollectionTypeInvalid() -``` - -It is returned is the collection type is not supported. For instance if the strategy is specific to hypercerts. - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### CurrencyInvalid - -```solidity -error CurrencyInvalid() -``` - -It is returned if the currency is invalid. - -### ERC20TransferFromFail - -```solidity -error ERC20TransferFromFail() -``` - -It is emitted if the ERC20 transferFrom fails. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### MerkleProofTooLarge - -```solidity -error MerkleProofTooLarge(uint256 length) -``` - -It is returned if the length of the merkle proof provided is greater than tolerated. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ------------ | -| length | uint256 | Proof length | - -### NewGasLimitETHTransferTooLow - -```solidity -error NewGasLimitETHTransferTooLow() -``` - -It is returned if the gas limit for a standard ETH transfer is too low. - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### NoncesInvalid - -```solidity -error NoncesInvalid() -``` - -It is returned if the nonces are invalid. - -### NotAContract - -```solidity -error NotAContract() -``` - -It is emitted if the call recipient is not a contract. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### NullSignerAddress - -```solidity -error NullSignerAddress() -``` - -It is emitted if the signer is null. - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### QuoteTypeInvalid - -```solidity -error QuoteTypeInvalid() -``` - -It is returned if the maker quote type is invalid. - -### ReentrancyFail - -```solidity -error ReentrancyFail() -``` - -This is returned when there is a reentrant call. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### SameDomainSeparator - -```solidity -error SameDomainSeparator() -``` - -It is returned if the domain separator cannot be updated (i.e. the chainId is the same). - -### SignatureEOAInvalid - -```solidity -error SignatureEOAInvalid() -``` - -It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). - -### SignatureERC1271Invalid - -```solidity -error SignatureERC1271Invalid() -``` - -It is emitted if the signature is invalid for a ERC1271 contract signer. - -### SignatureLengthInvalid - -```solidity -error SignatureLengthInvalid(uint256 length) -``` - -It is emitted if the signature's length is neither 64 nor 65 bytes. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| length | uint256 | undefined | - -### SignatureParameterSInvalid - -```solidity -error SignatureParameterSInvalid() -``` - -It is emitted if the signature is invalid due to S parameter. - -### SignatureParameterVInvalid - -```solidity -error SignatureParameterVInvalid(uint8 v) -``` - -It is emitted if the signature is invalid due to V parameter. - -#### Parameters - -| Name | Type | Description | -| ---- | ----- | ----------- | -| v | uint8 | undefined | - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### UnitAmountInvalid - -```solidity -error UnitAmountInvalid() -``` - -It is returned if the available amount of fraction units is not available for the selected type of transaction. For instance, a split transaction cannot be executed if the amount of fraction units is not higher than the amount of fraction units available. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/NonceManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/NonceManager.md deleted file mode 100644 index fea95495..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/NonceManager.md +++ /dev/null @@ -1,193 +0,0 @@ -# NonceManager - -_LooksRare protocol team (👀,💎)_ - -> NonceManager - -This contract handles the nonce logic that is used for invalidating maker orders that exist off-chain. The nonce logic revolves around three parts at the user level: - order nonce (orders sharing an order nonce are conditional, OCO-like) - subset (orders can be grouped under a same subset) - bid/ask (all orders can be executed only if the bid/ask nonce matches the user's one on-chain) Only the order nonce is invalidated at the time of the execution of a maker order that contains it. - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -## Errors - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md deleted file mode 100644 index 36f6a35c..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/ProtocolFeeRecipient.md +++ /dev/null @@ -1,75 +0,0 @@ -# ProtocolFeeRecipient - -_LooksRare protocol team (👀,💎)_ - -> ProtocolFeeRecipient - -This contract is used to receive protocol fees and transfer them to the fee sharing setter. Fee sharing setter cannot receive ETH directly, so we need to use this contract as a middleman to convert ETH into WETH before sending it. - -## Methods - -### FEE_SHARING_SETTER - -```solidity -function FEE_SHARING_SETTER() external view returns (address) -``` - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### WETH - -```solidity -function WETH() external view returns (contract IWETH) -``` - -#### Returns - -| Name | Type | Description | -| ---- | -------------- | ----------- | -| \_0 | contract IWETH | undefined | - -### transferERC20 - -```solidity -function transferERC20(address currency) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ---------------------- | -| currency | address | ERC20 currency address | - -### transferETH - -```solidity -function transferETH() external nonpayable -``` - -## Errors - -### ERC20TransferFail - -```solidity -error ERC20TransferFail() -``` - -It is emitted if the ERC20 transfer fails. - -### NotAContract - -```solidity -error NotAContract() -``` - -It is emitted if the call recipient is not a contract. - -### NothingToTransfer - -```solidity -error NothingToTransfer() -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/StrategyManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/StrategyManager.md deleted file mode 100644 index a55f3985..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/StrategyManager.md +++ /dev/null @@ -1,391 +0,0 @@ -# StrategyManager - -_LooksRare protocol team (👀,💎)_ - -> StrategyManager - -This contract handles the addition and the update of execution strategies. - -## Methods - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -## Errors - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/TransferManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/TransferManager.md deleted file mode 100644 index f042e290..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/TransferManager.md +++ /dev/null @@ -1,553 +0,0 @@ -# TransferManager - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> TransferManager - -This contract provides the transfer functions for ERC721/ERC1155/Hypercert for contracts that require them. Collection type "0" refers to ERC721 transfer functions. Collection type "1" refers to ERC1155 transfer functions. Collection type "2" refers to Hypercert transfer functions. - -_"Safe" transfer functions for ERC721 are not implemented since they come with added gas costs to verify if the recipient is a contract as it requires verifying the receiver interface is valid._ - -## Methods - -### allowOperator - -```solidity -function allowOperator(address operator) external nonpayable -``` - -This function allows an operator to be added for the shared transfer system. Once the operator is allowed, users can grant NFT approvals to this operator. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ------------------------- | -| operator | address | Operator address to allow | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### grantApprovals - -```solidity -function grantApprovals(address[] operators) external nonpayable -``` - -This function allows a user to grant approvals for an array of operators. Users cannot grant approvals if the operator is not allowed by this contract's owner. - -_Each operator address must be globally allowed to be approved._ - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| operators | address[] | Array of operator addresses | - -### hasUserApprovedOperator - -```solidity -function hasUserApprovedOperator(address, address) external view returns (bool) -``` - -This returns whether the user has approved the operator address. The first address is the user and the second address is the operator (e.g. LooksRareProtocol). - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isOperatorAllowed - -```solidity -function isOperatorAllowed(address) external view returns (bool) -``` - -This returns whether the operator address is allowed by this contract's owner. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### removeOperator - -```solidity -function removeOperator(address operator) external nonpayable -``` - -This function allows the user to remove an operator for the shared transfer system. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | -------------------------- | -| operator | address | Operator address to remove | - -### revokeApprovals - -```solidity -function revokeApprovals(address[] operators) external nonpayable -``` - -This function allows a user to revoke existing approvals for an array of operators. - -_Each operator address must be approved at the user level to be revoked._ - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| operators | address[] | Array of operator addresses | - -### splitItemsHypercert - -```solidity -function splitItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function splits and transfers a fraction of a hypercert. - -_It does not allow batch transferring._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -### transferBatchItemsAcrossCollections - -```solidity -function transferBatchItemsAcrossCollections(ITransferManager.BatchTransferItem[] items, address from, address to) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| ----- | ------------------------------------ | ----------- | -| items | ITransferManager.BatchTransferItem[] | undefined | -| from | address | undefined | -| to | address | undefined | - -### transferItemsERC1155 - -```solidity -function transferItemsERC1155(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function transfers items for a single ERC1155 collection. - -_It does not allow batch transferring if from = msg.sender since native function should be used._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -### transferItemsERC721 - -```solidity -function transferItemsERC721(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function transfers items for a single ERC721 collection. - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -### transferItemsHypercert - -```solidity -function transferItemsHypercert(address collection, address from, address to, uint256[] itemIds, uint256[] amounts) external nonpayable -``` - -This function transfers items for a single Hypercert. - -_It does not allow batch transferring if from = msg.sender since native function should be used._ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| from | address | Sender address | -| to | address | Recipient address | -| itemIds | uint256[] | Array of itemIds | -| amounts | uint256[] | Array of amounts | - -## Events - -### ApprovalsGranted - -```solidity -event ApprovalsGranted(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are granted by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | ----------- | -| user | address | undefined | -| operators | address[] | undefined | - -### ApprovalsRemoved - -```solidity -event ApprovalsRemoved(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are revoked by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | ----------- | -| user | address | undefined | -| operators | address[] | undefined | - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### OperatorAllowed - -```solidity -event OperatorAllowed(address operator) -``` - -It is emitted if a new operator is added to the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | - -### OperatorRemoved - -```solidity -event OperatorRemoved(address operator) -``` - -It is emitted if an operator is removed from the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | - -## Errors - -### AmountInvalid - -```solidity -error AmountInvalid() -``` - -It is returned if the amount is invalid. For ERC721 and Hypercert, any number that is not 1. For ERC1155, if amount is 0. - -### ERC1155SafeBatchTransferFromFail - -```solidity -error ERC1155SafeBatchTransferFromFail() -``` - -It is emitted if the ERC1155 safeBatchTransferFrom fails. - -### ERC1155SafeTransferFromFail - -```solidity -error ERC1155SafeTransferFromFail() -``` - -It is emitted if the ERC1155 safeTransferFrom fails. - -### ERC721TransferFromFail - -```solidity -error ERC721TransferFromFail() -``` - -It is emitted if the ERC721 transferFrom fails. - -### HypercertSplitFractionError - -```solidity -error HypercertSplitFractionError() -``` - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotAContract - -```solidity -error NotAContract() -``` - -It is emitted if the call recipient is not a contract. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### OperatorAlreadyAllowed - -```solidity -error OperatorAlreadyAllowed() -``` - -It is returned if the transfer caller is already allowed by the owner. - -_This error can only be returned for owner operations._ - -### OperatorAlreadyApprovedByUser - -```solidity -error OperatorAlreadyApprovedByUser() -``` - -It is returned if the operator to approve has already been approved by the user. - -### OperatorNotAllowed - -```solidity -error OperatorNotAllowed() -``` - -It is returned if the operator to approve is not in the global allowlist defined by the owner. - -_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ - -### OperatorNotApprovedByUser - -```solidity -error OperatorNotApprovedByUser() -``` - -It is returned if the operator to revoke has not been previously approved by the user. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferCallerInvalid - -```solidity -error TransferCallerInvalid() -``` - -It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/TransferSelectorNFT.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/TransferSelectorNFT.md deleted file mode 100644 index 168bab88..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/TransferSelectorNFT.md +++ /dev/null @@ -1,773 +0,0 @@ -# TransferSelectorNFT - -_LooksRare protocol team (👀,💎); bitbeckers;_ - -> TransferSelectorNFT - -This contract handles the logic for transferring non-fungible items. - -## Methods - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### addStrategy - -```solidity -function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable -``` - -This function allows the owner to add a new execution strategy to the protocol. - -_Strategies have an id that is incremental. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------- | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the strategy | -| isMakerBid | bool | Whether the function selector is for maker bid | -| implementation | address | Implementation address | - -### cancelOrderNonces - -```solidity -function cancelOrderNonces(uint256[] orderNonces) external nonpayable -``` - -This function allows a user to cancel an array of order nonces. - -_It does not check the status of the nonces to save gas and to prevent revertion if one of the orders is filled in the same block._ - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | --------------------- | -| orderNonces | uint256[] | Array of order nonces | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### cancelSubsetNonces - -```solidity -function cancelSubsetNonces(uint256[] subsetNonces) external nonpayable -``` - -This function allows a user to cancel an array of subset nonces. - -_It does not check the status of the nonces to save gas._ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ---------------------- | -| subsetNonces | uint256[] | Array of subset nonces | - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -Creator fee manager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### incrementBidAskNonces - -```solidity -function incrementBidAskNonces(bool bid, bool ask) external nonpayable -``` - -This function increments a user's bid/ask nonces. - -_The logic for computing the quasi-random number is inspired by Seaport v1.2. The pseudo-randomness allows non-deterministic computation of the next ask/bid nonce. A deterministic increment would make the cancel-all process non-effective in certain cases (orders signed with a greater ask/bid nonce). The same quasi-random number is used for incrementing both the bid and ask nonces if both values are incremented in the same transaction. If this function is used twice in the same block, it will return the same quasiRandomNumber but this will not impact the overall business logic._ - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | --------------------------------------- | -| bid | bool | Whether to increment the user bid nonce | -| ask | bool | Whether to increment the user ask nonce | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isCurrencyAllowed - -```solidity -function isCurrencyAllowed(address) external view returns (bool) -``` - -It checks whether the currency is allowed for transacting. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint16) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | uint16 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### protocolFeeRecipient - -```solidity -function protocolFeeRecipient() external view returns (address) -``` - -Protocol fee recipient. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### strategyInfo - -```solidity -function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -This returns the strategy information for a strategy id. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### transferManager - -```solidity -function transferManager() external view returns (contract TransferManager) -``` - -Transfer manager for ERC721, ERC1155 and Hypercerts. - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------ | ----------- | -| \_0 | contract TransferManager | undefined | - -### updateCreatorFeeManager - -```solidity -function updateCreatorFeeManager(address newCreatorFeeManager) external nonpayable -``` - -This function allows the owner to update the creator fee manager address. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ---------------------------------- | -| newCreatorFeeManager | address | Address of the creator fee manager | - -### updateCurrencyStatus - -```solidity -function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable -``` - -This function allows the owner to update the status of a currency. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | -------------------------------------------------- | -| currency | address | Currency address (address(0) for ETH) | -| isAllowed | bool | Whether the currency should be allowed for trading | - -### updateMaxCreatorFeeBp - -```solidity -function updateMaxCreatorFeeBp(uint16 newMaxCreatorFeeBp) external nonpayable -``` - -This function allows the owner to update the maximum creator fee (in basis point). - -_The maximum value that can be set is 25%. Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------ | ---------------------------------------- | -| newMaxCreatorFeeBp | uint16 | New maximum creator fee (in basis point) | - -### updateProtocolFeeRecipient - -```solidity -function updateProtocolFeeRecipient(address newProtocolFeeRecipient) external nonpayable -``` - -This function allows the owner to update the protocol fee recipient. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ---------------------------------- | -| newProtocolFeeRecipient | address | New protocol fee recipient address | - -### updateStrategy - -```solidity -function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable -``` - -This function allows the owner to update parameters for an existing execution strategy. - -_Only callable by owner._ - -#### Parameters - -| Name | Type | Description | -| ---------------------- | ------- | ------------------------------------------ | -| strategyId | uint256 | Strategy id | -| isActive | bool | Whether the strategy must be active | -| newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) | -| newMinTotalFee | uint16 | New minimum total fee (in basis point) | - -### userBidAskNonces - -```solidity -function userBidAskNonces(address) external view returns (uint256 bidNonce, uint256 askNonce) -``` - -This tracks the bid and ask nonces for a user address. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------- | ----------- | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### userOrderNonce - -```solidity -function userOrderNonce(address, uint256) external view returns (bytes32) -``` - -This checks whether the order nonce for a user was executed or cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### userSubsetNonce - -```solidity -function userSubsetNonce(address, uint256) external view returns (bool) -``` - -This checks whether the subset nonce for a user was cancelled. - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| currency | address | undefined | -| isAllowed | bool | undefined | - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| user | address | undefined | -| bidNonce | uint256 | undefined | -| askNonce | uint256 | undefined | - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| creatorFeeManager | address | undefined | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| maxCreatorFeeBp | uint256 | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| protocolFeeRecipient | address | undefined | - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | -| maxProtocolFeeBp | uint16 | undefined | -| selector | bytes4 | undefined | -| isMakerBid | bool | undefined | -| implementation | address | undefined | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ----------- | -| user | address | undefined | -| orderNonces | uint256[] | undefined | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ----------- | -| strategyId | uint256 | undefined | -| isActive | bool | undefined | -| standardProtocolFeeBp | uint16 | undefined | -| minTotalFeeBp | uint16 | undefined | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| user | address | undefined | -| subsetNonces | uint256[] | undefined | - -## Errors - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### ReentrancyFail - -```solidity -error ReentrancyFail() -``` - -This is returned when there is a reentrant call. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md deleted file mode 100644 index 6767c2c2..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/BaseStrategy.md +++ /dev/null @@ -1,41 +0,0 @@ -# BaseStrategy - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> BaseStrategy - -## Methods - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerOrder | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md deleted file mode 100644 index c9503939..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/BaseStrategyChainlinkPriceLatency.md +++ /dev/null @@ -1,212 +0,0 @@ -# BaseStrategyChainlinkPriceLatency - -_LooksRare protocol team (👀,💎)_ - -> BaseStrategyChainlinkPriceLatency - -This contract allows the owner to define the maximum acceptable Chainlink price latency. - -## Methods - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### maxLatency - -```solidity -function maxLatency() external view returns (uint256) -``` - -Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -## Errors - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md deleted file mode 100644 index e2d77dd3..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/Chainlink/StrategyChainlinkUSDDynamicAsk.md +++ /dev/null @@ -1,342 +0,0 @@ -# StrategyChainlinkUSDDynamicAsk - -_LooksRare protocol team (👀,💎)_ - -> StrategyChainlinkUSDDynamicAsk - -This contract allows a seller to sell an NFT priced in USD and the receivable amount to be in ETH. - -## Methods - -### ETH_USD_PRICE_FEED_DECIMALS - -```solidity -function ETH_USD_PRICE_FEED_DECIMALS() external view returns (uint256) -``` - -_It is possible to call priceFeed.decimals() to get the decimals, but to save gas, it is hard coded instead._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### WETH - -```solidity -function WETH() external view returns (address) -``` - -Wrapped ether (WETH) address. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### cancelOwnershipTransfer - -```solidity -function cancelOwnershipTransfer() external nonpayable -``` - -This function is used to cancel the ownership transfer. - -_This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership._ - -### confirmOwnershipRenouncement - -```solidity -function confirmOwnershipRenouncement() external nonpayable -``` - -This function is used to confirm the ownership renouncement. - -### confirmOwnershipTransfer - -```solidity -function confirmOwnershipTransfer() external nonpayable -``` - -This function is used to confirm the ownership transfer. - -_This function can only be called by the current potential owner._ - -### executeStrategyWithTakerBid - -```solidity -function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### initiateOwnershipRenouncement - -```solidity -function initiateOwnershipRenouncement() external nonpayable -``` - -This function is used to initiate the ownership renouncement. - -### initiateOwnershipTransfer - -```solidity -function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable -``` - -This function is used to initiate the transfer of ownership to a new owner. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------- | -| newPotentialOwner | address | New potential owner address | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -### maxLatency - -```solidity -function maxLatency() external view returns (uint256) -``` - -Maximum latency accepted after which the execution strategy rejects the retrieved price. For ETH, it cannot be higher than 3,600 as Chainlink will at least update the price every 3,600 seconds, provided ETH's price does not deviate more than 0.5%. For NFTs, it cannot be higher than 86,400 as Chainlink will at least update the price every 86,400 seconds, provided ETH's price does not deviate more than 2%. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -Address of the current owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownershipStatus - -```solidity -function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status) -``` - -Ownership status. - -#### Returns - -| Name | Type | Description | -| ---- | ---------------------------- | ----------- | -| \_0 | enum IOwnableTwoSteps.Status | undefined | - -### potentialOwner - -```solidity -function potentialOwner() external view returns (address) -``` - -Address of the potential owner. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### priceFeed - -```solidity -function priceFeed() external view returns (contract AggregatorV3Interface) -``` - -ETH/USD Chainlink price feed - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------------ | ----------- | -| \_0 | contract AggregatorV3Interface | undefined | - -## Events - -### CancelOwnershipTransfer - -```solidity -event CancelOwnershipTransfer() -``` - -This is emitted if the ownership transfer is cancelled. - -### InitiateOwnershipRenouncement - -```solidity -event InitiateOwnershipRenouncement() -``` - -This is emitted if the ownership renouncement is initiated. - -### InitiateOwnershipTransfer - -```solidity -event InitiateOwnershipTransfer(address previousOwner, address potentialOwner) -``` - -This is emitted if the ownership transfer is initiated. - -#### Parameters - -| Name | Type | Description | -| -------------- | ------- | ----------- | -| previousOwner | address | undefined | -| potentialOwner | address | undefined | - -### NewOwner - -```solidity -event NewOwner(address newOwner) -``` - -This is emitted when there is a new owner. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -## Errors - -### BidTooLow - -```solidity -error BidTooLow() -``` - -It is returned if the bid price is too low for the ask user. - -### ChainlinkPriceInvalid - -```solidity -error ChainlinkPriceInvalid() -``` - -It is returned if the Chainlink price is invalid (e.g. negative). - -### NoOngoingTransferInProgress - -```solidity -error NoOngoingTransferInProgress() -``` - -This is returned when there is no transfer of ownership in progress. - -### NotOwner - -```solidity -error NotOwner() -``` - -This is returned when the caller is not the owner. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. - -### PriceNotRecentEnough - -```solidity -error PriceNotRecentEnough() -``` - -It is returned if the current block time relative to the latest price's update time is greater than the latency tolerance. - -### RenouncementNotInProgress - -```solidity -error RenouncementNotInProgress() -``` - -This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement. - -### TransferAlreadyInProgress - -```solidity -error TransferAlreadyInProgress() -``` - -This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer. - -### TransferNotInProgress - -```solidity -error TransferNotInProgress() -``` - -This is returned when there is no ownership transfer in progress but the ownership change tries to be approved. - -### WrongPotentialOwner - -```solidity -error WrongPotentialOwner() -``` - -This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md deleted file mode 100644 index cecc9324..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyCollectionOffer.md +++ /dev/null @@ -1,135 +0,0 @@ -# StrategyCollectionOffer - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> StrategyCollectionOffer - -This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If ERC721, the amount must be 1. 2. If ERC1155, the amount can be greater than 1. - -## Methods - -### executeCollectionStrategyWithTakerAsk - -```solidity -function executeCollectionStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeCollectionStrategyWithTakerAskWithAllowlist - -```solidity -function executeCollectionStrategyWithTakerAskWithAllowlist(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeCollectionStrategyWithTakerAskWithProof - -```solidity -function executeCollectionStrategyWithTakerAskWithProof(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerBid | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### CollectionTypeInvalid - -```solidity -error CollectionTypeInvalid() -``` - -It is returned is the collection type is not supported. For instance if the strategy is specific to hypercerts. - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md deleted file mode 100644 index 65fd5b25..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyDutchAuction.md +++ /dev/null @@ -1,91 +0,0 @@ -# StrategyDutchAuction - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> StrategyDutchAuction - -This contract offers a single execution strategy for users to create Dutch auctions. - -## Methods - -### executeStrategyWithTakerBid - -```solidity -function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### BidTooLow - -```solidity -error BidTooLow() -``` - -It is returned if the bid price is too low for the ask user. - -### CollectionTypeInvalid - -```solidity -error CollectionTypeInvalid() -``` - -It is returned is the collection type is not supported. For instance if the strategy is specific to hypercerts. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertCollectionOffer.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertCollectionOffer.md deleted file mode 100644 index 17b10115..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertCollectionOffer.md +++ /dev/null @@ -1,135 +0,0 @@ -# StrategyHypercertCollectionOffer - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> StrategyHypercertCollectionOffer - -This contract offers execution strategies for users to create maker bid offers for items in a collection. There are two available functions: 1. executeCollectionStrategyWithTakerAsk --> it applies to all itemIds in a collection 2. executeCollectionStrategyWithTakerAskWithProof --> it allows adding merkle proof criteria for tokenIds. 2. executeCollectionStrategyWithTakerAskWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. The amount must be 1. 2. The units held at bid creation and ask execution time must be the same. 3. The units held by the item sold must be the same as the units held by the item bid. - -## Methods - -### executeHypercertCollectionStrategyWithTakerAsk - -```solidity -function executeHypercertCollectionStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeHypercertCollectionStrategyWithTakerAskWithAllowlist - -```solidity -function executeHypercertCollectionStrategyWithTakerAskWithAllowlist(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeHypercertCollectionStrategyWithTakerAskWithProof - -```solidity -function executeHypercertCollectionStrategyWithTakerAskWithProof(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerBid | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### CollectionTypeInvalid - -```solidity -error CollectionTypeInvalid() -``` - -It is returned is the collection type is not supported. For instance if the strategy is specific to hypercerts. - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertDutchAuction.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertDutchAuction.md deleted file mode 100644 index a1c37e73..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertDutchAuction.md +++ /dev/null @@ -1,91 +0,0 @@ -# StrategyHypercertDutchAuction - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> StrategyHypercertDutchAuction - -This contract offers a single execution strategy for users to create Dutch auctions for hypercerts. - -## Methods - -### executeStrategyWithTakerBid - -```solidity -function executeStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### BidTooLow - -```solidity -error BidTooLow() -``` - -It is returned if the bid price is too low for the ask user. - -### CollectionTypeInvalid - -```solidity -error CollectionTypeInvalid() -``` - -It is returned is the collection type is not supported. For instance if the strategy is specific to hypercerts. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md deleted file mode 100644 index 30b21a56..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyHypercertFractionOffer.md +++ /dev/null @@ -1,123 +0,0 @@ -# StrategyHypercertFractionOffer - -_LooksRare protocol team (👀,💎); bitbeckers;_ - -> StrategyHypercertFractionOffer - -This contract offers a single execution strategy for users to bid on a specific amount of units in an hypercerts that's for sale. Example: Alice has 100 units of a hypercert (id: 42) for sale at a minimum price of 0.001 ETH/unit. Bob wants to buy 10 units. Bob can create a taker bid order with the following parameters: - unitAmount: 10000 // in `additionalParameters` - pricePerUnit: 10 // amount of accepted token paid; in `additionalParameters` - proof: [0xsdadfa....s9fds,0xdasdas...asff8e] // proof to the root defined in the maker ask; in `additionalParameters` This strategy will validate the available units and the price.This contract offers execution strategies for users to create maker bid offers for items in a collection. There are three available functions: 1. executeHypercertFractionStrategyWithTakerBid --> it applies to all itemIds in a collection 2. executeHypercertFractionStrategyWithTakerBidWithAllowlist --> it allows adding merkle proof criteria for accounts.The bidder can only bid on 1 item id at a time. 1. If Hypercert, the amount must be 1 because the fractions are NFTs. - -_Use cases can include tiered pricing; think early bird tickets._ - -## Methods - -### executeHypercertFractionStrategyWithTakerBid - -```solidity -function executeHypercertFractionStrategyWithTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### executeHypercertFractionStrategyWithTakerBidWithAllowlist - -```solidity -function executeHypercertFractionStrategyWithTakerBidWithAllowlist(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk) external view returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerAsk, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerAsk | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### AmountInvalid - -```solidity -error AmountInvalid() -``` - -It is returned if the amount is invalid. For ERC721 and Hypercert, any number that is not 1. For ERC1155, if amount is 0. - -### LengthsInvalid - -```solidity -error LengthsInvalid() -``` - -It is returned if there is either a mismatch or an error in the length of the array(s). - -### MerkleProofInvalid - -```solidity -error MerkleProofInvalid() -``` - -It is returned if the merkle proof provided is invalid. - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md deleted file mode 100644 index 6a1f0cd5..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/executionStrategies/StrategyItemIdsRange.md +++ /dev/null @@ -1,75 +0,0 @@ -# StrategyItemIdsRange - -_LooksRare protocol team (👀,💎)_ - -> StrategyItemIdsRange - -This contract offers a single execution strategy for users to bid on a specific amount of items in a range bounded by 2 item ids. - -## Methods - -### executeStrategyWithTakerAsk - -```solidity -function executeStrategyWithTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid) external pure returns (uint256 price, uint256[] itemIds, uint256[] amounts, bool isNonceInvalidated) -``` - -#### Parameters - -| Name | Type | Description | -| -------- | ------------------ | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| price | uint256 | undefined | -| itemIds | uint256[] | undefined | -| amounts | uint256[] | undefined | -| isNonceInvalidated | bool | undefined | - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ---------------------------------------------- | -| \_0 | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerBid, bytes4 functionSelector) external pure returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerBid | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | - -## Errors - -### OrderInvalid - -```solidity -error OrderInvalid() -``` - -It is returned if the order is permanently invalid. There may be an issue with the order formatting. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md deleted file mode 100644 index 76918fc5..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/helpers/OrderValidatorV2A.md +++ /dev/null @@ -1,215 +0,0 @@ -# OrderValidatorV2A - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> OrderValidatorV2A - -This contract is used to check the validity of maker ask/bid orders in the LooksRareProtocol (v2). It performs checks for: 1. Protocol allowlist issues (i.e. currency or strategy not allowed) 2. Maker order-specific issues (e.g., order invalid due to format or other-strategy specific issues) 3. Nonce related issues (e.g., nonce executed or cancelled) 4. Signature related issues and merkle tree parameters 5. Timestamp related issues (e.g., order expired) 6. Asset-related issues for ERC20/ERC721/ERC1155/Hypercerts (approvals and balances) 7. Collection-type suggestions 8. Transfer manager related issues 9. Creator fee related issues (e.g., creator fee too high, ERC2981 bundles) - -_This version does not handle strategies with partial fills._ - -## Methods - -### CRITERIA_GROUPS - -```solidity -function CRITERIA_GROUPS() external view returns (uint256) -``` - -Number of distinct criteria groups checked to evaluate the validity of an order. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### ERC1155_INTERFACE_ID - -```solidity -function ERC1155_INTERFACE_ID() external view returns (bytes4) -``` - -ERC1155 interfaceId. - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### ERC721_INTERFACE_ID_1 - -```solidity -function ERC721_INTERFACE_ID_1() external view returns (bytes4) -``` - -ERC721 potential interfaceId. - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### ERC721_INTERFACE_ID_2 - -```solidity -function ERC721_INTERFACE_ID_2() external view returns (bytes4) -``` - -ERC721 potential interfaceId. - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### HYPERCERT_INTERFACE_ID - -```solidity -function HYPERCERT_INTERFACE_ID() external view returns (bytes4) -``` - -Hypercert interfaceId - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | bytes4 | undefined | - -### MAGIC_VALUE_ORDER_NONCE_EXECUTED - -```solidity -function MAGIC_VALUE_ORDER_NONCE_EXECUTED() external view returns (bytes32) -``` - -Magic value nonce returned if executed (or cancelled). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### checkMakerOrderValidity - -```solidity -function checkMakerOrderValidity(OrderStructs.Maker makerOrder, bytes signature, OrderStructs.MerkleTree merkleTree) external view returns (uint256[9] validationCodes) -``` - -#### Parameters - -| Name | Type | Description | -| ---------- | ----------------------- | ----------- | -| makerOrder | OrderStructs.Maker | undefined | -| signature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -#### Returns - -| Name | Type | Description | -| --------------- | ---------- | ----------- | -| validationCodes | uint256[9] | undefined | - -### checkMultipleMakerOrderValidities - -```solidity -function checkMultipleMakerOrderValidities(OrderStructs.Maker[] makerOrders, bytes[] signatures, OrderStructs.MerkleTree[] merkleTrees) external view returns (uint256[9][] validationCodes) -``` - -#### Parameters - -| Name | Type | Description | -| ----------- | ------------------------- | ----------- | -| makerOrders | OrderStructs.Maker[] | undefined | -| signatures | bytes[] | undefined | -| merkleTrees | OrderStructs.MerkleTree[] | undefined | - -#### Returns - -| Name | Type | Description | -| --------------- | ------------ | ----------- | -| validationCodes | uint256[9][] | undefined | - -### creatorFeeManager - -```solidity -function creatorFeeManager() external view returns (contract ICreatorFeeManager) -``` - -CreatorFeeManager. - -#### Returns - -| Name | Type | Description | -| ---- | --------------------------- | ----------- | -| \_0 | contract ICreatorFeeManager | undefined | - -### deriveProtocolParameters - -```solidity -function deriveProtocolParameters() external nonpayable -``` - -Derive protocol parameters. Anyone can call this function. - -_It allows adjusting if the domain separator or creator fee manager address were to change._ - -### domainSeparator - -```solidity -function domainSeparator() external view returns (bytes32) -``` - -LooksRareProtocol domain separator. - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### looksRareProtocol - -```solidity -function looksRareProtocol() external view returns (contract LooksRareProtocol) -``` - -LooksRareProtocol. - -#### Returns - -| Name | Type | Description | -| ---- | -------------------------- | ----------- | -| \_0 | contract LooksRareProtocol | undefined | - -### maxCreatorFeeBp - -```solidity -function maxCreatorFeeBp() external view returns (uint256) -``` - -Maximum creator fee (in basis point). - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### transferManager - -```solidity -function transferManager() external view returns (contract TransferManager) -``` - -TransferManager - -#### Returns - -| Name | Type | Description | -| ---- | ------------------------ | ----------- | -| \_0 | contract TransferManager | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md deleted file mode 100644 index 91be29a9..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/helpers/ProtocolHelpers.md +++ /dev/null @@ -1,159 +0,0 @@ -# ProtocolHelpers - -_LooksRare protocol team (👀,💎)_ - -> ProtocolHelpers - -This contract contains helper view functions for order creation. - -## Methods - -### computeDigestMerkleTree - -```solidity -function computeDigestMerkleTree(OrderStructs.MerkleTree merkleTree) external view returns (bytes32 digest) -``` - -#### Parameters - -| Name | Type | Description | -| ---------- | ----------------------- | ----------- | -| merkleTree | OrderStructs.MerkleTree | undefined | - -#### Returns - -| Name | Type | Description | -| ------ | ------- | ----------- | -| digest | bytes32 | undefined | - -### computeMakerDigest - -```solidity -function computeMakerDigest(OrderStructs.Maker maker) external view returns (bytes32 digest) -``` - -#### Parameters - -| Name | Type | Description | -| ----- | ------------------ | ----------- | -| maker | OrderStructs.Maker | undefined | - -#### Returns - -| Name | Type | Description | -| ------ | ------- | ----------- | -| digest | bytes32 | undefined | - -### looksRareProtocol - -```solidity -function looksRareProtocol() external view returns (contract LooksRareProtocol) -``` - -#### Returns - -| Name | Type | Description | -| ---- | -------------------------- | ----------- | -| \_0 | contract LooksRareProtocol | undefined | - -### verifyMakerSignature - -```solidity -function verifyMakerSignature(OrderStructs.Maker maker, bytes makerSignature, address signer) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ------------------ | ----------- | -| maker | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| signer | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### verifyMerkleTree - -```solidity -function verifyMerkleTree(OrderStructs.MerkleTree merkleTree, bytes makerSignature, address signer) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| merkleTree | OrderStructs.MerkleTree | undefined | -| makerSignature | bytes | undefined | -| signer | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -## Errors - -### NullSignerAddress - -```solidity -error NullSignerAddress() -``` - -It is emitted if the signer is null. - -### SignatureEOAInvalid - -```solidity -error SignatureEOAInvalid() -``` - -It is emitted if the signature is invalid for an EOA (the address recovered is not the expected one). - -### SignatureERC1271Invalid - -```solidity -error SignatureERC1271Invalid() -``` - -It is emitted if the signature is invalid for a ERC1271 contract signer. - -### SignatureLengthInvalid - -```solidity -error SignatureLengthInvalid(uint256 length) -``` - -It is emitted if the signature's length is neither 64 nor 65 bytes. - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| length | uint256 | undefined | - -### SignatureParameterSInvalid - -```solidity -error SignatureParameterSInvalid() -``` - -It is emitted if the signature is invalid due to S parameter. - -### SignatureParameterVInvalid - -```solidity -error SignatureParameterVInvalid(uint8 v) -``` - -It is emitted if the signature is invalid due to V parameter. - -#### Parameters - -| Name | Type | Description | -| ---- | ----- | ----------- | -| v | uint8 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md deleted file mode 100644 index b832744e..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ICreatorFeeManager.md +++ /dev/null @@ -1,60 +0,0 @@ -# ICreatorFeeManager - -_LooksRare protocol team (👀,💎)_ - -> ICreatorFeeManager - -## Methods - -### royaltyFeeRegistry - -```solidity -function royaltyFeeRegistry() external view returns (contract IRoyaltyFeeRegistry royaltyFeeRegistry) -``` - -It returns the royalty fee registry address/interface. - -#### Returns - -| Name | Type | Description | -| ------------------ | ---------------------------- | ------------------------------------- | -| royaltyFeeRegistry | contract IRoyaltyFeeRegistry | Interface of the royalty fee registry | - -### viewCreatorFeeInfo - -```solidity -function viewCreatorFeeInfo(address collection, uint256 price, uint256[] itemIds) external view returns (address creator, uint256 creatorFeeAmount) -``` - -This function returns the creator address and calculates the creator fee amount. - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | -| itemIds | uint256[] | Array of item ids | - -#### Returns - -| Name | Type | Description | -| ---------------- | ------- | ------------------ | -| creator | address | Creator address | -| creatorFeeAmount | uint256 | Creator fee amount | - -## Errors - -### BundleEIP2981NotAllowed - -```solidity -error BundleEIP2981NotAllowed(address collection) -``` - -It is returned if the bundle contains multiple itemIds with different creator fee structure. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| collection | address | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md deleted file mode 100644 index da683d8c..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ICurrencyManager.md +++ /dev/null @@ -1,22 +0,0 @@ -# ICurrencyManager - -_LooksRare protocol team (👀,💎)_ - -> ICurrencyManager - -## Events - -### CurrencyStatusUpdated - -```solidity -event CurrencyStatusUpdated(address currency, bool isAllowed) -``` - -It is emitted if the currency status in the allowlist is updated. - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------------------------------- | -| currency | address | Currency address (address(0) = ETH) | -| isAllowed | bool | Whether the currency is allowed | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md deleted file mode 100644 index 0e86c75b..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IExecutionManager.md +++ /dev/null @@ -1,99 +0,0 @@ -# IExecutionManager - -_LooksRare protocol team (👀,💎)_ - -> IExecutionManager - -## Events - -### NewCreatorFeeManager - -```solidity -event NewCreatorFeeManager(address creatorFeeManager) -``` - -It is issued when there is a new creator fee manager. - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | -------------------------------------- | -| creatorFeeManager | address | Address of the new creator fee manager | - -### NewMaxCreatorFeeBp - -```solidity -event NewMaxCreatorFeeBp(uint256 maxCreatorFeeBp) -``` - -It is issued when there is a new maximum creator fee (in basis point). - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ---------------------------------------- | -| maxCreatorFeeBp | uint256 | New maximum creator fee (in basis point) | - -### NewProtocolFeeRecipient - -```solidity -event NewProtocolFeeRecipient(address protocolFeeRecipient) -``` - -It is issued when there is a new protocol fee recipient address. - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------------------------------------- | -| protocolFeeRecipient | address | Address of the new protocol fee recipient | - -## Errors - -### CreatorFeeBpTooHigh - -```solidity -error CreatorFeeBpTooHigh() -``` - -It is returned if the creator fee (in basis point) is too high. - -### NewProtocolFeeRecipientCannotBeNullAddress - -```solidity -error NewProtocolFeeRecipientCannotBeNullAddress() -``` - -It is returned if the new protocol fee recipient is set to address(0). - -### NoSelectorForStrategy - -```solidity -error NoSelectorForStrategy() -``` - -It is returned if there is no selector for maker ask/bid for a given strategyId, depending on the quote type. - -### OutsideOfTimeRange - -```solidity -error OutsideOfTimeRange() -``` - -It is returned if the current block timestamp is not between start and end times in the maker order. - -### StrategyNotAvailable - -```solidity -error StrategyNotAvailable(uint256 strategyId) -``` - -It is returned if the strategy id has no implementation. - -_It is returned if there is no implementation address and the strategyId is strictly greater than 0._ - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ----------- | -| strategyId | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md deleted file mode 100644 index 393cb24b..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IImmutableCreate2Factory.md +++ /dev/null @@ -1,41 +0,0 @@ -# IImmutableCreate2Factory - -## Methods - -### findCreate2Address - -```solidity -function findCreate2Address(bytes32 salt, bytes initializationCode) external view returns (address deploymentAddress) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| salt | bytes32 | undefined | -| initializationCode | bytes | undefined | - -#### Returns - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| deploymentAddress | address | undefined | - -### safeCreate2 - -```solidity -function safeCreate2(bytes32 salt, bytes initializationCode) external payable returns (address deploymentAddress) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| salt | bytes32 | undefined | -| initializationCode | bytes | undefined | - -#### Returns - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| deploymentAddress | address | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md deleted file mode 100644 index e7414f54..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ILooksRareProtocol.md +++ /dev/null @@ -1,157 +0,0 @@ -# ILooksRareProtocol - -_LooksRare protocol team (👀,💎)_ - -> ILooksRareProtocol - -## Methods - -### executeMultipleTakerBids - -```solidity -function executeMultipleTakerBids(OrderStructs.Taker[] takerBids, OrderStructs.Maker[] makerAsks, bytes[] makerSignatures, OrderStructs.MerkleTree[] merkleTrees, bool isAtomic) external payable -``` - -#### Parameters - -| Name | Type | Description | -| --------------- | ------------------------- | ----------- | -| takerBids | OrderStructs.Taker[] | undefined | -| makerAsks | OrderStructs.Maker[] | undefined | -| makerSignatures | bytes[] | undefined | -| merkleTrees | OrderStructs.MerkleTree[] | undefined | -| isAtomic | bool | undefined | - -### executeTakerAsk - -```solidity -function executeTakerAsk(OrderStructs.Taker takerAsk, OrderStructs.Maker makerBid, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerAsk | OrderStructs.Taker | undefined | -| makerBid | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -### executeTakerBid - -```solidity -function executeTakerBid(OrderStructs.Taker takerBid, OrderStructs.Maker makerAsk, bytes makerSignature, OrderStructs.MerkleTree merkleTree) external payable -``` - -#### Parameters - -| Name | Type | Description | -| -------------- | ----------------------- | ----------- | -| takerBid | OrderStructs.Taker | undefined | -| makerAsk | OrderStructs.Maker | undefined | -| makerSignature | bytes | undefined | -| merkleTree | OrderStructs.MerkleTree | undefined | - -## Events - -### NewDomainSeparator - -```solidity -event NewDomainSeparator() -``` - -It is emitted if there is a change in the domain separator. - -### NewGasLimitETHTransfer - -```solidity -event NewGasLimitETHTransfer(uint256 gasLimitETHTransfer) -``` - -It is emitted when there is a new gas limit for a ETH transfer (before it is wrapped to WETH). - -#### Parameters - -| Name | Type | Description | -| ------------------- | ------- | ----------------------------- | -| gasLimitETHTransfer | uint256 | Gas limit for an ETH transfer | - -### TakerAsk - -```solidity -event TakerAsk(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address askUser, address bidUser, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker ask transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | -| askUser | address | Address of the ask user | -| bidUser | address | Address of the bid user | -| strategyId | uint256 | Id of the strategy | -| currency | address | Address of the currency | -| collection | address | Address of the collection | -| itemIds | uint256[] | Array of item ids | -| amounts | uint256[] | Array of amounts (for item ids) | -| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it can be the taker ask user or different) feeRecipients[1] Creator fee recipient (if none, address(0)) | -| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | - -### TakerBid - -```solidity -event TakerBid(ILooksRareProtocol.NonceInvalidationParameters nonceInvalidationParameters, address bidUser, address bidRecipient, uint256 strategyId, address currency, address collection, uint256[] itemIds, uint256[] amounts, address[2] feeRecipients, uint256[3] feeAmounts) -``` - -It is emitted when a taker bid transaction is completed. - -#### Parameters - -| Name | Type | Description | -| --------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| nonceInvalidationParameters | ILooksRareProtocol.NonceInvalidationParameters | Struct about nonce invalidation parameters | -| bidUser | address | Address of the bid user | -| bidRecipient | address | Address of the recipient of the bid | -| strategyId | uint256 | Id of the strategy | -| currency | address | Address of the currency | -| collection | address | Address of the collection | -| itemIds | uint256[] | Array of item ids | -| amounts | uint256[] | Array of amounts (for item ids) | -| feeRecipients | address[2] | Array of fee recipients feeRecipients[0] User who receives the proceeds of the sale (it is the maker ask user) feeRecipients[1] Creator fee recipient (if none, address(0)) | -| feeAmounts | uint256[3] | Array of fee amounts feeAmounts[0] Fee amount for the user receiving sale proceeds feeAmounts[1] Creator fee amount feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment | - -## Errors - -### ChainIdInvalid - -```solidity -error ChainIdInvalid() -``` - -It is returned if the domain separator should change. - -### NewGasLimitETHTransferTooLow - -```solidity -error NewGasLimitETHTransferTooLow() -``` - -It is returned if the gas limit for a standard ETH transfer is too low. - -### NoncesInvalid - -```solidity -error NoncesInvalid() -``` - -It is returned if the nonces are invalid. - -### SameDomainSeparator - -```solidity -error SameDomainSeparator() -``` - -It is returned if the domain separator cannot be updated (i.e. the chainId is the same). diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/INonceManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/INonceManager.md deleted file mode 100644 index eaa3f977..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/INonceManager.md +++ /dev/null @@ -1,53 +0,0 @@ -# INonceManager - -_LooksRare protocol team (👀,💎)_ - -> INonceManager - -## Events - -### NewBidAskNonces - -```solidity -event NewBidAskNonces(address user, uint256 bidNonce, uint256 askNonce) -``` - -It is emitted when there is an update of the global bid/ask nonces for a user. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ------------------- | -| user | address | Address of the user | -| bidNonce | uint256 | New bid nonce | -| askNonce | uint256 | New ask nonce | - -### OrderNoncesCancelled - -```solidity -event OrderNoncesCancelled(address user, uint256[] orderNonces) -``` - -It is emitted when order nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ----------- | --------- | ------------------------------- | -| user | address | Address of the user | -| orderNonces | uint256[] | Array of order nonces cancelled | - -### SubsetNoncesCancelled - -```solidity -event SubsetNoncesCancelled(address user, uint256[] subsetNonces) -``` - -It is emitted when subset nonces are cancelled for a user. - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | -------------------------------- | -| user | address | Address of the user | -| subsetNonces | uint256[] | Array of subset nonces cancelled | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md deleted file mode 100644 index 5ed0ef6c..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IRoyaltyFeeRegistry.md +++ /dev/null @@ -1,29 +0,0 @@ -# IRoyaltyFeeRegistry - -_LooksRare protocol team (👀,💎)_ - -> IRoyaltyFeeRegistry - -## Methods - -### royaltyInfo - -```solidity -function royaltyInfo(address collection, uint256 price) external view returns (address receiver, uint256 royaltyFee) -``` - -This function returns the royalty information for a collection at a given transaction price. - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ------------------ | -| collection | address | Collection address | -| price | uint256 | Transaction price | - -#### Returns - -| Name | Type | Description | -| ---------- | ------- | ------------------ | -| receiver | address | Receiver address | -| royaltyFee | uint256 | Royalty fee amount | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IStrategy.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IStrategy.md deleted file mode 100644 index 2b4a45bc..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IStrategy.md +++ /dev/null @@ -1,41 +0,0 @@ -# IStrategy - -_LooksRare protocol team (👀,💎)_ - -> IStrategy - -## Methods - -### isLooksRareV2Strategy - -```solidity -function isLooksRareV2Strategy() external pure returns (bool isStrategy) -``` - -This function acts as a safety check for the protocol's owner when adding new execution strategies. - -#### Returns - -| Name | Type | Description | -| ---------- | ---- | ---------------------------------------------- | -| isStrategy | bool | Whether it is a LooksRare V2 protocol strategy | - -### isMakerOrderValid - -```solidity -function isMakerOrderValid(OrderStructs.Maker makerOrder, bytes4 functionSelector) external view returns (bool isValid, bytes4 errorSelector) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------------------ | ----------- | -| makerOrder | OrderStructs.Maker | undefined | -| functionSelector | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ------------- | ------ | ----------- | -| isValid | bool | undefined | -| errorSelector | bytes4 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md deleted file mode 100644 index ae6ea7b1..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/IStrategyManager.md +++ /dev/null @@ -1,84 +0,0 @@ -# IStrategyManager - -_LooksRare protocol team (👀,💎)_ - -> IStrategyManager - -## Events - -### NewStrategy - -```solidity -event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) -``` - -It is emitted when a new strategy is added. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | ---------------------------------------------------- | -| strategyId | uint256 | Id of the new strategy | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | -| maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) | -| selector | bytes4 | Function selector for the transaction to be executed | -| isMakerBid | bool | Whether the strategyId is for maker bid | -| implementation | address | Address of the implementation of the strategy | - -### StrategyUpdated - -```solidity -event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp) -``` - -It is emitted when an existing strategy is updated. - -#### Parameters - -| Name | Type | Description | -| --------------------- | ------- | -------------------------------------------------------- | -| strategyId | uint256 | Id of the strategy | -| isActive | bool | Whether the strategy is active (or not) after the update | -| standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) | -| minTotalFeeBp | uint16 | Minimum total fee (in basis point) | - -## Errors - -### NotV2Strategy - -```solidity -error NotV2Strategy() -``` - -If the strategy has not set properly its implementation contract. - -_It can only be returned for owner operations._ - -### StrategyHasNoSelector - -```solidity -error StrategyHasNoSelector() -``` - -It is returned if the strategy has no selector. - -_It can only be returned for owner operations._ - -### StrategyNotUsed - -```solidity -error StrategyNotUsed() -``` - -It is returned if the strategyId is invalid. - -### StrategyProtocolFeeTooHigh - -```solidity -error StrategyProtocolFeeTooHigh() -``` - -It is returned if the strategy's protocol fee is too high. - -_It can only be returned for owner operations._ diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md deleted file mode 100644 index 3ba8ca81..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/interfaces/ITransferManager.md +++ /dev/null @@ -1,111 +0,0 @@ -# ITransferManager - -_LooksRare protocol team (👀,💎)_ - -> ITransferManager - -## Events - -### ApprovalsGranted - -```solidity -event ApprovalsGranted(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are granted by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| user | address | Address of the user | -| operators | address[] | Array of operator addresses | - -### ApprovalsRemoved - -```solidity -event ApprovalsRemoved(address user, address[] operators) -``` - -It is emitted if operators' approvals to transfer NFTs are revoked by a user. - -#### Parameters - -| Name | Type | Description | -| --------- | --------- | --------------------------- | -| user | address | Address of the user | -| operators | address[] | Array of operator addresses | - -### OperatorAllowed - -```solidity -event OperatorAllowed(address operator) -``` - -It is emitted if a new operator is added to the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ---------------- | -| operator | address | Operator address | - -### OperatorRemoved - -```solidity -event OperatorRemoved(address operator) -``` - -It is emitted if an operator is removed from the global allowlist. - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ---------------- | -| operator | address | Operator address | - -## Errors - -### OperatorAlreadyAllowed - -```solidity -error OperatorAlreadyAllowed() -``` - -It is returned if the transfer caller is already allowed by the owner. - -_This error can only be returned for owner operations._ - -### OperatorAlreadyApprovedByUser - -```solidity -error OperatorAlreadyApprovedByUser() -``` - -It is returned if the operator to approve has already been approved by the user. - -### OperatorNotAllowed - -```solidity -error OperatorNotAllowed() -``` - -It is returned if the operator to approve is not in the global allowlist defined by the owner. - -_This error can be returned if the user tries to grant approval to an operator address not in the allowlist or if the owner tries to remove the operator from the global allowlist._ - -### OperatorNotApprovedByUser - -```solidity -error OperatorNotApprovedByUser() -``` - -It is returned if the operator to revoke has not been previously approved by the user. - -### TransferCallerInvalid - -```solidity -error TransferCallerInvalid() -``` - -It is returned if the transfer caller is invalid. For a transfer called to be valid, the operator must be in the global allowlist and approved by the 'from' user. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md deleted file mode 100644 index 1b1f41a2..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/CurrencyValidator.md +++ /dev/null @@ -1,7 +0,0 @@ -# CurrencyValidator - -_LooksRare protocol team (👀,💎)_ - -> CurrencyValidator - -This library validates the order currency to be the chain's native currency or the specified ERC20 token. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md deleted file mode 100644 index 5951cc56..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/LowLevelHypercertCaller.md +++ /dev/null @@ -1,21 +0,0 @@ -# LowLevelHypercertCaller - -_bitbeckers_ - -> LowLevelHypercertCaller - -This contract contains low-level calls to transfer ERC1155 tokens. - -## Errors - -### HypercertSplitFractionError - -```solidity -error HypercertSplitFractionError() -``` - -### NotAContract - -```solidity -error NotAContract() -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md deleted file mode 100644 index 943a54cd..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofCalldataWithNodes.md +++ /dev/null @@ -1,7 +0,0 @@ -# MerkleProofCalldataWithNodes - -_OpenZeppelin (adjusted by LooksRare)_ - -> MerkleProofCalldataWithNodes - -This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md deleted file mode 100644 index 37529181..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OpenZeppelin/MerkleProofMemory.md +++ /dev/null @@ -1,7 +0,0 @@ -# MerkleProofMemory - -_OpenZeppelin (adjusted by LooksRare)_ - -> MerkleProofMemory - -This library is adjusted from the work of OpenZeppelin. It is based on the 4.7.0 (utils/cryptography/MerkleProof.sol). diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OrderStructs.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OrderStructs.md deleted file mode 100644 index 6ffa83e2..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/OrderStructs.md +++ /dev/null @@ -1,7 +0,0 @@ -# OrderStructs - -_LooksRare protocol team (👀,💎); bitbeckers_ - -> OrderStructs - -This library contains all order struct types for the LooksRare protocol (v2). diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/RoyaltyFeeRegistry.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/RoyaltyFeeRegistry.md deleted file mode 100644 index 781ab041..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/marketplace/libraries/RoyaltyFeeRegistry.md +++ /dev/null @@ -1,172 +0,0 @@ -# RoyaltyFeeRegistry - -> RoyaltyFeeRegistry - -It is a royalty fee registry for the LooksRare exchange. - -## Methods - -### owner - -```solidity -function owner() external view returns (address) -``` - -_Returns the address of the current owner._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - -_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner._ - -### royaltyFeeInfoCollection - -```solidity -function royaltyFeeInfoCollection(address collection) external view returns (address, address, uint256) -``` - -View royalty info for a collection address - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ------------------ | -| collection | address | collection address | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | -| \_1 | address | undefined | -| \_2 | uint256 | undefined | - -### royaltyFeeLimit - -```solidity -function royaltyFeeLimit() external view returns (uint256) -``` - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### royaltyInfo - -```solidity -function royaltyInfo(address collection, uint256 amount) external view returns (address, uint256) -``` - -Calculate royalty info for a collection address and a sale gross amount - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ------------------ | -| collection | address | collection address | -| amount | uint256 | amount | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | --------------------------------------------------------- | -| \_0 | address | receiver address and amount received by royalty recipient | -| \_1 | uint256 | undefined | - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - -_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### updateRoyaltyFeeLimit - -```solidity -function updateRoyaltyFeeLimit(uint256 _royaltyFeeLimit) external nonpayable -``` - -Update royalty info for collection - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | --------------------------------------------- | -| \_royaltyFeeLimit | uint256 | new royalty fee limit (500 = 5%, 1,000 = 10%) | - -### updateRoyaltyInfoForCollection - -```solidity -function updateRoyaltyInfoForCollection(address collection, address setter, address receiver, uint256 fee) external nonpayable -``` - -Update royalty info for collection - -#### Parameters - -| Name | Type | Description | -| ---------- | ------- | ------------------------------ | -| collection | address | address of the NFT contract | -| setter | address | address that sets the receiver | -| receiver | address | receiver for the royalty fee | -| fee | uint256 | fee (500 = 5%, 1,000 = 10%) | - -## Events - -### NewRoyaltyFeeLimit - -```solidity -event NewRoyaltyFeeLimit(uint256 royaltyFeeLimit) -``` - -#### Parameters - -| Name | Type | Description | -| --------------- | ------- | ----------- | -| royaltyFeeLimit | uint256 | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ----------- | -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### RoyaltyFeeUpdate - -```solidity -event RoyaltyFeeUpdate(address indexed collection, address indexed setter, address indexed receiver, uint256 fee) -``` - -#### Parameters - -| Name | Type | Description | -| -------------------- | ------- | ----------- | -| collection `indexed` | address | undefined | -| setter `indexed` | address | undefined | -| receiver `indexed` | address | undefined | -| fee | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/AllowlistMinter.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/AllowlistMinter.md deleted file mode 100644 index ed412b6b..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/AllowlistMinter.md +++ /dev/null @@ -1,102 +0,0 @@ -# AllowlistMinter - -_bitbeckers_ - -> Interface for hypercert token interactions - -This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) - -## Methods - -### getMinted - -```solidity -function getMinted(uint256 claimID) external view returns (uint256 mintedUnits) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| claimID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----------- | ------- | ----------- | -| mintedUnits | uint256 | undefined | - -### hasBeenClaimed - -```solidity -function hasBeenClaimed(uint256, bytes32) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | -| \_1 | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### isAllowedToClaim - -```solidity -function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| proof | bytes32[] | undefined | -| claimID | uint256 | undefined | -| leaf | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| --------- | ---- | ----------- | -| isAllowed | bool | undefined | - -## Events - -### AllowlistCreated - -```solidity -event AllowlistCreated(uint256 tokenID, bytes32 root) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| root | bytes32 | undefined | - -### LeafClaimed - -```solidity -event LeafClaimed(uint256 tokenID, bytes32 leaf) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| leaf | bytes32 | undefined | - -## Errors - -### DoesNotExist - -```solidity -error DoesNotExist() -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/HypercertMinter.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/HypercertMinter.md deleted file mode 100644 index b2780935..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/HypercertMinter.md +++ /dev/null @@ -1,913 +0,0 @@ -# HypercertMinter - -_bitbeckers_ - -> Contract for managing hypercert claims and whitelists - -Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.This contract supports whitelisted minting via { AllowlistMinter }. - -_Wrapper contract to expose and chain functions._ - -## Methods - -### \_\_SemiFungible1155_init - -```solidity -function __SemiFungible1155_init() external nonpayable -``` - -_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - -_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - -_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | --------- | ----------- | -| \_0 | uint256[] | undefined | - -### batchBurnFraction - -```solidity -function batchBurnFraction(address _account, uint256[] _tokenIDs) external nonpayable -``` - -Burn a claimtoken - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ---------- | --------- | ----------- | -| \_account | address | undefined | -| \_tokenIDs | uint256[] | undefined | - -### batchMintClaimsFromAllowlists - -```solidity -function batchMintClaimsFromAllowlists(address account, bytes32[][] proofs, uint256[] claimIDs, uint256[] units) external nonpayable -``` - -Mint semi-fungible tokens representing a fraction of the claims in `claimIDs` - -_Calls AllowlistMinter to verify `proofs`.Mints the `amount` of units for the hypercert stored under `claimIDs`_ - -#### Parameters - -| Name | Type | Description | -| -------- | ----------- | ----------- | -| account | address | undefined | -| proofs | bytes32[][] | undefined | -| claimIDs | uint256[] | undefined | -| units | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256) external nonpayable -``` - -Burn a claimtoken; override is needed to update units/values - -_see {ERC1155Burnable}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | -| \_2 | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[]) external nonpayable -``` - -Batch burn claimtokens; override is needed to update units/values - -_see {ERC1155Burnable}_ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| account | address | undefined | -| ids | uint256[] | undefined | -| \_2 | uint256[] | undefined | - -### burnFraction - -```solidity -function burnFraction(address _account, uint256 _tokenID) external nonpayable -``` - -Burn a claimtoken - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| --------- | ------- | ----------- | -| \_account | address | undefined | -| \_tokenID | uint256 | undefined | - -### createAllowlist - -```solidity -function createAllowlist(address account, uint256 units, bytes32 merkleRoot, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -Register a claim and the whitelist for minting token(s) belonging to that claim - -_Calls SemiFungible1155 to store the claim referenced in `uri` with amount of `units`Calls AllowlistMinter to store the `merkleRoot` as proof to authorize claims_ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| merkleRoot | bytes32 | undefined | -| \_uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### getMinted - -```solidity -function getMinted(uint256 claimID) external view returns (uint256 mintedUnits) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| claimID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----------- | ------- | ----------- | -| mintedUnits | uint256 | undefined | - -### hasBeenClaimed - -```solidity -function hasBeenClaimed(uint256, bytes32) external view returns (bool) -``` - -#### Parameters - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | -| \_1 | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### initialize - -```solidity -function initialize() external nonpayable -``` - -_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ - -### isAllowedToClaim - -```solidity -function isAllowedToClaim(bytes32[] proof, uint256 claimID, bytes32 leaf) external view returns (bool isAllowed) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| proof | bytes32[] | undefined | -| claimID | uint256 | undefined | -| leaf | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| --------- | ---- | ----------- | -| isAllowed | bool | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - -_See {IERC1155-isApprovedForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### mergeFractions - -```solidity -function mergeFractions(address _account, uint256[] _fractionIDs) external nonpayable -``` - -Merge the value of tokens belonging to the same claim - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------------- | --------- | ----------- | -| \_account | address | undefined | -| \_fractionIDs | uint256[] | undefined | - -### mintClaim - -```solidity -function mintClaim(address account, uint256 units, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -Mint a semi-fungible token for the impact claim referenced via `uri` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| \_uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### mintClaimFromAllowlist - -```solidity -function mintClaimFromAllowlist(address account, bytes32[] proof, uint256 claimID, uint256 units) external nonpayable -``` - -Mint a semi-fungible token representing a fraction of the claim - -_Calls AllowlistMinter to verify `proof`.Mints the `amount` of units for the hypercert stored under `claimID`_ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| account | address | undefined | -| proof | bytes32[] | undefined | -| claimID | uint256 | undefined | -| units | uint256 | undefined | - -### mintClaimWithFractions - -```solidity -function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string _uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -Mint semi-fungible tokens for the impact claim referenced via `uri` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| fractions | uint256[] | undefined | -| \_uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### name - -```solidity -function name() external view returns (string) -``` - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | string | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -_Returns the address of the current owner._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenID) external view returns (address _owner) -``` - -_Returns the owner of a given token ID._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------------------------- | -| tokenID | uint256 | The ID of the token to query. | - -#### Returns - -| Name | Type | Description | -| ------- | ------- | -------------------------------------- | -| \_owner | address | The address of the owner of the token. | - -### pause - -```solidity -function pause() external nonpayable -``` - -PAUSABLE - -### paused - -```solidity -function paused() external view returns (bool) -``` - -_Returns true if the contract is paused, and false otherwise._ - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### proxiableUUID - -```solidity -function proxiableUUID() external view returns (bytes32) -``` - -_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### readTransferRestriction - -```solidity -function readTransferRestriction(uint256 tokenID) external view returns (string) -``` - -TRANSFER RESTRICTIONS - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------ | ----------- | -| \_0 | string | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - -_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - -_See {IERC1155-safeBatchTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - -_See {IERC1155-safeTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - -_See {IERC1155-setApprovalForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | -| approved | bool | undefined | - -### splitFraction - -```solidity -function splitFraction(address _account, uint256 _tokenID, uint256[] _newFractions) external nonpayable -``` - -Split a claimtokens value into parts with summed value equal to the original - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| -------------- | --------- | ----------- | -| \_account | address | undefined | -| \_tokenID | uint256 | undefined | -| \_newFractions | uint256[] | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - -_See {IERC165-supportsInterface}._ - -#### Parameters - -| Name | Type | Description | -| ----------- | ------ | ----------- | -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - -_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### unitsOf - -```solidity -function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) -``` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### unitsOf - -```solidity -function unitsOf(uint256 tokenID) external view returns (uint256 units) -``` - -_see {IHypercertToken}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### unpause - -```solidity -function unpause() external nonpayable -``` - -### upgradeTo - -```solidity -function upgradeTo(address newImplementation) external nonpayable -``` - -_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | - -### upgradeToAndCall - -```solidity -function upgradeToAndCall(address newImplementation, bytes data) external payable -``` - -_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | -| data | bytes | undefined | - -### uri - -```solidity -function uri(uint256 tokenID) external view returns (string _uri) -``` - -_see { IHypercertMetadata}_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------ | ----------- | -| \_uri | string | undefined | - -## Events - -### AdminChanged - -```solidity -event AdminChanged(address previousAdmin, address newAdmin) -``` - -#### Parameters - -| Name | Type | Description | -| ------------- | ------- | ----------- | -| previousAdmin | address | undefined | -| newAdmin | address | undefined | - -### AllowlistCreated - -```solidity -event AllowlistCreated(uint256 tokenID, bytes32 root) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| root | bytes32 | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### BatchValueTransfer - -```solidity -event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) -``` - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| claimIDs | uint256[] | undefined | -| fromTokenIDs | uint256[] | undefined | -| toTokenIDs | uint256[] | undefined | -| values | uint256[] | undefined | - -### BeaconUpgraded - -```solidity -event BeaconUpgraded(address indexed beacon) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------- | ----------- | -| beacon `indexed` | address | undefined | - -### ClaimStored - -```solidity -event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| claimID `indexed` | uint256 | undefined | -| uri | string | undefined | -| totalUnits | uint256 | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ----- | ----------- | -| version | uint8 | undefined | - -### LeafClaimed - -```solidity -event LeafClaimed(uint256 tokenID, bytes32 leaf) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | -| leaf | bytes32 | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ----------- | -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### Paused - -```solidity -event Paused(address account) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - -#### Parameters - -| Name | Type | Description | -| ------------ | ------- | ----------- | -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Unpaused - -```solidity -event Unpaused(address account) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | - -### Upgraded - -```solidity -event Upgraded(address indexed implementation) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------------ | ------- | ----------- | -| implementation `indexed` | address | undefined | - -### ValueTransfer - -```solidity -event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) -``` - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ----------- | -| claimID | uint256 | undefined | -| fromTokenID | uint256 | undefined | -| toTokenID | uint256 | undefined | -| value | uint256 | undefined | - -## Errors - -### AlreadyClaimed - -```solidity -error AlreadyClaimed() -``` - -### ArraySize - -```solidity -error ArraySize() -``` - -### DoesNotExist - -```solidity -error DoesNotExist() -``` - -### DuplicateEntry - -```solidity -error DuplicateEntry() -``` - -### Invalid - -```solidity -error Invalid() -``` - -### NotAllowed - -```solidity -error NotAllowed() -``` - -### NotApprovedOrOwner - -```solidity -error NotApprovedOrOwner() -``` - -### TransfersNotAllowed - -```solidity -error TransfersNotAllowed() -``` - -### TypeMismatch - -```solidity -error TypeMismatch() -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/SemiFungible1155.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/SemiFungible1155.md deleted file mode 100644 index a4086e37..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/SemiFungible1155.md +++ /dev/null @@ -1,457 +0,0 @@ -# SemiFungible1155 - -_bitbeckers_ - -> Contract for minting semi-fungible EIP1155 tokens - -Extends { Upgradeable1155 } token with semi-fungible properties and the concept of `units` - -_Adds split bit strategy as described in [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155#non-fungible-tokens)_ - -## Methods - -### \_\_SemiFungible1155_init - -```solidity -function __SemiFungible1155_init() external nonpayable -``` - -_see { openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol }_ - -### balanceOf - -```solidity -function balanceOf(address account, uint256 id) external view returns (uint256) -``` - -_See {IERC1155-balanceOf}. Requirements: - `account` cannot be the zero address._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | uint256 | undefined | - -### balanceOfBatch - -```solidity -function balanceOfBatch(address[] accounts, uint256[] ids) external view returns (uint256[]) -``` - -_See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| accounts | address[] | undefined | -| ids | uint256[] | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | --------- | ----------- | -| \_0 | uint256[] | undefined | - -### burn - -```solidity -function burn(address account, uint256 id, uint256 value) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### burnBatch - -```solidity -function burnBatch(address account, uint256[] ids, uint256[] values) external nonpayable -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| account | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### isApprovedForAll - -```solidity -function isApprovedForAll(address account, address operator) external view returns (bool) -``` - -_See {IERC1155-isApprovedForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| account | address | undefined | -| operator | address | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### owner - -```solidity -function owner() external view returns (address) -``` - -_Returns the address of the current owner._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | address | undefined | - -### ownerOf - -```solidity -function ownerOf(uint256 tokenID) external view returns (address _owner) -``` - -_Returns the owner of a given token ID._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------------------------- | -| tokenID | uint256 | The ID of the token to query. | - -#### Returns - -| Name | Type | Description | -| ------- | ------- | -------------------------------------- | -| \_owner | address | The address of the owner of the token. | - -### proxiableUUID - -```solidity -function proxiableUUID() external view returns (bytes32) -``` - -_Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier._ - -#### Returns - -| Name | Type | Description | -| ---- | ------- | ----------- | -| \_0 | bytes32 | undefined | - -### renounceOwnership - -```solidity -function renounceOwnership() external nonpayable -``` - -_Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner._ - -### safeBatchTransferFrom - -```solidity -function safeBatchTransferFrom(address from, address to, uint256[] ids, uint256[] amounts, bytes data) external nonpayable -``` - -_See {IERC1155-safeBatchTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| ids | uint256[] | undefined | -| amounts | uint256[] | undefined | -| data | bytes | undefined | - -### safeTransferFrom - -```solidity -function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes data) external nonpayable -``` - -_See {IERC1155-safeTransferFrom}._ - -#### Parameters - -| Name | Type | Description | -| ------ | ------- | ----------- | -| from | address | undefined | -| to | address | undefined | -| id | uint256 | undefined | -| amount | uint256 | undefined | -| data | bytes | undefined | - -### setApprovalForAll - -```solidity -function setApprovalForAll(address operator, bool approved) external nonpayable -``` - -_See {IERC1155-setApprovalForAll}._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| operator | address | undefined | -| approved | bool | undefined | - -### supportsInterface - -```solidity -function supportsInterface(bytes4 interfaceId) external view returns (bool) -``` - -_See {IERC165-supportsInterface}._ - -#### Parameters - -| Name | Type | Description | -| ----------- | ------ | ----------- | -| interfaceId | bytes4 | undefined | - -#### Returns - -| Name | Type | Description | -| ---- | ---- | ----------- | -| \_0 | bool | undefined | - -### transferOwnership - -```solidity -function transferOwnership(address newOwner) external nonpayable -``` - -_Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner._ - -#### Parameters - -| Name | Type | Description | -| -------- | ------- | ----------- | -| newOwner | address | undefined | - -### upgradeTo - -```solidity -function upgradeTo(address newImplementation) external nonpayable -``` - -_Upgrade the implementation of the proxy to `newImplementation`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | - -### upgradeToAndCall - -```solidity -function upgradeToAndCall(address newImplementation, bytes data) external payable -``` - -_Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call encoded in `data`. Calls {\_authorizeUpgrade}. Emits an {Upgraded} event._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| newImplementation | address | undefined | -| data | bytes | undefined | - -### uri - -```solidity -function uri(uint256 tokenID) external view returns (string _uri) -``` - -_Returns the metadata URI for a given token ID.This function retrieves the metadata URI for the specified token ID by calling the `uri` function of the `ERC1155URIStorageUpgradeable` contract.The metadata URI is a string that points to a JSON file containing information about the token, such as its name, symbol, and image.This function always returns the URI for the basetype so that it's managed in one place._ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------------------------------------------------- | -| tokenID | uint256 | The ID of the token to retrieve the metadata URI for. | - -#### Returns - -| Name | Type | Description | -| ----- | ------ | -------------------------------------------- | -| \_uri | string | The metadata URI for the specified token ID. | - -## Events - -### AdminChanged - -```solidity -event AdminChanged(address previousAdmin, address newAdmin) -``` - -#### Parameters - -| Name | Type | Description | -| ------------- | ------- | ----------- | -| previousAdmin | address | undefined | -| newAdmin | address | undefined | - -### ApprovalForAll - -```solidity -event ApprovalForAll(address indexed account, address indexed operator, bool approved) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| account `indexed` | address | undefined | -| operator `indexed` | address | undefined | -| approved | bool | undefined | - -### BatchValueTransfer - -```solidity -event BatchValueTransfer(uint256[] claimIDs, uint256[] fromTokenIDs, uint256[] toTokenIDs, uint256[] values) -``` - -_Emitted on transfer of `values` between `fromTokenIDs` to `toTokenIDs` of `claimIDs`_ - -#### Parameters - -| Name | Type | Description | -| ------------ | --------- | ----------- | -| claimIDs | uint256[] | undefined | -| fromTokenIDs | uint256[] | undefined | -| toTokenIDs | uint256[] | undefined | -| values | uint256[] | undefined | - -### BeaconUpgraded - -```solidity -event BeaconUpgraded(address indexed beacon) -``` - -#### Parameters - -| Name | Type | Description | -| ---------------- | ------- | ----------- | -| beacon `indexed` | address | undefined | - -### Initialized - -```solidity -event Initialized(uint8 version) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | ----- | ----------- | -| version | uint8 | undefined | - -### OwnershipTransferred - -```solidity -event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -``` - -#### Parameters - -| Name | Type | Description | -| ----------------------- | ------- | ----------- | -| previousOwner `indexed` | address | undefined | -| newOwner `indexed` | address | undefined | - -### TransferBatch - -```solidity -event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | --------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| ids | uint256[] | undefined | -| values | uint256[] | undefined | - -### TransferSingle - -```solidity -event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------ | ------- | ----------- | -| operator `indexed` | address | undefined | -| from `indexed` | address | undefined | -| to `indexed` | address | undefined | -| id | uint256 | undefined | -| value | uint256 | undefined | - -### URI - -```solidity -event URI(string value, uint256 indexed id) -``` - -#### Parameters - -| Name | Type | Description | -| ------------ | ------- | ----------- | -| value | string | undefined | -| id `indexed` | uint256 | undefined | - -### Upgraded - -```solidity -event Upgraded(address indexed implementation) -``` - -#### Parameters - -| Name | Type | Description | -| ------------------------ | ------- | ----------- | -| implementation `indexed` | address | undefined | - -### ValueTransfer - -```solidity -event ValueTransfer(uint256 claimID, uint256 fromTokenID, uint256 toTokenID, uint256 value) -``` - -_Emitted on transfer of `value` between `fromTokenID` to `toTokenID` of the same `claimID`_ - -#### Parameters - -| Name | Type | Description | -| ----------- | ------- | ----------- | -| claimID | uint256 | undefined | -| fromTokenID | uint256 | undefined | -| toTokenID | uint256 | undefined | -| value | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/interfaces/IAllowlist.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/interfaces/IAllowlist.md deleted file mode 100644 index 72455b43..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/interfaces/IAllowlist.md +++ /dev/null @@ -1,29 +0,0 @@ -# IAllowlist - -_bitbeckers_ - -> Interface for allowlist - -This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) - -## Methods - -### isAllowedToClaim - -```solidity -function isAllowedToClaim(bytes32[] proof, uint256 tokenID, bytes32 leaf) external view returns (bool isAllowed) -``` - -#### Parameters - -| Name | Type | Description | -| ------- | --------- | ----------- | -| proof | bytes32[] | undefined | -| tokenID | uint256 | undefined | -| leaf | bytes32 | undefined | - -#### Returns - -| Name | Type | Description | -| --------- | ---- | ----------- | -| isAllowed | bool | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md deleted file mode 100644 index 30ed6f95..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/interfaces/IHypercertToken.md +++ /dev/null @@ -1,192 +0,0 @@ -# IHypercertToken - -_bitbeckers_ - -> Interface for hypercert token interactions - -This interface declares the required functionality for a hypercert tokenThis interface does not specify the underlying token type (e.g. 721 or 1155) - -## Methods - -### batchBurnFraction - -```solidity -function batchBurnFraction(address account, uint256[] tokenIDs) external nonpayable -``` - -Operator must be allowed by `creator` and the tokens must represent the total amount of available units. - -_Function to burn the tokens at `tokenIDs` for `account`_ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| account | address | undefined | -| tokenIDs | uint256[] | undefined | - -### burnFraction - -```solidity -function burnFraction(address account, uint256 tokenID) external nonpayable -``` - -Operator must be allowed by `creator` and the token must represent the total amount of available units. - -_Function to burn the token at `tokenID` for `account`_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | - -### mergeFractions - -```solidity -function mergeFractions(address account, uint256[] tokenIDs) external nonpayable -``` - -Tokens that have been merged are burned. - -_Function called to merge tokens within `tokenIDs`._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| account | address | undefined | -| tokenIDs | uint256[] | undefined | - -### mintClaim - -```solidity -function mintClaim(address account, uint256 units, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -_Function called to store a claim referenced via `uri` with a maximum number of fractions `units`._ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### mintClaimWithFractions - -```solidity -function mintClaimWithFractions(address account, uint256 units, uint256[] fractions, string uri, enum IHypercertToken.TransferRestrictions restrictions) external nonpayable -``` - -_Function called to store a claim referenced via `uri` with a set of `fractions`.Fractions are internally summed to total units._ - -#### Parameters - -| Name | Type | Description | -| ------------ | ----------------------------------------- | ----------- | -| account | address | undefined | -| units | uint256 | undefined | -| fractions | uint256[] | undefined | -| uri | string | undefined | -| restrictions | enum IHypercertToken.TransferRestrictions | undefined | - -### splitFraction - -```solidity -function splitFraction(address account, uint256 tokenID, uint256[] _values) external nonpayable -``` - -The sum of `values` must equal the current value of `_tokenID`. - -_Function called to split `tokenID` owned by `account` into units declared in `values`._ - -#### Parameters - -| Name | Type | Description | -| -------- | --------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | -| \_values | uint256[] | undefined | - -### unitsOf - -```solidity -function unitsOf(address account, uint256 tokenID) external view returns (uint256 units) -``` - -_Returns the `units` held by `account` of a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` held by `account` for the claim is returned.If `tokenID` is a fractional token, the `units` held by `account` the token is returned_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| account | address | undefined | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### unitsOf - -```solidity -function unitsOf(uint256 tokenID) external view returns (uint256 units) -``` - -_Returns the `units` held by a (fractional) token at `claimID`If `tokenID` is a base type, the total amount of `units` for the claim is returned.If `tokenID` is a fractional token, the `units` held by the token is returned_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| ----- | ------- | ----------- | -| units | uint256 | undefined | - -### uri - -```solidity -function uri(uint256 tokenID) external view returns (string metadata) -``` - -_Returns the `uri` for metadata of the claim represented by `tokenID`Metadata must conform to { Hypercert Metadata } spec (based on ERC1155 Metadata)_ - -#### Parameters - -| Name | Type | Description | -| ------- | ------- | ----------- | -| tokenID | uint256 | undefined | - -#### Returns - -| Name | Type | Description | -| -------- | ------ | ----------- | -| metadata | string | undefined | - -## Events - -### ClaimStored - -```solidity -event ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits) -``` - -_Emitted when token with tokenID `claimID` is stored, with external data reference via `uri`._ - -#### Parameters - -| Name | Type | Description | -| ----------------- | ------- | ----------- | -| claimID `indexed` | uint256 | undefined | -| uri | string | undefined | -| totalUnits | uint256 | undefined | diff --git a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/libs/Errors.md b/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/libs/Errors.md deleted file mode 100644 index 93fe0124..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/contracts/protocol/libs/Errors.md +++ /dev/null @@ -1,59 +0,0 @@ -# Errors - -_bitbeckers_ - -## Errors - -### AlreadyClaimed - -```solidity -error AlreadyClaimed() -``` - -### ArraySize - -```solidity -error ArraySize() -``` - -### DoesNotExist - -```solidity -error DoesNotExist() -``` - -### DuplicateEntry - -```solidity -error DuplicateEntry() -``` - -### Invalid - -```solidity -error Invalid() -``` - -### NotAllowed - -```solidity -error NotAllowed() -``` - -### NotApprovedOrOwner - -```solidity -error NotApprovedOrOwner() -``` - -### TransfersNotAllowed - -```solidity -error TransfersNotAllowed() -``` - -### TypeMismatch - -```solidity -error TypeMismatch() -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/api/index.md b/docs/versioned_docs/version-1.4.1/developer/api/index.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/_category_.yml b/docs/versioned_docs/version-1.4.1/developer/api/sdk/_category_.yml deleted file mode 100644 index 5c4b05b1..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/_category_.yml +++ /dev/null @@ -1,3 +0,0 @@ -label: "API SDK" -position: 0 -collapsed: false \ No newline at end of file diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ClientError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ClientError.md deleted file mode 100644 index 085ed768..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ClientError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "ClientError" -title: "Class: ClientError" -sidebar_label: "ClientError" -sidebar_position: 0 -custom_edit_url: null ---- - -An error that is caused by a problem with the client. - -## Hierarchy - -- `Error` - - ↳ **`ClientError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new ClientError**(`message`, `payload?`): [`ClientError`](ClientError.md) - -Creates a new instance of the ClientError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`ClientError`](ClientError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:27](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L27) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:20](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L20) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ConfigurationError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ConfigurationError.md deleted file mode 100644 index 44dcd47a..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ConfigurationError.md +++ /dev/null @@ -1,196 +0,0 @@ ---- -id: "ConfigurationError" -title: "Class: ConfigurationError" -sidebar_label: "ConfigurationError" -sidebar_position: 0 -custom_edit_url: null ---- - -The configuration was invalid - -## Hierarchy - -- `Error` - - ↳ **`ConfigurationError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new ConfigurationError**(`message`, `payload?`): [`ConfigurationError`](ConfigurationError.md) - -#### Parameters - -| Name | Type | -| :--------- | :------- | -| `message` | `string` | -| `payload?` | `Object` | - -#### Returns - -[`ConfigurationError`](ConfigurationError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:188](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L188) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:187](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L187) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ContractError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ContractError.md deleted file mode 100644 index b3c1924e..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/ContractError.md +++ /dev/null @@ -1,197 +0,0 @@ ---- -id: "ContractError" -title: "Class: ContractError" -sidebar_label: "ContractError" -sidebar_position: 0 -custom_edit_url: null ---- - -An error that is returned by the contract - -## Hierarchy - -- `Error` - - ↳ **`ContractError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new ContractError**(`errorName?`, `payload?`): [`ContractError`](ContractError.md) - -#### Parameters - -| Name | Type | -| :------------- | :------------------------------ | -| `errorName?` | `string` | -| `payload?` | `Object` | -| `payload.data` | \`0x$\{string}\` \| `BaseError` | - -#### Returns - -[`ContractError`](ContractError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:43](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L43) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L41) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/FetchError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/FetchError.md deleted file mode 100644 index 80cd2ac5..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/FetchError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "FetchError" -title: "Class: FetchError" -sidebar_label: "FetchError" -sidebar_position: 0 -custom_edit_url: null ---- - -Fails fetching a remote resource - -## Hierarchy - -- `Error` - - ↳ **`FetchError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new FetchError**(`message`, `payload?`): [`FetchError`](FetchError.md) - -Creates a new instance of the FetchError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`FetchError`](FetchError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:65](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L65) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:58](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L58) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/HypercertClient.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/HypercertClient.md deleted file mode 100644 index 175836d5..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/HypercertClient.md +++ /dev/null @@ -1,874 +0,0 @@ ---- -id: "HypercertClient" -title: "Class: HypercertClient" -sidebar_label: "HypercertClient" -sidebar_position: 0 -custom_edit_url: null ---- - -The `HypercertClient` is a core class in the hypercerts SDK, providing a high-level interface to interact with the hypercerts system. - -It encapsulates the logic for storage, evaluation, indexing, and wallet interactions, abstracting the complexity and providing a simple API for users. -The client is read-only if no walletClient was found. - -**`Example`** - -```ts -const config: Partial = { - chain: { id: 11155111 }, -}; -const client = new HypercertClient(config); -``` - -**`Param`** - -The configuration options for the client. - -## Implements - -- [`HypercertClientInterface`](../interfaces/HypercertClientInterface.md) - -## Constructors - -### constructor - -• **new HypercertClient**(`config`): [`HypercertClient`](HypercertClient.md) - -Creates a new instance of the `HypercertClient` class. - -This constructor takes a `config` parameter that is used to configure the client. The `config` parameter should be a `HypercertClientConfig` object. If the public client cannot be connected, it throws a `ClientError`. - -#### Parameters - -| Name | Type | Description | -| :------- | :------------------------------------------------------------------------- | :---------------------------------------- | -| `config` | `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> | The configuration options for the client. | - -#### Returns - -[`HypercertClient`](HypercertClient.md) - -**`Throws`** - -Will throw a `ClientError` if the public client cannot be connected. - -#### Defined in - -[sdk/src/client.ts:58](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L58) - -## Properties - -### \_config - -• `Readonly` **\_config**: `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> - -#### Defined in - -[sdk/src/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L41) - ---- - -### \_evaluator - -• `Private` `Optional` **\_evaluator**: `HypercertEvaluator` - -#### Defined in - -[sdk/src/client.ts:44](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L44) - ---- - -### \_indexer - -• `Private` **\_indexer**: `HypercertIndexer` - -#### Defined in - -[sdk/src/client.ts:45](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L45) - ---- - -### \_publicClient - -• `Private` **\_publicClient**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `account` | `undefined` | The Account of the Client. | -| `batch?` | \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } | Flags for batch settings. | -| `batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `call` | (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> | Executes a new message call immediately without submitting a transaction to the network. - Docs: https://viem.sh/docs/actions/public/call.html - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) ` | -| `chain` | `undefined` \| `Chain` | Chain for the client. | -| `createBlockFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> | Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter) **`Example`** `ts import { createPublicClient, createBlockFilter, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await createBlockFilter(client) // { id: "0x345a6572337856574a76364e457a4366", type: 'block' } ` | -| `createContractEventFilter` | (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html). - Docs: https://viem.sh/docs/contract/createContractEventFilter.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), }) ` | -| `createEventFilter` | (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> | Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createEventFilter.html - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', }) ` | -| `createPendingTransactionFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> | Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' } ` | -| `estimateContractGas` | (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas.html **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gas = await client.estimateContractGas({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), functionName: 'mint', account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | -| `estimateFeesPerGas` | (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> | Returns an estimate for the fees per gas for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateFeesPerGas() // { maxFeePerGas: ..., maxPriorityFeePerGas: ... } ` | -| `estimateGas` | (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas.html - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) **`Example`** `ts import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasEstimate = await client.estimateGas({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }) ` | -| `estimateMaxPriorityFeePerGas` | (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> | Returns an estimate for the max priority fee per gas (in wei) for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() // 10000000n ` | -| `extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> | - | -| `getBalance` | (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> | Returns the balance of an address in wei. - Docs: https://viem.sh/docs/actions/public/getBalance.html - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance) **`Remarks`** You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html). `ts const balance = await getBalance(client, { address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', blockTag: 'safe' }) const balanceAsEther = formatEther(balance) // "6.942" ` **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const balance = await client.getBalance({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) // 10000000000000000000000n (wei) ` | -| `getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getBlock() ` | -| `getBlockNumber` | (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> | Returns the number of the most recent block seen. - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blockNumber = await client.getBlockNumber() // 69420n ` | -| `getBlockTransactionCount` | (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of Transactions at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html - JSON-RPC Methods: - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const count = await client.getBlockTransactionCount() ` | -| `getBytecode` | (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> | Retrieves the bytecode at an address. - Docs: https://viem.sh/docs/contract/getBytecode.html - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getBytecode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', }) ` | -| `getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const chainId = await client.getChainId() // 1 ` | -| `getContractEvents` | (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents.html - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { wagmiAbi } from './abi' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getContractEvents(client, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: wagmiAbi, eventName: 'Transfer' }) ` | -| `getEnsAddress` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAddress = await client.getEnsAddress({ name: normalize('wevm.eth'), }) // '0xd2135CfB216b74109775236E36d4b433F1DF507B' ` | -| `getEnsAvatar` | (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAvatar = await client.getEnsAvatar({ name: normalize('wevm.eth'), }) // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio' ` | -| `getEnsName` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensName = await client.getEnsName({ address: '0xd2135CfB216b74109775236E36d4b433F1DF507B', }) // 'wevm.eth' ` | -| `getEnsResolver` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> | Gets resolver for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const resolverAddress = await client.getEnsResolver({ name: normalize('wevm.eth'), }) // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41' ` | -| `getEnsText` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const twitterRecord = await client.getEnsText({ name: normalize('wevm.eth'), key: 'com.twitter', }) // 'wagmi_sh' ` | -| `getFeeHistory` | (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> | Returns a collection of historical gas information. - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const feeHistory = await client.getFeeHistory({ blockCount: 4, rewardPercentiles: [25, 75], }) ` | -| `getFilterChanges` | (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called. - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) **`Remarks`** A Filter can be created from the following actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) Depending on the type of filter, the return value will be different: - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs. - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes. - If the filter was created with `createBlockFilter`, it returns a list of block hashes. **`Example`** `ts // Blocks import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createBlockFilter() const hashes = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Contract Events import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), eventName: 'Transfer', }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Raw Events import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Transactions import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() const hashes = await client.getFilterChanges({ filter }) ` | -| `getFilterLogs` | (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs since the filter was created. - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) **`Remarks`** `getFilterLogs` is only compatible with **event filters**. **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterLogs({ filter }) ` | -| `getGasPrice` | () => `Promise`<`bigint`\> | Returns the current price of gas (in wei). - Docs: https://viem.sh/docs/actions/public/getGasPrice.html - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasPrice = await client.getGasPrice() ` | -| `getLogs` | (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs matching the provided parameters. - Docs: https://viem.sh/docs/actions/public/getLogs.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/filters-and-logs/event-logs - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getLogs() ` | -| `getProof` | (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> | Returns the account and storage values of the specified account including the Merkle-proof. - Docs: https://viem.sh/docs/actions/public/getProof.html - JSON-RPC Methods: - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getProof({ address: '0x...', storageKeys: ['0x...'], }) ` | -| `getStorageAt` | (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> | Returns the value from a storage slot at a given address. - Docs: https://viem.sh/docs/contract/getStorageAt.html - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getStorageAt } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getStorageAt({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', slot: toHex(0), }) ` | -| `getTransaction` | (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transaction = await client.getTransaction({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `getTransactionConfirmations` | (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> | Returns the number of blocks passed (confirmations) since the transaction was processed on a block. - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const confirmations = await client.getTransactionConfirmations({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `getTransactionCount` | (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionCount = await client.getTransactionCount({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `getTransactionReceipt` | (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> | Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.getTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `key` | `string` | A key for the client. | -| `multicall` | (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall). - Docs: https://viem.sh/docs/contract/multicall.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const abi = parseAbi([ 'function balanceOf(address) view returns (uint256)', 'function totalSupply() view returns (uint256)', ]) const result = await client.multicall({ contracts: [ { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'totalSupply', }, ], }) // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }] ` | -| `name` | `string` | A name for the client. | -| `pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `readContract` | (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/reading-contracts **`Remarks`** A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' import { readContract } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.readContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function balanceOf(address) view returns (uint256)']), functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }) // 424122n ` | -| `request` | `EIP1193RequestFn`<`PublicRpcSchema`\> | Request function wrapped with friendly error handling | -| `sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `simulateContract` | (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> | Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions. - Docs: https://viem.sh/docs/contract/simulateContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts **`Remarks`** This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32) view returns (uint32)']), functionName: 'mint', args: ['69420'], account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `type` | `string` | The type of client. | -| `uid` | `string` | A unique ID for the client. | -| `uninstallFilter` | (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> | Destroys a Filter that was created from one of the following Actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { createPendingTransactionFilter, uninstallFilter } from 'viem/public' const filter = await client.createPendingTransactionFilter() const uninstalled = await client.uninstallFilter({ filter }) // true ` | -| `verifyMessage` | (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> | - | -| `verifyTypedData` | (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> | - | -| `waitForTransactionReceipt` | (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> | Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed. - If a Transaction has been replaced: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions - Checks if one of the Transactions is a replacement - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt). **`Remarks`** The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions). Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce. There are 3 types of Transaction Replacement reasons: - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`) - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`) - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.waitForTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `watchBlockNumber` | (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` | Watches and returns incoming block numbers. - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlockNumber({ onBlockNumber: (blockNumber) => console.log(blockNumber), }) ` | -| `watchBlocks` | (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` | Watches and returns information for incoming blocks. - Docs: https://viem.sh/docs/actions/public/watchBlocks.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlocks({ onBlock: (block) => console.log(block), }) ` | -| `watchContractEvent` | (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent.html **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchContractEvent({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']), eventName: 'Transfer', args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, onLogs: (logs) => console.log(logs), }) ` | -| `watchEvent` | (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent.html - JSON-RPC Methods: - **RPC Provider supports `eth_newFilter`:** - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize). - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - **RPC Provider does not support `eth_newFilter`:** - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval. **`Remarks`** This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchEvent({ onLogs: (logs) => console.log(logs), }) ` | -| `watchPendingTransactions` | (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` | Watches and returns pending transaction hashes. - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html - JSON-RPC Methods: - When `poll: true` - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter. - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event. **`Remarks`** This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchPendingTransactions({ onTransactions: (hashes) => console.log(hashes), }) ` | - -#### Defined in - -[sdk/src/client.ts:46](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L46) - ---- - -### \_storage - -• `Private` **\_storage**: [`HypercertsStorage`](HypercertsStorage.md) - -#### Defined in - -[sdk/src/client.ts:42](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L42) - ---- - -### \_walletClient - -• `Private` `Optional` **\_walletClient**: `Object` - -#### Type declaration - -| Name | Type | Description | -| :-------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `account` | `undefined` \| `Account` | The Account of the Client. | -| `addChain` | (`args`: `AddChainParameters`) => `Promise`<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain.html - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism }) ` | -| `batch?` | \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } | Flags for batch settings. | -| `batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `chain` | `undefined` \| `Chain` | Chain for the client. | -| `deployContract` | (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/deploying-contracts **`Example`** `ts import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', }) ` | -| `extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> | - | -| `getAddresses` | () => `Promise`<`GetAddressesReturnType`\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses() ` | -| `getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1 ` | -| `getPermissions` | () => `Promise`<`GetPermissionsReturnType`\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions() ` | -| `key` | `string` | A key for the client. | -| `name` | `string` | A name for the client. | -| `pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `request` | `EIP1193RequestFn`<`WalletRpcSchema`\> | Request function wrapped with friendly error handling | -| `requestAddresses` | () => `Promise`<`RequestAddressesReturnType`\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses() ` | -| `requestPermissions` | (`args`: \{ [x: string]: Record; eth_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} }) ` | -| `sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `sendTransaction` | (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` | -| `signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage.html - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signMessage({ message: 'hello world', }) ` | -| `signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` | -| `signTypedData` | (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` | -| `switchChain` | (`args`: `SwitchChainParameters`) => `Promise`<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id }) ` | -| `transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `type` | `string` | The type of client. | -| `uid` | `string` | A unique ID for the client. | -| `watchAsset` | (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, }) ` | -| `writeContract` | (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.** **`Example`** `ts import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], }) ` **`Example`** `ts // With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request) ` | - -#### Defined in - -[sdk/src/client.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L47) - ---- - -### readonly - -• **readonly**: `boolean` - -Whether the client is in read-only mode. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[readonly](../interfaces/HypercertClientInterface.md#readonly) - -#### Defined in - -[sdk/src/client.ts:48](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L48) - -## Accessors - -### config - -• `get` **config**(): `Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> - -Gets the config for the client. - -#### Returns - -`Partial`<[`HypercertClientConfig`](../modules.md#hypercertclientconfig)\> - -The client config. - -#### Defined in - -[sdk/src/client.ts:82](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L82) - ---- - -### contract - -• `get` **contract**(): `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -Gets the HypercertMinter contract used by the client. - -#### Returns - -`GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -The contract. - -**`Deprecated`** - -Use getDeployments instead. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[contract](../interfaces/HypercertClientInterface.md#contract) - -#### Defined in - -[sdk/src/client.ts:107](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L107) - ---- - -### indexer - -• `get` **indexer**(): `HypercertIndexer` - -Gets the indexer for the client. - -#### Returns - -`HypercertIndexer` - -The indexer. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[indexer](../interfaces/HypercertClientInterface.md#indexer) - -#### Defined in - -[sdk/src/client.ts:98](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L98) - ---- - -### storage - -• `get` **storage**(): [`HypercertsStorage`](HypercertsStorage.md) - -Gets the storage layer for the client. - -#### Returns - -[`HypercertsStorage`](HypercertsStorage.md) - -The storage layer. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[storage](../interfaces/HypercertClientInterface.md#storage) - -#### Defined in - -[sdk/src/client.ts:90](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L90) - -## Methods - -### batchMintClaimFractionsFromAllowlists - -▸ **batchMintClaimFractionsFromAllowlists**(`claimIds`, `units`, `proofs`, `roots?`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints multiple claim fractions from allowlists in a batch. - -This method first retrieves the wallet client and account using the `getWallet` method. If the roots are provided, it verifies each proof using the `verifyMerkleProofs` function. If any of the proofs are invalid, it throws an `InvalidOrMissingError`. -It then simulates a contract call to the `batchMintClaimsFromAllowlists` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :------------------------------------------------------------------------ | -| `claimIds` | `bigint`[] | The IDs of the claims to mint. | -| `units` | `bigint`[] | The units of each claim to mint. | -| `proofs` | (\`0x$\{string}\` \| `Uint8Array`)[][] | The proofs for each claim. | -| `roots?` | (\`0x$\{string}\` \| `Uint8Array`)[] | The roots of each proof. If provided, they are used to verify the proofs. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw an `InvalidOrMissingError` if any of the proofs are invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[batchMintClaimFractionsFromAllowlists](../interfaces/HypercertClientInterface.md#batchmintclaimfractionsfromallowlists) - -#### Defined in - -[sdk/src/client.ts:454](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L454) - ---- - -### batchTransferFractions - -▸ **batchTransferFractions**(`fractionIds`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers multiple claim fractions to a new owner. - -This method first retrieves the wallet client and account using the `getWallet` method. -It then simulates a contract call to the `safeBatchTransferFrom` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------- | -| `fractionIds` | `bigint`[] | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[batchTransferFractions](../interfaces/HypercertClientInterface.md#batchtransferfractions) - -#### Defined in - -[sdk/src/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L216) - ---- - -### burnClaimFraction - -▸ **burnClaimFraction**(`claimId`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Burns a claim fraction. - -This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner of the claim using the `ownerOf` method of the read contract. -If the claim is not owned by the account, it throws a `ClientError`. -It then simulates a contract call to the `burnFraction` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :---------------------------------------- | -| `claimId` | `bigint` | The ID of the claim to burn. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `ClientError` if the claim is not owned by the account. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[burnClaimFraction](../interfaces/HypercertClientInterface.md#burnclaimfraction) - -#### Defined in - -[sdk/src/client.ts:377](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L377) - ---- - -### createAllowlist - -▸ **createAllowlist**(`allowList`, `metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Creates an allowlist. - -This method first validates the provided allowlist and metadata using the `validateAllowlist` and `validateMetaData` functions respectively. If either is invalid, it throws a `MalformedDataError`. -It then creates an allowlist from the provided entries and stores it on IPFS using the `storeData` method of the storage client. -After that, it stores the metadata (including the CID of the allowlist) on IPFS using the `storeMetadata` method of the storage client. -Finally, it simulates a contract call to the `createAllowlist` function with the provided parameters and the stored metadata CID, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :---------------------------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The entries for the allowlist. | -| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restrictions for the claim. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided allowlist or metadata is invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[createAllowlist](../interfaces/HypercertClientInterface.md#createallowlist) - -#### Defined in - -[sdk/src/client.ts:249](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L249) - ---- - -### getClaimStoredDataFromTxHash - -▸ **getClaimStoredDataFromTxHash**(`hash`): `Promise`<`ParserReturnType`\> - -#### Parameters - -| Name | Type | -| :----- | :--------------- | -| `hash` | \`0x$\{string}\` | - -#### Returns - -`Promise`<`ParserReturnType`\> - -#### Defined in - -[sdk/src/client.ts:485](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L485) - ---- - -### getCleanedOverrides - -▸ **getCleanedOverrides**(`overrides?`): `Object` - -#### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Object` - -#### Defined in - -[sdk/src/client.ts:502](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L502) - ---- - -### getContractConfig - -▸ **getContractConfig**(): `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[], \{ `account`: `undefined` ; `batch?`: \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } ; `cacheTime`: `number` ; `call`: (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> ; `chain`: `undefined` \| `Chain` ; `createBlockFilter`: () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> ; `createContractEventFilter`: (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `createEventFilter`: (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> ; `createPendingTransactionFilter`: () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> ; `estimateContractGas`: (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> ; `estimateFeesPerGas`: (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> ; `estimateGas`: (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> ; `estimateMaxPriorityFeePerGas`: (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> ; `extend`: (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> ; `getBalance`: (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> ; `getBlock`: (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> ; `getBlockNumber`: (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> ; `getBlockTransactionCount`: (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> ; `getBytecode`: (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> ; `getChainId`: () => `Promise`<`number`\> ; `getContractEvents`: (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getEnsAddress`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> ; `getEnsAvatar`: (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> ; `getEnsName`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> ; `getEnsResolver`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> ; `getEnsText`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> ; `getFeeHistory`: (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> ; `getFilterChanges`: (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getFilterLogs`: (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getGasPrice`: () => `Promise`<`bigint`\> ; `getLogs`: (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getProof`: (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> ; `getStorageAt`: (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> ; `getTransaction`: (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> ; `getTransactionConfirmations`: (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> ; `getTransactionCount`: (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> ; `getTransactionReceipt`: (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> ; `key`: `string` ; `multicall`: (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> ; `name`: `string` ; `pollingInterval`: `number` ; `prepareTransactionRequest`: (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> ; `readContract`: (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> ; `request`: `EIP1193RequestFn`<`PublicRpcSchema`\> ; `sendRawTransaction`: (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> ; `simulateContract`: (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> ; `transport`: `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> ; `type`: `string` ; `uid`: `string` ; `uninstallFilter`: (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> ; `verifyMessage`: (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> ; `verifyTypedData`: (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> ; `waitForTransactionReceipt`: (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> ; `watchBlockNumber`: (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` ; `watchBlocks`: (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` ; `watchContractEvent`: (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` ; `watchEvent`: (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` ; `watchPendingTransactions`: (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` }, `undefined` \| `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`\>, \`0x$\{string}\`, `string`, `string`, `string`, `false`\> - -#### Returns - -`GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[], \{ `account`: `undefined` ; `batch?`: \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } ; `cacheTime`: `number` ; `call`: (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> ; `chain`: `undefined` \| `Chain` ; `createBlockFilter`: () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> ; `createContractEventFilter`: (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `createEventFilter`: (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> ; `createPendingTransactionFilter`: () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> ; `estimateContractGas`: (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> ; `estimateFeesPerGas`: (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> ; `estimateGas`: (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> ; `estimateMaxPriorityFeePerGas`: (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> ; `extend`: (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> ; `getBalance`: (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> ; `getBlock`: (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> ; `getBlockNumber`: (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> ; `getBlockTransactionCount`: (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> ; `getBytecode`: (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> ; `getChainId`: () => `Promise`<`number`\> ; `getContractEvents`: (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getEnsAddress`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> ; `getEnsAvatar`: (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> ; `getEnsName`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> ; `getEnsResolver`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> ; `getEnsText`: (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> ; `getFeeHistory`: (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> ; `getFilterChanges`: (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getFilterLogs`: (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getGasPrice`: () => `Promise`<`bigint`\> ; `getLogs`: (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> ; `getProof`: (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> ; `getStorageAt`: (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> ; `getTransaction`: (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> ; `getTransactionConfirmations`: (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> ; `getTransactionCount`: (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> ; `getTransactionReceipt`: (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> ; `key`: `string` ; `multicall`: (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> ; `name`: `string` ; `pollingInterval`: `number` ; `prepareTransactionRequest`: (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> ; `readContract`: (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> ; `request`: `EIP1193RequestFn`<`PublicRpcSchema`\> ; `sendRawTransaction`: (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> ; `simulateContract`: (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> ; `transport`: `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> ; `type`: `string` ; `uid`: `string` ; `uninstallFilter`: (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> ; `verifyMessage`: (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> ; `verifyTypedData`: (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> ; `waitForTransactionReceipt`: (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> ; `watchBlockNumber`: (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` ; `watchBlocks`: (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` ; `watchContractEvent`: (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` ; `watchEvent`: (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` ; `watchPendingTransactions`: (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` }, `undefined` \| `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`\>, \`0x$\{string}\`, `string`, `string`, `string`, `false`\> - -#### Defined in - -[sdk/src/client.ts:491](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L491) - ---- - -### getDeployment - -▸ **getDeployment**(`chainId`): `Partial`<[`Deployment`](../modules.md#deployment)\> - -Gets the contract addresses and graph urls for the provided `chainId` - -#### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `chainId` | [`SupportedChainIds`](../modules.md#supportedchainids) | - -#### Returns - -`Partial`<[`Deployment`](../modules.md#deployment)\> - -The addresses, graph name and graph url. - -**`Deprecated`** - -Use getDeployments instead. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[getDeployment](../interfaces/HypercertClientInterface.md#getdeployment) - -#### Defined in - -[sdk/src/client.ts:120](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L120) - ---- - -### getTransferRestrictions - -▸ **getTransferRestrictions**(`fractionId`): `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -Gets the TransferRestrictions for a claim. - -This method first retrieves the read contract using the `getContract` method. It then simulates a contract call to the `readTransferRestriction` function with the provided fraction ID. - -#### Parameters - -| Name | Type | -| :----------- | :------- | -| `fractionId` | `bigint` | - -#### Returns - -`Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -a Promise that resolves to the applicable transfer restrictions. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[getTransferRestrictions](../interfaces/HypercertClientInterface.md#gettransferrestrictions) - -#### Defined in - -[sdk/src/client.ts:168](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L168) - ---- - -### getWallet - -▸ **getWallet**(): `Object` - -#### Returns - -`Object` - -| Name | Type | -| :--------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `account` | `Account` | -| `walletClient` | \{ `account`: `undefined` \| `Account` ; `addChain`: (`args`: `AddChainParameters`) => `Promise`<`void`\> ; `batch?`: \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } ; `cacheTime`: `number` ; `chain`: `undefined` \| `Chain` ; `deployContract`: (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> ; `extend`: (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> ; `getAddresses`: () => `Promise`<`GetAddressesReturnType`\> ; `getChainId`: () => `Promise`<`number`\> ; `getPermissions`: () => `Promise`<`GetPermissionsReturnType`\> ; `key`: `string` ; `name`: `string` ; `pollingInterval`: `number` ; `prepareTransactionRequest`: (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> ; `request`: `EIP1193RequestFn`<`WalletRpcSchema`\> ; `requestAddresses`: () => `Promise`<`RequestAddressesReturnType`\> ; `requestPermissions`: (`args`: \{ [x: string]: Record; eth\_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> ; `sendRawTransaction`: (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> ; `sendTransaction`: (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> ; `signMessage`: (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> ; `signTransaction`: (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> ; `signTypedData`: (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> ; `switchChain`: (`args`: `SwitchChainParameters`) => `Promise`<`void`\> ; `transport`: `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> ; `type`: `string` ; `uid`: `string` ; `watchAsset`: (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> ; `writeContract`: (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> } | -| `walletClient.account` | `undefined` \| `Account` | -| `walletClient.addChain` | (`args`: `AddChainParameters`) => `Promise`<`void`\> | -| `walletClient.batch?` | \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } | -| `walletClient.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | -| `walletClient.cacheTime` | `number` | -| `walletClient.chain` | `undefined` \| `Chain` | -| `walletClient.deployContract` | (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> | -| `walletClient.getAddresses` | () => `Promise`<`GetAddressesReturnType`\> | -| `walletClient.getChainId` | () => `Promise`<`number`\> | -| `walletClient.getPermissions` | () => `Promise`<`GetPermissionsReturnType`\> | -| `walletClient.key` | `string` | -| `walletClient.name` | `string` | -| `walletClient.pollingInterval` | `number` | -| `walletClient.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | -| `walletClient.request` | `EIP1193RequestFn`<`WalletRpcSchema`\> | -| `walletClient.requestAddresses` | () => `Promise`<`RequestAddressesReturnType`\> | -| `walletClient.requestPermissions` | (`args`: \{ [x: string]: Record; eth_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> | -| `walletClient.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.sendTransaction` | (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.signTypedData` | (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | -| `walletClient.switchChain` | (`args`: `SwitchChainParameters`) => `Promise`<`void`\> | -| `walletClient.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | -| `walletClient.type` | `string` | -| `walletClient.uid` | `string` | -| `walletClient.watchAsset` | (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> | -| `walletClient.writeContract` | (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | - -#### Defined in - -[sdk/src/client.ts:512](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L512) - ---- - -### mergeFractionUnits - -▸ **mergeFractionUnits**(`fractionIds`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Merges multiple fractions into a single fraction. - -This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner of each fraction using the `ownerOf` method of the read contract. -If any of the fractions are not owned by the account, it throws a `ClientError`. -It then simulates a contract call to the `mergeFractions` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :------------ | :------------------------------------------------------- | :---------------------------------------- | -| `fractionIds` | `bigint`[] | The IDs of the fractions to merge. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `ClientError` if any of the fractions are not owned by the account. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[mergeFractionUnits](../interfaces/HypercertClientInterface.md#mergefractionunits) - -#### Defined in - -[sdk/src/client.ts:336](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L336) - ---- - -### mintClaim - -▸ **mintClaim**(`metaData`, `totalUnits`, `transferRestriction`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a new claim. - -This method first validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. -It then stores the metadata on IPFS using the `storeMetadata` method of the storage client. -After that, it simulates a contract call to the `mintClaim` function with the provided parameters and the stored metadata CID to validate the transaction. -Finally, it submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :---------------------------------------- | -| `metaData` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restrictions for the claim. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided metadata is invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[mintClaim](../interfaces/HypercertClientInterface.md#mintclaim) - -#### Defined in - -[sdk/src/client.ts:139](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L139) - ---- - -### mintClaimFractionFromAllowlist - -▸ **mintClaimFractionFromAllowlist**(`claimId`, `units`, `proof`, `root?`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a claim fraction from an allowlist. - -This method first retrieves the wallet client and account using the `getWallet` method. It then verifies the provided proof using the `verifyMerkleProof` function. If the proof is invalid, it throws an `InvalidOrMissingError`. -It then simulates a contract call to the `mintClaimFromAllowlist` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :------------------------------------------------------------------ | -| `claimId` | `bigint` | The ID of the claim to mint. | -| `units` | `bigint` | The units of the claim to mint. | -| `proof` | (\`0x$\{string}\` \| `Uint8Array`)[] | The proof for the claim. | -| `root?` | \`0x$\{string}\` \| `Uint8Array` | The root of the proof. If provided, it is used to verify the proof. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw an `InvalidOrMissingError` if the proof is invalid. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[mintClaimFractionFromAllowlist](../interfaces/HypercertClientInterface.md#mintclaimfractionfromallowlist) - -#### Defined in - -[sdk/src/client.ts:410](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L410) - ---- - -### simulateRequest - -▸ **simulateRequest**(`account`, `functionName`, `args`, `overrides?`): `Promise`<\{ `abi`: `Narrow`<\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" }\>[] ; `accessList?`: `AccessList` ; `account`: \`0x$\{string}\` \| `Account` ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `chain`: `undefined` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"legacy"` \| `"eip2930"` \| `"eip1559"` ; `value?`: `bigint` }\> - -#### Parameters - -| Name | Type | -| :------------- | :------------------------------------------------------- | -| `account` | `Account` | -| `functionName` | `string` | -| `args` | `unknown`[] | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Promise`<\{ `abi`: `Narrow`<\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" }\>[] ; `accessList?`: `AccessList` ; `account`: \`0x$\{string}\` \| `Account` ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `chain`: `undefined` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"legacy"` \| `"eip2930"` \| `"eip1559"` ; `value?`: `bigint` }\> - -#### Defined in - -[sdk/src/client.ts:522](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L522) - ---- - -### splitFractionUnits - -▸ **splitFractionUnits**(`fractionId`, `fractions`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Splits a fraction into multiple fractions. - -This method first retrieves the wallet client and account using the `getWallet` method. It then retrieves the owner and total units of the fraction using the `ownerOf` and `unitsOf` methods of the read contract. -If the fraction is not owned by the account, it throws a `ClientError`. -It then checks if the sum of the provided fractions is equal to the total units of the fraction. If not, it throws a `ClientError`. -Finally, it simulates a contract call to the `splitFraction` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------------- | :---------------------------------------- | -| `fractionId` | `bigint` | The ID of the fraction to split. | -| `fractions` | `bigint`[] | The fractions to split the fraction into. | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | Optional overrides for the contract call. | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -**`Throws`** - -Will throw a `ClientError` if the fraction is not owned by the account or if the sum of the fractions is not equal to the total units of the fraction. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[splitFractionUnits](../interfaces/HypercertClientInterface.md#splitfractionunits) - -#### Defined in - -[sdk/src/client.ts:291](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L291) - ---- - -### submitRequest - -▸ **submitRequest**(`request`): `Promise`<\`0x$\{string}\`\> - -Submits a contract request. - -This method submits a contract request using the `writeContract` method of the wallet client. If the request fails, it throws a `ClientError`. - -#### Parameters - -| Name | Type | Description | -| :-------- | :---- | :------------------------------ | -| `request` | `any` | The contract request to submit. | - -#### Returns - -`Promise`<\`0x$\{string}\`\> - -A promise that resolves to the hash of the submitted request. - -**`Throws`** - -Will throw a `ClientError` if the request fails. - -#### Defined in - -[sdk/src/client.ts:553](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L553) - ---- - -### transferFraction - -▸ **transferFraction**(`fractionId`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers a claim fraction to a new owner. - -This method first retrieves the wallet client and account using the `getWallet` method. -It then simulates a contract call to the `safeTransferFrom` function with the provided parameters and the account, and submits the request using the `submitRequest` method. - -#### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `fractionId` | `bigint` | -| `to` | `string` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -#### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A promise that resolves to the transaction hash. - -#### Implementation of - -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[transferFraction](../interfaces/HypercertClientInterface.md#transferfraction) - -#### Defined in - -[sdk/src/client.ts:188](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/client.ts#L188) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/HypercertsStorage.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/HypercertsStorage.md deleted file mode 100644 index 4e0afed6..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/HypercertsStorage.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -id: "HypercertsStorage" -title: "Class: HypercertsStorage" -sidebar_label: "HypercertsStorage" -sidebar_position: 0 -custom_edit_url: null ---- - -A class that provides storage functionality for Hypercerts. - -This class implements the `HypercertStorageInterface` and provides methods for storing and retrieving Hypercerts. - -**`Example`** - -```ts -const storage = new HypercertsStorage(); -const metadata = await storage.getMetadata("your-hypercert-id"); -``` - -## Implements - -- [`HypercertStorageInterface`](../interfaces/HypercertStorageInterface.md) - -## Constructors - -### constructor - -• **new HypercertsStorage**(): [`HypercertsStorage`](HypercertsStorage.md) - -#### Returns - -[`HypercertsStorage`](HypercertsStorage.md) - -## Methods - -### getData - -▸ **getData**(`cidOrIpfsUri`): `Promise`<`unknown`\> - -Retrieves data from IPFS using the provided CID or IPFS URI. - -This method first retrieves the data from IPFS using the `getFromIPFS` function. It then parses the retrieved data as JSON and returns it. - -#### Parameters - -| Name | Type | Description | -| :------------- | :------- | :------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | - -#### Returns - -`Promise`<`unknown`\> - -A promise that resolves to the retrieved data. - -**`Throws`** - -Will throw a `FetchError` if the retrieval operation fails. - -**`Throws`** - -Will throw a `MalformedDataError` if the retrieved data is not a single file. - -**`Remarkts`** - -Note: The original implementation using the Web3 Storage client is currently commented out due to issues with upstream repos. This will be replaced once those issues are resolved. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[getData](../interfaces/HypercertStorageInterface.md#getdata) - -#### Defined in - -[sdk/src/storage.ts:126](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L126) - ---- - -### getMetadata - -▸ **getMetadata**(`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> - -Retrieves Hypercert metadata from IPFS using the provided CID or IPFS URI. - -This method first retrieves the data from IPFS using the `getFromIPFS` function. It then validates the retrieved data using the `validateMetaData` function. If the data is invalid, it throws a `MalformedDataError`. -If the data is valid, it returns the data as a `HypercertMetadata` object. - -#### Parameters - -| Name | Type | Description | -| :------------- | :------- | :----------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | - -#### Returns - -`Promise`<[`HypercertMetadata`](../interfaces/HypercertMetadata.md)\> - -A promise that resolves to the retrieved metadata. - -**`Throws`** - -Will throw a `MalformedDataError` if the retrieved data is invalid. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[getMetadata](../interfaces/HypercertStorageInterface.md#getmetadata) - -#### Defined in - -[sdk/src/storage.ts:103](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L103) - ---- - -### storeAllowList - -▸ **storeAllowList**(`allowList`, `totalUnits`): `Promise`<`string`\> - -Stores hypercerts allowlist on IPFS. - -First it validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. -If the metadata is valid, it creates a new Blob from the metadata and stores it using the hypercerts API. If the storage operation fails, it throws a `StorageError`. - -#### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------- | :---------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowList to store. | -| `totalUnits` | `bigint` | - | - -#### Returns - -`Promise`<`string`\> - -A promise that resolves to the CID of the stored metadata. - -**`Throws`** - -Will throw a `StorageError` if the storage operation fails. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided metadata is invalid. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[storeAllowList](../interfaces/HypercertStorageInterface.md#storeallowlist) - -#### Defined in - -[sdk/src/storage.ts:33](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L33) - ---- - -### storeMetadata - -▸ **storeMetadata**(`metadata`): `Promise`<`string`\> - -Stores Hypercert metadata using the hypercerts API. - -It then validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. -If the metadata is valid, it creates a new Blob from the metadata and stores it using the hypercerts API. If the storage operation fails, it throws a `StorageError`. - -#### Parameters - -| Name | Type | -| :--------- | :-------------------------------------------------------- | -| `metadata` | [`HypercertMetadata`](../interfaces/HypercertMetadata.md) | - -#### Returns - -`Promise`<`string`\> - -A promise that resolves to the CID of the stored metadata. - -**`Throws`** - -Will throw a `StorageError` if the storage operation fails. - -**`Throws`** - -Will throw a `MalformedDataError` if the provided metadata is invalid. - -#### Implementation of - -[HypercertStorageInterface](../interfaces/HypercertStorageInterface.md).[storeMetadata](../interfaces/HypercertStorageInterface.md#storemetadata) - -#### Defined in - -[sdk/src/storage.ts:72](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/storage.ts#L72) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/InvalidOrMissingError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/InvalidOrMissingError.md deleted file mode 100644 index 2458964f..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/InvalidOrMissingError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "InvalidOrMissingError" -title: "Class: InvalidOrMissingError" -sidebar_label: "InvalidOrMissingError" -sidebar_position: 0 -custom_edit_url: null ---- - -The provided value was undefined or empty - -## Hierarchy - -- `Error` - - ↳ **`InvalidOrMissingError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new InvalidOrMissingError**(`message`, `payload?`): [`InvalidOrMissingError`](InvalidOrMissingError.md) - -Creates a new instance of the InvalidOrMissingError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`InvalidOrMissingError`](InvalidOrMissingError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:83](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L83) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:76](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L76) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/MalformedDataError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/MalformedDataError.md deleted file mode 100644 index 1c31cae7..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/MalformedDataError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "MalformedDataError" -title: "Class: MalformedDataError" -sidebar_label: "MalformedDataError" -sidebar_position: 0 -custom_edit_url: null ---- - -Data doesn't conform to expectations - -## Hierarchy - -- `Error` - - ↳ **`MalformedDataError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new MalformedDataError**(`message`, `payload?`): [`MalformedDataError`](MalformedDataError.md) - -Creates a new instance of the MalformedDataError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`MalformedDataError`](MalformedDataError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:155](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L155) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:148](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L148) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/MintingError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/MintingError.md deleted file mode 100644 index 63301554..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/MintingError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "MintingError" -title: "Class: MintingError" -sidebar_label: "MintingError" -sidebar_position: 0 -custom_edit_url: null ---- - -Minting transaction failed - -## Hierarchy - -- `Error` - - ↳ **`MintingError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new MintingError**(`message`, `payload?`): [`MintingError`](MintingError.md) - -Creates a new instance of the MintingError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`MintingError`](MintingError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:101](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L101) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:94](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L94) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/StorageError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/StorageError.md deleted file mode 100644 index d1fc11a4..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/StorageError.md +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: "StorageError" -title: "Class: StorageError" -sidebar_label: "StorageError" -sidebar_position: 0 -custom_edit_url: null ---- - -Fails storing to a remote resource - -## Hierarchy - -- `Error` - - ↳ **`StorageError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new StorageError**(`message`, `payload?`): [`StorageError`](StorageError.md) - -Creates a new instance of the StorageError class. - -#### Parameters - -| Name | Type | Description | -| :--------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | - -#### Returns - -[`StorageError`](StorageError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:119](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L119) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:112](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L112) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/UnknownSchemaError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/UnknownSchemaError.md deleted file mode 100644 index 753ed795..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/UnknownSchemaError.md +++ /dev/null @@ -1,201 +0,0 @@ ---- -id: "UnknownSchemaError" -title: "Class: UnknownSchemaError" -sidebar_label: "UnknownSchemaError" -sidebar_position: 0 -custom_edit_url: null ---- - -Schema could not be loaded - -## Hierarchy - -- `Error` - - ↳ **`UnknownSchemaError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new UnknownSchemaError**(`message`, `payload?`): [`UnknownSchemaError`](UnknownSchemaError.md) - -Creates a new instance of the UnknownSchemaError class. - -#### Parameters - -| Name | Type | Description | -| :------------------- | :------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | -| `payload.schemaName` | `string` | - | - -#### Returns - -[`UnknownSchemaError`](UnknownSchemaError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:137](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L137) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Type declaration - -| Name | Type | -| :----------- | :------- | -| `schemaName` | `string` | - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:130](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L130) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/UnsupportedChainError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/UnsupportedChainError.md deleted file mode 100644 index f5f87b74..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/UnsupportedChainError.md +++ /dev/null @@ -1,202 +0,0 @@ ---- -id: "UnsupportedChainError" -title: "Class: UnsupportedChainError" -sidebar_label: "UnsupportedChainError" -sidebar_position: 0 -custom_edit_url: null ---- - -This blockchain is not yet supported -Please file an issue - -## Hierarchy - -- `Error` - - ↳ **`UnsupportedChainError`** - -## Implements - -- [`CustomError`](../interfaces/CustomError.md) - -## Constructors - -### constructor - -• **new UnsupportedChainError**(`message`, `payload?`): [`UnsupportedChainError`](UnsupportedChainError.md) - -Creates a new instance of the UnsupportedChainError class. - -#### Parameters - -| Name | Type | Description | -| :---------------- | :---------------------------------- | :------------------------ | -| `message` | `string` | The error message. | -| `payload?` | `Object` | Additional error payload. | -| `payload.chainID` | `undefined` \| `string` \| `number` | - | - -#### Returns - -[`UnsupportedChainError`](UnsupportedChainError.md) - -#### Overrides - -Error.constructor - -#### Defined in - -[sdk/src/types/errors.ts:174](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L174) - -## Properties - -### cause - -• `Optional` **cause**: `unknown` - -#### Inherited from - -Error.cause - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es2022.error.d.ts:24 - ---- - -### message - -• **message**: `string` - -#### Inherited from - -Error.message - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1076 - ---- - -### name - -• **name**: `string` - -#### Inherited from - -Error.name - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1075 - ---- - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Type declaration - -| Name | Type | -| :-------- | :---------------------------------- | -| `chainID` | `undefined` \| `string` \| `number` | - -#### Implementation of - -[CustomError](../interfaces/CustomError.md).[payload](../interfaces/CustomError.md#payload) - -#### Defined in - -[sdk/src/types/errors.ts:167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L167) - ---- - -### stack - -• `Optional` **stack**: `string` - -#### Inherited from - -Error.stack - -#### Defined in - -node_modules/.pnpm/typescript@5.3.2/node_modules/typescript/lib/lib.es5.d.ts:1077 - ---- - -### prepareStackTrace - -▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any` - -#### 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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:11 - ---- - -### stackTraceLimit - -▪ `Static` **stackTraceLimit**: `number` - -#### Inherited from - -Error.stackTraceLimit - -#### Defined in - -node_modules/.pnpm/@types+node@18.18.7/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/.pnpm/@types+node@18.18.7/node_modules/@types/node/globals.d.ts:4 diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/_category_.yml b/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/_category_.yml deleted file mode 100644 index 55c7980a..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/classes/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Classes" -position: 3 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/index.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/index.md deleted file mode 100644 index e40c271b..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/index.md +++ /dev/null @@ -1,140 +0,0 @@ ---- -id: "index" -title: "@hypercerts-org/sdk" -sidebar_label: "Readme" -sidebar_position: 0 -custom_edit_url: null ---- - -# Hypercert SDK - -## Quickstart Guide - -1. Install the SDK using npm or yarn: - -```bash -npm install @hypercerts-org/sdk -``` - -or - -```bash - yarn add @hypercerts-org/sdk -``` - -2. Import the SDK into your project: - -```bash -import { HypercertClient } from "@hypercerts-org/sdk"; -``` - -3. Create a new instance of the HypercertClient class with your configuration options: - -```js -const client = new HypercertClient({ - chain: { id: 11155111 }, // required -}); -``` - -> **Note** If there's no `walletClient` provided the client will run in [read-only mode](#read-only-mode) - -4. Use the client object to interact with the Hypercert network. - -For example, you can use the `client.mintClaim` method to create a new claim: - -```js -const tx = await client.mintClaim( - metaData, - totalUnits, - transferRestriction, - overrides, -); -``` - -This will validate the metadata, store it on IPFS, create a new hypercert on-chain and return a transaction receipt. - -You can also use the client to query the subgraph and retrieve which claims an address owns: - -```js -const claims = await client.indexer.fractionsByOwner(owner); -``` - -For more information on how to use the SDK, check out the -[developer documentation](https://hypercerts.org/docs/developer/) and the -[Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet). - -That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. - -## Config - -HypercertClientConfig is a configuration object used when initializing a new instance of the HypercertClient. It allows -you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide -`chain.id` to initalize the client in `readonly` mode. - -| Field | Type | Description | -| --------------------------- | ------- | ---------------------------------------------------------------------------------------------- | -| `chain` | Object | Partial configuration for the blockchain network. | -| `contractAddress` | String | The address of the deployed contract. | -| `graphUrl` | String | The URL to the subgraph that indexes the contract events. Override for localized testing. | -| `graphName` | String | The name of the subgraph. | -| `easContractAddress` | String | The address of the EAS contract. | -| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | -| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | -| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | -| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | -| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | - -### Read-only mode - -The SDK client will be in read-only mode if any of the following conditions are true: - -- The client was initialized without a walletprovider. -- The contract address is not set. -- The storage layer is in read-only mode. - -If any of these conditions are true, the readonly property of the HypercertClient instance will be set to true, and a -warning message will be logged indicating that the client is in read-only mode. - -### Logging - -The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level -determines which log messages are printed to the console. By default, the logger is configured to log messages with a -level of info or higher to the console. - -## Client modules - -The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient -has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, -HypercertIndexer, and HypercertMinter classes, respectively. - -```js -const { - client: { storage }, -} = new HypercertClient({ chain: { id: 11155111 } }); -``` - -The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata from IPFS. It is used by the HypercertClient to store metadata when creating new Hypercerts. - -```js -const { - client: { indexer }, -} = new HypercertClient({ chain: { id: 11155111 } }); -``` - -The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. -It is used by the HypercertClient to retrieve event-based data via the subgraph - -```js -const { - client: { contract }, -} = new HypercertClient({ chain: { id: 11155111 } }); -``` - -Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used -by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. - -By providing instances of these classes through the storage, indexer, and contract getters, the HypercertClient allows -developers to easily interact with the various components of the Hypercert system. For example, a developer could use -the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based -on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the -contract. diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/CustomError.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/CustomError.md deleted file mode 100644 index 8acfe8fd..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/CustomError.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -id: "CustomError" -title: "Interface: CustomError" -sidebar_label: "CustomError" -sidebar_position: 0 -custom_edit_url: null ---- - -An interface for errors that have a specific type. - -## Implemented by - -- [`ClientError`](../classes/ClientError.md) -- [`ConfigurationError`](../classes/ConfigurationError.md) -- [`ContractError`](../classes/ContractError.md) -- [`FetchError`](../classes/FetchError.md) -- [`InvalidOrMissingError`](../classes/InvalidOrMissingError.md) -- [`MalformedDataError`](../classes/MalformedDataError.md) -- [`MintingError`](../classes/MintingError.md) -- [`StorageError`](../classes/StorageError.md) -- [`UnknownSchemaError`](../classes/UnknownSchemaError.md) -- [`UnsupportedChainError`](../classes/UnsupportedChainError.md) - -## Properties - -### payload - -• `Optional` **payload**: `Object` - -Additional error payload. - -#### Index signature - -▪ [key: `string`]: `unknown` - -#### Defined in - -[sdk/src/types/errors.ts:10](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L10) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/DuplicateEvaluation.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/DuplicateEvaluation.md deleted file mode 100644 index 41eb7831..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/DuplicateEvaluation.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: "DuplicateEvaluation" -title: "Interface: DuplicateEvaluation" -sidebar_label: "DuplicateEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### duplicateHypercerts - -• **duplicateHypercerts**: [`HypercertPointer`](HypercertPointer.md)[] - -#### Defined in - -[sdk/src/types/evaluation.d.ts:22](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L22) - ---- - -### explanation - -• **explanation**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L24) - ---- - -### realHypercert - -• **realHypercert**: [`HypercertPointer`](HypercertPointer.md) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L23) - ---- - -### type - -• **type**: `"duplicate"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:21](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L21) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/EASEvaluation.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/EASEvaluation.md deleted file mode 100644 index 825fdd95..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/EASEvaluation.md +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: "EASEvaluation" -title: "Interface: EASEvaluation" -sidebar_label: "EASEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### chainId - -• **chainId**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L41) - ---- - -### contract - -• **contract**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:42](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L42) - ---- - -### type - -• **type**: `"EAS"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L40) - ---- - -### uid - -• **uid**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:43](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L43) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClaimdata.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClaimdata.md deleted file mode 100644 index 6dbcb7d4..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClaimdata.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -id: "HypercertClaimdata" -title: "Interface: HypercertClaimdata" -sidebar_label: "HypercertClaimdata" -sidebar_position: 0 -custom_edit_url: null ---- - -Properties of an impact claim - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### contributors - -• **contributors**: `Object` - -Contributors - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:53](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L53) - ---- - -### impact_scope - -• **impact_scope**: `Object` - -Scopes of impact - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `excludes?` | `string`[] | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L15) - ---- - -### impact_timeframe - -• **impact_timeframe**: `Object` - -Impact time period. The value is UNIX time in seconds from epoch. - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `name?` | `string` | -| `value?` | `number`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:44](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L44) - ---- - -### rights - -• `Optional` **rights**: `Object` - -Rights - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `excludes?` | `string`[] | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:62](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L62) - ---- - -### work_scope - -• **work_scope**: `Object` - -Scopes of work - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `excludes?` | `string`[] | -| `name?` | `string` | -| `value?` | `string`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:25](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L25) - ---- - -### work_timeframe - -• **work_timeframe**: `Object` - -Work time period. The value is UNIX time in seconds from epoch. - -#### Index signature - -▪ [k: `string`]: `unknown` - -#### Type declaration - -| Name | Type | -| :--------------- | :--------- | -| `display_value?` | `string` | -| `name?` | `string` | -| `value?` | `number`[] | - -#### Defined in - -[sdk/src/types/claimdata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/claimdata.d.ts#L35) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientInterface.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientInterface.md deleted file mode 100644 index e7cdf71b..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientInterface.md +++ /dev/null @@ -1,459 +0,0 @@ ---- -id: "HypercertClientInterface" -title: "Interface: HypercertClientInterface" -sidebar_label: "HypercertClientInterface" -sidebar_position: 0 -custom_edit_url: null ---- - -The interface for the Hypercert client. - -## Hierarchy - -- [`HypercertClientMethods`](HypercertClientMethods.md) - -- [`HypercertClientState`](HypercertClientState.md) - - ↳ **`HypercertClientInterface`** - -## Implemented by - -- [`HypercertClient`](../classes/HypercertClient.md) - -## Properties - -### batchMintClaimFractionsFromAllowlists - -• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `bigint`[], `units`: `bigint`[], `proofs`: (\`0x$\{string}\` \| `Uint8Array`)[][]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimIds`, `units`, `proofs`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Batch mints a claim fraction from an allowlist - -##### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------- | :---------------------------------------------------- | -| `claimIds` | `bigint`[] | Array of the IDs of the claims to mint fractions for. | -| `units` | `bigint`[] | Array of the number of units for each fraction. | -| `proofs` | (\`0x$\{string}\` \| `Uint8Array`)[][] | Array of Merkle proofs for the allowlists. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction receipt - -A Promise that resolves to the transaction hash - -**`Note`** - -The length of the arrays must be equal. - -**`Note`** - -The order of the arrays must be equal. - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[batchMintClaimFractionsFromAllowlists](HypercertClientMethods.md#batchmintclaimfractionsfromallowlists) - -#### Defined in - -[sdk/src/types/client.ts:255](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L255) - ---- - -### batchTransferFractions - -• **batchTransferFractions**: (`fractionIds`: `bigint`[], `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers multiple claim fractions to a new owner. - -##### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------- | -| `fractionIds` | `bigint`[] | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[batchTransferFractions](HypercertClientMethods.md#batchtransferfractions) - -#### Defined in - -[sdk/src/types/client.ts:189](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L189) - ---- - -### burnClaimFraction - -• **burnClaimFraction**: (`fractionId`: `bigint`) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Burns a claim fraction. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------------ | -| `fractionId` | `bigint` | The ID of the claim fraction to burn. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[burnClaimFraction](HypercertClientMethods.md#burnclaimfraction) - -#### Defined in - -[sdk/src/types/client.ts:230](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L230) - ---- - -### contract - -• **contract**: `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[contract](HypercertClientState.md#contract) - -#### Defined in - -[sdk/src/types/client.ts:136](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L136) - ---- - -### createAllowlist - -• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Creates a new allowlist and mints a new claim with the allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[createAllowlist](HypercertClientMethods.md#createallowlist) - -#### Defined in - -[sdk/src/types/client.ts:203](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L203) - ---- - -### getDeployment - -• **getDeployment**: (`chainId`: [`SupportedChainIds`](../modules.md#supportedchainids)) => `Partial`<[`Deployment`](../modules.md#deployment)\> - -#### Type declaration - -▸ (`chainId`): `Partial`<[`Deployment`](../modules.md#deployment)\> - -Gets the contract addresses and graph urls for the provided `chainId` - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `chainId` | [`SupportedChainIds`](../modules.md#supportedchainids) | - -##### Returns - -`Partial`<[`Deployment`](../modules.md#deployment)\> - -The addresses, graph name and graph url. - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[getDeployment](HypercertClientMethods.md#getdeployment) - -#### Defined in - -[sdk/src/types/client.ts:147](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L147) - ---- - -### getTransferRestrictions - -• **getTransferRestrictions**: (`fractionId`: `bigint`) => `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -Retrieves the TransferRestrictions for a claim. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------- | -| `fractionId` | `bigint` | The ID of the claim to retrieve. | - -##### Returns - -`Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -A Promise that resolves to the applicable transfer restrictions. - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[getTransferRestrictions](HypercertClientMethods.md#gettransferrestrictions) - -#### Defined in - -[sdk/src/types/client.ts:167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L167) - ---- - -### indexer - -• **indexer**: `HypercertIndexer` - -The indexer used by the client. - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[indexer](HypercertClientState.md#indexer) - -#### Defined in - -[sdk/src/types/client.ts:135](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L135) - ---- - -### mergeFractionUnits - -• **mergeFractionUnits**: (`fractionIds`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Merges multiple claim fractions into a single claim. - -##### Parameters - -| Name | Type | Description | -| :------------ | :--------- | :--------------------------------------- | -| `fractionIds` | `bigint`[] | The IDs of the claim fractions to merge. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[mergeFractionUnits](HypercertClientMethods.md#mergefractionunits) - -#### Defined in - -[sdk/src/types/client.ts:223](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L223) - ---- - -### mintClaim - -• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a new claim. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[mintClaim](HypercertClientMethods.md#mintclaim) - -#### Defined in - -[sdk/src/types/client.ts:156](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L156) - ---- - -### mintClaimFractionFromAllowlist - -• **mintClaimFractionFromAllowlist**: (`claimId`: `bigint`, `units`: `bigint`, `proof`: (\`0x$\{string}\` \| `Uint8Array`)[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimId`, `units`, `proof`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a claim fraction from an allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------- | :------------------------------------------ | -| `claimId` | `bigint` | The ID of the claim to mint a fraction for. | -| `units` | `bigint` | The number of units for the fraction. | -| `proof` | (\`0x$\{string}\` \| `Uint8Array`)[] | The Merkle proof for the allowlist. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[mintClaimFractionFromAllowlist](HypercertClientMethods.md#mintclaimfractionfromallowlist) - -#### Defined in - -[sdk/src/types/client.ts:239](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L239) - ---- - -### readonly - -• **readonly**: `boolean` - -Whether the client is in read-only mode. - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[readonly](HypercertClientState.md#readonly) - -#### Defined in - -[sdk/src/types/client.ts:131](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L131) - ---- - -### splitFractionUnits - -• **splitFractionUnits**: (`fractionId`: `bigint`, `fractions`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `fractions`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Splits a claim into multiple fractions. - -##### Parameters - -| Name | Type | Description | -| :----------- | :--------- | :---------------------------- | -| `fractionId` | `bigint` | The ID of the claim to split. | -| `fractions` | `bigint`[] | - | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[splitFractionUnits](HypercertClientMethods.md#splitfractionunits) - -#### Defined in - -[sdk/src/types/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L216) - ---- - -### storage - -• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) - -The storage layer used by the client. - -#### Inherited from - -[HypercertClientState](HypercertClientState.md).[storage](HypercertClientState.md#storage) - -#### Defined in - -[sdk/src/types/client.ts:133](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L133) - ---- - -### transferFraction - -• **transferFraction**: (`fractionId`: `bigint`, `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers a claim fraction to a new owner. - -##### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `fractionId` | `bigint` | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Inherited from - -[HypercertClientMethods](HypercertClientMethods.md).[transferFraction](HypercertClientMethods.md#transferfraction) - -#### Defined in - -[sdk/src/types/client.ts:176](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L176) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientMethods.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientMethods.md deleted file mode 100644 index 59ee7d96..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientMethods.md +++ /dev/null @@ -1,347 +0,0 @@ ---- -id: "HypercertClientMethods" -title: "Interface: HypercertClientMethods" -sidebar_label: "HypercertClientMethods" -sidebar_position: 0 -custom_edit_url: null ---- - -The methods for the Hypercert client. - -## Hierarchy - -- **`HypercertClientMethods`** - - ↳ [`HypercertClientInterface`](HypercertClientInterface.md) - -## Properties - -### batchMintClaimFractionsFromAllowlists - -• **batchMintClaimFractionsFromAllowlists**: (`claimIds`: `bigint`[], `units`: `bigint`[], `proofs`: (\`0x$\{string}\` \| `Uint8Array`)[][]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimIds`, `units`, `proofs`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Batch mints a claim fraction from an allowlist - -##### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------- | :---------------------------------------------------- | -| `claimIds` | `bigint`[] | Array of the IDs of the claims to mint fractions for. | -| `units` | `bigint`[] | Array of the number of units for each fraction. | -| `proofs` | (\`0x$\{string}\` \| `Uint8Array`)[][] | Array of Merkle proofs for the allowlists. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction receipt - -A Promise that resolves to the transaction hash - -**`Note`** - -The length of the arrays must be equal. - -**`Note`** - -The order of the arrays must be equal. - -#### Defined in - -[sdk/src/types/client.ts:255](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L255) - ---- - -### batchTransferFractions - -• **batchTransferFractions**: (`fractionIds`: `bigint`[], `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers multiple claim fractions to a new owner. - -##### Parameters - -| Name | Type | -| :------------ | :------------------------------------------------------- | -| `fractionIds` | `bigint`[] | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:189](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L189) - ---- - -### burnClaimFraction - -• **burnClaimFraction**: (`fractionId`: `bigint`) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Burns a claim fraction. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------------ | -| `fractionId` | `bigint` | The ID of the claim fraction to burn. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:230](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L230) - ---- - -### createAllowlist - -• **createAllowlist**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`allowList`, `metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Creates a new allowlist and mints a new claim with the allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The allowlist for the claim. | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:203](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L203) - ---- - -### getDeployment - -• **getDeployment**: (`chainId`: [`SupportedChainIds`](../modules.md#supportedchainids)) => `Partial`<[`Deployment`](../modules.md#deployment)\> - -#### Type declaration - -▸ (`chainId`): `Partial`<[`Deployment`](../modules.md#deployment)\> - -Gets the contract addresses and graph urls for the provided `chainId` - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------------------- | -| `chainId` | [`SupportedChainIds`](../modules.md#supportedchainids) | - -##### Returns - -`Partial`<[`Deployment`](../modules.md#deployment)\> - -The addresses, graph name and graph url. - -#### Defined in - -[sdk/src/types/client.ts:147](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L147) - ---- - -### getTransferRestrictions - -• **getTransferRestrictions**: (`fractionId`: `bigint`) => `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -Retrieves the TransferRestrictions for a claim. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------- | :------------------------------- | -| `fractionId` | `bigint` | The ID of the claim to retrieve. | - -##### Returns - -`Promise`<[`TransferRestrictions`](../modules.md#transferrestrictions-1)\> - -A Promise that resolves to the applicable transfer restrictions. - -#### Defined in - -[sdk/src/types/client.ts:167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L167) - ---- - -### mergeFractionUnits - -• **mergeFractionUnits**: (`fractionIds`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionIds`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Merges multiple claim fractions into a single claim. - -##### Parameters - -| Name | Type | Description | -| :------------ | :--------- | :--------------------------------------- | -| `fractionIds` | `bigint`[] | The IDs of the claim fractions to merge. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:223](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L223) - ---- - -### mintClaim - -• **mintClaim**: (`metaData`: [`HypercertMetadata`](HypercertMetadata.md), `totalUnits`: `bigint`, `transferRestriction`: [`TransferRestrictions`](../modules.md#transferrestrictions-1)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`metaData`, `totalUnits`, `transferRestriction`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a new claim. - -##### Parameters - -| Name | Type | Description | -| :-------------------- | :------------------------------------------------------------- | :--------------------------------------- | -| `metaData` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata for the claim. | -| `totalUnits` | `bigint` | The total number of units for the claim. | -| `transferRestriction` | [`TransferRestrictions`](../modules.md#transferrestrictions-1) | The transfer restriction for the claim. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:156](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L156) - ---- - -### mintClaimFractionFromAllowlist - -• **mintClaimFractionFromAllowlist**: (`claimId`: `bigint`, `units`: `bigint`, `proof`: (\`0x$\{string}\` \| `Uint8Array`)[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`claimId`, `units`, `proof`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Mints a claim fraction from an allowlist. - -##### Parameters - -| Name | Type | Description | -| :-------- | :----------------------------------- | :------------------------------------------ | -| `claimId` | `bigint` | The ID of the claim to mint a fraction for. | -| `units` | `bigint` | The number of units for the fraction. | -| `proof` | (\`0x$\{string}\` \| `Uint8Array`)[] | The Merkle proof for the allowlist. | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:239](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L239) - ---- - -### splitFractionUnits - -• **splitFractionUnits**: (`fractionId`: `bigint`, `fractions`: `bigint`[]) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `fractions`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Splits a claim into multiple fractions. - -##### Parameters - -| Name | Type | Description | -| :----------- | :--------- | :---------------------------- | -| `fractionId` | `bigint` | The ID of the claim to split. | -| `fractions` | `bigint`[] | - | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L216) - ---- - -### transferFraction - -• **transferFraction**: (`fractionId`: `bigint`, `to`: \`0x$\{string}\`, `overrides?`: [`SupportedOverrides`](../modules.md#supportedoverrides)) => `Promise`<`undefined` \| \`0x$\{string}\`\> - -#### Type declaration - -▸ (`fractionId`, `to`, `overrides?`): `Promise`<`undefined` \| \`0x$\{string}\`\> - -Transfers a claim fraction to a new owner. - -##### Parameters - -| Name | Type | -| :----------- | :------------------------------------------------------- | -| `fractionId` | `bigint` | -| `to` | \`0x$\{string}\` | -| `overrides?` | [`SupportedOverrides`](../modules.md#supportedoverrides) | - -##### Returns - -`Promise`<`undefined` \| \`0x$\{string}\`\> - -A Promise that resolves to the transaction hash - -#### Defined in - -[sdk/src/types/client.ts:176](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L176) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientState.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientState.md deleted file mode 100644 index a03e6436..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertClientState.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -id: "HypercertClientState" -title: "Interface: HypercertClientState" -sidebar_label: "HypercertClientState" -sidebar_position: 0 -custom_edit_url: null ---- - -The state of the Hypercert client. - -## Hierarchy - -- **`HypercertClientState`** - - ↳ [`HypercertClientInterface`](HypercertClientInterface.md) - -## Properties - -### contract - -• **contract**: `GetContractReturnType`<(\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[]\> - -#### Defined in - -[sdk/src/types/client.ts:136](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L136) - ---- - -### indexer - -• **indexer**: `HypercertIndexer` - -The indexer used by the client. - -#### Defined in - -[sdk/src/types/client.ts:135](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L135) - ---- - -### readonly - -• **readonly**: `boolean` - -Whether the client is in read-only mode. - -#### Defined in - -[sdk/src/types/client.ts:131](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L131) - ---- - -### storage - -• **storage**: [`HypercertStorageInterface`](HypercertStorageInterface.md) - -The storage layer used by the client. - -#### Defined in - -[sdk/src/types/client.ts:133](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L133) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md deleted file mode 100644 index eba16af0..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertEvaluationSchema.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -id: "HypercertEvaluationSchema" -title: "Interface: HypercertEvaluationSchema" -sidebar_label: "HypercertEvaluationSchema" -sidebar_position: 0 -custom_edit_url: null ---- - -Schema for evaluating Hypercerts across different sources and evaluation types - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### creator - -• **creator**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L15) - ---- - -### evaluationData - -• **evaluationData**: [`EvaluationData`](../modules.md#evaluationdata) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:16](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L16) - ---- - -### evaluationSource - -• **evaluationSource**: [`EvaluationSource`](../modules.md#evaluationsource) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:17](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L17) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md deleted file mode 100644 index a08235b2..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertIndexerInterface.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -id: "HypercertIndexerInterface" -title: "Interface: HypercertIndexerInterface" -sidebar_label: "HypercertIndexerInterface" -sidebar_position: 0 -custom_edit_url: null ---- - -## Properties - -### claimById - -• **claimById**: (`id`: `string`) => `Promise`<`undefined` \| [`ClaimByIdQuery`](../modules.md#claimbyidquery)\> - -#### Type declaration - -▸ (`id`): `Promise`<`undefined` \| [`ClaimByIdQuery`](../modules.md#claimbyidquery)\> - -##### Parameters - -| Name | Type | -| :--- | :------- | -| `id` | `string` | - -##### Returns - -`Promise`<`undefined` \| [`ClaimByIdQuery`](../modules.md#claimbyidquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:20](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L20) - ---- - -### claimsByOwner - -• **claimsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`ClaimsByOwnerQuery`](../modules.md#claimsbyownerquery)\> - -#### Type declaration - -▸ (`owner`, `params?`): `Promise`<`undefined` \| [`ClaimsByOwnerQuery`](../modules.md#claimsbyownerquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `owner` | `string` | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`ClaimsByOwnerQuery`](../modules.md#claimsbyownerquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:19](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L19) - ---- - -### firstClaims - -• **firstClaims**: (`params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`RecentClaimsQuery`](../modules.md#recentclaimsquery)\> - -#### Type declaration - -▸ (`params?`): `Promise`<`undefined` \| [`RecentClaimsQuery`](../modules.md#recentclaimsquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`RecentClaimsQuery`](../modules.md#recentclaimsquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:21](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L21) - ---- - -### fractionById - -• **fractionById**: (`fractionId`: `string`) => `Promise`<`undefined` \| [`ClaimTokenByIdQuery`](../modules.md#claimtokenbyidquery)\> - -#### Type declaration - -▸ (`fractionId`): `Promise`<`undefined` \| [`ClaimTokenByIdQuery`](../modules.md#claimtokenbyidquery)\> - -##### Parameters - -| Name | Type | -| :----------- | :------- | -| `fractionId` | `string` | - -##### Returns - -`Promise`<`undefined` \| [`ClaimTokenByIdQuery`](../modules.md#claimtokenbyidquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L24) - ---- - -### fractionsByClaim - -• **fractionsByClaim**: (`claimId`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`ClaimTokensByClaimQuery`](../modules.md#claimtokensbyclaimquery)\> - -#### Type declaration - -▸ (`claimId`, `params?`): `Promise`<`undefined` \| [`ClaimTokensByClaimQuery`](../modules.md#claimtokensbyclaimquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `claimId` | `string` | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`ClaimTokensByClaimQuery`](../modules.md#claimtokensbyclaimquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L23) - ---- - -### fractionsByOwner - -• **fractionsByOwner**: (`owner`: `string`, `params?`: [`QueryParams`](../modules.md#queryparams)) => `Promise`<`undefined` \| [`ClaimTokensByOwnerQuery`](../modules.md#claimtokensbyownerquery)\> - -#### Type declaration - -▸ (`owner`, `params?`): `Promise`<`undefined` \| [`ClaimTokensByOwnerQuery`](../modules.md#claimtokensbyownerquery)\> - -##### Parameters - -| Name | Type | -| :-------- | :----------------------------------------- | -| `owner` | `string` | -| `params?` | [`QueryParams`](../modules.md#queryparams) | - -##### Returns - -`Promise`<`undefined` \| [`ClaimTokensByOwnerQuery`](../modules.md#claimtokensbyownerquery)\> - -#### Defined in - -[sdk/src/types/indexer.ts:22](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L22) - ---- - -### graphClient - -• **graphClient**: `Client` - -#### Defined in - -[sdk/src/types/indexer.ts:18](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L18) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertMetadata.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertMetadata.md deleted file mode 100644 index d65c96b0..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertMetadata.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -id: "HypercertMetadata" -title: "Interface: HypercertMetadata" -sidebar_label: "HypercertMetadata" -sidebar_position: 0 -custom_edit_url: null ---- - -Claim data for hypercert. ERC1155 Metadata compliant - -## Properties - -### allowList - -• `Optional` **allowList**: `string` - -A CID pointer to the merke tree proof json on ipfs - -#### Defined in - -[sdk/src/types/metadata.d.ts:39](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L39) - ---- - -### description - -• **description**: `string` - -Describes the asset to which this token represents - -#### Defined in - -[sdk/src/types/metadata.d.ts:19](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L19) - ---- - -### external_url - -• `Optional` **external_url**: `string` - -An url pointing to the external website of the project - -#### Defined in - -[sdk/src/types/metadata.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L23) - ---- - -### hypercert - -• `Optional` **hypercert**: `HypercertClaimdata` - -#### Defined in - -[sdk/src/types/metadata.d.ts:45](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L45) - ---- - -### image - -• **image**: `string` - -A URI pointing to a resource with mime type image/\* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. - -#### Defined in - -[sdk/src/types/metadata.d.ts:27](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L27) - ---- - -### name - -• **name**: `string` - -Identifies the asset to which this token represents - -#### Defined in - -[sdk/src/types/metadata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L15) - ---- - -### properties - -• `Optional` **properties**: \{ `[k: string]`: `unknown`; `trait_type?`: `string` ; `value?`: `string` }[] - -#### Defined in - -[sdk/src/types/metadata.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L40) - ---- - -### ref - -• `Optional` **ref**: `string` - -Describes the asset to which this token represents - -#### Defined in - -[sdk/src/types/metadata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L35) - ---- - -### version - -• `Optional` **version**: `string` - -The version of Hypercert schema used to describe this hypercert - -#### Defined in - -[sdk/src/types/metadata.d.ts:31](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/metadata.d.ts#L31) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertPointer.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertPointer.md deleted file mode 100644 index 1e369342..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertPointer.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: "HypercertPointer" -title: "Interface: HypercertPointer" -sidebar_label: "HypercertPointer" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### chainId - -• **chainId**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:28](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L28) - ---- - -### claimId - -• **claimId**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:30](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L30) - ---- - -### contract - -• **contract**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:29](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L29) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertStorageInterface.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertStorageInterface.md deleted file mode 100644 index aaec7a73..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/HypercertStorageInterface.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -id: "HypercertStorageInterface" -title: "Interface: HypercertStorageInterface" -sidebar_label: "HypercertStorageInterface" -sidebar_position: 0 -custom_edit_url: null ---- - -The interface for the Hypercert storage layer. - -## Implemented by - -- [`HypercertsStorage`](../classes/HypercertsStorage.md) - -## Properties - -### getData - -• **getData**: (`cidOrIpfsUri`: `string`) => `Promise`<`unknown`\> - -#### Type declaration - -▸ (`cidOrIpfsUri`): `Promise`<`unknown`\> - -Retrieves arbitrary data from IPFS. - -##### Parameters - -| Name | Type | Description | -| :------------- | :------- | :------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the data to retrieve. | - -##### Returns - -`Promise`<`unknown`\> - -A Promise that resolves to the retrieved data. - -#### Defined in - -[sdk/src/types/client.ts:110](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L110) - ---- - -### getMetadata - -• **getMetadata**: (`cidOrIpfsUri`: `string`) => `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> - -#### Type declaration - -▸ (`cidOrIpfsUri`): `Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> - -Retrieves the metadata for a hypercerts. - -##### Parameters - -| Name | Type | Description | -| :------------- | :------- | :----------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI of the metadata to retrieve. | - -##### Returns - -`Promise`<[`HypercertMetadata`](HypercertMetadata.md)\> - -A Promise that resolves to the retrieved metadata. - -#### Defined in - -[sdk/src/types/client.ts:103](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L103) - ---- - -### storeAllowList - -• **storeAllowList**: (`allowList`: [`AllowlistEntry`](../modules.md#allowlistentry)[], `totalUnits`: `bigint`) => `Promise`<`string`\> - -#### Type declaration - -▸ (`allowList`, `totalUnits`): `Promise`<`string`\> - -Stores the allowlost for a hypercert. - -##### Parameters - -| Name | Type | Description | -| :----------- | :------------------------------------------------- | :--------------------- | -| `allowList` | [`AllowlistEntry`](../modules.md#allowlistentry)[] | The metadata to store. | -| `totalUnits` | `bigint` | - | - -##### Returns - -`Promise`<`string`\> - -A Promise that resolves to the CID of the stored metadata. - -#### Defined in - -[sdk/src/types/client.ts:89](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L89) - ---- - -### storeMetadata - -• **storeMetadata**: (`metadata`: [`HypercertMetadata`](HypercertMetadata.md)) => `Promise`<`string`\> - -#### Type declaration - -▸ (`metadata`): `Promise`<`string`\> - -Stores the metadata for a hypercert. - -##### Parameters - -| Name | Type | Description | -| :--------- | :------------------------------------------ | :--------------------- | -| `metadata` | [`HypercertMetadata`](HypercertMetadata.md) | The metadata to store. | - -##### Returns - -`Promise`<`string`\> - -A Promise that resolves to the CID of the stored metadata. - -#### Defined in - -[sdk/src/types/client.ts:96](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L96) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/IPFSEvaluation.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/IPFSEvaluation.md deleted file mode 100644 index f3003492..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/IPFSEvaluation.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -id: "IPFSEvaluation" -title: "Interface: IPFSEvaluation" -sidebar_label: "IPFSEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### cid - -• **cid**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:48](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L48) - ---- - -### type - -• **type**: `"IPFS"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L47) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md deleted file mode 100644 index bb72a191..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/SimpleTextEvaluation.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -id: "SimpleTextEvaluation" -title: "Interface: SimpleTextEvaluation" -sidebar_label: "SimpleTextEvaluation" -sidebar_position: 0 -custom_edit_url: null ---- - -## Indexable - -▪ [k: `string`]: `unknown` - -## Properties - -### hypercert - -• **hypercert**: [`HypercertPointer`](HypercertPointer.md) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L35) - ---- - -### text - -• **text**: `string` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:36](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L36) - ---- - -### type - -• **type**: `"simpleText"` - -#### Defined in - -[sdk/src/types/evaluation.d.ts:34](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L34) diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/_category_.yml b/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/_category_.yml deleted file mode 100644 index 43bec88c..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/interfaces/_category_.yml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Interfaces" -position: 4 \ No newline at end of file diff --git a/docs/versioned_docs/version-1.4.1/developer/api/sdk/modules.md b/docs/versioned_docs/version-1.4.1/developer/api/sdk/modules.md deleted file mode 100644 index 3402343c..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/api/sdk/modules.md +++ /dev/null @@ -1,1520 +0,0 @@ ---- -id: "modules" -title: "@hypercerts-org/sdk" -sidebar_label: "Exports" -sidebar_position: 0.5 -custom_edit_url: null ---- - -## Classes - -- [ClientError](classes/ClientError.md) -- [ConfigurationError](classes/ConfigurationError.md) -- [ContractError](classes/ContractError.md) -- [FetchError](classes/FetchError.md) -- [HypercertClient](classes/HypercertClient.md) -- [HypercertsStorage](classes/HypercertsStorage.md) -- [InvalidOrMissingError](classes/InvalidOrMissingError.md) -- [MalformedDataError](classes/MalformedDataError.md) -- [MintingError](classes/MintingError.md) -- [StorageError](classes/StorageError.md) -- [UnknownSchemaError](classes/UnknownSchemaError.md) -- [UnsupportedChainError](classes/UnsupportedChainError.md) - -## Interfaces - -- [CustomError](interfaces/CustomError.md) -- [DuplicateEvaluation](interfaces/DuplicateEvaluation.md) -- [EASEvaluation](interfaces/EASEvaluation.md) -- [HypercertClaimdata](interfaces/HypercertClaimdata.md) -- [HypercertClientInterface](interfaces/HypercertClientInterface.md) -- [HypercertClientMethods](interfaces/HypercertClientMethods.md) -- [HypercertClientState](interfaces/HypercertClientState.md) -- [HypercertEvaluationSchema](interfaces/HypercertEvaluationSchema.md) -- [HypercertIndexerInterface](interfaces/HypercertIndexerInterface.md) -- [HypercertMetadata](interfaces/HypercertMetadata.md) -- [HypercertPointer](interfaces/HypercertPointer.md) -- [HypercertStorageInterface](interfaces/HypercertStorageInterface.md) -- [IPFSEvaluation](interfaces/IPFSEvaluation.md) -- [SimpleTextEvaluation](interfaces/SimpleTextEvaluation.md) - -## Type Aliases - -### AllowlistEntry - -Ƭ **AllowlistEntry**: `Object` - -Represents an entry in an allowlist. - -#### Type declaration - -| Name | Type | -| :-------- | :------- | -| `address` | `string` | -| `units` | `bigint` | - -#### Defined in - -[sdk/src/types/hypercerts.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L24) - ---- - -### Claim - -Ƭ **Claim**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :-------------------------------------------- | -| `__typename?` | `"Claim"` | -| `allowlist?` | `Maybe`<`Allowlist`\> | -| `contract` | `Scalars`[`"String"`][``"output"``] | -| `creation` | `Scalars`[`"BigInt"`][``"output"``] | -| `creator?` | `Maybe`<`Scalars`[`"Bytes"`][``"output"``]\> | -| `id` | `Scalars`[`"String"`][``"output"``] | -| `owner?` | `Maybe`<`Scalars`[`"Bytes"`][``"output"``]\> | -| `tokenID` | `Scalars`[`"BigInt"`][``"output"``] | -| `totalUnits?` | `Maybe`<`Scalars`[`"BigInt"`][``"output"``]\> | -| `uri?` | `Maybe`<`Scalars`[`"String"`][``"output"``]\> | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:195](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L195) - ---- - -### ClaimByIdQuery - -Ƭ **ClaimByIdQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claim?` | \{ `__typename?`: `"Claim"` ; `contract`: `string` ; `creator?`: `any` \| `null` ; `id`: `string` ; `owner?`: `any` \| `null` ; `tokenID`: `any` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` } \| `null` | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:1167](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1167) - ---- - -### ClaimToken - -Ƭ **ClaimToken**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :---------------------------------- | -| `__typename?` | `"ClaimToken"` | -| `claim` | [`Claim`](modules.md#claim) | -| `id` | `Scalars`[`"String"`][``"output"``] | -| `offers?` | `Maybe`<`Offer`[]\> | -| `owner` | `Scalars`[`"Bytes"`][``"output"``] | -| `tokenID` | `Scalars`[`"BigInt"`][``"output"``] | -| `units` | `Scalars`[`"BigInt"`][``"output"``] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:208](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L208) - ---- - -### ClaimTokenByIdQuery - -Ƭ **ClaimTokenByIdQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claimToken?` | \{ `__typename?`: `"ClaimToken"` ; `claim`: \{ `__typename?`: `"Claim"` ; `creation`: `any` ; `id`: `string` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` } ; `id`: `string` ; `owner`: `any` ; `tokenID`: `any` ; `units`: `any` } \| `null` | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:1194](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1194) - ---- - -### ClaimTokensByClaimQuery - -Ƭ **ClaimTokensByClaimQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :--------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claimTokens` | \{ `__typename?`: `"ClaimToken"` ; `id`: `string` ; `owner`: `any` ; `tokenID`: `any` ; `units`: `any` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:1187](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1187) - ---- - -### ClaimTokensByOwnerQuery - -Ƭ **ClaimTokensByOwnerQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claimTokens` | \{ `__typename?`: `"ClaimToken"` ; `claim`: \{ `__typename?`: `"Claim"` ; `creation`: `any` ; `id`: `string` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` } ; `id`: `string` ; `owner`: `any` ; `tokenID`: `any` ; `units`: `any` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:1177](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1177) - ---- - -### ClaimsByOwnerQuery - -Ƭ **ClaimsByOwnerQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claims` | \{ `__typename?`: `"Claim"` ; `contract`: `string` ; `creator?`: `any` \| `null` ; `id`: `string` ; `owner?`: `any` \| `null` ; `tokenID`: `any` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:1151](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1151) - ---- - -### Contracts - -Ƭ **Contracts**: `"HypercertMinterUUPS"` \| `"TransferManager"` \| `"ProtocolFeeRecipient"` \| `"HypercertExchange"` \| `"RoyaltyFeeRegistry"` \| `"OrderValidator"` \| `"CreatorFeeManager"` \| `"StrategyCollectionOffer"` \| `"StrategyDutchAuction"` \| `"StrategyItemIdsRange"` \| `"StrategyHypercertCollectionOffer"` \| `"StrategyHypercertDutchAuction"` \| `"StrategyHypercertFractionOffer"` - -#### Defined in - -[sdk/src/types/client.ts:17](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L17) - ---- - -### Deployment - -Ƭ **Deployment**: `Object` - -Represents a deployment of a contract on a specific network. - -#### Type declaration - -| Name | Type | Description | -| :---------- | :--------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------- | -| `addresses` | `Partial`<`Record`<[`Contracts`](modules.md#contracts), \`0x$\{string}\`\>\> | The address of the deployed contract. | -| `chain` | `Partial`<`Chain`\> | - | -| `graphName` | `string` | - | -| `graphUrl` | `string` | The url to the subgraph that indexes the contract events. Override for localized testing | - -#### Defined in - -[sdk/src/types/client.ts:35](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L35) - ---- - -### DocumentType - -Ƭ **DocumentType**<`TDocumentNode`\>: `TDocumentNode` extends `DocumentNode` ? `TType` : `never` - -#### Type parameters - -| Name | Type | -| :-------------- | :------------------------------------ | -| `TDocumentNode` | extends `DocumentNode`<`any`, `any`\> | - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L47) - ---- - -### EvaluationData - -Ƭ **EvaluationData**: [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) \| [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) - -This file was automatically generated by json-schema-to-typescript. -DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -and run json-schema-to-typescript to regenerate this file. - -#### Defined in - -[sdk/src/types/evaluation.d.ts:8](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L8) - ---- - -### EvaluationSource - -Ƭ **EvaluationSource**: [`EASEvaluation`](interfaces/EASEvaluation.md) \| [`IPFSEvaluation`](interfaces/IPFSEvaluation.md) - -#### Defined in - -[sdk/src/types/evaluation.d.ts:9](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/evaluation.d.ts#L9) - ---- - -### FragmentType - -Ƭ **FragmentType**<`TDocumentType`\>: `TDocumentType` extends `DocumentTypeDecoration` ? [`TType`] extends [\{ ` $fragmentName?`: infer TKey }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in TKey]: TType } } : `never` : `never` : `never` - -#### Type parameters - -| Name | Type | -| :-------------- | :---------------------------------------------- | -| `TDocumentType` | extends `DocumentTypeDecoration`<`any`, `any`\> | - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:6](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L6) - ---- - -### HypercertClientConfig - -Ƭ **HypercertClientConfig**: [`Deployment`](modules.md#deployment) & [`HypercertStorageConfig`](modules.md#hypercertstorageconfig) & [`HypercertEvaluatorConfig`](modules.md#hypercertevaluatorconfig) & \{ `publicClient`: `PublicClient` ; `readOnly`: `boolean` ; `readOnlyReason?`: `string` ; `unsafeForceOverrideConfig?`: `boolean` ; `walletClient`: `WalletClient` } - -Configuration options for the Hypercert client. - -#### Defined in - -[sdk/src/types/client.ts:47](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L47) - ---- - -### HypercertClientProps - -Ƭ **HypercertClientProps**: `Object` - -The props for the Hypercert client. - -#### Type declaration - -| Name | Type | Description | -| :-------- | :---------------------------------------------------------------------- | :-------------------------------------------------- | -| `config?` | `Partial`<[`HypercertClientConfig`](modules.md#hypercertclientconfig)\> | The configuration options for the Hypercert client. | - -#### Defined in - -[sdk/src/types/client.ts:116](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L116) - ---- - -### HypercertEvaluatorConfig - -Ƭ **HypercertEvaluatorConfig**: `Omit`<`PartialTypedDataConfig`, `"address"`\> & \{ `easContractAddress`: `string` } - -Configuration options for the Hypercert evaluator. - -**`Note`** - -The signer is required for submitting evaluations. - -#### Defined in - -[sdk/src/types/client.ts:76](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L76) - ---- - -### HypercertStorageConfig - -Ƭ **HypercertStorageConfig**: `Object` - -Configuration options for the Hypercert storage layer. - -**`Note`** - -The API tokens are optional, but required for storing data on NFT.storage and Web3.storage. - -**`Deprecated`** - -nft.storage and web3.storage are no longer used - -#### Type declaration - -| Name | Type | Description | -| :----------------- | :------- | :----------------------------- | -| `nftStorageToken?` | `string` | The API token for NFT.storage. | - -#### Defined in - -[sdk/src/types/client.ts:67](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L67) - ---- - -### HypercertsSdkError - -Ƭ **HypercertsSdkError**: [`ConfigurationError`](classes/ConfigurationError.md) \| [`FetchError`](classes/FetchError.md) \| [`InvalidOrMissingError`](classes/InvalidOrMissingError.md) \| [`MalformedDataError`](classes/MalformedDataError.md) \| [`MintingError`](classes/MintingError.md) \| [`StorageError`](classes/StorageError.md) \| [`UnsupportedChainError`](classes/UnsupportedChainError.md) \| [`UnknownSchemaError`](classes/UnknownSchemaError.md) - -#### Defined in - -[sdk/src/types/errors.ts:195](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/errors.ts#L195) - ---- - -### QueryParams - -Ƭ **QueryParams**: `Object` - -#### Index signature - -▪ [key: `string`]: `string` \| `number` \| `undefined` - -#### Type declaration - -| Name | Type | -| :---------------- | :------------------ | -| `first` | `number` | -| `orderDirections` | `"asc"` \| `"desc"` | -| `skip` | `number` | - -#### Defined in - -[sdk/src/types/indexer.ts:10](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/indexer.ts#L10) - ---- - -### RecentClaimsQuery - -Ƭ **RecentClaimsQuery**: `Object` - -#### Type declaration - -| Name | Type | -| :------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__typename?` | `"Query"` | -| `claims` | \{ `__typename?`: `"Claim"` ; `contract`: `string` ; `creator?`: `any` \| `null` ; `id`: `string` ; `owner?`: `any` \| `null` ; `tokenID`: `any` ; `totalUnits?`: `any` \| `null` ; `uri?`: `string` \| `null` }[] | - -#### Defined in - -[sdk/src/indexer/gql/graphql.ts:1160](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/graphql.ts#L1160) - ---- - -### SupportedChainIds - -Ƭ **SupportedChainIds**: `10` \| `42220` \| `11155111` - -#### Defined in - -[sdk/src/types/client.ts:10](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L10) - ---- - -### SupportedOverrides - -Ƭ **SupportedOverrides**: `Object` - -#### Type declaration - -| Name | Type | -| :---------- | :------- | -| `gasLimit?` | `bigint` | -| `gasPrice?` | `bigint` | -| `value?` | `bigint` | - -#### Defined in - -[sdk/src/types/client.ts:11](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/client.ts#L11) - ---- - -### TransferRestrictions - -Ƭ **TransferRestrictions**: typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)[keyof typeof [`TransferRestrictions`](modules.md#transferrestrictions-1)] - -#### Defined in - -[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L9) - -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L15) - -## Variables - -### CreatorFeeManagerWithRoyaltiesAbi - -• **CreatorFeeManagerWithRoyaltiesAbi**: (\{ `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_royaltyFeeRegistry"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "collection"; `type`: `string` = "address" }[] ; `name`: `string` = "BundleEIP2981NotAllowed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "collection"; `type`: `string` = "address" }[] ; `name`: `string` = "viewCreatorFeeInfo"; `outputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "creator"; `type`: `string` = "address" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5782 - ---- - -### ExecutionManagerAbi - -• **ExecutionManagerAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_owner"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = "strategyId"; `type`: `string` = "uint256" }[] ; `name`: `string` = "StrategyNotAvailable"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "currency"; `type`: `string` = "address" }[] ; `name`: `string` = "CurrencyStatusUpdated"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = ""; `type`: `string` = "address" }[] ; `name`: `string` = "isCurrencyAllowed"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = ""; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6906 - ---- - -### HypercertExchangeAbi - -• **HypercertExchangeAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_owner"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = "length"; `type`: `string` = "uint256" }[] ; `name`: `string` = "MerkleProofTooLarge"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: (\{ `components`: \{ `internalType`: `string` = "bytes32"; `name`: `string` = "orderHash"; `type`: `string` = "bytes32" }[] ; `indexed`: `boolean` = false; `internalType`: `string` = "struct ILooksRareProtocol.NonceInvalidationParameters"; `name`: `string` = "nonceInvalidationParameters"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "askUser"; `type`: `string` = "address" })[] ; `name`: `string` = "TakerAsk"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: (\{ `components?`: `undefined` ; `internalType`: `string` = "bytes[]"; `name`: `string` = "makerSignatures"; `type`: `string` = "bytes[]" } \| \{ `components`: (\{ `components?`: `undefined` ; `internalType`: `string` = "bytes32"; `name`: `string` = "root"; `type`: `string` = "bytes32" } \| \{ `components`: \{ `internalType`: `string` = "bytes32"; `name`: `string` = "value"; `type`: `string` = "bytes32" }[] ; `internalType`: `string` = "struct OrderStructs.MerkleTreeNode[]"; `name`: `string` = "proof"; `type`: `string` = "tuple[]" })[] ; `internalType`: `string` = "struct OrderStructs.MerkleTree[]"; `name`: `string` = "merkleTrees"; `type`: `string` = "tuple[]" })[] ; `name`: `string` = "executeMultipleTakerBids"; `outputs`: `never`[] = []; `stateMutability`: `string` = "payable"; `type`: `string` = "function" } \| \{ `anonymous?`: `undefined` = false; `inputs`: (\{ `components`: \{ `internalType`: `string` = "address"; `name`: `string` = "recipient"; `type`: `string` = "address" }[] ; `internalType`: `string` = "struct OrderStructs.Taker"; `name`: `string` = "takerBid"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "address"; `name`: `string` = "sender"; `type`: `string` = "address" })[] ; `name`: `string` = "restrictedExecuteTakerBid"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = "protocolFeeAmount"; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:1226 - ---- - -### HypercertMinterAbi - -• **HypercertMinterAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AlreadyClaimed"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "previousAdmin"; `type`: `string` = "address" }[] ; `name`: `string` = "AdminChanged"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "account"; `type`: `string` = "address" }[] ; `name`: `string` = "balanceOf"; `outputs`: \{ `internalType`: `string` = "uint256"; `name`: `string` = ""; `type`: `string` = "uint256" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:35 - ---- - -### OrderValidatorV2AAbi - -• **OrderValidatorV2AAbi**: (\{ `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_looksRareProtocol"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `inputs`: (\{ `components?`: `undefined` ; `internalType`: `string` = "bytes"; `name`: `string` = "signature"; `type`: `string` = "bytes" } \| \{ `components`: (\{ `components?`: `undefined` ; `internalType`: `string` = "bytes32"; `name`: `string` = "root"; `type`: `string` = "bytes32" } \| \{ `components`: \{ `internalType`: `string` = "bytes32"; `name`: `string` = "value"; `type`: `string` = "bytes32" }[] ; `internalType`: `string` = "struct OrderStructs.MerkleTreeNode[]"; `name`: `string` = "proof"; `type`: `string` = "tuple[]" })[] ; `internalType`: `string` = "struct OrderStructs.MerkleTree"; `name`: `string` = "merkleTree"; `type`: `string` = "tuple" })[] ; `name`: `string` = "checkMakerOrderValidity"; `outputs`: \{ `internalType`: `string` = "uint256[9]"; `name`: `string` = "validationCodes"; `type`: `string` = "uint256[9]" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3071 - ---- - -### StrategyCollectionOfferAbi - -• **StrategyCollectionOfferAbi**: (\{ `inputs`: `never`[] = []; `name`: `string` = "CollectionTypeInvalid"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: (\{ `components`: \{ `internalType`: `string` = "enum QuoteType"; `name`: `string` = "quoteType"; `type`: `string` = "uint8" }[] ; `internalType`: `string` = "struct OrderStructs.Maker"; `name`: `string` = "makerBid"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "bytes4"; `name`: `string` = "functionSelector"; `type`: `string` = "bytes4" })[] ; `name`: `string` = "isMakerOrderValid"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = "isValid"; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "pure"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:4585 - ---- - -### StrategyDutchAuctionAbi - -• **StrategyDutchAuctionAbi**: (\{ `inputs`: `never`[] = []; `name`: `string` = "BidTooLow"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: (\{ `components`: \{ `internalType`: `string` = "enum QuoteType"; `name`: `string` = "quoteType"; `type`: `string` = "uint8" }[] ; `internalType`: `string` = "struct OrderStructs.Maker"; `name`: `string` = "makerAsk"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "bytes4"; `name`: `string` = "functionSelector"; `type`: `string` = "bytes4" })[] ; `name`: `string` = "isMakerOrderValid"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = "isValid"; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "pure"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5110 - ---- - -### StrategyHypercertCollectionOfferAbi - -• **StrategyHypercertCollectionOfferAbi**: (\{ `inputs`: `never`[] = []; `name`: `string` = "CollectionTypeInvalid"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: (\{ `components`: \{ `internalType`: `string` = "enum QuoteType"; `name`: `string` = "quoteType"; `type`: `string` = "uint8" }[] ; `internalType`: `string` = "struct OrderStructs.Maker"; `name`: `string` = "makerBid"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "bytes4"; `name`: `string` = "functionSelector"; `type`: `string` = "bytes4" })[] ; `name`: `string` = "isMakerOrderValid"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = "isValid"; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "pure"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5855 - ---- - -### StrategyHypercertDutchAuctionAbi - -• **StrategyHypercertDutchAuctionAbi**: (\{ `inputs`: `never`[] = []; `name`: `string` = "BidTooLow"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: (\{ `components`: \{ `internalType`: `string` = "enum QuoteType"; `name`: `string` = "quoteType"; `type`: `string` = "uint8" }[] ; `internalType`: `string` = "struct OrderStructs.Maker"; `name`: `string` = "makerAsk"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "bytes4"; `name`: `string` = "functionSelector"; `type`: `string` = "bytes4" })[] ; `name`: `string` = "isMakerOrderValid"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = "isValid"; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6380 - ---- - -### StrategyHypercertFractionOfferAbi - -• **StrategyHypercertFractionOfferAbi**: (\{ `inputs`: `never`[] = []; `name`: `string` = "AmountInvalid"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: (\{ `components`: \{ `internalType`: `string` = "enum QuoteType"; `name`: `string` = "quoteType"; `type`: `string` = "uint8" }[] ; `internalType`: `string` = "struct OrderStructs.Maker"; `name`: `string` = "makerAsk"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "bytes4"; `name`: `string` = "functionSelector"; `type`: `string` = "bytes4" })[] ; `name`: `string` = "isMakerOrderValid"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = "isValid"; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5379 - ---- - -### StrategyItemIdsRangeAbi - -• **StrategyItemIdsRangeAbi**: (\{ `inputs`: `never`[] = []; `name`: `string` = "OrderInvalid"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `inputs`: (\{ `components`: \{ `internalType`: `string` = "enum QuoteType"; `name`: `string` = "quoteType"; `type`: `string` = "uint8" }[] ; `internalType`: `string` = "struct OrderStructs.Maker"; `name`: `string` = "makerBid"; `type`: `string` = "tuple" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "bytes4"; `name`: `string` = "functionSelector"; `type`: `string` = "bytes4" })[] ; `name`: `string` = "isMakerOrderValid"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = "isValid"; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "pure"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6649 - ---- - -### StrategyManagerAbi - -• **StrategyManagerAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_owner"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "NoOngoingTransferInProgress"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "currency"; `type`: `string` = "address" }[] ; `name`: `string` = "CurrencyStatusUpdated"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = ""; `type`: `string` = "address" }[] ; `name`: `string` = "isCurrencyAllowed"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = ""; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3508 - ---- - -### TransferManagerAbi - -• **TransferManagerAbi**: (\{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = "\_owner"; `type`: `string` = "address" }[] ; `name?`: `undefined` = "balanceOf"; `outputs?`: `undefined` ; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "constructor" } \| \{ `anonymous?`: `undefined` = false; `inputs`: `never`[] = []; `name`: `string` = "AmountInvalid"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "error" } \| \{ `anonymous`: `boolean` = false; `inputs`: \{ `indexed`: `boolean` = false; `internalType`: `string` = "address"; `name`: `string` = "user"; `type`: `string` = "address" }[] ; `name`: `string` = "ApprovalsGranted"; `outputs?`: `undefined` ; `stateMutability?`: `undefined` = "view"; `type`: `string` = "event" } \| \{ `anonymous?`: `undefined` = false; `inputs`: \{ `internalType`: `string` = "address"; `name`: `string` = ""; `type`: `string` = "address" }[] ; `name`: `string` = "hasUserApprovedOperator"; `outputs`: \{ `internalType`: `string` = "bool"; `name`: `string` = ""; `type`: `string` = "bool" }[] ; `stateMutability`: `string` = "view"; `type`: `string` = "function" } \| \{ `anonymous?`: `undefined` = false; `inputs`: (\{ `components`: \{ `internalType`: `string` = "address"; `name`: `string` = "collection"; `type`: `string` = "address" }[] ; `internalType`: `string` = "struct ITransferManager.BatchTransferItem[]"; `name`: `string` = "items"; `type`: `string` = "tuple[]" } \| \{ `components?`: `undefined` ; `internalType`: `string` = "address"; `name`: `string` = "from"; `type`: `string` = "address" })[] ; `name`: `string` = "transferBatchItemsAcrossCollections"; `outputs`: `never`[] = []; `stateMutability`: `string` = "nonpayable"; `type`: `string` = "function" })[] - -#### Defined in - -node_modules/.pnpm/@hypercerts-org+contracts@1.1.0_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3974 - ---- - -### TransferRestrictions - -• `Const` **TransferRestrictions**: `Object` - -Represents the possible transfer restrictions of a claim matching the hypercerts protocol. - -#### Type declaration - -| Name | Type | -| :---------------- | :--- | -| `AllowAll` | `0` | -| `DisallowAll` | `1` | -| `FromCreatorOnly` | `2` | - -#### Defined in - -[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L9) - -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/types/hypercerts.ts#L15) - ---- - -### apis - -• `Const` **apis**: `Object` - -#### Index signature - -▪ [key: `string`]: `string` - -#### Defined in - -[sdk/src/constants.ts:12](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/constants.ts#L12) - ---- - -### deployments - -• `Const` **deployments**: \{ [key in SupportedChainIds]: Partial } - -#### Defined in - -[sdk/src/constants.ts:18](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/constants.ts#L18) - ---- - -### logger - -• `Const` **logger**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :-------------------------------------------------------------------------- | -| `debug` | (`message`: `string`, `label?`: `string`, ...`data`: `unknown`[]) => `void` | -| `error` | (`error`: `Error`, `label?`: `string`) => `void` | -| `info` | (`message`: `string`, `label?`: `string`, ...`data`: `unknown`[]) => `void` | -| `warn` | (`message`: `string`, `label?`: `string`, ...`data`: `unknown`[]) => `void` | - -#### Defined in - -[sdk/src/utils/logger.ts:24](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/logger.ts#L24) - -## Functions - -### formatHypercertData - -▸ **formatHypercertData**(`«destructured»`): `FormatResult` - -Formats input data to an object containing HypercertMetadata including appropriate labels - -#### Parameters - -| Name | Type | -| :----------------------- | :------------------------------------------------ | -| `«destructured»` | `Object` | -| › `contributors` | `string`[] | -| › `description` | `string` | -| › `excludedImpactScope` | `string`[] | -| › `excludedRights` | `string`[] | -| › `excludedWorkScope` | `string`[] | -| › `external_url?` | `string` | -| › `image` | `string` | -| › `impactScope` | `string`[] | -| › `impactTimeframeEnd` | `number` | -| › `impactTimeframeStart` | `number` | -| › `name` | `string` | -| › `properties?` | \{ `trait_type`: `string` ; `value`: `string` }[] | -| › `rights` | `string`[] | -| › `version` | `string` | -| › `workScope` | `string`[] | -| › `workTimeframeEnd` | `number` | -| › `workTimeframeStart` | `number` | - -#### Returns - -`FormatResult` - -#### Defined in - -[sdk/src/utils/formatter.ts:27](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/formatter.ts#L27) - ---- - -### getClaimStoredDataFromTxHash - -▸ **getClaimStoredDataFromTxHash**(`client`, `hash`): `Promise`<`ParserReturnType`\> - -Utility method to parse a hypercert mint transaction (createAllowlist, mintClaim) and get the ID of the minted claim - -#### Parameters - -| Name | Type | Description | -| :-------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `client` | `Object` | public client provided by viem | -| `client.account` | `undefined` | The Account of the Client. | -| `client.batch?` | `Object` | Flags for batch settings. | -| `client.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `client.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `client.call` | (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> | Executes a new message call immediately without submitting a transaction to the network. - Docs: https://viem.sh/docs/actions/public/call.html - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) ` | -| `client.chain` | `undefined` \| `Chain` | Chain for the client. | -| `client.createBlockFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> | Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter) **`Example`** `ts import { createPublicClient, createBlockFilter, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await createBlockFilter(client) // { id: "0x345a6572337856574a76364e457a4366", type: 'block' } ` | -| `client.createContractEventFilter` | (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html). - Docs: https://viem.sh/docs/contract/createContractEventFilter.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), }) ` | -| `client.createEventFilter` | (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> | Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createEventFilter.html - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', }) ` | -| `client.createPendingTransactionFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> | Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' } ` | -| `client.estimateContractGas` | (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas.html **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gas = await client.estimateContractGas({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), functionName: 'mint', account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | -| `client.estimateFeesPerGas` | (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> | Returns an estimate for the fees per gas for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateFeesPerGas() // { maxFeePerGas: ..., maxPriorityFeePerGas: ... } ` | -| `client.estimateGas` | (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas.html - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) **`Example`** `ts import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasEstimate = await client.estimateGas({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }) ` | -| `client.estimateMaxPriorityFeePerGas` | (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> | Returns an estimate for the max priority fee per gas (in wei) for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() // 10000000n ` | -| `client.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> | - | -| `client.getBalance` | (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> | Returns the balance of an address in wei. - Docs: https://viem.sh/docs/actions/public/getBalance.html - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance) **`Remarks`** You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html). `ts const balance = await getBalance(client, { address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', blockTag: 'safe' }) const balanceAsEther = formatEther(balance) // "6.942" ` **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const balance = await client.getBalance({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) // 10000000000000000000000n (wei) ` | -| `client.getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getBlock() ` | -| `client.getBlockNumber` | (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> | Returns the number of the most recent block seen. - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blockNumber = await client.getBlockNumber() // 69420n ` | -| `client.getBlockTransactionCount` | (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of Transactions at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html - JSON-RPC Methods: - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const count = await client.getBlockTransactionCount() ` | -| `client.getBytecode` | (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> | Retrieves the bytecode at an address. - Docs: https://viem.sh/docs/contract/getBytecode.html - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getBytecode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', }) ` | -| `client.getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const chainId = await client.getChainId() // 1 ` | -| `client.getContractEvents` | (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents.html - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { wagmiAbi } from './abi' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getContractEvents(client, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: wagmiAbi, eventName: 'Transfer' }) ` | -| `client.getEnsAddress` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAddress = await client.getEnsAddress({ name: normalize('wevm.eth'), }) // '0xd2135CfB216b74109775236E36d4b433F1DF507B' ` | -| `client.getEnsAvatar` | (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAvatar = await client.getEnsAvatar({ name: normalize('wevm.eth'), }) // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio' ` | -| `client.getEnsName` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensName = await client.getEnsName({ address: '0xd2135CfB216b74109775236E36d4b433F1DF507B', }) // 'wevm.eth' ` | -| `client.getEnsResolver` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> | Gets resolver for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const resolverAddress = await client.getEnsResolver({ name: normalize('wevm.eth'), }) // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41' ` | -| `client.getEnsText` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const twitterRecord = await client.getEnsText({ name: normalize('wevm.eth'), key: 'com.twitter', }) // 'wagmi_sh' ` | -| `client.getFeeHistory` | (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> | Returns a collection of historical gas information. - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const feeHistory = await client.getFeeHistory({ blockCount: 4, rewardPercentiles: [25, 75], }) ` | -| `client.getFilterChanges` | (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called. - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) **`Remarks`** A Filter can be created from the following actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) Depending on the type of filter, the return value will be different: - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs. - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes. - If the filter was created with `createBlockFilter`, it returns a list of block hashes. **`Example`** `ts // Blocks import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createBlockFilter() const hashes = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Contract Events import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), eventName: 'Transfer', }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Raw Events import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Transactions import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() const hashes = await client.getFilterChanges({ filter }) ` | -| `client.getFilterLogs` | (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs since the filter was created. - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) **`Remarks`** `getFilterLogs` is only compatible with **event filters**. **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterLogs({ filter }) ` | -| `client.getGasPrice` | () => `Promise`<`bigint`\> | Returns the current price of gas (in wei). - Docs: https://viem.sh/docs/actions/public/getGasPrice.html - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasPrice = await client.getGasPrice() ` | -| `client.getLogs` | (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs matching the provided parameters. - Docs: https://viem.sh/docs/actions/public/getLogs.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/filters-and-logs/event-logs - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getLogs() ` | -| `client.getProof` | (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> | Returns the account and storage values of the specified account including the Merkle-proof. - Docs: https://viem.sh/docs/actions/public/getProof.html - JSON-RPC Methods: - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getProof({ address: '0x...', storageKeys: ['0x...'], }) ` | -| `client.getStorageAt` | (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> | Returns the value from a storage slot at a given address. - Docs: https://viem.sh/docs/contract/getStorageAt.html - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getStorageAt } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getStorageAt({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', slot: toHex(0), }) ` | -| `client.getTransaction` | (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transaction = await client.getTransaction({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `client.getTransactionConfirmations` | (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> | Returns the number of blocks passed (confirmations) since the transaction was processed on a block. - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const confirmations = await client.getTransactionConfirmations({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `client.getTransactionCount` | (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionCount = await client.getTransactionCount({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `client.getTransactionReceipt` | (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> | Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.getTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `client.key` | `string` | A key for the client. | -| `client.multicall` | (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall). - Docs: https://viem.sh/docs/contract/multicall.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const abi = parseAbi([ 'function balanceOf(address) view returns (uint256)', 'function totalSupply() view returns (uint256)', ]) const result = await client.multicall({ contracts: [ { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'totalSupply', }, ], }) // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }] ` | -| `client.name` | `string` | A name for the client. | -| `client.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `client.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `client.readContract` | (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/reading-contracts **`Remarks`** A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' import { readContract } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.readContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function balanceOf(address) view returns (uint256)']), functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }) // 424122n ` | -| `client.request` | `EIP1193RequestFn`<`PublicRpcSchema`\> | Request function wrapped with friendly error handling | -| `client.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `client.simulateContract` | (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> | Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions. - Docs: https://viem.sh/docs/contract/simulateContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts **`Remarks`** This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32) view returns (uint32)']), functionName: 'mint', args: ['69420'], account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `client.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `client.type` | `string` | The type of client. | -| `client.uid` | `string` | A unique ID for the client. | -| `client.uninstallFilter` | (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> | Destroys a Filter that was created from one of the following Actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { createPendingTransactionFilter, uninstallFilter } from 'viem/public' const filter = await client.createPendingTransactionFilter() const uninstalled = await client.uninstallFilter({ filter }) // true ` | -| `client.verifyMessage` | (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> | - | -| `client.verifyTypedData` | (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> | - | -| `client.waitForTransactionReceipt` | (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> | Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed. - If a Transaction has been replaced: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions - Checks if one of the Transactions is a replacement - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt). **`Remarks`** The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions). Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce. There are 3 types of Transaction Replacement reasons: - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`) - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`) - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.waitForTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `client.watchBlockNumber` | (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` | Watches and returns incoming block numbers. - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlockNumber({ onBlockNumber: (blockNumber) => console.log(blockNumber), }) ` | -| `client.watchBlocks` | (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` | Watches and returns information for incoming blocks. - Docs: https://viem.sh/docs/actions/public/watchBlocks.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlocks({ onBlock: (block) => console.log(block), }) ` | -| `client.watchContractEvent` | (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent.html **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchContractEvent({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']), eventName: 'Transfer', args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, onLogs: (logs) => console.log(logs), }) ` | -| `client.watchEvent` | (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent.html - JSON-RPC Methods: - **RPC Provider supports `eth_newFilter`:** - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize). - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - **RPC Provider does not support `eth_newFilter`:** - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval. **`Remarks`** This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchEvent({ onLogs: (logs) => console.log(logs), }) ` | -| `client.watchPendingTransactions` | (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` | Watches and returns pending transaction hashes. - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html - JSON-RPC Methods: - When `poll: true` - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter. - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event. **`Remarks`** This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchPendingTransactions({ onTransactions: (hashes) => console.log(hashes), }) ` | -| `hash` | \`0x$\{string}\` | transaction hash returned from the transaction | - -#### Returns - -`Promise`<`ParserReturnType`\> - -returns a promise with the parsed data or errors - -**`Notice`** - -This method is a wrapper around basic viem utilties to parse ClaimStored(uint256 indexed claimID, string uri, uint256 totalUnits). - -#### Defined in - -[sdk/src/utils/txParser.ts:26](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/txParser.ts#L26) - ---- - -### getFromIPFS - -▸ **getFromIPFS**(`cidOrIpfsUri`, `timeout?`): `Promise`<`unknown`\> - -Fetches data from IPFS using either the NFT Storage gateway or the Web3Up gateway. - -This function attempts to fetch data from the NFT Storage gateway first. If the request times out, it then tries to fetch the data from the Web3Up gateway. -If the data cannot be fetched from either gateway, it throws a `StorageError`. - -#### Parameters - -| Name | Type | Default value | Description | -| :------------- | :------- | :------------ | :---------------------------------------------------------------------- | -| `cidOrIpfsUri` | `string` | `undefined` | The CID or IPFS URI of the data to fetch. | -| `timeout?` | `number` | `10000` | The timeout for the fetch request in milliseconds. Defaults to 10000ms. | - -#### Returns - -`Promise`<`unknown`\> - -The data fetched from IPFS. - -**`Throws`** - -Will throw a `StoragjeError` if the data cannot be fetched from either gateway. - -**`Async`** - -#### Defined in - -[sdk/src/utils/fetchers.ts:17](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/fetchers.ts#L17) - ---- - -### getProofsFromAllowlist - -▸ **getProofsFromAllowlist**(`cidOrIpfsUri`, `account`): `Promise`<`undefined` \| \{ `proof`: `string`[] ; `root`: `string` = tree.root }\> - -This function retrieves proofs from an allowlist. - -It fetches a Merkle tree from IPFS using a given CID or IPFS URI, then iterates over the tree to find an account. -When the account is found, it generates a proof for that account and logs the account, index, and proof as debug. -It returns the proof and the root of the Merkle tree. - -#### Parameters - -| Name | Type | Description | -| :------------- | :--------------- | :------------------------------------------------- | -| `cidOrIpfsUri` | `string` | The CID or IPFS URI to fetch the Merkle tree from. | -| `account` | \`0x$\{string}\` | The account to find in the Merkle tree. | - -#### Returns - -`Promise`<`undefined` \| \{ `proof`: `string`[] ; `root`: `string` = tree.root }\> - -An object containing the proof for the account and the root of the Merkle tree. - -**`Throws`** - -Will throw an error if the Merkle tree cannot be fetched. - -**`Async`** - -#### Defined in - -[sdk/src/utils/allowlist.ts:43](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/allowlist.ts#L43) - ---- - -### graphql - -▸ **graphql**(`source`): `unknown` - -The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - -#### Parameters - -| Name | Type | -| :------- | :------- | -| `source` | `string` | - -#### Returns - -`unknown` - -**`Example`** - -```ts -const query = graphql( - ` - query GetUser($id: ID!) { - user(id: $id) { - name - } - } - `, -); -``` - -The query argument is unknown! -Please regenerate the types. - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:32](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L32) - -▸ **graphql**(`source`): typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"``] - -The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - -#### Parameters - -| Name | Type | -| :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `source` | `"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"` | - -#### Returns - -typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery RecentClaims($orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claims(orderDirection: $orderDirection, orderBy: creation, first: $first) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}\n\nquery ClaimById($id: ID!) {\n claim(id: $id) {\n contract\n tokenID\n creator\n id\n owner\n totalUnits\n uri\n }\n}"``] - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:37](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L37) - -▸ **graphql**(`source`): typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"``] - -The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - -#### Parameters - -| Name | Type | -| :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `source` | `"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"` | - -#### Returns - -typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {owner: $owner}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}\n\nquery ClaimTokensByClaim($claimId: String!, $orderDirection: OrderDirection, $first: Int, $skip: Int) {\n claimTokens(\n where: {claim: $claimId}\n skip: $skip\n first: $first\n orderDirection: $orderDirection\n ) {\n id\n owner\n tokenID\n units\n }\n}\n\nquery ClaimTokenById($claimTokenId: ID!) {\n claimToken(id: $claimTokenId) {\n id\n owner\n tokenID\n units\n claim {\n id\n creation\n uri\n totalUnits\n }\n }\n}"``] - -#### Defined in - -[sdk/src/indexer/gql/gql.ts:41](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/gql.ts#L41) - ---- - -### handleContractError - -▸ **handleContractError**(`data`): [`ContractError`](classes/ContractError.md) - -#### Parameters - -| Name | Type | -| :----- | :--------------- | -| `data` | \`0x$\{string}\` | - -#### Returns - -[`ContractError`](classes/ContractError.md) - -#### Defined in - -[sdk/src/utils/errors.ts:39](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/errors.ts#L39) - ---- - -### handleSdkError - -▸ **handleSdkError**(`err`): `void` - -Method to catch errors and log them - -#### Parameters - -| Name | Type | Description | -| :---- | :---------------------------------------------------- | :-------------------------------------------- | -| `err` | [`HypercertsSdkError`](modules.md#hypercertssdkerror) | Error to handle defined in HypercertsSdkError | - -#### Returns - -`void` - -#### Defined in - -[sdk/src/utils/errors.ts:22](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/errors.ts#L22) - ---- - -### isFragmentReady - -▸ **isFragmentReady**<`TQuery`, `TFrag`\>(`queryNode`, `fragmentNode`, `data`): data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never - -#### Type parameters - -| Name | -| :------- | -| `TQuery` | -| `TFrag` | - -#### Parameters - -| Name | Type | -| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `queryNode` | `DocumentTypeDecoration`<`TQuery`, `any`\> | -| `fragmentNode` | `TypedDocumentNode`<`TFrag`, \{ `[key: string]`: `any`; }\> | -| `data` | `undefined` \| `null` \| [`Incremental`<`TFrag`\>] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: Object } } : `never` : `never` | - -#### Returns - -data is [TFrag] extends [Object] ? TKey extends string ? Object : never : never - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:51](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L51) - ---- - -### makeFragmentData - -▸ **makeFragmentData**<`F`, `FT`\>(`data`, `_fragment`): [`FragmentType`](modules.md#fragmenttype)<`F`\> - -#### Type parameters - -| Name | Type | -| :--- | :---------------------------------------------- | -| `F` | extends `DocumentTypeDecoration`<`any`, `any`\> | -| `FT` | extends `any` | - -#### Parameters - -| Name | Type | -| :---------- | :--- | -| `data` | `FT` | -| `_fragment` | `F` | - -#### Returns - -[`FragmentType`](modules.md#fragmenttype)<`F`\> - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:45](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L45) - ---- - -### parseAllowListEntriesToMerkleTree - -▸ **parseAllowListEntriesToMerkleTree**(`allowList`): `StandardMerkleTree`<`string`[]\> - -#### Parameters - -| Name | Type | -| :---------- | :---------------------------------------------- | -| `allowList` | [`AllowlistEntry`](modules.md#allowlistentry)[] | - -#### Returns - -`StandardMerkleTree`<`string`[]\> - -#### Defined in - -[sdk/src/utils/allowlist.ts:6](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/allowlist.ts#L6) - ---- - -### publicClientToProvider - -▸ **publicClientToProvider**(`publicClient`): `undefined` \| `FallbackProvider` \| `JsonRpcProvider` - -This function converts a `PublicClient` instance to an ethers.js `Provider` to faciliate compatibility between ethers and viem. - -It extracts the chain and transport from the `PublicClient` and creates a network object. -If no chain is found in the `PublicClient`, it logs a warning and stops the signature request. -If the transport type is "fallback", it creates a `FallbackProvider` with multiple transports. -Otherwise, it creates a `JsonRpcProvider` with a single transport. - -Ref: https://viem.sh/docs/ethers-migration.html - -#### Parameters - -| Name | Type | Description | -| :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `publicClient` | `Object` | The `PublicClient` instance to convert. | -| `publicClient.account` | `undefined` | The Account of the Client. | -| `publicClient.batch?` | `Object` | Flags for batch settings. | -| `publicClient.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `publicClient.call` | (`parameters`: `CallParameters`<`undefined` \| `Chain`\>) => `Promise`<`CallReturnType`\> | Executes a new message call immediately without submitting a transaction to the network. - Docs: https://viem.sh/docs/actions/public/call.html - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const data = await client.call({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }) ` | -| `publicClient.chain` | `undefined` \| `Chain` | Chain for the client. | -| `publicClient.createBlockFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"block"` }\> | Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter) **`Example`** `ts import { createPublicClient, createBlockFilter, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await createBlockFilter(client) // { id: "0x345a6572337856574a76364e457a4366", type: 'block' } ` | -| `publicClient.createContractEventFilter` | (`args`: `CreateContractEventFilterParameters`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`CreateContractEventFilterReturnType`<`TAbi`, `TEventName`, `TArgs`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html). - Docs: https://viem.sh/docs/contract/createContractEventFilter.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), }) ` | -| `publicClient.createEventFilter` | (`args?`: `CreateEventFilterParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`, `_EventName`, `_Args`\>) => `Promise`<\{ [K in keyof Filter<"event", TAbiEvents, \_EventName, \_Args, TStrict, TFromBlock, TToBlock\>]: Filter<"event", TAbiEvents, ... 4 more ..., TToBlock\>[K]; }\> | Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createEventFilter.html - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', }) ` | -| `publicClient.createPendingTransactionFilter` | () => `Promise`<\{ `id`: \`0x$\{string}\` ; `request`: `EIP1193RequestFn` ; `type`: `"transaction"` }\> | Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' } ` | -| `publicClient.estimateContractGas` | (`args`: `EstimateContractGasParameters`<`TAbi`, `TFunctionName`, `TChain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas.html **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gas = await client.estimateContractGas({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), functionName: 'mint', account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | -| `publicClient.estimateFeesPerGas` | (`args?`: `EstimateFeesPerGasParameters`<`undefined` \| `Chain`, `TChainOverride`, `TType`\>) => `Promise`<`EstimateFeesPerGasReturnType`\> | Returns an estimate for the fees per gas for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateFeesPerGas() // { maxFeePerGas: ..., maxPriorityFeePerGas: ... } ` | -| `publicClient.estimateGas` | (`args`: `EstimateGasParameters`<`undefined` \| `Chain`, `undefined` \| `Account`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas.html - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas) **`Example`** `ts import { createPublicClient, http, parseEther } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasEstimate = await client.estimateGas({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), }) ` | -| `publicClient.estimateMaxPriorityFeePerGas` | (`args?`: \{ `chain`: `null` \| `TChainOverride` }) => `Promise`<`bigint`\> | Returns an estimate for the max priority fee per gas (in wei) for a transaction to be included in the next block. - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas.html **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() // 10000000n ` | -| `publicClient.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, `PublicActions`<`Transport`, `undefined` \| `Chain`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined`, `PublicRpcSchema`, \{ [K in keyof client]: client[K]; } & `PublicActions`<`Transport`, `undefined` \| `Chain`\>\> | - | -| `publicClient.getBalance` | (`args`: `GetBalanceParameters`) => `Promise`<`bigint`\> | Returns the balance of an address in wei. - Docs: https://viem.sh/docs/actions/public/getBalance.html - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance) **`Remarks`** You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html). `ts const balance = await getBalance(client, { address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', blockTag: 'safe' }) const balanceAsEther = formatEther(balance) // "6.942" ` **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const balance = await client.getBalance({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) // 10000000000000000000000n (wei) ` | -| `publicClient.getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<`GetBlockReturnType`<`undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getBlock() ` | -| `publicClient.getBlockNumber` | (`args?`: `GetBlockNumberParameters`) => `Promise`<`bigint`\> | Returns the number of the most recent block seen. - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blockNumber = await client.getBlockNumber() // 69420n ` | -| `publicClient.getBlockTransactionCount` | (`args?`: `GetBlockTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of Transactions at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html - JSON-RPC Methods: - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`. - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const count = await client.getBlockTransactionCount() ` | -| `publicClient.getBytecode` | (`args`: `GetBytecodeParameters`) => `Promise`<`GetBytecodeReturnType`\> | Retrieves the bytecode at an address. - Docs: https://viem.sh/docs/contract/getBytecode.html - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getBytecode({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', }) ` | -| `publicClient.getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const chainId = await client.getChainId() // 1 ` | -| `publicClient.getContractEvents` | (`args`: `GetContractEventsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetContractEventsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents.html - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { wagmiAbi } from './abi' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getContractEvents(client, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: wagmiAbi, eventName: 'Transfer' }) ` | -| `publicClient.getEnsAddress` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; coinType?: number \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAddress = await client.getEnsAddress({ name: normalize('wevm.eth'), }) // '0xd2135CfB216b74109775236E36d4b433F1DF507B' ` | -| `publicClient.getEnsAvatar` | (`args`: \{ name: string; blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; gatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensAvatar = await client.getEnsAvatar({ name: normalize('wevm.eth'), }) // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio' ` | -| `publicClient.getEnsName` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; address: \`0x$\{string}\`; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const ensName = await client.getEnsName({ address: '0xd2135CfB216b74109775236E36d4b433F1DF507B', }) // 'wevm.eth' ` | -| `publicClient.getEnsResolver` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<\`0x$\{string}\`\> | Gets resolver for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const resolverAddress = await client.getEnsResolver({ name: normalize('wevm.eth'), }) // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41' ` | -| `publicClient.getEnsText` | (`args`: \{ blockNumber?: bigint \| undefined; blockTag?: BlockTag \| undefined; name: string; key: string; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract. Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { normalize } from 'viem/ens' const client = createPublicClient({ chain: mainnet, transport: http(), }) const twitterRecord = await client.getEnsText({ name: normalize('wevm.eth'), key: 'com.twitter', }) // 'wagmi_sh' ` | -| `publicClient.getFeeHistory` | (`args`: `GetFeeHistoryParameters`) => `Promise`<`GetFeeHistoryReturnType`\> | Returns a collection of historical gas information. - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const feeHistory = await client.getFeeHistory({ blockCount: 4, rewardPercentiles: [25, 75], }) ` | -| `publicClient.getFilterChanges` | (`args`: `GetFilterChangesParameters`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterChangesReturnType`<`TFilterType`, `TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called. - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges) **`Remarks`** A Filter can be created from the following actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) Depending on the type of filter, the return value will be different: - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs. - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes. - If the filter was created with `createBlockFilter`, it returns a list of block hashes. **`Example`** `ts // Blocks import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createBlockFilter() const hashes = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Contract Events import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createContractEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), eventName: 'Transfer', }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Raw Events import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterChanges({ filter }) ` **`Example`** `ts // Transactions import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createPendingTransactionFilter() const hashes = await client.getFilterChanges({ filter }) ` | -| `publicClient.getFilterLogs` | (`args`: `GetFilterLogsParameters`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetFilterLogsReturnType`<`TAbi`, `TEventName`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs since the filter was created. - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs) **`Remarks`** `getFilterLogs` is only compatible with **event filters**. **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const filter = await client.createEventFilter({ address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'), }) const logs = await client.getFilterLogs({ filter }) ` | -| `publicClient.getGasPrice` | () => `Promise`<`bigint`\> | Returns the current price of gas (in wei). - Docs: https://viem.sh/docs/actions/public/getGasPrice.html - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const gasPrice = await client.getGasPrice() ` | -| `publicClient.getLogs` | (`args?`: `GetLogsParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>) => `Promise`<`GetLogsReturnType`<`TAbiEvent`, `TAbiEvents`, `TStrict`, `TFromBlock`, `TToBlock`\>\> | Returns a list of event logs matching the provided parameters. - Docs: https://viem.sh/docs/actions/public/getLogs.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/filters-and-logs/event-logs - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) **`Example`** `ts import { createPublicClient, http, parseAbiItem } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const logs = await client.getLogs() ` | -| `publicClient.getProof` | (`args`: `GetProofParameters`) => `Promise`<`GetProofReturnType`\> | Returns the account and storage values of the specified account including the Merkle-proof. - Docs: https://viem.sh/docs/actions/public/getProof.html - JSON-RPC Methods: - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const block = await client.getProof({ address: '0x...', storageKeys: ['0x...'], }) ` | -| `publicClient.getStorageAt` | (`args`: `GetStorageAtParameters`) => `Promise`<`GetStorageAtReturnType`\> | Returns the value from a storage slot at a given address. - Docs: https://viem.sh/docs/contract/getStorageAt.html - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getStorageAt } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const code = await client.getStorageAt({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', slot: toHex(0), }) ` | -| `publicClient.getTransaction` | (`args`: `GetTransactionParameters`<`TBlockTag`\>) => `Promise`<`GetTransactionReturnType`<`undefined` \| `Chain`, `TBlockTag`\>\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transaction = await client.getTransaction({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.getTransactionConfirmations` | (`args`: `GetTransactionConfirmationsParameters`<`undefined` \| `Chain`\>) => `Promise`<`bigint`\> | Returns the number of blocks passed (confirmations) since the transaction was processed on a block. - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const confirmations = await client.getTransactionConfirmations({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.getTransactionCount` | (`args`: `GetTransactionCountParameters`) => `Promise`<`number`\> | Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionCount = await client.getTransactionCount({ address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `publicClient.getTransactionReceipt` | (`args`: `GetTransactionReceiptParameters`) => `Promise`<`TransactionReceipt`\> | Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.getTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.key` | `string` | A key for the client. | -| `publicClient.multicall` | (`args`: `MulticallParameters`<`TContracts`, `TAllowFailure`\>) => `Promise`<`MulticallReturnType`<`TContracts`, `TAllowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall). - Docs: https://viem.sh/docs/contract/multicall.html **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const abi = parseAbi([ 'function balanceOf(address) view returns (uint256)', 'function totalSupply() view returns (uint256)', ]) const result = await client.multicall({ contracts: [ { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }, { address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi, functionName: 'totalSupply', }, ], }) // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }] ` | -| `publicClient.name` | `string` | A name for the client. | -| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `publicClient.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `publicClient.readContract` | (`args`: `ReadContractParameters`<`TAbi`, `TFunctionName`\>) => `Promise`<`ReadContractReturnType`<`TAbi`, `TFunctionName`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/reading-contracts **`Remarks`** A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' import { readContract } from 'viem/contract' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.readContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function balanceOf(address) view returns (uint256)']), functionName: 'balanceOf', args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'], }) // 424122n ` | -| `publicClient.request` | `EIP1193RequestFn`<`PublicRpcSchema`\> | Request function wrapped with friendly error handling | -| `publicClient.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `publicClient.simulateContract` | (`args`: `SimulateContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>) => `Promise`<`SimulateContractReturnType`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `TChainOverride`\>\> | Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions. - Docs: https://viem.sh/docs/contract/simulateContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts **`Remarks`** This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const result = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32) view returns (uint32)']), functionName: 'mint', args: ['69420'], account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', }) ` | -| `publicClient.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `publicClient.type` | `string` | The type of client. | -| `publicClient.uid` | `string` | A unique ID for the client. | -| `publicClient.uninstallFilter` | (`args`: `UninstallFilterParameters`) => `Promise`<`boolean`\> | Destroys a Filter that was created from one of the following Actions: - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html) - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { createPendingTransactionFilter, uninstallFilter } from 'viem/public' const filter = await client.createPendingTransactionFilter() const uninstalled = await client.uninstallFilter({ filter }) // true ` | -| `publicClient.verifyMessage` | (`args`: `VerifyMessageParameters`) => `Promise`<`boolean`\> | - | -| `publicClient.verifyTypedData` | (`args`: `VerifyTypedDataParameters`) => `Promise`<`boolean`\> | - | -| `publicClient.waitForTransactionReceipt` | (`args`: `WaitForTransactionReceiptParameters`<`undefined` \| `Chain`\>) => `Promise`<`TransactionReceipt`\> | Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed. - If a Transaction has been replaced: - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions - Checks if one of the Transactions is a replacement - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt). **`Remarks`** The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions). Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce. There are 3 types of Transaction Replacement reasons: - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`) - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`) - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const transactionReceipt = await client.waitForTransactionReceipt({ hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', }) ` | -| `publicClient.watchBlockNumber` | (`args`: `WatchBlockNumberParameters`) => `WatchBlockNumberReturnType` | Watches and returns incoming block numbers. - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlockNumber({ onBlockNumber: (blockNumber) => console.log(blockNumber), }) ` | -| `publicClient.watchBlocks` | (`args`: `WatchBlocksParameters`<`Transport`, `undefined` \| `Chain`, `TIncludeTransactions`, `TBlockTag`\>) => `WatchBlocksReturnType` | Watches and returns information for incoming blocks. - Docs: https://viem.sh/docs/actions/public/watchBlocks.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks - JSON-RPC Methods: - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchBlocks({ onBlock: (block) => console.log(block), }) ` | -| `publicClient.watchContractEvent` | (`args`: `WatchContractEventParameters`<`TAbi`, `TEventName`, `TStrict`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent.html **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchContractEvent({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']), eventName: 'Transfer', args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, onLogs: (logs) => console.log(logs), }) ` | -| `publicClient.watchEvent` | (`args`: `WatchEventParameters`<`TAbiEvent`, `TAbiEvents`, `TStrict`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent.html - JSON-RPC Methods: - **RPC Provider supports `eth_newFilter`:** - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize). - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). - **RPC Provider does not support `eth_newFilter`:** - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval. **`Remarks`** This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead. **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = client.watchEvent({ onLogs: (logs) => console.log(logs), }) ` | -| `publicClient.watchPendingTransactions` | (`args`: `WatchPendingTransactionsParameters`<`Transport`\>) => `WatchPendingTransactionsReturnType` | Watches and returns pending transaction hashes. - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html - JSON-RPC Methods: - When `poll: true` - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter. - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval. - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event. **`Remarks`** This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions). **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createPublicClient({ chain: mainnet, transport: http(), }) const unwatch = await client.watchPendingTransactions({ onTransactions: (hashes) => console.log(hashes), }) ` | - -#### Returns - -`undefined` \| `FallbackProvider` \| `JsonRpcProvider` - -An ethers.js `Provider` instance, or `undefined` if no chain is found in the `PublicClient`. - -#### Defined in - -[sdk/src/utils/adapters.ts:19](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/adapters.ts#L19) - ---- - -### uploadAllowlist - -▸ **uploadAllowlist**(`req`): `Promise`<`ResponseData`<\{ `cid`: `string` }\>\> - -Uploads an allowlist to the API. - -#### Parameters - -| Name | Type | Description | -| :---- | :--------------------- | :----------------------------------------------------------------------------------------------------------------- | -| `req` | `AllowListPostRequest` | The request body containing the allowlist and total units. The allowList should be a stringified Merkle tree dump. | - -#### Returns - -`Promise`<`ResponseData`<\{ `cid`: `string` }\>\> - -The response data from the API. - -#### Defined in - -[sdk/src/utils/apis.ts:49](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/apis.ts#L49) - ---- - -### uploadMetadata - -▸ **uploadMetadata**(`metadata`): `Promise`<`ResponseData`<\{ `cid`: `string` }\>\> - -Uploads metadata to the API. - -#### Parameters - -| Name | Type | Description | -| :--------- | :----------------------------------------------------- | :--------------------------------------------------------------------------------------- | -| `metadata` | [`HypercertMetadata`](interfaces/HypercertMetadata.md) | The metadata to upload. Should be an object that conforms to the HypercertMetadata type. | - -#### Returns - -`Promise`<`ResponseData`<\{ `cid`: `string` }\>\> - -The response data from the API. - -#### Defined in - -[sdk/src/utils/apis.ts:33](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/apis.ts#L33) - ---- - -### useFragment - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never` | - -#### Returns - -`TType` - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:18](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L18) - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` \| `null` \| `undefined` - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | `undefined` \| `null` \| [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never` | - -#### Returns - -`TType` \| `null` \| `undefined` - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:23](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L23) - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | readonly [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never`[] | - -#### Returns - -`ReadonlyArray`<`TType`\> - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:28](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L28) - -▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> \| `null` \| `undefined` - -#### Type parameters - -| Name | -| :------ | -| `TType` | - -#### Parameters - -| Name | Type | -| :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `_documentNode` | `DocumentTypeDecoration`<`TType`, `any`\> | -| `fragmentType` | `undefined` \| `null` \| readonly [`TType`] extends [\{ ` $fragmentName?`: `TKey` }] ? `TKey` extends `string` ? \{ ` $fragmentRefs?`: \{ [key in string]: TType } } : `never` : `never`[] | - -#### Returns - -`ReadonlyArray`<`TType`\> \| `null` \| `undefined` - -#### Defined in - -[sdk/src/indexer/gql/fragment-masking.ts:33](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/indexer/gql/fragment-masking.ts#L33) - ---- - -### validateAllowlist - -▸ **validateAllowlist**(`data`, `units`): `ValidationResult` - -Validates an array of allowlist entries. - -This function checks that the total units in the allowlist match the expected total units, that the total units are greater than 0, -and that all addresses in the allowlist are valid Ethereum addresses. It returns an object that includes a validity flag and any errors that occurred during validation. - -#### Parameters - -| Name | Type | Description | -| :------ | :---------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | -| `data` | [`AllowlistEntry`](modules.md#allowlistentry)[] | The allowlist entries to validate. Each entry should be an object that includes an address and a number of units. | -| `units` | `bigint` | The expected total units in the allowlist. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. The keys in the errors object are the names of the invalid properties, and the values are the error messages. - -#### Defined in - -[sdk/src/validator/index.ts:108](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L108) - ---- - -### validateClaimData - -▸ **validateClaimData**(`data`): `ValidationResult` - -Validates Hypercert claim data. - -This function uses the AJV library to validate the claim data. It first retrieves the schema for the claim data, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------- | :------------------------------------------------------------------------------------------------- | -| `data` | `unknown` | The claim data to validate. This should be an object that conforms to the HypercertClaimdata type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:77](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L77) - ---- - -### validateDuplicateEvaluationData - -▸ **validateDuplicateEvaluationData**(`data`): `ValidationResult` - -Validates duplicate evaluation data. - -This function uses the AJV library to validate the duplicate evaluation data. It first retrieves the schema for the duplicate evaluation data, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :--------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------- | -| `data` | [`DuplicateEvaluation`](interfaces/DuplicateEvaluation.md) | The duplicate evaluation data to validate. This should be an object that conforms to the DuplicateEvaluation type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:143](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L143) - ---- - -### validateMetaData - -▸ **validateMetaData**(`data`): `ValidationResult` - -Validates Hypercert metadata. - -This function uses the AJV library to validate the metadata. It first retrieves the schema for the metadata, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :-------- | :---------------------------------------------------------------------------------------------- | -| `data` | `unknown` | The metadata to validate. This should be an object that conforms to the HypercertMetadata type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:46](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L46) - ---- - -### validateSimpleTextEvaluationData - -▸ **validateSimpleTextEvaluationData**(`data`): `ValidationResult` - -Validates simple text evaluation data against a predefined schema. - -This function uses the AJV library to validate the simple text evaluation data. It first retrieves the schema for the simple text evaluation data, -then validates the data against the schema. If the schema is not found, it returns an error. If the data does not -conform to the schema, it returns the validation errors. If the data is valid, it returns a success message. - -#### Parameters - -| Name | Type | Description | -| :----- | :----------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------- | -| `data` | [`SimpleTextEvaluation`](interfaces/SimpleTextEvaluation.md) | The simple text evaluation data to validate. This should be an object that conforms to the SimpleTextEvaluation type. | - -#### Returns - -`ValidationResult` - -An object that includes a validity flag and any errors that occurred during validation. - -#### Defined in - -[sdk/src/validator/index.ts:173](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L173) - ---- - -### verifyMerkleProof - -▸ **verifyMerkleProof**(`root`, `signerAddress`, `units`, `proof`): `void` - -Verifies a Merkle proof for a given root, signer address, units, and proof. - -This function first checks if the signer address is a valid Ethereum address. If it's not, it throws a `MintingError`. -It then verifies the Merkle proof using the `StandardMerkleTree.verify` method. If the verification fails, it throws a `MintingError`. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :--------- | :----------------------------- | -| `root` | `string` | The root of the Merkle tree. | -| `signerAddress` | `string` | The signer's Ethereum address. | -| `units` | `bigint` | The number of units. | -| `proof` | `string`[] | The Merkle proof to verify. | - -#### Returns - -`void` - -**`Throws`** - -Will throw a `MintingError` if the signer address is invalid or if the Merkle proof verification fails. - -#### Defined in - -[sdk/src/validator/index.ts:205](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L205) - ---- - -### verifyMerkleProofs - -▸ **verifyMerkleProofs**(`roots`, `signerAddress`, `units`, `proofs`): `void` - -Verifies multiple Merkle proofs for given roots, a signer address, units, and proofs. - -This function first checks if the lengths of the roots, units, and proofs arrays are equal. If they're not, it throws a `MintingError`. -It then iterates over the arrays and verifies each Merkle proof using the `verifyMerkleProof` function. If any verification fails, it throws a `MintingError`. - -#### Parameters - -| Name | Type | Description | -| :-------------- | :----------- | :----------------------------- | -| `roots` | `string`[] | The roots of the Merkle trees. | -| `signerAddress` | `string` | The signer's Ethereum address. | -| `units` | `bigint`[] | The numbers of units. | -| `proofs` | `string`[][] | The Merkle proofs to verify. | - -#### Returns - -`void` - -**`Throws`** - -Will throw a `MintingError` if the lengths of the input arrays are not equal or if any Merkle proof verification fails. - -#### Defined in - -[sdk/src/validator/index.ts:228](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/validator/index.ts#L228) - ---- - -### walletClientToSigner - -▸ **walletClientToSigner**(`walletClient`): `undefined` \| `Signer` & `TypedDataSigner` - -This function converts a `WalletClient` instance to an ethers.js `Signer` to faciliate compatibility between ethers and viem. - -It extracts the account, chain, and transport from the `WalletClient` and creates a network object. -If no chain is found in the `WalletClient`, it logs a warning and stops the signature request. -It then creates a `Web3Provider` with the transport and network, and gets a `Signer` from the provider using the account's address. - -Ref: https://viem.sh/docs/ethers-migration.html - -#### Parameters - -| Name | Type | Description | -| :--------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `walletClient` | `Object` | The `WalletClient` instance to convert. | -| `walletClient.account` | `undefined` \| `Account` | The Account of the Client. | -| `walletClient.addChain` | (`args`: `AddChainParameters`) => `Promise`<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain.html - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism }) ` | -| `walletClient.batch?` | `Object` | Flags for batch settings. | -| `walletClient.batch.multicall?` | `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } | Toggle to enable `eth_call` multicall aggregation. | -| `walletClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | -| `walletClient.chain` | `undefined` \| `Chain` | Chain for the client. | -| `walletClient.deployContract` | (`args`: `DeployContractParameters`<`TAbi`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/deploying-contracts **`Example`** `ts import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', }) ` | -| `walletClient.extend` | (`fn`: (`client`: `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\>) => `client`) => `Client`<`Transport`, `undefined` \| `Chain`, `undefined` \| `Account`, `WalletRpcSchema`, \{ [K in keyof client]: client[K]; } & `WalletActions`<`undefined` \| `Chain`, `undefined` \| `Account`\>\> | - | -| `walletClient.getAddresses` | () => `Promise`<`GetAddressesReturnType`\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses() ` | -| `walletClient.getChainId` | () => `Promise`<`number`\> | Returns the chain ID associated with the current network. - Docs: https://viem.sh/docs/actions/public/getChainId.html - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid) **`Example`** `ts import { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1 ` | -| `walletClient.getPermissions` | () => `Promise`<`GetPermissionsReturnType`\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions() ` | -| `walletClient.key` | `string` | A key for the client. | -| `walletClient.name` | `string` | A name for the client. | -| `walletClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | -| `walletClient.prepareTransactionRequest` | (`args`: `PrepareTransactionRequestParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<`PrepareTransactionRequestReturnType`\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest.html **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) ` | -| `walletClient.request` | `EIP1193RequestFn`<`WalletRpcSchema`\> | Request function wrapped with friendly error handling | -| `walletClient.requestAddresses` | () => `Promise`<`RequestAddressesReturnType`\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses() ` | -| `walletClient.requestPermissions` | (`args`: \{ [x: string]: Record; eth_accounts: Record; }) => `Promise`<`RequestPermissionsReturnType`\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} }) ` | -| `walletClient.sendRawTransaction` | (`args`: `SendRawTransactionParameters`) => `Promise`<\`0x$\{string}\`\> | Sends a **signed** transaction to the network - Docs: https://viem.sh/docs/actions/wallet/sendRawTransaction.html - JSON-RPC Method: [`eth_sendRawTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' import { sendRawTransaction } from 'viem/wallet' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendRawTransaction({ serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33' }) ` | -| `walletClient.sendTransaction` | (`args`: `SendTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, }) ` | -| `walletClient.signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage.html - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signMessage({ message: 'hello world', }) ` | -| `walletClient.signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: custom(window.ethereum), }) const request = await client.prepareTransactionRequest({ to: '0x0000000000000000000000000000000000000000', value: 1n, }) const signature = await client.signTransaction(request) ` | -| `walletClient.signTypedData` | (`args`: `SignTypedDataParameters`<`TTypedData`, `TPrimaryType`, `undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` **`Example`** `ts // Account Hoisting import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, }) ` | -| `walletClient.switchChain` | (`args`: `SwitchChainParameters`) => `Promise`<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id }) ` | -| `walletClient.transport` | `TransportConfig`<`string`, `EIP1193RequestFn`\> & `Record`<`string`, `any`\> | The RPC transport | -| `walletClient.type` | `string` | The type of client. | -| `walletClient.uid` | `string` | A unique ID for the client. | -| `walletClient.watchAsset` | (`args`: `WatchAssetParams`) => `Promise`<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **`Example`** `ts import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, }) ` | -| `walletClient.writeContract` | (`args`: `WriteContractParameters`<`TAbi`, `TFunctionName`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract.html - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html). **Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.** **`Example`** `ts import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], }) ` **`Example`** `ts // With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request) ` | - -#### Returns - -`undefined` \| `Signer` & `TypedDataSigner` - -An ethers.js `Signer` instance, or `undefined` if no chain is found in the `WalletClient`. - -#### Defined in - -[sdk/src/utils/adapters.ts:51](https://github.com/hypercerts-org/hypercerts/blob/e194fdd/sdk/src/utils/adapters.ts#L51) diff --git a/docs/versioned_docs/version-1.4.1/developer/burning.md b/docs/versioned_docs/version-1.4.1/developer/burning.md deleted file mode 100644 index 331ebc52..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/burning.md +++ /dev/null @@ -1,12 +0,0 @@ -# Burning - -> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. - -## Burning fraction tokens - -You can only burn fraction tokens that you own. Hypercert claims cannot be burned once minted. -You can get a list of all fraction tokens you own with [this query](./querying.md#claimtokensbyowner). - -```js -const txHash = await hypercerts.burnClaimFraction({ claimId }); -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/config.md b/docs/versioned_docs/version-1.4.1/developer/config.md deleted file mode 100644 index 3689e557..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/config.md +++ /dev/null @@ -1,96 +0,0 @@ -# Hypercert Client Configuration - -The client provides a high level interface that communicates with the Graph, IPFS and the evm. For easy setup we harmonised the configuration into a flow that allows for configuration with different levels of specificity. - -## Configuration - -### Setup - -The SDK allows for minimal configuration, explicit overrides and defining values in environment variables. We apply the following hierarchy: - -1. Overrides declared in `Partial` - -Based on the chainID we load the default config for the respected chain, if it's supported. - -We then process the rest of the overrides and possible environment variables to customise the default configuration. - -To get started quickly you can either: - -- initialize a new client by calling `new HypercertClient({chain: {id: 11155111})`. - -Using either of the options above will launch the client in `read only` mode using the defaults in [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) - -### Read-only mode - -The SDK client will be in read-only mode if any of the following conditions are true: - -- The client was initialized without an operator. -- The client was initialized with an operator without signing abilities. -- The contract address is not set. - -If any of these conditions are true, the read-only property of the `HypercertClient` instance will be set to true, and a warning message will be logged indicating that the client is in read-only mode. - -### Defaults - -The [constants.ts](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/constants.ts) file defines various defaults constants that are used throughout the Hypercert system. - -`DEPLOYMENTS`: This constant defines the deployments that are managed by the Hypercert system. Each Deployment object -contains information about a specific deployment, including the chain ID, chain name, contract address, and graph name. - -For example: - -```json -{ - "11155111": { - "addresses": { - "HypercertMinterUUPS": "0x1234567890abcdef1234567890abcdef12345678", - "TransferManager": "0x1234567890abcdef1234567890abcdef12345678", - "...": "...", - "StrategyHypercertFractionOffer": "0x1234567890abcdef1234567890abcdef12345678" - }, - "graphName": "hypercerts-sepola", - "graphUrl": "https://api.thegraph.com/subgraphs/name/hypercerts-admin/hypercerts-sepolia" - } -} -``` - -You can select which deployment to use by passing in a `chainId` configuration parameter. We also allow for `overrides` -when creating the SDK by passing configuration variables. - -### Client config properties - -HypercertClientConfig is a configuration object used when initializing a new instance of the HypercertClient. It allows -you to customize the client by setting your own providers or deployments. At it's simplest, you only need to provide -`chain.id` to initalize the client in `readonly` mode. - -| Field | Type | Description | -| --------------------------- | ------- | ---------------------------------------------------------------------------------------------- | -| `chain` | Object | Partial configuration for the blockchain network. | -| `contractAddress` | String | The address of the deployed contract. | -| `graphUrl` | String | The URL to the subgraph that indexes the contract events. Override for localized testing. | -| `graphName` | String | The name of the subgraph. | -| `easContractAddress` | String | The address of the EAS contract. | -| `publicClient` | Object | The PublicClient is inherently read-only and is used for reading data from the blockchain. | -| `walletClient` | Object | The WalletClient is used for signing and sending transactions. | -| `unsafeForceOverrideConfig` | Boolean | Boolean to force the use of overridden values. | -| `readOnly` | Boolean | Boolean to assert if the client is in read-only mode. | -| `readOnlyReason` | String | Reason for read-only mode. This is optional and can be used for logging or debugging purposes. | - -### Logging - -The logger for the SDK uses the log level based on the value of the LOG_LEVEL environment variable. The log level -determines which log messages are printed to the console. By default, the logger is configured to log messages with a -level of info or higher to the console. - -In your `.env` file: - -```bash -LOG_LEVEL="info" -``` - -The SDK logger supports four log levels: `error`, `warn`, `info`, and `debug`. - -- The `error` log level is used to log errors that occur in the SDK. -- The `warn` log level is used to log warnings that do not necessarily indicate an error, but may be important to investigate. -- The `info` log level is used to log general information about the SDK's state or behavior. -- The `debug` log level is used to log detailed information that is useful for debugging purposes. diff --git a/docs/versioned_docs/version-1.4.1/developer/errors.md b/docs/versioned_docs/version-1.4.1/developer/errors.md deleted file mode 100644 index 291bb9f0..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/errors.md +++ /dev/null @@ -1,20 +0,0 @@ -# Errors in the SDK - -Generally, we follow the pattern of throwing on errors and letting those surface to the application. This allows for developers to handle any (un)expected errors in a manner they find suitable. - -### Handling Errors - -To support debugging we've implemented some custom errors. - -| Error | Description | Payload | -| ----------------------- | ---------------------------------------------------- | ---------------------------- | -| `ClientError` | An error that is caused by a problem with the client | `{ "key": "value" }` | -| `ContractError` | An error that is returned by the contract | \`{ "data": "BaseError | -| `FetchError` | Fails fetching a remote resource | `{ "key": "value" }` | -| `InvalidOrMissingError` | The provided value was undefined or empty | `{ "key": "value" }` | -| `MintingError` | Minting transaction failed | `{ "key": "value" }` | -| `StorageError` | Fails storing to a remote resource | `{ "key": "value" }` | -| `UnknownSchemaError` | Schema could not be loaded | `{ "schemaName": "string" }` | -| `MalformedDataError` | Data doesn't conform to expectations | `{ "key": "value" }` | -| `UnsupportedChainError` | This blockchain is not yet supported | \`{ "chainID": "string | -| `ConfigurationError` | The configuration was invalid | `{ "key": "value" }` | diff --git a/docs/versioned_docs/version-1.4.1/developer/index.md b/docs/versioned_docs/version-1.4.1/developer/index.md deleted file mode 100644 index 1baebcca..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/index.md +++ /dev/null @@ -1,49 +0,0 @@ -# Developer Documentation for Hypercerts - -Welcome to the developer documentation for Hypercerts! This guide will provide you with all the information you need to get started with developing applications using Hypercerts. - -## API Documentation - -The API documentation section contains detailed information about the hypercerts SDK and contracts. You will find everything you need to integrate Hypercerts into your applications. - -## NPM packages - -We provide the following NPM packages for you to use in your applications: - -- [SDK](https://www.npmjs.com/package/@hypercerts-org/sdk) -- [Contracts](https://www.npmjs.com/package/@hypercerts-org/contracts) - -## Starter app - -The starter app repo contains a sample application that demonstrates how to use the Hypercerts SDK to create a simple web application based on Next.js, Chakra UI, and the Hypercerts SDK. - -[Starter app repository](https://github.com/hypercerts-org/hypercert-nextjs-chakra-starter) - ---- - -**NOTE** - -The starter app is a template to feel free to fork it and get started quickly. - ---- - -## Demo Apps - -In the demo apps repo, you will find a collection of sample applications that show the bare minimum to implement hypercerts. These apps serve as a starting point for your own development and can be used as a reference to understand how to implement the SDK. - -[Demo apps repository](https://github.com/hypercerts-org/demo-apps) - -## Issue Tracking - -If you encounter any issues or have questions while working with hypercerts, the issue tracking is the place to go. Here, you can find a list of known issues, report new issues, and participate in discussions with the hypercerts community. - -[Issues on GitHub](https://github.com/hypercerts-org/hypercerts/issues) - -## Quickstarts - -The quickstarts section provides step-by-step guides to help you quickly get up and running with Hypercerts. Whether you are a beginner or an experienced developer, these guides will walk you through the process of setting up your development environment and creating your first Hypercerts application. - -[Quickstart Javascript](./quickstart-javascript.md) -[Quickstart Solidity](./quickstart-solidity.md) - -We hope you find this developer documentation helpful in your journey with Hypercerts. Happy coding! diff --git a/docs/versioned_docs/version-1.4.1/developer/minting.md b/docs/versioned_docs/version-1.4.1/developer/minting.md deleted file mode 100644 index f826759b..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/minting.md +++ /dev/null @@ -1,57 +0,0 @@ -# Minting - -## Token design - -Hypercerts are semi-fungible tokens. -Thus, each hypercert is represented on-chain by a group of fraction tokens, -each representing a fraction of ownership over the hypercert. -If you want to split your fraction token, or merge multiple tokens into one, -check out the section on [splitting and merging](./split-merge.md). - -## Minting your first hypercert - -To mint a hypercert you need to provide the `metadata`, total amount of `units` and the preferred `TransferRestrictions`. -The resulting hypercert will be wholly owned by the creator. - -```js -import { TransferRestrictions, formatHypercertData } from "@hypercerts-org/sdk" - -const { metadata } = formatHypercertData(...); -const totalUnits = 10000n; - -const txHash = await hypercerts.mintClaim({ - metadata, - totalUnits, - transferRestrictions: TransferRestrictions.FromCreatorOnly, -}); -``` - -> **Note** If you did not initialize your HypercertsClient with an `walletClient`, the client will run in [read-only mode](#read-only-mode) and this will fail. - -Let's see what happens under the hood: - -First, `mintClaim` checks that the client is not `read only` and that the operator is a `Signer`. If not, it throws an `InvalidOrMissingError`. - -Next, the function validates the provided metadata using the `validateMetaData` function. If the metadata is invalid, it throws a `MalformedDataError`. The function then stores the metadata on `IPFS` using the `storeMetadata` method and returns the `CID` for the metadata. - -Finally, we call the mintClaim function on the contract with the signer `address`, total `units`, `CID`, and `transfer restriction` as parameters. If `overrides` are provided, the function uses them to send the transaction. Otherwise, it sends the transaction without overrides. - -## Transfer restrictions - -When minting a Hypercert, you must pass in a `TransferRestriction` policy. For now there are only 3 implemented policies: - -```js -enum TransferRestrictions { - // Unrestricted - AllowAll, - // All transfers disabled after minting - DisallowAll, - // Only the original creator can transfer - FromCreatorOnly -} -``` - -## Reference - -See the [code](https://github.com/hypercerts-org/hypercerts/tree/main/sdk/src/client.ts) -for more details on how we implement minting. diff --git a/docs/versioned_docs/version-1.4.1/developer/querying.md b/docs/versioned_docs/version-1.4.1/developer/querying.md deleted file mode 100644 index 80439bfe..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/querying.md +++ /dev/null @@ -1,273 +0,0 @@ -# Querying - -## Overview - -The `HypercertClient` provides a high-level interface for interacting with the Hypercert ecosystem. The HypercertClient -has three getter methods: `storage`, `indexer`, and `contract`. These methods return instances of the HypercertsStorage, -HypercertIndexer, and HypercertMinter classes, respectively. - -```js -const { - client: { storage }, -} = new HypercertClient({ chain: { id: 11155111 } }); -``` - -The `storage` is a utility class that provides methods for storing and retrieving Hypercert metadata off-chain on IPFS. It is used by the HypercertClient to store metadata when creating new Hypercerts. - -```js -const { - client: { indexer }, -} = new HypercertClient({ chain: { id: 11155111 } }); -``` - -The `indexer` is a utility class that provides methods for indexing and searching Hypercerts based on various criteria. -It is used by the HypercertClient to retrieve event-based data via the subgraph. - -```js -const { - client: { contract }, -} = new HypercertClient({ chain: { id: 11155111 } }); -``` - -Finally we have a `contract` that provides methods for interacting with the HypercertMinter smart contract. It is used -by the HypercertClient to create new Hypercerts and retrieve specific on-chain information. - -By providing instances of these classes through the `storage`, `indexer`, and `contract` getters, the HypercertClient allows developers to easily interact with the various components of the Hypercert system directly. -For example, a developer could use the storage instance to store metadata for a new Hypercert, the indexer instance to search for existing Hypercerts based on various criteria, and the contract instance to create new Hypercerts and retrieve existing Hypercerts from the contract. - -## Indexer - -For indexing purposes, we rely on the [Graph](https://thegraph.com/docs/en/) to index Hypercert events. To make the subgraph easily accessible with typed methods and object we provide a client that wraps [urql](https://formidable.com/open-source/urql/) into an opiniated set of queries. - -### Live graph playground - -To inspect the subgraph and explore queries, have a look at the Graph playground for Goerli testnet and Optimism mainnet: - -- [Goerli dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-testnet) -- [Optimism dashboard](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet) - -### Graph client - -Since the client is fully typed, it's easy to explore the functionalities using code completion in IDEs. - -Here's one example from our frontend where we let [react-query](https://www.npmjs.com/package/%2540tanstack/react-query) frequently update the call to the graph: - -```js -import { useHypercertClient } from "./hypercerts-client"; -import { useQuery } from "@tanstack/react-query"; - -export const useFractionsByOwner = (owner: `0x${string}`) => { - const { - client: { indexer }, - } = useHypercertClient(); - - return useQuery( - ["hypercerts", "fractions", "owner", owner], - () => indexer.fractionsByOwner(owner), - { enabled: !!owner, refetchInterval: 5000 }, - ); -}; -``` - -### Queries: Claims - -These tables show the input parameters and output fields for each of the GraphQL queries in [claims.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/claims.graphql). -A claim represents 1 Hypercert and all of the common data across all claim/fraction tokens. - -#### `ClaimsByOwner` - -The `ClaimsByOwner` query retrieves an array of claims that belong to a specific owner. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | -------------------------------------------------- | ------------- | -| `owner` | `Bytes` | The address of the owner whose claims to retrieve. | "" | -| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | -| `first` | `Int` | The number of claims to retrieve. | `100` | -| `skip` | `Int` | The number of claims to skip. | `0` | - -##### Output - -The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------ | -| `contract` | `Bytes` | The address of the contract. | -| `tokenID` | `String` | The token ID. | -| `creator` | `Bytes` | The address of the creator. | -| `id` | `ID` | The ID of the claim. | -| `owner` | `Bytes` | The address of the owner. | -| `totalUnits` | `BigInt` | The total number of units. | -| `uri` | `String` | The URI of the claim metadata. | - -#### `RecentClaims` - -The RecentClaims query retrieves an array of the most recent claims on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | ---------------------------------- | ------------- | -| `orderDirection` | `OrderDirection` | The direction to order the claims. | `asc` | -| `first` | `Int` | The number of claims to retrieve. | `100` | -| `skip` | `Int` | The number of claims to skip. | `0` | - -##### Output - -The query returns an array of claim objects that match the input parameters. Each claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------ | -| `contract` | `Bytes` | The address of the contract. | -| `tokenID` | `String` | The token ID. | -| `creator` | `Bytes` | The address of the creator. | -| `id` | `ID` | The ID of the claim. | -| `owner` | `Bytes` | The address of the owner. | -| `totalUnits` | `BigInt` | The total number of units. | -| `uri` | `String` | The URI of the claim metadata. | - -#### `ClaimByID` - -The ClaimById query retrieves a single claim by its ID on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | -| --------- | ----- | -------------------------------- | -| `id` | `ID!` | The ID of the claim to retrieve. | - -##### Output - -The query returns a claim object that matches the input parameter. The claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------ | -| `contract` | `Bytes` | The address of the contract. | -| `tokenID` | `String` | The token ID. | -| `creator` | `Bytes` | The address of the creator. | -| `id` | `ID` | The ID of the claim. | -| `owner` | `Bytes` | The address of the owner. | -| `totalUnits` | `BigInt` | The total number of units. | -| `uri` | `String` | The URI of the claim metadata. | - -### Queries: Fractions - -These tables show the input parameters and output fields for each of the GraphQL queries in [fractions.graphql](https://github.com/hypercerts-org/hypercerts/blob/main/sdk/src/indexer/queries/fractions.graphql). -A claim token represents a fraction of ownership of a Hypercert. - -#### `ClaimTokensByOwner` - -The `ClaimTokensByOwner` query retrieves an array of claim tokens that belong to a specific owner on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | -| `owner` | `Bytes` | The address of the owner whose claim tokens to retrieve. | "" | -| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | -| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | -| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | - -##### Output - -The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: - -| Field | Type | Description | -| --------- | -------- | ------------------------------------------ | -| `id` | `ID` | The ID of the claim token. | -| `owner` | `Bytes` | The address of the owner. | -| `tokenID` | `String` | The token ID. | -| `units` | `BigInt` | The number of units. | -| `claim` | `Claim` | The claim associated with the claim token. | - -The Claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------------ | -| `id` | `ID` | The ID of the claim. | -| `creation` | `Int` | The timestamp of the claim creation. | -| `uri` | `String` | The URI of the claim metadata. | -| `totalUnits` | `BigInt` | The total number of units. | - -#### `ClaimTokensByClaim` - -The `ClaimTokensByClaim` query retrieves an array of claim tokens that belong to a specific claim on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | Default Value | -| ---------------- | ---------------- | -------------------------------------------------------------------- | ------------- | -| `claimId` | `String!` | The ID of the claim whose claim tokens to retrieve. | None | -| `orderDirection` | `OrderDirection` | The direction to order the claim tokens. The default value is `asc`. | `asc` | -| `first` | `Int` | The number of claim tokens to retrieve. The default value is `100`. | `100` | -| `skip` | `Int` | The number of claim tokens to skip. The default value is `0`. | `0` | - -##### Output - -The query returns an array of claim token objects that match the input parameters. Each claim token object has the following fields: - -| Field | Type | Description | -| --------- | -------- | -------------------------- | -| `id` | `ID` | The ID of the claim token. | -| `owner` | `Bytes` | The address of the owner. | -| `tokenID` | `String` | The token ID. | -| `units` | `BigInt` | The number of units. | - -#### `ClaimTokenById` Query - -The `ClaimTokenById` query retrieves a single claim token by its ID on the Hypercert platform. - -##### Input - -The query takes the following input parameters: - -| Parameter | Type | Description | -| --------- | ----- | -------------------------------------- | -| `id` | `ID!` | The ID of the claim token to retrieve. | - -##### Output - -The query returns a claim token object that matches the input parameter. The claim token object has the following fields: - -| Field | Type | Description | -| --------- | -------- | ------------------------------------------ | -| `id` | `ID` | The ID of the claim token. | -| `owner` | `Bytes` | The address of the owner. | -| `tokenID` | `String` | The token ID. | -| `units` | `BigInt` | The number of units. | -| `claim` | `Claim` | The claim associated with the claim token. | - -The Claim object has the following fields: - -| Field | Type | Description | -| ------------ | -------- | ------------------------------------ | -| `id` | `ID` | The ID of the claim. | -| `creation` | `Int` | The timestamp of the claim creation. | -| `uri` | `String` | The URI of the claim metadata. | -| `totalUnits` | `BigInt` | The total number of units. | - -## Storage - -### Hypercert Metadata - -Currently, all metadata is stored off-chain in IPFS. Use the `storage` client to retrieve the metadata - -```js -const claimId = "0x822f17a9a5eecfd...85254363386255337"; -const { indexer, storage } = hypercertsClient; -// Get the on-chain claim -const claimById = await indexer.claimById(claimId); -// Get the off-chain metadata -const metadata = await storage.getMetadata(claimById.claim.uri); -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/quickstart-javascript.md b/docs/versioned_docs/version-1.4.1/developer/quickstart-javascript.md deleted file mode 100644 index ba133de6..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/quickstart-javascript.md +++ /dev/null @@ -1,93 +0,0 @@ -# Getting started with JavaScript - -The Hypercerts SDK makes it easy to integrate Hypercerts into your application or backend with JavaScript/TypeScript. - -## Installation - -Install the SDK using npm or yarn: - -```bash -npm install @hypercerts-org/sdk -# OR yarn add @hypercerts-org/sdk -``` - -## Initialize - -Import the SDK into your project and create a new instance of `HypercertClient` with your configuration options: - -```js -import { HypercertClient } from "@hypercerts-org/sdk"; -import { createWalletClient, custom } from "viem"; -import { mainnet } from "viem/chains"; - -const walletClient = createWalletClient({ - chain: mainnet, - transport: custom(window.ethereum), -}); - -// NOTE: you should replace this with your own JSON-RPC provider to the network -// This should have signing abilities and match the `chainId` passed into HypercertClient - -const client = new HypercertClient({ - chainId: 11155111, // Sepolia testnet - walletClient, -}); -``` - -Hypercerts is a multi-chain protocol. -See [here](./supported-networks.md) for a list of currently supported networks. - -> **Note** If there's no `walletClient` provided, the client will run in [read-only mode](#read-only-mode). - -## Make a Hypercert - -Use the client object to interact with the Hypercert network. For example, you can use the `client.mintClaim` method to create a new claim: - -```js -import { - formatHypercertData, - TransferRestrictions, -} from "@hypercerts-org/sdk"; - -// Validate and format your Hypercert metadata -const { data: metadata, valid, errors } = formatHypercertData({ - name, - ... -}) - -// Check on errors -if (!valid) { - return console.error(errors); -} - -// Set the total amount of units available -const totalUnits: bigint = 10000n - -// Define the transfer restriction -const transferRestrictions: TransferRestrictions = TransferRestrictions.FromCreatorOnly - -// Mint your Hypercert! -const tx = await client.mintClaim( - metadata, - totalUnits, - transferRestrictions, -); -``` - -For guidance on how to specify your metadata, see the [minting guide](../minting-guide/step-by-step.md). -This will validate the metadata, store claim metadata on IPFS, create a new hypercert on-chain, and return a transaction receipt. - -For more details, check out the [Minting Guide](./minting.md). - -## Query for Hypercerts - -You can also use the client to query the subgraph and retrieve which claims an address owns: - -```js -const claims = await client.indexer.fractionsByOwner(owner), -``` - -For more details, checkout the [Querying guide](./querying.md) -and our [Graph playground](https://thegraph.com/hosted-service/subgraph/hypercerts-admin/hypercerts-optimism-mainnet). - -That's it! With these simple steps, you can start using the Hypercert SDK in your own projects. diff --git a/docs/versioned_docs/version-1.4.1/developer/quickstart-solidity.md b/docs/versioned_docs/version-1.4.1/developer/quickstart-solidity.md deleted file mode 100644 index 409a1e9d..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/quickstart-solidity.md +++ /dev/null @@ -1,41 +0,0 @@ -# Getting started with Solidity - -> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. - -If you need the Solidity contracts or interfaces exported from the SDK, -please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). - -## Hypercerts deployments - -Hypercerts is a multi-chain protocol and we want to support any network that wants to make positive impact. -We plan to support at most 1 canonical contract deployment per network. -For a complete list of deployments and their contract addresses, see [Supported Networks](./supported-networks.md). - -## Installing the Hypercert contracts - -```bash -npm install @hypercerts-org/contracts -# or yarn add @hypercerts-org/contracts -``` - -## Using the Solidity interface - -If you want to call the Hypercerts contract on your network directly from Solidity, -we export the interface/ABI for you to use from your contract. - -```js -import { IHypercertToken } from "@hypercerts-org/contracts/IHypercertMinter.sol"; - -contract MyContract { - IHypercertToken hypercerts; - - function initialize(address _addr) public virtual initializer { - hypercerts = IHypercertToken(_addr); - } - - function uri(uint256 tokenID) public view returns (string memory _uri) { - _uri = hypercerts.uri(tokenID); - } -} - -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/split-merge.md b/docs/versioned_docs/version-1.4.1/developer/split-merge.md deleted file mode 100644 index 1335884f..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/split-merge.md +++ /dev/null @@ -1,15 +0,0 @@ -# Split and Merge - -> :construction: **NOTE**: This is a work-in-progress and may not be fully functioning yet. - -## By Token Value - -### Split / merge token values - -```js -const { tokenIds } = await hypercerts.splitFractionUnits({ - fractionId, - units: [10n, 12n, 15n], -}); -const { tokenId } = await hypercerts.mergeFractionUnits({ fractionIds }); -``` diff --git a/docs/versioned_docs/version-1.4.1/developer/supported-networks.md b/docs/versioned_docs/version-1.4.1/developer/supported-networks.md deleted file mode 100644 index f12ece5f..00000000 --- a/docs/versioned_docs/version-1.4.1/developer/supported-networks.md +++ /dev/null @@ -1,14 +0,0 @@ -# Supported networks - -Hypercerts is developed in public and released under [dual MIT and Apache license](https://github.com/hypercerts-org/hypercerts/blob/main/LICENSE). The Hypercert Foundation currently rolled out on a select set of networks: `Sepolia` for testing, `Optimism` and `Celo` as the production deployment. - -We want to support every network that wants to support positive impact! -If you want to see Hypercerts deployed on another network, please reach out by [filing an issue](https://github.com/hypercerts-org/hypercerts/issues). - -## Overview - -| Network | HypercertMinter (UUPS Proxy) | Safe | -| -------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| Sepolia | [0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941](https://goerli.etherscan.io/address/0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941) | TBD | -| Celo | [0x16bA53B74c234C870c61EFC04cD418B8f2865959](https://celoscan.io/address/0x16bA53B74c234C870c61EFC04cD418B8f2865959) | TBD | -| Optimism | [0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07](https://optimistic.etherscan.io/address/0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07) | [0x560adA72a80b4707e493cA8c3B7B7528930E7Be5](https://optimistic.etherscan.io/address/0x560adA72a80b4707e493cA8c3B7B7528930E7Be5) | diff --git a/docs/versioned_docs/version-1.4.1/devops/deploy-proxy.md b/docs/versioned_docs/version-1.4.1/devops/deploy-proxy.md deleted file mode 100644 index 4ed58fc0..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/deploy-proxy.md +++ /dev/null @@ -1,138 +0,0 @@ -# Deploy a new proxy contract - -This should be done only on rare occasions. For example, when: - -- We want to deploy to a new network -- We have updated the contract in a way that is _NOT_ backwards-compatible. - - For most upgrades, please use UUPS [upgrades](./upgrade.md). - -## Smart Contracts - -### Setup the `contracts/` environment - -Navigate to `contracts/`. Configure your `.env` file by following the instructions in the -[README](https://github.com/hypercerts-org/hypercerts/tree/main/contracts#setup). - -### Build and deploy the smart contracts - ---- - -**NOTE** - -While we use foundry for developement and testing, we use hardhat for deployment. This is because hardhat is more flexible and allows us to easily integrate with OpenZeppelin tools for upgradeable contracts. - ---- - -If you are deploying on a new network, configure `contracts/hardhat.config.ts` to support the new network under the `networks` key. - -```javascript - "sepolia": getChainConfig("sepolia"), -``` - -Build the contracts and deploy. Specify the network to match the key used in `hardhat.config.ts`. - -```sh -# Run in contracts/ -yarn build:hardhat -yarn hardhat deploy --network NETWORK -``` - -This will output the new proxy address. Update the root `README.md` with this new address. - -Now transfer ownership over the proxy contract to the multisig: - -```sh -yarn hardhat transfer-owner --network NETWORK --proxy PROXY_CONTRACT_ADDRESS --owner MULTISIG_ADDRESS -``` - -## Subgraph - -### Setup the `graph/` environment - -Navigate to `graph/`. Follow the instructions in the -[README](https://github.com/hypercerts-org/hypercerts/tree/main/graph#setup) -to get set up. - -### Deploy the subgraph - -Update `graph/networks.json` with the new proxy address. To speed up indexing, you set the `startBlock` to the block containing the contract creation. We can add multiple networks that are monitored by the same subgraph. For more details, see the [Graph documentation](https://thegraph.com/docs/en/deploying/deploying-a-subgraph-to-hosted/#deploying-the-subgraph-to-multiple-ethereum-networks). - -To separate test from production, we use a different subgraph for each network. This means that we need to deploy a new subgraph for each network; but we group the deployments in the scripts. - -- Create a new deploy script for the network in the `package.json` of the `graph/` directory. For example, if you are deploying to the `sepolia` network, you would add the following script: - -````json - "deploy:sepolia": "graph deploy --node https://api.thegraph.com/deploy/ --network sepolia hypercerts-admin/hypercerts-sepolia" - ``` - -* Add the deploy script to `deploy:test` or `deploy:prod` depending on whether you are deploying to a test or production network. - -* Now deploy the subgraph - -```sh -# Run in graph/ -yarn build -yarn deploy:test -```` - -## OpenZeppelin Defender - -### Create a new Supabase table - -Log into the [Supabase dashboard](https://app.supabase.com/). -We store all data in a single project, but use different tables for each network. -The table name should be suffixed by the network (e.g. `allowlistCache-goerli`). -If you are deploying to a new network, create a new table. You can copy the table schema and RLS policy from another pre-existing table. - -If you are deploying a new proxy contract to a network for which you already have another deployment, you'll have to make a judgement call as to whether you can reuse the existing table, whether you need to clear the existing table, or create another table. - -Note: We want to merge all the tables in this [issue](https://github.com/hypercerts-org/hypercerts/issues/477). - -### Update the OpenZeppelin Defender scripts - -Modify the Defender scripts to support the new network in `defender/src/networks.ts`. - -If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. - -Note: The entry point for deployment is in `defender/src/setup.ts`. - -### Setup the `defender/` environment - -Navigate to `defender/`. Follow the instructions in the -[README](https://github.com/hypercerts-org/hypercerts/tree/main/defender#setup) -to get set up. - -### Deploy defender scripts - -Deploy to OpenZeppelin Defender via - -```sh -# Run in defender/ -yarn deploy -``` - -## Hypercerts SDK - -TODO: Flesh this out - -Run the build in `contracts/`. - -(Soon to be deprecated) Publish `contracts/` to npm - -Configure the SDK to support the new network via the graphclient. - -Publish SDK to npm - -## Deploy the Dapp frontend - -Each frontend build is configured to run on a different network (e.g. `https://testnet.hypercerts.org`). You can use any CDN to serve the site (e.g. Netlify, Vercel, GitHub Pages, Cloudflare Pages, Fleek, Firebase Hosting). - -1. Configure your build environment with the environment variables specified in `frontend/.env.local.example`. - -2. Configure your builds to the following settings: - -- Build command: `yarn build:site` -- Build output directory: `/build` -- Root directory: `/` - -3. Configure the domain that you want for your build. diff --git a/docs/versioned_docs/version-1.4.1/devops/errors.md b/docs/versioned_docs/version-1.4.1/devops/errors.md deleted file mode 100644 index 05dc5b0c..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/errors.md +++ /dev/null @@ -1,45 +0,0 @@ -# Errors - -## Deploying - -### Artifact for contract "HypercertMinter" not found - -#### Error message - -`Error HH700: Artifact for contract "HypercertMinter" not found.` - -#### Cause - -Attempting to deploy a contract with `npx hardhat deploy` before the contract has been compiled by hardhat. Contracts compiled by forge are currently not visible to hardhat (this could be a configuration problem). - -### insufficient funds for intrinsic transaction cost - -#### Error message - -`Error: insufficient funds for intrinsic transaction cost` - -#### Cause - -The environment variable `MNEMONIC` is not configured correctly. - -Alternatively, the wallet may not have enough funds for the selected network - -Causing pause twice - -Error: cannot estimate gas; transaction may fail or may require manual gas limit - -reason: 'execution reverted: Pausable: paused', - -#### Etherscan API - -Note: It can take between 5-10 minutes before a newly created etherscan API key becomes valid for queries to goerli. - -When using an etherscan API key that was too recently created, hardhat tasks using etherscan to verify transactions will exit with an error message: - -`Etherscan returned with message: NOTOK, reason: Invalid API Key` - -Despite this error the transaction may have succeeded, the hardhat task just can't confirm it. - -It is unknown if this is a problem for queries to mainnet as well. - -Metamask makes it very difficult to have multiple wallets. diff --git a/docs/versioned_docs/version-1.4.1/devops/index.md b/docs/versioned_docs/version-1.4.1/devops/index.md deleted file mode 100644 index 9b208595..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# DevOps - -We use this playbook to encapsulate our practices and current setup. - -## Setup dev environment - -- [Setup guide](./setup.md) -- [Plasmic setup](./plasmic.md) - -## Tasks - -- [Deploy new proxy contract](./deploy-proxy.md) -- [Upgrade contract](./upgrade.md) -- [Pause contract](./pause.md) - -## FAQ - -- [Common errors](./errors.md) diff --git a/docs/versioned_docs/version-1.4.1/devops/pause.md b/docs/versioned_docs/version-1.4.1/devops/pause.md deleted file mode 100644 index 2668f51e..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/pause.md +++ /dev/null @@ -1,29 +0,0 @@ -# Pause / Unpause - -## Pause - -### Contract owned by an address - -Make sure you have set up your wallets and config from the [setup guide](./setup.md). - -To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: - -```sh -yarn hardhat pause --network NETWORK --address CONTRACT_ADDRESS -``` - -### Contract owned by a multi-sig - -If we transferred ownership to a multisig, we can use -[OpenZeppelin Defender Admin](https://defender.openzeppelin.com/#/admin) -to propose a pause to be approved by the multisig. - -## Unpause - -Make sure you have set up your wallets and config from the [setup guide](./setup.md). - -To pause the contract, run the following, where `CONTRACT_ADDRESS` is the proxy address of the HypercertMinter, and `NETWORK` is one of the networks from `hardhat.config.ts`: - -```sh -yarn hardhat unpause --network NETWORK --address CONTRACT_ADDRESS -``` diff --git a/docs/versioned_docs/version-1.4.1/devops/plasmic.md b/docs/versioned_docs/version-1.4.1/devops/plasmic.md deleted file mode 100644 index 10e52f5b..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/plasmic.md +++ /dev/null @@ -1,76 +0,0 @@ -# Plasmic setup - -## HypercertImage - -### Props - -hideImpact - -``` -$ctx.currentForm.impactTimeEnd === "indefinite" && ($ctx.currentForm.impactScopes.length === 0 || ($ctx.currentForm.impactScopes.length === 1 && $ctx.currentForm.impactScopes[0] === "all")) -``` - -color - -``` -$ctx.currentForm.backgroundColor -``` - -vectorart - -``` -$ctx.currentForm.backgroundVectorArt -``` - -### Slots - -logoImage Image URL - -``` -$ctx.currentForm.logoUrl -``` - -title Content - -``` -$ctx.currentForm.name -``` - -workPeriod Content - -``` -`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.workTimeEnd.format ? $ctx.currentForm.workTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.workTimeEnd}` -``` - -bannerImage Image URL - -``` -$ctx.currentForm.bannerUrl -``` - -impactPeriod Content - -``` -`${$ctx.currentForm.workTimeStart.format ? $ctx.currentForm.workTimeStart.format("YYYY-MM-DD") : $ctx.currentForm.workTimeStart} → ${$ctx.currentForm.impactTimeEnd.format ? $ctx.currentForm.impactTimeEnd.format("YYYY-MM-DD") : $ctx.currentForm.impactTimeEnd}` -``` - -#### workScopes: repeated ScopeChip - -Collection - -``` -$ctx.currentForm.workScopes.split(/[,\n]/).map(i => i.trim()).filter(i => !!i) -``` - -Element name: `currentWorkScope` -Index name: `currentIndex` -Color variant: `$ctx.currentForm.backgroundColor` -Content: `currentWorkScope` - -#### impactScopes: repeated ScopeChip - -Collection: `$ctx.currentForm.impactScopes` -Element name: `currentImpactScope` -Index name: `currentIndex` -Color variant: `$ctx.currentForm.backgroundColor` -Content: `currentImpactScope` diff --git a/docs/versioned_docs/version-1.4.1/devops/setup.md b/docs/versioned_docs/version-1.4.1/devops/setup.md deleted file mode 100644 index afb95296..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/setup.md +++ /dev/null @@ -1,41 +0,0 @@ -# Setup - -## Pre-requisites - -1. Install [NodeJS](https://nodejs.org/en/) and [git](https://git-scm.com/) -2. Install [yarn](https://classic.yarnpkg.com/) - -```sh -npm install --global yarn -``` - -3. Clone the repository: - -``` -git clone git@github.com:hypercerts-org/hypercerts.git -cd hypercerts -``` - -4. Install dependancies: - -To install dependencies across all projects in the monorepo workspace: - -```sh -yarn install -``` - -## Setup your wallets - -We need 2 wallets: a multi-sig for administering the contracts, and a hot wallet for setting everything up. - -1. We use a [Gnosis Safe](https://app.safe.global/) multisig for managing and administering the contracts. Set one up with your desired confirmation threshold (e.g. 2 of 3). This wallet will not require any balance. -2. Separately, set up a wallet that we'll use in our developer scripts. - -- If you don't have one, you can goto `contracts/` and run `yarn hardhat generate-address`. -- Make sure there is enough balance in this account to deploy the contract and transfer ownership to the multisig - - [Goerli Faucet](https://goerlifaucet.com/) - - [Optimism Bridge](https://app.optimism.io/bridge/deposit) - -## Next Steps - -Depending on what you want to do (e.g. in `./sdk/` or `./frontend/`), there will be further setup instructions in the respective `README.md` file. diff --git a/docs/versioned_docs/version-1.4.1/devops/upgrade.md b/docs/versioned_docs/version-1.4.1/devops/upgrade.md deleted file mode 100644 index 820255e7..00000000 --- a/docs/versioned_docs/version-1.4.1/devops/upgrade.md +++ /dev/null @@ -1,35 +0,0 @@ -# Upgrading the contract - -## Validate upgrade - -Validate contract upgradeability against deployment. - -For example, for the `goerli` deployment: - -```sh -yarn hardhat validate-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS -``` - -## Propose Upgrade - -Propose an upgrade via OpenZeppelin Defender. For more information, see this -[guide](https://docs.openzeppelin.com/defender/guide-upgrades) - -For example, for the `goerli` deployment: - -```sh -yarn build:hardhat -yarn hardhat propose-upgrade --network goerli --proxy PROXY_CONTRACT_ADDRESS --multisig OWNER_MULTISIG_ADDRESS -``` - -This will output an OpenZeppelin URL that multi-sig members can use to approve/reject the upgrade. - -## Publish to npm - -After you update the contracts, deploy the `contracts/` package to npm. - -TODO - -Update the dependencies in `frontend/package.json` and `sdk/package.json`. - -If the ABI of the contract has changed, make sure you also update `defender/src/HypercertMinterABI.ts`. diff --git a/docs/versioned_docs/version-1.4.1/faq.md b/docs/versioned_docs/version-1.4.1/faq.md deleted file mode 100644 index b9659b5a..00000000 --- a/docs/versioned_docs/version-1.4.1/faq.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Frequently Asked Questions -id: faq ---- - -# FAQs - -### How do I create a hypercert? - -We've created a step-by-step guide in the documents, which you can find [here](minting-guide/minting-guide-start). - -### Who gets to claim my hypercert? - -There are currently two types of users who are eligible to claim your hypercert. - -1. You as the creator of the hypercert are eligible to claim your hypercert. For projects with an allow list, you are eligible to claim 50% of the total tokens. For projects with no allow list, you will receive 100% of the tokens automatically and can do whatever you like with them. - -2. Anyone on the hypercert's allow list will be eligible to claim your hypercert. The allow list is stored and the time of minting and allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions through a separate contract interaction. Creators often use allow lists be used to allocate fractions to previous funders and contributors. - -### How do I claim a hypercert? Can I claim all of the ones I’m eligible for at once? - -After you connect your wallet, you will see a dashboard of hypercerts that you can claim. You can either claim them individually or in a batch transaction. Note that if you perform the batch transaction you will automatically claim _all_ hypercerts you are allow-listed for. (You still pay a gas fee for each claim, however.) If you don't want to claim _all_ at once, then you should claim them one-by-one. - -### What token standard do hypercerts utilize? - -The interface supports both ERC-1155s and 721s. Our current implementation makes use of [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) (a semi-fungible token). - -### What are the required fields to generate a hypercert? - -There are six required fields: - -1. Set of contributors: An ordered list of all contributors, who claim to do or have done the work described by this hypercert. -2. Scope of work: A conjunction of potentially-negated work scope tags, where an empty string means “all”. -3. Time of work: A date range, from the start to the end of the work being claimed by this hypercert. -4. Scope of impact: A conjunction of potentially-negated impact scope tags, where an empty string means “all”. -5. Time of impact: Date ranges from the start to the end of the impact. -6. Rights of the owners: An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. - -Hypercerts also need a name and description. - -### What should I put for my hypercert's work scope? - -For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. - -If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. - -### Are hypercerts the same as impact evaluations? - -No. A hypercert is a claim over a discrete piece of work and the impact that may result from that work. It has no opinion about the legitimacy or quality of the claim. - -An impact evaluation is an opinionated assessment about the legitimacy or quality of a claim. - -For example, a hypercert might represent "Planting trees in the Amazon in 2022". An impact evaluation might point to that hypercert and assert the percent of trees that survived, the amount of CO2 removed by the trees, or the income change among people living around the project. - -Over time, the expectation is that hypercerts that attract multiple, high quality, credibly neutral impact evaluations will be more relevant than ones that do not. - -### What can I do with my hypercert? - -The `rights` dimension specific what an owner can do with their hypercert. Currently, the only `right` that owners have is "Public Display". Over time, we hope the protocol can support various `rights` including transfers, intellectual property, tax-deductibility, carbon offsets, ESG reporting, and more. - -### How is a hypercert different than a POAP or Impact NFT? - -Hypercerts have some things in common with certain POAPs or Impact NFTs, but also a number of crucial differences. - -First, all POAPs and most Impact NFTs are implemented as non-fungible tokens (ERC-721s). Hypercerts are currently being implemented as semi-fungible tokens (ERC-1155s), meaning it is possible to own more than one unit or fraction of a given hypercert. This makes it easy and intuitive to display the share of hypercerts that a given owner has. - -Second, hypercerts have specific metadata requirements and interpretation logic. These include a standard schema for how the six required hypercert dimensions are defined and captured (i.e., work scopes, impact scopes, timeframes, contributors, etc) as well as logic for how to interpret different inputs (e.g., how to include or exclude certain work scopes, create an indefinite time period, etc). POAPs have a completely different schema. Although there is no standard schema for Impact NFTs, an Impact NFT project could choose to adopt the hypercert standard and token interface and thereby achieve compatibility. - -Third, the hypercerts token interface is intended to support several functions that are not possible out of the box with other token standards, chiefly, atomic split and merge capabilities. We also expect other protocols to work with hypercerts for the purposes of prospective and retrospective funding, contributor verification, and impact evaluation. - -For certain use cases, POAPs may be better suited for projects as hypercerts are focused on the funding aspect of impactful work. - -### Where can I purchase a hypercert? - -Currently, it is only possible to purchase a hypercert from a creator or project. This can be facilitated directly by the project or via a third-party marketplace like OpenSea. Currently, hypercerts cannot be resold on secondary markets. - -### What chain(s) is hypercerts running on? - -The hypercerts smart contracts have been deployed on Optimism and Goerli Testnet. We plan to support various EVM chains in the near future. - -### How do I bridge to Optimism? - -There are various bridging services including the official [Optimism Bridge](https://app.optimism.io/bridge/deposit). Note that bridging assets from Ethereum to Optimism will incur a gas fee. - -### How much gas will it cost to create or claim a hypercert? - -In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). Claiming a hypercert should be below 0.0001 ETH or less than $0.10 on Optimism. - -### How do I create a hypercert from a multisig? - -If you are creating a hypercert on Optimism, then you will need an Optimism-based multisig. (Unfortunately, Safe wallets created on Ethereum won't work on Optimism.) - -### Have the smart contracts been audited? - -Yes. The auditor's security report is available [here](https://github.com/pashov/audits/blob/master/solo/Hypercerts-security-review.md). - -### How is the allow list generated? - -For Gitcoin projects, an allow list is generated from a snapshot of all of the on-chain funding received by the project. - -The queries used to generate the allow lists can be viewed here: - -- ETH Infra: https://dune.com/queries/1934656 -- Climate: https://dune.com/queries/1934689 -- OSS: https://dune.com/queries/1934969 - -Once the snapshot is taken, the formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. - -For example: - -- $5.60 donated --> 5 fractions -- $5.20 donated --> 5 fractions -- $0.96 donated --> 1 fraction -- $0.52 donated --> 0 fractions - -### Why am I not on the allow list even though I contributed to the project? - -If you contributed less than $1 DAI to a project, then you will not be eligible to claim a hypercert fraction. - -### I supported a project. Why I don't I see the hypercert in my dashboard? - -In order to your hypercert to appear as "claimable", the project needs to mint the hypercert first. If the project has not minted its hypercert yet, then you will not be able to claim it. We suggest you check back in a few days to see if the project has created the hypercert and is now claimable. - -If the project has created its hypercert, then please try the following solutions: - -1. Confirm the wallet address is correct (some users have multiple wallet addresses and forget which one they donated with) -2. Check that your wallet is included in the Dune Dashboards for each Gitcoin Round - -- ETH Infra: https://dune.com/queries/1934656 -- Climate: https://dune.com/queries/1934689 -- OSS: https://dune.com/queries/1934969 - -3. Confirm you donated more than $1 DAI to the project. - -If the project has created its hypercert, and you have confirmed items 1-3, then please send us a DM over Twitter or Telegram with your wallet address and we will get back to you promptly. - -### How do I retire a hypercert? - -We don't yet have a frontend for retiring hypercerts but you can do this by interacting directly with the smart contract on Etherscan. diff --git a/docs/versioned_docs/version-1.4.1/further-resources.md b/docs/versioned_docs/version-1.4.1/further-resources.md deleted file mode 100644 index 86c25331..00000000 --- a/docs/versioned_docs/version-1.4.1/further-resources.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: Further Resources -id: further-resources ---- - -# Papers, Articles, Presentations - -## Writings - -- Feb 14, 2023, Whitepaper draft by [@hypercerts](http://twitter.com/hypercerts): [Hypercerts: A new primitive for impact funding systems (draft v0)](../static/pdf/hypercerts_whitepaper_v0.pdf) -- Aug 24, 2022, Blogpost by [@holkeb](https://twitter.com/holkeb): [Hypercerts: A new primitive for public goods funding](https://protocol.ai/blog/hypercert-new-primitive/) -- Jun 2022, Tech report (draft) by [@davidad](https://twitter.com/davidad): [Hypercerts; an Interoperable Datalayer for Impact-Funding Mechanisms](../static/pdf/hypercerts_Tech_Report_draft.pdf) - -## Talks - -#### Jun 24, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Hypercerts: on-chain primitives for impact markets](https://youtu.be/2hOhOdCbBlU) - - - -#### Jun 23, 2022, Conversation between [@emiyazono](http://twitter.com/emiyazono) and [@owocki](http://twitter.com/owocki) at GreenPill Podcast: [Impact Certificates | Evan Miyazono, Head of Research at Protocol Labs | Green Pill #21](https://youtu.be/kyo5SxtSJ9U) - - - -#### Mar 4, 2022, Talk at [Funding the Commons](https://fundingthecommons.io/) by [@davidad](https://twitter.com/davidad): [Interoperable mechanisms for non-rival goods (Hypercerts)](https://youtu.be/acbBeGcevok) - - - -## Other resources - -Overview of some previous writings on impact certificates, retrospective funding and impact markets: - -- Christiano, Paul (2014) Certificates of impact, Rational Altruist, [https://rationalaltruist.com/2014/11/15/certificates-of-impact/](https://rationalaltruist.com/2014/11/15/certificates-of-impact/) -- Christiano, Paul & Katja Grace (2015) The Impact Purchase, [https://impactpurchase.org/why-certificates/](https://impactpurchase.org/why-certificates/) -- Optimism & Buterin, Vitalik (2021) Retroactive Public Goods Funding, [https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c) -- Cotton-Barratt, Owen (2021), Impact Certificates and Impact Markets, Funding the Commons November 2021, [https://youtu.be/ZiDV56o5M7Q](https://youtu.be/ZiDV56o5M7Q) -- Drescher, Denis (2022) Towards Impact Markets, [https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1](https://forum.effectivealtruism.org/posts/7kqL4G5badqjskYQs/toward-impact-markets-1) -- Ofer & Cotton-Barratt, Owen (2022) Impact markets may incentivize predictably net-negative projects, [https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6](https://forum.effectivealtruism.org/posts/74rz7b8fztCsKotL6) diff --git a/docs/versioned_docs/version-1.4.1/implementation/glossary.md b/docs/versioned_docs/version-1.4.1/implementation/glossary.md deleted file mode 100644 index b35d4405..00000000 --- a/docs/versioned_docs/version-1.4.1/implementation/glossary.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Glossary -id: glossary -sidebar_position: 3 ---- - -# Glossary of Hypercerts Terms - -## Main Terms - -### Allowlist - -A list that determines how fractions of hypercerts will be allocated to new owners. The current implementation requires a project to specify an allowlist at the time of minting its hypercert. Based on allowlists, designated new owners are able to claim their fractions. - -### Claiming a fraction - -Transferring the ownership of a fraction of a hypercert to a (new) owner. Generally 'claiming' implies minting a new token that represents said fraction by the new owner. - -### Contributor - -An individual or organization that performs some or all of the work described in a hypercert. - -### Creating a hypercert - -Synonymous to minting a hypercert. - -### Fraction - -A token that represents a quantified proportion of a hypercert denominated in units. - -### Funder - -Individual, organization, or algorithm that funds work. There are generally two types: (1) **prospective** funders, who fund work _before_ it is done, and (2) **retrospective** funders, who fund work _after_ it is done. - -### Hypercert - -A token that (1) accounts for work by specified contributors that is supposed to be impactful, (2) represents the – potentially explicitly specified – impact of this work, and (3) assigns right over this work to its owners. If a hypercert is split into multiple fractions, the hypercert refers to the sum of all of its fractions. The term `hypercert` may also refer to an implementation of the hypercert interface and standard. - -### Hypercerts interface - -The hypercerts [contract interface](https://github.com/hypercerts-org/hypercerts/blob/main/contracts/src/protocol/interfaces/IHypercertToken.sol), which declares the required functionality for a hypercert token. The current interface includes functions for minting, burning, splitting, and merging of hypercert tokens. - -### Hypercerts implementation - -An implementation that builds on top of the hypercerts interface and conforms to the hypercerts standard. For instance, our initial implementation uses an [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) token. The first 128 bits of the 256-bit token ID identifies the hypercert, the latter 128 bits identifies the specific fraction. Other implementations are possible (e.g., based on ERC-721) as long as they also conform to the data standard and use the hypercerts interface to support capabilities like splitting and merging of values. - -### Hypercerts standard - -A data standard for hypercerts. It requires the following fields to be defined in the metadata of the token: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. - -### Impact - -Value that is created or destroyed by work. It mostly refers to positive impact, i.e., value that is created. If work destroys value, it is referred to as negative impact. - -### Impact evaluation - -A claim that a specified impact has or will occur – potentially claiming which work was responsible for the impact. - -### Impact Funding System (IFS) - -A system of actors (contributors, evaluators, funders) that interact according to a set of rules (funding mechanisms, coordination mechanisms) to maximize the domain-specific impact. - -### Impact space - -A geometrical space representing all possible work with its associated impact and rights. The space is spanned by the six fields specified in the hypercerts data standard: (1) set of contributors, (2) scope of work, (3) time of work, (4) scope of impact, (5) time of impact, (6) rights. - -### Merging hypercerts - -An operation to combine two or more hypercerts, such that the resulting, merged hypercert covers the exact same region in the impact space that the individual hypercerts covered. - -### Minting a hypercert - -Creating a new record for a hypercert on a blockchain. The properties of the hypercert (e.g., its timeframe and scope of work) are retrievable via this record. - -### Project - -Work by one or more contributors to achieve a goal. A project does not always need to be represented by one hypercert; it can be represented by multiple hypercerts (e.g., one hypercert per phase or milestone of a project). A hypercert can also represent multiple projects or even parts of multiple projects. - -### Prospective funder - -Individual, organization, or algorithm that fund work before it is done. - -### Retrospective funder - -Individual, organization, or algorithm that fund work after it is done. - -### Rights - -An unordered list of usage rights tags, which define the rights of the owners of a hypercert over the work being claimed by a hypercert. One of the axis of the impact space and part of the required fields in the hypercerts data standard. - -### Set of contributors - -An ordered list of all contributors, who claim to do or have done the work described by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Scope of impact - -A conjunction of potentially-negated impact scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Scope of work - -A conjunction of potentially-negated work scope tags, where an empty string means “all”. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Splitting hypercerts - -An operation to split one hypercert into two or more separate hypercerts, such that the resulting, separated hypercerts cover the exact same region in the impact space that the previous hypercert covered. - -### Time of impact - -Date ranges from the start to the end of the impact being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Time of work - -A date range, from the start to the end of the work being claimed by a hypercert. One axis of the impact space and part of the required fields in the hypercerts data standard. - -### Unit - -The smallest possible fraction of a claim. Generally units are grouped in fractions. - -### Work - -Activities that produce impact. - -## Additional Impact Evaluation Terms - -### Auditor - -Individual, organization, or algorithm that evaluates the impact of work after it is done. - -### Beneficiaries - -People or objects that are impacted by work. - -### Evaluator - -Individual, organization, or algorithm that evaluates the impact of work. There are two types: Scouts evaluate the potential impact before it is done, auditors evaluate the impact after it is done. - -### Scout - -Individual, organization, or algorithm that evaluates the potential impact of work before it is done. diff --git a/docs/versioned_docs/version-1.4.1/implementation/metadata.md b/docs/versioned_docs/version-1.4.1/implementation/metadata.md deleted file mode 100644 index 08eb9fcb..00000000 --- a/docs/versioned_docs/version-1.4.1/implementation/metadata.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: Metadata Standard -id: metadata -sidebar_position: 2 ---- - -# Hypercert Metadata Structure - -Hypercerts are represented as [ERC-1155](https://eips.ethereum.org/EIPS/eip-1155) tokens. All token instances of a hypercert must share the same ERC-1155 metadata. For sites like OpenSea to pull in off-chain metadata for ERC-1155 assets, your hypercert contract will need to return an IPFS URI that contains all necessary hypercert metadata. - -The hypercert metadata schema follows the [Enjin recommendation](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md#erc-1155-metadata-uri-json-schema) for ERC-1155 metadata. It also includes **six required dimensions** that are necessary to clearly and unambiguously identify the hypercert's impact claim. - -The following are standard ERC-1155 metadata fields. - -## ERC-1155 fields - -| Property | Description | -| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | Name or title of the hypercert. Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. | -| `description` | A human readable description of the hypercert. Markdown is supported. Additional external URLs can be added. | -| `image` | A URI pointing to a resource with mime type image/\* that represents the hypercert's artwork, i.e., `ipfs://`. We recommend images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. | -| `external_url` | [optional] A URL that can be displayed next to the hypercert on webpages like OpenSea and links users to a page that has more information about the project or impact claim. | -| `properties` | [optional] Additional properties (aka attributes) that may be helpful for discovery and curation of hypercerts. Marketplaces like OpenSea will display these properties in the same way as they display rarity traits of NFTs. | - -In order to perform hypercert-specific operations, including split and merge functions, and for your hypercert to robustly claim a set of coordinates in the impact space, there are six additional dimensions that must be included in your metadata. - -## Required Hypercert dimensions - -| Property | Description | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `work_scope` | An _ordered list_ of work scope tags. Work scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any work scope that is explicitly excluded from the claim. | -| `work_timeframe` | Date range from the start to the end of the work in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). | -| `impact_scope` | An _ordered list_ of impact scope tags. Impact scopes may also be excluded from the claim. The `¬` prefix will be displayed next to any impact scope that is explicitly excluded from the claim. The default claim is to "all" impact, giving the owner rights to claim all potential impact created by the work that is represented by the hypercert. | -| `impact_timeframe` | Date range from the start to the end of the impact in the form of a [UTC timestamp](https://www.utctime.net/utc-timestamp). The default claim is from the start date of work until `indefinite` (i.e., the impact may occur at any point in time in the future). | -| `contributors` | An _ordered list_ of all contributors. Contributors should be itemized as wallet addresses or ENS names, but may be names / pseudonyms. The default claim is to the wallet address that created the hypercert contract. A multisig wallet can be used to represent a group of contributors. | -| `rights` | An _unordered list_ of usage rights tags. The default claim is solely to "public display" of the hypercert, i.e., all other rights remain with the contributors. | - -## Examples - -### Example 1: hypercert with minimal bounds - -Here is an example of hypercert dimensions for work on IPFS with minimal bounds: - -``` -"hypercert": { - "work_scope": { - "name": "Work Scope", - "value": ["IPFS"], - "excludes": [], - "display_value": "IPFS" - }, - "impact_scope": { - "name": "Impact Scope", - "value": ["All"], - "excludes": [], - "display_value": "All" - }, - "work_timeframe": { - "name": "Work Timeframe", - "value": [1380585600, 1388534399], - "display_value": "2013-10-01 -> 2013-12-31" - }, - "impact_timeframe": { - "name": "Impact Timeframe", - "value": [1380585600, 0], - "display_value": "2013-10-01 -> Indefinite" - }, - "contributors": { - "name": "Contributors", - "value": ["Protocol Labs"], - "display_value": "Protocol Labs" - }, - "rights": { - "name": "Rights", - "value": ["Public Display"], - "display_value": "Public Display" - } -} -``` - -### Example 2: hypercert with bounded impact claims - -This hypercert is for a carbon removal project that provides a bounded impact scope. - -``` -"hypercert": { - "work_scope": { - "name": "Work Scope", - "value": ["Protecting Trees in Amazon"], - "excludes": [], - "display_value": "Protecting Trees in Amazon" - }, - "impact_scope": { - "name": "Impact Scope", - "value": ["CO2 in Atmosphere"], - "excludes": [], - "display_value": "CO2 in Atmosphere" - }, - "work_timeframe": { - "name": "Work Timeframe", - "value": [1356998400, 1388534399], - "display_value": "2013-01-01 -> 2013-12-31" - }, - "impact_timeframe": { - "name": "Impact Timeframe", - "value": [1356998400, 0], - "display_value": "2013-01-01 -> Indefinite" - }, - "contributors": { - "name": "Contributors", - "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], - "display_value": "0xa1f...000, Project Forest Conservation" - }, - "rights": { - "name": "Rights", - "value": ["Public Display"], - "display_value": "Public Display" - } -} -``` - -### Example 3: hypercert with excluded impact claims - -Here is an example that explicitly excludes an impact scope to generate a more fine-grained claim. - -``` -"hypercert": { - "work_scope": { - "name": "Work Scope", - "value": ["Protecting Trees in Amazon"], - "excludes": [], - "display_value": "Protecting Trees in Amazon" - }, - "impact_scope": { - "name": "Impact Scope", - "value": ["All"], - "excludes": ["CO2 in Atmosphere"], - "display_value": "All ∧ ¬CO2 in Atmosphere" - }, - "work_timeframe": { - "name": "Work Timeframe", - "value": [1356998400, 1388534399], - "display_value": "2013-01-01 -> 2013-12-31" - }, - "impact_timeframe": { - "name": "Impact Timeframe", - "value": [1356998400, 0], - "display_value": "2013-01-01 -> Indefinite" - }, - "contributors": { - "name": "Contributors", - "value": ["0xa1fa1fa000000000000000000000000000000000", "Project Forest Conservation"], - "display_value": "0xa1f...000, Project Forest Conservation" - }, - "rights": { - "name": "Rights", - "value": ["Public Display"], - "display_value": "Public Display" - } -} -``` - -### Additional guidelines - -Here are some additional guidelines for defining hypercert dimensions. - -- For most hypercerts, the `work_scope` is best represented as the name of the project or activity. Other information contained in the hypercert, namely, the `contributors` and the `work_timeframe` should provide sufficient context to disambiguate multiple claims from the same project. -- Similarly, for most hypercerts, the `impact_scope` will be most clearly represented as "all" (with an indefinite upper bound on the `impact_timeframe` dimensions). This gives the hypercert creator and its owners the flexibility to make claims about impact that may not have been observable or well-understood when the hypercert was created. - -- It is recommended to browse the `impact_scope` and `work_scope` tags that have already been created and are in use by your or other projects. (We are building a catalog to be available at [hypercerts.org](https://hypercerts.org).) Picking established tags can make it easier for users to discover, curate, and interact with your hypercert. In the long-run, we expect different ontologies to emerge in domains like climate solutions, open source software, etc, and picking more established tags will help prevent overlapping or duplicate claims. -- Tags for work scopes and impact scopes are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. -- Scopes that are explicitly excluded from the hypercert claim are enumerated separately and displayed with the `¬` prefix in the tag. Excluded scopes are not currently displayed on hypercert artwork. -- The order of tags matters only for display purposes. The hypercert artwork will only display a limited number of tags in the `impact_scope` and `work_scope` arrays due to image size and stylistic constraints. -- A `contributor` can be identified using any human-readable string. The base case is to set the `contributors` to the wallet address used to create the hypercert. A multisig wallet can be used to represent a group of contributors. - -### Assigning `rights` - -In version 1.0 of the protocol, only one `rights` tag will be enabled: - -> **Public Display**: owners of the hypercert have the right to publicly display and receive social utility from their hypercert. - -This means that any other rights regarding the work described by the hypercert either remain with the original contributors or are governed by other agreements. - -Additional `rights` including the potential for certain types of transfers to be explicitly enabled will be released in subsequent versions. - -## Optional hidden properties - -Creators may wish to add other fields in their metadata that are not a part of the hypercert claim and are not for display on third-party marketplaces like OpenSea. These can be added by creating a `hidden_properties` field in the metadata. diff --git a/docs/versioned_docs/version-1.4.1/implementation/token-standard.md b/docs/versioned_docs/version-1.4.1/implementation/token-standard.md deleted file mode 100644 index a767c670..00000000 --- a/docs/versioned_docs/version-1.4.1/implementation/token-standard.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Token Standard -id: token-standard -sidebar_position: 1 ---- - -### Hypercerts as a semi-fungible token - -In order to make the token identifiable, traceable, and transferable, hypercerts are represented as [ERC-1155 tokens](https://eips.ethereum.org/EIPS/eip-1155). The ERC-1155 standard enables a single deployed contract to store many hypercerts, facilitating simpler creation, transfers, as well as splitting and merging of hypercerts within a single namespace. As a semi-fungible token, each unique token represents a fraction of ownership of a hypercert. Hypercerts are then represented as a group of tokens, where the total ownership sums to 100%. In order to easily identify which hypercert a token belongs to, we utilize the upper 128 bits of a 256-bit token ID to identify the hypercert. All tokens within the same hypercert group should share the same [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). - -![hypercert id](../../static/img/hypercert_id.png) - -For illustrative purposes, let us assume that token IDs are just 2 bytes long, where the first byte represents the hypercert ID and the last byte represents which fraction of ownership. Alice could create a new hypercert token 0x2301, representing 100% of hypercert 0x23. If Alice wanted to transfer 20% to Bob, Alice could perform a split operation by minting token 0x2302 and transferring 20% of value to it, such that tokens 0x2301 and 0x2302 represent 80% and 20% ownership respectively of hypercert 0x23. Then Alice transfers token 0x2302 to Bob. Similarly, they could merge these 2 tokens together, back to form a token that represented 100% ownership. In this case, the value of 0x2301 would be transferred to 0x2302, and then 0x2301 is subsequently burned. - -Alice can also choose to split or merge hypercerts along some dimension of the impact space. For example, Alice may split hypercert 0x23 into two new hypercerts — 0x24 representing work done before the year 2000, and 0x25 representing work done after 2000. The original hypercert 0x23 is burned and the two new hypercerts store a reference to the previous hypercert. When the history of splits and merges are indexed, we can easily trace through the provenance of any individual hypercert. - -### Claim Data - -Hypercert claim data, such as scope of work and the contributor list, is encoded in JSON format into the [ERC-1155 Metadata](https://eips.ethereum.org/EIPS/eip-1155#metadata). Claim data can be stored on-chain alongside the token, or in off-chain storage such as IPFS. For details on the JSON schema and how off-chain storage can be utilized, see the [hypercerts-sdk repository](https://github.com/hypercerts-org/hypercerts/tree/main/sdk). - -When considering whether to store hypercert metadata on-chain or off-chain, we can consider the different trade-offs to the user experience and cost, which may differ depending on which blockchain is being used. Storing data off-chain saves on costs, but could lead to on-chain claims without the metadata. Storing data on-chain adds additional security that the claims will not be forgotten but can lead to higher gas fees. - -Beyond the standard fields of hypercerts that locate the hypercert in the impact space, additional fields can be added. This allows for different templates in different impact areas, such as AI safety or biodiversity, as different additional information will be useful. Importantly, however, all hypercerts will be located in a single impact space – the additional fields do not change that. - -### Multi-chain support - -We expect hypercerts to exist in a multi-chain ecosystem, where the local deployment can be used to support the unique funding systems of that community. In order to visualize a single global impact space, we index the different contract deployments across chains and surface any potential hypercert claim conflicts. Because different blockchains support different subsets of programming languages, we do expect different implementations of the hypercert protocol to exist. However, they must adhere to the same hypercert data model to be indexed into the impact space. - -In order to decide which deployments to index into the hypercerts impact space, decentralized governance institutions will be used to govern the list of contract addresses used across all blockchains. diff --git a/docs/versioned_docs/version-1.4.1/intro.md b/docs/versioned_docs/version-1.4.1/intro.md deleted file mode 100644 index 0c4d7ca3..00000000 --- a/docs/versioned_docs/version-1.4.1/intro.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: What Are Hypercerts? -id: intro ---- - -# What are hypercerts? - -### Hypercerts are a new token standard for tracking and rewarding positive impact. - -Each hypercert represents a unique impact claim capturing the following information: - -- a scope of work and its corresponding scope of impact -- a set of time frames for both the work and its impact -- a set of contributors – the organization or people behind the work -- a set of rights you get by owning a hypercert - -The hypercert itself is an ERC-1155 semi-fungible token with the information above stored as metadata on IPFS. Here’s an example. - -### Hypercert example - -#### Graphic representation - -![hypercert design example](../static/img/hypercert_example.png) - -#### Supplementary information (metadata) - -- **Title of hypercert:** Invention of the InterPlanetary Filesystem (IPFS) -- **Description:** The InterPlanetary File System (IPFS) is a set of composable, peer-to-peer protocols for addressing, routing, and transferring content-addressed data in a decentralized file system. -- **Link:** ipns://ipfs.tech/ - -#### Hypercert dimensions (metadata) - -- **Set of contributors:** 0xb794f5ea0ba39494ce839613fffba74279579268 _(example Ethereum address)_ -- **Scope of work:** IPFS ∧ ¬ go-ipfs -- **Time of work:** 2013-01-01 --> 2013-12-31 -- **Scope of impact:** All -- **Time of impact:** 2013-01-01 --> indefinite -- **Rights:** Public display - -### Why should you care? - -We spend trillions of dollars every year on public goods via governmental agencies, foundations, private donations and corporate spendings; however, we don’t effectively track this work – leaving us in the dark, hoping that it actually has the intended positive impact. - -We believe we can do better: - -- We should start by tracking this work consistently – this is what hypercerts are for. -- We should evaluate how impactful that work was – this is what the open evaluation system of hypercerts supports. -- We should reward the work that was exceptionally impactful – this is what the public display of hypercerts and retrospective funding is for. - -Doing this would unfold powerful incentives. Retrospective funding 1) provides incentives for creators to take on public goods projects with a potentially high, but uncertain, impact, 2) enables feedback loops to learn from successes and failures, and 3) attracts more talent to the public goods sector by improving performance-based compensation. - -While we are excited about the prospects of retrospective funding, hypercerts do not impose any specific funding mechanisms, but start with tracking the work that is supposed to be impactful. As a database for many funding mechanisms this facilitates experimentation and interoperability between funding mechanisms. - -### Next - -Curious and want to learn more? Head over to the [whitepaper](whitepaper/whitepaper-intro.md) to dive deeper into the world of hypercerts. - -Or do you want to get started right away? Head to the [minting guide](minting-guide/minting-guide-start.md). diff --git a/docs/versioned_docs/version-1.4.1/minting-guide/gitcoin-round.md b/docs/versioned_docs/version-1.4.1/minting-guide/gitcoin-round.md deleted file mode 100644 index 1ad2310a..00000000 --- a/docs/versioned_docs/version-1.4.1/minting-guide/gitcoin-round.md +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: Gitcoin Alpha Round Instructions -id: gitcoin-round -sidebar_position: 3 ---- - -# Gitcoin Alpha Round Instructions - -## Overview - -- all projects in the Gitcoin Alpha Round are invited to mint a hypercert for their work -- anyone who gave over $1 to a project is automatically allowlisted for that project’s hypercert -- 50% of each hypercert is distributed to the funders, 50% is kept by the project and can be transferred later -- each project has a custom URL to make minting super easy (the link is sent directly to each project) -- everything runs on Optimism (users only need to pay L2 gas costs) - -:::info -If your project participated in the Gitcoin Alpha Round, but you didn't get a message with a custom URL, please reach out to team[at]hypercert.org. -::: - -## Hypercerts x Gitcoin Alpha Round - -Now that Gitcoin’s Alpha Round has officially closed and the funding distribution is finalized, we are inviting all eligible projects that participated to mint a hypercert for their past work and to allocate fractions of their hypercert to a list of supporters. - -We’ve created a dApp that pulls all of the data required to mint your hypercert directly from Gitcoin’s Grant Protocol. You can fine-tune the properties, tweak your artwork, and review the distribution mechanism. Once you’re ready, hit the create button and your hypercert will be released into the ethers! - -Once your hypercert has been minted, the people who supported your project with a contribution of at least $1 DAI on Gitcoin’s Alpha Round will be able to connect and claim their fractions. - -A few important notes about the Alpha Round: - -- The total units of a hypercert is based on the total donations; each funder get awarded units proportional to their donations. -- Transfers will be restricted to one transfer from the project to the supporters. -- There will be no additional rights awarded to the funders except the right to "public display" their support for the project. - -## Instructions - -The following guidance is only for projects that receive a custom URL that pre-populates the hypercerts form based on their Gitcoin Grants' data. - -It explains the default settings in the form and recommends fields that the creator may choose to update or edit. - -:::note -Gitcoin Grant hypercerts are for retrospective work, i.e., they are intended to capture work that happened between Gitcoin Grants Round 15 (September 2022) and the Alpha Round (January 2023). Therefore, the work time period is always set to past dates. (You might need to adjust the name and description to also refer to past work only.) We are focusing solely on retrospective hypercerts for this round as part of broader efforts to promote retrospective funding; you can read more about it [in the whitepaper](whitepaper/retrospective-funding.md). -::: - -### General Fields - -#### Name of Hypercert - -This field is set by default to the name of your project on Gitcoin Grants. You can edit this to be more specific. Given that your project may create numerous hypercerts over time, consider giving each hypercert a name that represents a more discrete phase or output. - -#### Logo - -This field is set to the icon artwork provided for your project on Gitcoin Grants. If there was an error accessing your icon, you will see a generic icon. - -You can update this by providing a new URL and the hypercert artwork should update automatically. - -Logo images look best with an aspect ratio of 1.0 (square-shaped). - -#### Background Banner Image - -This field is set to the banner artwork provided for your project on Gitcoin Grants. If there was an error accessing your banner, you will see a generic Gitcoin banner. - -You can update this by providing a new URL and the hypercert artwork should update automatically. - -Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. - -#### Project Description - -This field is set by default to the description of your project on Gitcoin Grants. Review closely -- a long project description in your Gitcoin Grant description will be truncated. - -You may edit this to provide more details about your work and to remove information that is targeted solely at Gitcoin Grants users. This is also a good place to provide other links, such as Github repos or social media accounts, where the general public can learn more about the work. Please aim for a project description that is less than 500 characters. - -:::note -The project description should refer to **past work**, not future work that you would like to do with additional funding. -::: - -#### Link - -This field is set to the first external URL provided for your project on Gitcoin Grants. You can update this. - -### Hypercert Fields - -#### Work Scope - -This field is set by default to a **shortened version** of the name of your project on Gitcoin Grants. You may edit or add additional work scope tags. - -For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. - -If you choose to use more than one tag, remember that tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. - -#### Work Start/End Dates - -The start date has been set by default to the `2022-09-22` for all projects on Gitcoin Grants. This date coincides with the end of Gitcoin Grants Round 15. - -The end date references the last update to your grant page on Gitcoin Grants. - -You may edit or update these fields, however, the end date may not extend beyond `2023-01-31` (the close of the funding round) as all hypercerts will be retrospective in this round. - -#### Set of Contributors - -This field is set by default to the wallet address that is set as the recipient address for receiving Gitcoin Grants funding. - -:::note -You should review this field closely and – if applicable – provide the addresses of additional contributors. -::: - -### Advanced Fields - -#### Impact Scope - -This field is set by default to `all`. - -Updates are currently disabled on the frontend because funding decisions on Gitcoin Grants were not specific to an impact scope or impact time period. - -#### Impact Start/End Dates - -This field is set by default to the work start date of `2022-09-22` (see above) and a work end date of `indefinite`. Updates are currently disabled on the frontend. - -#### Rights - -This field is set by default to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. - -Updates are currently disabled on the frontend. - -### Distribution - -#### Allowlist - -This field is set by default to a custom allowlist generated for each project based on the funding it received on the Gitcoin Grants Alpha Round. You should not need to update this field. If there is a problem with your allowlist, please contact us. - -50% of the hypercert will be allocated according to this allowlist. The other 50% will be kept by the project, i.e. it is allocated to the address that mints the hypercert. You will be able to transfer or sell these fractions later as long as they are owned by the minter. This means that they can only be transferred or sold once. - -The formula assigns one fraction (rounded down) for every $1 (using the exchange rate at the time of the transaction) that a donor contributed to the project. It also provides a small buffer (of 5%) so that a transaction worth $0.999 or $0.951 remains eligible for one fraction. - -For example: - -- $5.60 donated --> 5 fractions -- $5.20 donated --> 5 fractions -- $0.96 donated --> 1 fraction -- $0.52 donated --> 0 fractions - -The queries used to generate the allowlists can be viewed here: - -- ETH Infra: https://dune.com/queries/1934656 -- Climate: https://dune.com/queries/1934689 -- OSS: https://dune.com/queries/1934969 - -Donors who contributed to the matching pool for each round are also eligible to claim hypercerts. - -:::note -You are free to edit your allowlist. You can do this by following the step-by-step instructions [here](minting-guide/step-by-step.md). Just remember that you will need to upload the new allowlist in a CSV format to a storage site like [web3.storage](https://web3.storage) and then update the link in the allowlist field. Contact team[at]hypercerts.org if you need help. -::: - -### Confirmations - -#### Contributors' permission - -Every contributor needs to agree to have their contribution be represented by a hypercert. This is why the person minting the hypercert has to confirm to have the permission of all listed contributors. - -#### Terms & Conditions - -The terms & Conditions can be found [here](https://hypercerts.org/terms). - -### Final step: Click "Create" - -Make sure your Optimism wallet or multi-sig is connected. Click on "create" and wait for your hypercert to be created. Congratulations! diff --git a/docs/versioned_docs/version-1.4.1/minting-guide/minting-guide-start.md b/docs/versioned_docs/version-1.4.1/minting-guide/minting-guide-start.md deleted file mode 100644 index 47e8ad7c..00000000 --- a/docs/versioned_docs/version-1.4.1/minting-guide/minting-guide-start.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Getting Started -id: minting-guide-start -sidebar_position: 1 ---- - -# Getting started - -### How to create a hypercert - -Creating a hypercert is similar to creating an NFT on sites like OpenSea or Zora. - -In this article, we’ll walk through the steps one by one and explain exactly what you need to do to create your first hypercert. - -There are typically two ways of creating a hypercert: - -1. As a project affiliated with a specific funding network (e.g., Gitcoin Grants): In this case, you should receive a custom URL from the funding network that pre-populates most of your hypercert fields. You will still be able to change most of these, so you should review and adjust them as needed to better describe your hypercert. Guidance on how to do so (for Gitcoin Grants projects) is provided at the end of this doc. -2. As a project not affiliated with a specific funding network: In this case, you will be creating a hypercert from scratch and filling in each field on your own. Read on below. - -### Who can create a hypercert? - -Anyone doing work that is intended to have a positive impact can create a hypercert. Your hypercert can be as simple as "I did X on this date and want to claim all future impact from it". - -It can also represent something more, such as a phase in an ongoing team project, an invention or discovery, a research publication, or an important software release. - -Critically, if the work was done by more than one person, then each person should be listed as a contributor to the hypercert and approve the creation of the hypercert. - -_Note: In the future, the approval of each contributor will be verified on-chain._ - -### What do I need to create a hypercert? - -You will need to prepare all of the information required in the form builder (see **Step-by-step instructions for creating a hypercert** below). This includes important metadata, such as a description of the project and the dimensions of your impact claim, as well as a project artwork. You may also want to include an allowlist of wallets that are approved to claim one or more fractions of the hypercert. - -In addition to the information regarding the hypercert itself, you’ll need a crypto wallet to mint your hypercert. “Minting” a hypercert is the process of writing an impact claim to the blockchain. This establishes its immutable record of authenticity and ownership. - -Next, choose a blockchain on which to mint your hypercert. The hypercerts protocol is available on Ethereum, Goerli (testnet), and Optimism. Each of these blockchains has different gas fees associated with transactions on their networks. To reduce gas fees we recommend Optimism for most projects. - -Finally, go ahead and create your hypercert. - -### How much does it cost to create a hypercert? - -You will need enough Ethereum in your wallet to cover gas fees. In our simulations, the gas fee for minting a hypercert on Ethereum Mainnet ranged from 2,707,282 to 7,515,075 gwei (0.0027 to 0.0075 ETH). Minting costs are significantly cheaper on Optimism (i.e., below 0.0005 ETH or less than $1). - -The protocol currently does not offer gas-free or "lazy" minting. diff --git a/docs/versioned_docs/version-1.4.1/minting-guide/step-by-step.md b/docs/versioned_docs/version-1.4.1/minting-guide/step-by-step.md deleted file mode 100644 index 9f3b6303..00000000 --- a/docs/versioned_docs/version-1.4.1/minting-guide/step-by-step.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: Step-by-step Instructions -id: step-by-step -sidebar_position: 2 ---- - -# Step-by-step instructions - -First, go to the [Create Hypercert](https://hypercerts.org/app/create) site with a wallet-enabled browser or follow the custom URL you received to access a prepopulated form. - -Although the site works on mobile, it is easier to use on desktop because the browser will display a dynamic preview of the hypercert while you fill out the Create form. - -Next, connect your wallet. You will be prompted to switch to the Ethereum or Optimism network. - -Once you've connected, you will see an empty form for creating a hypercert. - -### General fields - -#### Name of Hypercert - -Enter the name or title of the hypercert. This is the place to be verbose and specific about what the project is doing. You'll see on the preview when your title becomes too long. - -Given that a project may create numerous hypercerts over time, consider giving the hypercert a name that represents a discrete phase or output. - -Names are restricted to 100 characters but may include emojis (:smile:), accents (é), non-Latin scripts (表情), and other Unicode characters. - -#### Project Description - -Enter a human readable description of the hypercert. This is the place to share more details about the work and the team or individual behind the work. - -The description field supports [Markdown syntax](https://www.markdownguide.org/cheat-sheet/) and has a limit of 10,000 characters. - -In addition to the main link (see next field) you can add further links in the markdown to help others to understand the work of the project. - -#### Link - -A valid URL for the project, beginning with https:// - -This will be displayed next to the hypercert on webpages like OpenSea and should link users to a page that has more information about the project or impact claim. - -#### Logo - -An icon for the top left part of the card. This could be your project logo. It will be automatically masked to the shape of a circle. - -Logo images look best with an aspect ratio of 1.0 (square-shaped). - -The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. - -#### Background Banner Image - -A background image that will extend across the upper half of the artwork. This could be your project masthead or a unique piece of art. - -Banner images look best with an aspect ratio of 1.5 (e.g., 600 x 400 pixels). The dimensions should be at least 320 pixels wide and 214 pixels high to avoid stretching. - -Currently we don't support zoom / cropping, so you will need to test the look and feel on your own. - -The easiest way is to find an image you like in your web browser, right click "Copy Image Address", and paste it in the field. Images stored on IPFS should be referenced through a hosted URL service, e.g., `https://cloudflare-ipfs.com/ipfs/`. - -### Work Scope fields - -#### Work Scope - -One or multiple tags describe the work that the hypercert represents. This work scope will be used to identify the work that is included in the hypercerts and the work that is not included. - -Multiple tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction), e.g. `Planting trees` ∧ `Germany` means that the hypercert includes the planting of trees only in Germany, but not planting trees anywhere else or any other work in Germany that wasn't planting trees. - -For most projects, it's probably best just to use a single tag that is a short form of your project's name. Given that your project may create numerous hypercerts over time, having a work scope that represents the name of your project will make your claims in the "impact hyperspace" more continuous. - -_Note: In the future, you will be able to specifically exclude work from the hypercert._ - -#### Start and End Date of Work - -The work time period defines when the work was done that the hypercert represents, i.e., only the work in this time period is included in the hypercert. - -The time period of work doesn't need to be the start and end date of a project, but it can be. One project can be split up into multiple hypercerts, e.g. all hypercerts can have the same `work scope`, but different time periods of work. Of course, the time periods are not allowed to overlap. - -### Impact scope fields - -#### Impact Scope - -The impact scope can be used to limit the impact that a hypercert represents, e.g. for the work scope `Planting trees` a hypercert can represent _only_ the impact on biodiversity by including the impact scope tag `Biodiversity`. This would exclude all other impacts, including the impact on CO2 in the atmosphere, which can be useful if that impact is already captured by a carbon credit. - -By default this is set to "`all`" and we strongly recommend keeping it that way. - -Just like the work scope, multiple impact scope tags are [logically conjunctive](https://en.wikipedia.org/wiki/Logical_conjunction). - -#### Start and End Date of Impact - -The impact time period is another way to limit the impact that a hypercert represents, e.g. inventing a new medical treatment has a positive impact over many years, but we might want to capture the positive impact separately for each year. - -By default the `impact start date` is the same as the `work start date` and the `impact end date` is "`indefinite`", i.e., the impact is not restricted time-wise. We strongly recommend keeping it that way. - -### Set of Contributors - -Provide a list of contributors, one per line, or comma-separated. - -The list should include _all_ contributors that performed the described work. - -Contributors are generally itemized as wallet addresses or ENS names, but can also be names / pseudonyms. Groups of contributors can be represented by a multisig or name of an organization. - -### Owners - -#### Allowlist - -The allowlist allocates fractions of the hypercert to specific wallet addresses. These wallet addresses are then allowed to claim these fractions afterwards. For example, it can be used to allocate fractions to previous funders and contributors. - -The allowlist is implemented as a CSV file specifying `index,address,price,fractions` headers. - -| index | address | price | fractions | -| ----- | ------------------------------------------ | ----- | --------- | -| 0 | 0x5dee7b340764c49a827c60d2b8729e49405fbefc | 0.0 | 100 | -| 1 | 0x1e2dbb9ca3f6d48e085384a821b7259abfdc7d65 | 0.0 | 50 | -| ... | ... | ... | ... | -| 999 | 0x436bad18642f45d3fa5fcaad0a2d81764a9cba85 | 0.0 | 1 | - -The `price` field is denominated in ETH. This should remain at 0.0 for all hypercerts, as primary sales are not currently supported through the app and the secondary sale/transfer of hypercerts is currently not allowed. - -You can store your allowlists on IPFS using [web3.storage](https://web3.storage/). - -:::note -If your allowlist is not properly formatted, you will be unable to mint your hypercert. If you do not include an allowlist, then the creator of the hypercert will receive 100% of the hypercert (set to a default of 10,000 units), which you can then sell or transfer to another wallet a maximum of one time. -::: - -#### Rights - -This field defines the rights that owners of the hypercert have over the work being claimed by this hypercert. - -By default this is set to `Public Display`, i.e., the owners are allowed to publicly display the hypercert and show their support of the work. - -_Note: In the future, additional rights can be included for different hypercerts._ diff --git a/docs/versioned_docs/version-1.4.1/whitepaper/evaluation.md b/docs/versioned_docs/version-1.4.1/whitepaper/evaluation.md deleted file mode 100644 index 87fb9194..00000000 --- a/docs/versioned_docs/version-1.4.1/whitepaper/evaluation.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: Open Impact Evaluations -id: evaluation -sidebar_position: 5 ---- - -A key design element is that hypercerts themselves do not make a claim about the size of the impact, but only account for the work that is supposed to be impactful. The figure below shows this contrast in a simplified illustration of the example that we introduced above. The open evaluation system allows multiple evaluations to point at the same area of the impact space that a hypercert claims. The evaluations can include self-evaluation from the contributors themselves. Funders observe these and make their funding decisions based on this richer set of information. - -![hypercert evaluations](../../static/img/hypercert_evaluations.png) - -The open evaluation system is also used to provide additional information, e.g. an evaluator or the project itself provides information about the health of the trees. This information can then be used transparently by other evaluators to evaluate the impact on CO2 in the atmosphere. - -An important feature is that the evaluations do not directly point at a hypercert, but rather at an area in the impact space. In practice this area will mostly be the exact same area that a hypercert claims, such that it can be considered an evaluation of the hypercert, but it does not have to. This feature ensures that, if hypercerts are merged or split, previous evaluations will continue to be linked appropriately. - -The form of evaluations can be standardized to simplify handling and comparing multiple evaluations from multiple evaluators. The open evaluation system allows for templates to be created and used by any evaluators. Similar to the emerging ontologies, these are not enforced centrally, but should emerge as useful standards – potentially steered by decentralized governance institutions. - -Important characteristics of the open evaluation system are: - -- Evaluators can submit multiple evaluations of the same area in the impact space as more information becomes available -- Evaluations can challenge other evaluations -- Evaluation methodologies can evolve over time - -These features allow the whole evaluation system to be dynamically improved by each actor. The relevant incentives for this improvement will stem from the funders who will value the signals from some evaluators more than others and evaluators are able to build up reputation. diff --git a/docs/versioned_docs/version-1.4.1/whitepaper/hypercerts-intro.md b/docs/versioned_docs/version-1.4.1/whitepaper/hypercerts-intro.md deleted file mode 100644 index 8acc11d1..00000000 --- a/docs/versioned_docs/version-1.4.1/whitepaper/hypercerts-intro.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Hypercerts: a New Primitive for Impact Funding Systems" -id: hypercerts-intro -sidebar_position: 3 ---- - -### Defining hypercerts - -A hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and represents all or parts of that impact. A hypercert has the following fields (one for each dimension): - -1. **Set of contributors:** An ordered list of all contributors, who claim to do or have done the work described by this hypercert. -2. **Scope of work:** A conjunction of potentially-negated work scope tags, where an empty string means “all”: - -``` - ::= AND | " " - ::= | NOT -``` - -3. **Time of work:** A date range, from the start to the end of the work being claimed by this hypercert. -4. **Scope of impact:** A conjunction of potentially-negated impact scope tags, where an empty string means “all”: - -``` - ::= AND | " " - ::= | NOT -``` - -5. **Time of impact:** Date ranges from the start to the end of the impact. -6. **Rights of the owners:** An unordered list of usage rights tags, which define the rights of the owners of this hypercert over the work being claimed by this hypercert. - -Implementing hypercerts as a semi-fungible token allows multiple contributors and funders to own parts of hypercerts. For instance the original contributors can award 10% of a hypercert to a funder, while keeping 90%, which they can award to other funders later. This is why hypercerts are fractionalizable. - -### Examples - -In the simplest cases of hypercerts, the scope of work and impact as well as the time of impact are not restricted and no rights are transferred to owners of the hypercerts, i.e. the hypercerts just define the who (set of contributors) and when (time of work) of the claimed work. Scope of work and impact would be set to all, time of impact to “indefinite” and the rights to only “public display of support”. The latter is always included as the hypercert is a public record, such that owners will always automatically display their support of the work. - -Take for example hypercert 1 below: It represents all work that contributor 1 has performed in 2013 with all the impact that the work had from the beginning of the work; the hypercert doesn’t give any additional rights to the owners of the hypercert. - -The other fields – except the rights field – can be used to limit the work or impact that is represented by the hypercert. Hypercert 2 limits this to the work on IPFS in 2013, i.e. any other work besides IPFS that contributor 1 performed is not included. Hypercert 3 limits it even further as it excludes a specific aspect of IPFS, the go-ipfs implementation. - -| | **Hypercert 1** | **Hypercert 2** | **Hypercert 3** | -| ----------------------- | ------------------------- | ------------------------- | ------------------------- | -| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | -| **Scope of work** | all | IPFS | IPFS ∧ ¬ go-ipfs | -| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | -| **Scope of impact** | all | all | all | -| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → 2013-12-31 | -| **Rights** | Public display of support | Public display of support | Public display of support | - -In the table below we illustrate a use case for limiting the scope of impact. Suppose contributor 1 protects trees in a certain area. This work has positive effects on the CO2 in the atmosphere and could turn into carbon credits; however, the trees have additional positive impacts, such as protecting biodiversity. Instead of including all positive impacts in one hypercert (hypercert 4), the impact can be split between the impact on CO2 in the atmosphere (hypercert 5) and all other positive impacts (hypercert 6). If funders are willing to pay for biodiversity, this would be a new income opportunity. And it would account for the additional positive impact that other methods of reducing CO2 might not have, like industrial carbon capture. Importantly, negative impacts can not be excluded from a hypercert. - -| | **Hypercert 4** | **Hypercert 5** | **Hypercert 6** | -| ----------------------- | -------------------------- | -------------------------- | -------------------------- | -| **Set of contributors** | Contributor 1 | Contributor 1 | Contributor 1 | -| **Scope of work** | Protecting trees in area X | Protecting trees in area X | Protecting trees in area X | -| **Time of work** | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | 2013-01-01 to 2013-12-31 | -| **Scope of impact** | all | CO2 in atmosphere | all ∧ ¬ CO2 in atmosphere | -| **Time of impact** | 2013-01-01 → indefinite | 2013-01-01 → indefinite | 2013-01-01 → indefinite | -| **Rights** | Public display of support | Public display of support | Public display of support | - -Importantly a hypercert does not specify the “size” of the impact, e.g. a hypercert does not state “5 tons of CO2 removed from the atmosphere.” Instead the hypercert only defines the work, e.g. “200 trees protected” (scope of work) in 2022 (time of work). The size of the impact is then left to the evaluations of the “CO2 in the atmosphere” (scope of impact) in 2022 (time of impact) that point towards the covered region of the hypercert. For instance: This allows a self evaluation to claim that 5 tons of CO2 were removed in a given year as well as one or multiple evaluations from independent auditors to confirm or challenge how much CO2 has been removed. An evaluator could detect that some of the trees were not healthy and hence only 4 tons of CO2 were removed. Allowing for multiple evaluation is a defining characteristic of the open evaluation system. - -### Functions of hypercerts - -#### 1. Identifiability - -Hypercerts clearly define the work that is supposed to be impactful by creating a record of who (set of contributors) claims to do or have done what (scope of work) in what time period (time of work). They also allow the creation of multiple records of the same work to identify separate impacts that this work had or will have (scope of impact) over specified time periods (time of impact). - -#### 2. Traceability - -As these records are public and logically monotonic (immutable, except to split or merge hypercerts), records are durable and permanent. - -#### 3. Transferability - -The records are a digital object that can be owned and ownership can be transferred (under specific conditions). As hypercerts can be created as fractionalizable, it is also possible to transfer only a specified fraction of the hypercert. Each hypercert defines the rights over the defined work that owners have, such as rights to retrospective rewards, rights to public display of the support (“bragging rights”) or rights to passive income from intellectual property. - -:::note Transferability restrictions - -Hypercerts are generally transferable. However, there are use cases, in which minters of hypercerts want to restrict how their hypercerts can be transferred. The protocol allows the minter to restrict who can transfer the hypercert and/or to whom the hypercert can be transferred. For instance, by specifying that only the original owner can transfer the hypercert, any future owner is prohibited from selling it, i.e. a secondary market would not exist for this hypercert. - -::: - -### Merging hypercerts - -Besides the fungible dimension, hypercerts can be merged and split on any of the six dimensions as shown in box 1. Let us take the hypercert 1 from the section "Hypercerts definition" and focus only on two of the dimensions, scope of work and time of work. These two dimensions create a simplified impact space. The figure below shows how work on IPFS (InterPlanetary File System) could have been minted over time in separate hypercerts, one for each quarter of work. - -![minting hypercerts example](../../static/img/creating.png) - -We created five hypercerts, one for each quarter of work. As the resulting work of all of these together is IPFS 0.1, the merged hypercert in total is more meaningful and more valuable than just the five individual hypercerts. In this case the proverb is true, the whole is greater than the sum of its parts. Hence, we want to merge them as shown in the next figure. - -![merging hypercerts example](../../static/img/merging.png) - -### Splitting hypercerts - -Conversely, splitting can increase the meaningfulness and value of hypercerts as well. We can split the work on IPFS 0.1 into the conceptual work “invention of IPFS” and the implementation via “go-ipfs 0.1” as shown in the next figure. - -![splitting hypercerts examples](../../static/img/splitting.png) - -Other use cases are where multiple contributors want to combine their work on the same scope of work (merging) or disentangle their work (splitting). Ultimately, splitting and merging allows users to repackage the digital representation of their work and impact. - -Importantly, splitting and merging are the only operations that are permitted to change hypercerts. Once an area in the impact space is claimed, it can not be unclaimed. This ensures that claims are never forgotten. - -### Retiring hypercerts - -While a claim in the impact space can not be unclaimed, it can be retired. Retiring a hypercert means that owners can not transfer and sell it anymore. This way owners prove that they are the final buyers of the impact. Technically retiring hypercerts means that they are sent to a specific null address, which ensures that the retired hypercerts are recorded and traceable. diff --git a/docs/versioned_docs/version-1.4.1/whitepaper/ifs.md b/docs/versioned_docs/version-1.4.1/whitepaper/ifs.md deleted file mode 100644 index 6f71ac50..00000000 --- a/docs/versioned_docs/version-1.4.1/whitepaper/ifs.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: The Need for Interoperable Impact Funding Systems (IFSs) -id: ifs ---- - -# The Need for Interoperable Impact Funding Systems (IFSs) - -### An IFS consists of - -- **Actors:** Contributors, funders, evaluators, and beneficiaries -- **Funding mechanisms:** Grants, bounties, retrospective funding, etc. -- **Coordination mechanisms:** Roadmapping, communication forums, etc. -- **A goal:** Maximize the domain-specific positive value created (impact) - -The goal will be specific to the impact area, e.g. prevent existential risks from artificial intelligence (AI) would be the goal for the impact area “AI safety.” To achieve these goals, skilled contributors must work with high effort on promising projects. Additionally, for those projects that create impact continuously, sufficient income streams are necessary to cover both their ongoing operating expenses and contributors’ upside incentives. - -#### Actors in IFSs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeSubtypeDescription
ContributorsPeople or organizations who do the work
FundersProspective fundersPeople or organizations who fund work before it is done
Retrospective fundersPeople or organizations who fund work after it is done
EvaluatorsScoutsPeople or organizations who evaluate the potential impact of work before it is done
AuditorsPeople or organizations who evaluate the impact of work after it is done
BeneficiariesPeople or objects that are impacted by the work
- -### Guiding questions for designing IFSs - -1. **Projects:** How can we improve the chances that the most promising projects are worked on? -2. **Talent & resources:** How can we attract top talent to contribute to the most promising projects and provide them with the necessary resources? -3. **Effort:** How can we reward contributors for their impact on outcomes? -4. **Sustainable income:** How can we create recurring income streams and financial sustainability for impactful projects? - -Markets have been proven very powerful in answering these questions if they are directed towards maximizing profits. As we are directing systems towards maximizing impact, these answers become more challenging. In particular, in an IFS we are facing coordination and incentive problems in funding impact, such as the free-rider problem. - -### Example dynamics between actors in an IFS - -In order for impact funding systems to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources and (3) evaluations. In the diagram below you see a potential dynamic between the actors of an IFS. In that scenario hypercerts can account for the prospective funding (steps 2-3) as well as for the retrospective funding (steps 8-9) from different funders. Evaluations are made public and can be discovered through the hypercerts for all funders (steps 5-7). Retrospective funders can reward not only the contributors but also the prospective funders (steps 10-11). - -```mermaid -sequenceDiagram - autonumber - participant Beneficiaries - participant Contributors - participant Prospective funders - participant Retrospective funders - participant Evaluators - Contributors ->> Contributors: Mint hypercerts - Prospective funders ->> Contributors: Award funding - Contributors ->> Prospective funders: Award fractions of
the hypercert - Contributors ->> Beneficiaries: Create impact - Retrospective funders ->> Evaluators: Fund evaluation - Evaluators ->> Beneficiaries: Evaluate impact on beneficiaries - Evaluators ->> Retrospective funders: Make evaluations public,
esp. for retrospective
funders - Retrospective funders ->> Contributors: Award funding - Contributors ->> Retrospective funders: Award fractions of hypercerts - opt - Retrospective funders ->> Prospective funders: Award funding - Prospective funders ->> Retrospective funders: Transfer fractions
of hypercert - end -``` - -### Hypercerts as a data layer for IFSs - -By serving as a single, open, shared, decentralized database hypercerts lower the transaction costs to coordinate and fund impactful work together. This is important because the optimal funding decisions of a single funder depends on the funding decision of all other funders. For instance, some work is only impactful if a minimum funding is provided: The impact is non-linear in the funding amount, e.g. half a bridge is not half as impactful as a full bridge. Other work might be over-funded, i.e. the impact of an additional dollar is basically zero. Ultimately, funders want to find the highest impact for each additional dollar spend (cf. S-process as in Critch, 2021). Today multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Through hypercerts the funding becomes more transparent and the credits for funding impactful work can be easily shared. Coordinating funding becomes easier. - -Hypercerts don’t solve this coordination problem by themselves, but build the basis for different decision and funding mechanisms as shown below. Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. Hypercerts do not lock in any particular decision-making scheme for funders. - -![Hypercerts as a data layer for an IFS](../../static/img/hypercert_data_layer.png) - -Looking farther into the future: If a large majority of funding across an entire IFS ends up flowing through hypercerts, funders have created the transparency that enables each of them to make the best decisions given the funding decision of everyone else. diff --git a/docs/versioned_docs/version-1.4.1/whitepaper/impact-space.md b/docs/versioned_docs/version-1.4.1/whitepaper/impact-space.md deleted file mode 100644 index f8fed762..00000000 --- a/docs/versioned_docs/version-1.4.1/whitepaper/impact-space.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: A Consistent Impact Space -id: impact-space -sidebar_position: 4 ---- - -Every hypercert represents a claim in the impact space, which itself represents all possible claims. Above we illustrated the impact space with two dimensions, scope and time of work. The complete impact space is spanned by the six dimensions introduced in the definition of hypercerts. - -### Consistency of the impact space - -Every point in the impact space should either be claimed or not be claimed. No point must be claimed twice, or equivalently: - -- If the impact of some work is represented in one hypercert, it must not be part of any other hypercert. -- Hypercerts must not overlap with each other. - -The table below shows two hypercerts that were illustrated in the section on "Hypercerts operations", but now with all six fields. The two hypercerts can represent the exact same work by the same contributor, but they do not overlap because of the difference in the time of work. - -| | **Hypercert 7** | **Hypercert 8** | -| ----------------------- | ------------------------ | ------------------------ | -| **Set of contributors** | Contributor 1 | Contributor 1 | -| **Scope of work** | IPFS | IPFS | -| **Time of work** | 2013-10-01 to 2013-12-31 | 2014-01-01 to 2014-03-31 | -| **Scope of impact** | all | all | -| **Time of impact** | 2013-10-01 → indefinite | 2014-01-01 → indefinite | -| **Rights** | None | None | - -The consistency of the impact space is crucial as it ensures that no rights to an impact claim are sold twice. If for example someone owns the right to retrospective rewards for the impact of some work, the owners must be identifiable unambiguously. - -Because users can create hypercerts with arbitrary data on any chain, on which a hypercert contract is deployed, we provide ways to help users detect collisions in the impact space. For example, if one hypercert on Ethereum points to the work on “IPFS”, and another hypercert on Filecoin points to the work on “https://github.com/ipfs/go-ipfs” both with the same contributor and time of work, which of these overlapping hypercerts is the correct one to support? To surface such overlapping hypercerts, the hypercerts protocol and SDK will support mechanisms to index, search, and visualize neighbors in the impact space. With these tools evaluators can quickly detect potential conflicts and submit the results as evaluations to help disambiguate proper credit and attribution. - -### Emerging ontologies - -Common ontologies for the scope of work and scope of impact are useful to create transparency and improve discoverability. Such ontologies need to be created from the practices and should be adapted over time. They are like emerging norms, instead of fixed rules. However, some larger players or a group of smaller players could enforce certain ontologies, e.g. if multiple funders agree that they only fund projects that follow a specified ontology. - -As some ontologies might be more useful than others, we would ideally see a consensus emerge between participants and experts in each impact area. Decentralized governance institutions can help facilitate this; however, further details on the design are out of the scope of this paper and are left for future work. diff --git a/docs/versioned_docs/version-1.4.1/whitepaper/retrospective-funding.md b/docs/versioned_docs/version-1.4.1/whitepaper/retrospective-funding.md deleted file mode 100644 index 57444581..00000000 --- a/docs/versioned_docs/version-1.4.1/whitepaper/retrospective-funding.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: Retrospective Impact Funding -id: retrospective-funding -sidebar_position: 6 ---- - -### Introducing retrospective funding - -While hypercerts do not impose any specific funding mechanisms, they are especially useful for retrospective funding. The core idea, from the perspective of contributors building impactful goods, is this: if you can reasonably expect to get funded retrospectively for your work once you produce a positive impact, then you can work now, in expectation of a probabilistic future cash flow. In another conception, you are effectively “borrowing” money from this anticipated future cash flow to fund the work in the first place; the expectation of future funding “retro-causes” the impactful work. Retrospective funding may be able to 1) provide incentives for contributors to take on impactful goods projects with a potentially high, but uncertain, impact and 2) create a more efficient IFS by back-propagating signals on what outcomes were impactful post-hoc. - -In addition, contributors are able to receive fair compensation by providing outsized impact that will be highly valued. It incentivizes you to create a positive impact, beyond your intrinsic motivation. This does not mean that the most successful contributors to impactful goods automatically have potential upside comparable to some for-profit startup founders (or that they should), just that their potential upside does depend on how much funders later value their past work. This will attract more talent to the impact sector by improving performance-based compensation. - -The crucial aspect for this to work: funders need to retrospectively fund impact, and send credible signals that they will do so in the future. Based on these signals contributors form expectations about future retrospective rewards and can start working today to receive them in the future. - -Hypercerts facilitate retrospective funding as the impact claims are identifiable, traceable and transferable. Contributors can sell parts of their hypercerts to prospective funders to receive the necessary funding for their project (“activity” in the figure below). The project delivers impact to a larger group (“beneficiaries”), which retrospectively buys the hypercerts from the prospective funder, and from the contributors if they retained some fraction of their hypercerts (the latter is not represented in the figure). - -![Retrospective funding with hypercerts](../../static/img/retrospective_funding.png) - -### Increasing rewards - -Retrospective funding allows us to increase rewards as more impact is created because impact is easier to observe, measure and prove retrospectively. Increasing rewards – as shown in the next figure – incentivizes contributors to put in their highest effort to produce impact and enables contributors to be rewarded for their talent. Moreover, prospective funders are incentivized to select, fund and support the projects with the highest expected impact, if they also receive retrospective rewards. - -![Increasing rewards](../../static/img/increasing_rewards.png) - -Note that retrospective funding should not be used in cases where a significant negative impact is possible since a nongovernmental, permissionless framework can not impose retrospective penalties for negative externalities. See Ofer & Cotton-Barratt (2022) for a discussion of this limitation of retrospective funding. - -In some cases we do not expect the retrospective evaluation to be any different than the prospective evaluation, i.e. there is no uncertainty resolved over time as the impact of an activity is already “known” prospectively. In these cases retrospective funding would only complicate the funding mechanism and funding via grants or milestone bounties would be preferable. Retrospective funding is preferable only if uncertainty is resolved over time. - -### Impact evaluations - -The relevance of impact evaluations will depend on how much their signals influence the funding decisions of retrospective funders (see the potential dynamics in the section on "IFSs"). This is a critical difference to many impact reports today: If a project was funded by a grant, the funders as well as the project want to receive a positive evaluation. If, however, the funding decisions of the retrospective funders are outstanding, they are interested in truthful signals about the impact. Hence, funders value improvements in evaluation methodologies and can fund independent evaluators. Evaluators in turn would build up a reputation for their evaluation methodologies and improve the strength of their signals to retrospective funders. - -Impact evaluators can take on a range of forms ranging forms, such as - -- Voting by relevant communities or beneficiaries -- Expert panels -- Professional evaluators similar to financial rating agencies -- Automatic monitoring and data collection by sensors and oracles - -The most useful form or combinations thereof will depend on the specific requirements of the impact area. For a generalized framework on impact evaluators see Protocol Labs (2023). - -While retrospective funding makes impact evaluations financially relevant for funders and contributors, hypercerts enable to pre-commit funding for those evaluations: As impact claims are never forgotten, any actor can at any time commit funding to a future evaluation of these claims. diff --git a/docs/versioned_docs/version-1.4.1/whitepaper/whitepaper-intro.md b/docs/versioned_docs/version-1.4.1/whitepaper/whitepaper-intro.md deleted file mode 100644 index 4d4648ba..00000000 --- a/docs/versioned_docs/version-1.4.1/whitepaper/whitepaper-intro.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Introduction -id: whitepaper-intro ---- - -# Vision & Whitepaper - -:::note - -If you prefer to read the draft whitepaper (v0) as a pdf, you can find it [here](../../static/pdf/hypercerts_whitepaper_v0.pdf). The content is mostly identical to the following pages. - -::: - -#### The world faces unprecedented challenges, from climate change to safe artificial intelligence, that require billions to trillions of dollars of public goods funding. - -High-upside/high-uncertainty endeavors are often overlooked due to the absence of strong incentives to pursue them in the dominant public goods funding framework of at-cost grants or even a milestone-bounty framework (which directly exposes small contributors to aversive risk levels). Yet these should be pursued when the expected positive value is very high, as it often is. New impact funding mechanisms can address this. One such mechanism is retrospective funding, which rewards projects based on the impact they create after the impact is observable. If projects can reasonably expect such retrospective rewards, they are incentivized to maximize their impact and – together with prospective funders – take risky bets when the expected positive value is high. - -#### In order for Impact Funding Systems (IFSs) to be most effective, they should be interoperable regarding (1) funding mechanisms, (2) funding sources, and (3) evaluations. - -Quadratic voting, bargaining solutions, DAO-style votes, milestone bounties, and simple unconditional grants all have their strengths, among others. We do not wish to lock in any particular decision-making scheme for funders. Without mechanisms like these, multi-funder coordination on impact funding is prohibitively expensive, leading to suboptimal efficiency in impact capital allocation. Funders should be able to easily collaborate with other funders or to intentionally fund different projects to diversify the funded approaches. Evaluators should be able to evaluate the same impact with different methodologies – potentially with conflicting results, to foster rigor and progress of evaluation methodologies. - -#### Hypercerts create this interoperability by serving as a single, open, shared, decentralized database for impact funding mechanisms. - -A single hypercert is a semi-fungible token that accounts for work that is supposed to be impactful and whose ownership is fractionizable and transferable (under specific conditions). Hypercerts do not impose any specific funding mechanisms but provide baseline invariant guarantees such that claims will not be forgotten as different mechanisms come into and out of fashion. This is also why hypercerts are especially useful for any retrospective funding mechanisms – funding can be applied to claims of the past. diff --git a/docs/versioned_sidebars/version-1.0.0-sidebars.json b/docs/versioned_sidebars/version-1.0.0-sidebars.json deleted file mode 100644 index a17aed17..00000000 --- a/docs/versioned_sidebars/version-1.0.0-sidebars.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "mySidebar": [ - { - "type": "doc", - "id": "intro" - }, - { - "type": "category", - "label": "Vision & Whitepaper", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "whitepaper/whitepaper-intro" - }, - { - "type": "doc", - "id": "whitepaper/ifs" - }, - { - "type": "doc", - "id": "whitepaper/hypercerts-intro" - }, - { - "type": "doc", - "id": "whitepaper/impact-space" - }, - { - "type": "doc", - "id": "whitepaper/retrospective-funding" - } - ] - }, - { - "type": "category", - "label": "Developer Guide", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "developer/quickstart-javascript" - }, - { - "type": "doc", - "id": "developer/quickstart-solidity" - }, - { - "type": "doc", - "id": "developer/minting" - }, - { - "type": "doc", - "id": "developer/allowlists" - }, - { - "type": "doc", - "id": "developer/querying" - }, - { - "type": "doc", - "id": "developer/split-merge" - }, - { - "type": "doc", - "id": "developer/burning" - }, - { - "type": "doc", - "id": "developer/supported-networks" - }, - { - "type": "doc", - "id": "devops/index" - }, - { - "type": "category", - "label": "API Reference", - "collapsed": true, - "items": [ - { - "type": "category", - "label": "Contracts", - "collapsed": true, - "items": [ - { - "type": "autogenerated", - "dirName": "developer/api/contracts" - } - ] - }, - { - "type": "category", - "label": "SDK", - "collapsed": true, - "items": [ - { - "type": "autogenerated", - "dirName": "developer/api/sdk" - } - ] - } - ] - } - ] - }, - { - "type": "category", - "label": "Minting Guide", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "minting-guide/minting-guide-start" - }, - { - "type": "doc", - "id": "minting-guide/step-by-step" - }, - { - "type": "doc", - "id": "minting-guide/gitcoin-round" - } - ] - }, - { - "type": "category", - "label": "Implementation", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "implementation/token-standard" - }, - { - "type": "doc", - "id": "implementation/metadata" - }, - { - "type": "doc", - "id": "implementation/glossary" - } - ] - }, - { - "type": "doc", - "id": "faq" - }, - { - "type": "doc", - "id": "further-resources" - } - ] -} diff --git a/docs/versioned_sidebars/version-1.4.1-sidebars.json b/docs/versioned_sidebars/version-1.4.1-sidebars.json deleted file mode 100644 index 480ad50d..00000000 --- a/docs/versioned_sidebars/version-1.4.1-sidebars.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "mySidebar": [ - { - "type": "category", - "label": "Announcements", - "collapsed": true, - "items": [ - { - "type": "autogenerated", - "dirName": "announcements" - } - ] - }, - { - "type": "doc", - "id": "intro" - }, - { - "type": "category", - "label": "Vision & Whitepaper", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "whitepaper/whitepaper-intro" - }, - { - "type": "doc", - "id": "whitepaper/ifs" - }, - { - "type": "doc", - "id": "whitepaper/hypercerts-intro" - }, - { - "type": "doc", - "id": "whitepaper/impact-space" - }, - { - "type": "doc", - "id": "whitepaper/retrospective-funding" - } - ] - }, - { - "type": "category", - "label": "Developer Guide", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "developer/quickstart-javascript" - }, - { - "type": "doc", - "id": "developer/quickstart-solidity" - }, - { - "type": "doc", - "id": "developer/minting" - }, - { - "type": "doc", - "id": "developer/allowlists" - }, - { - "type": "doc", - "id": "developer/querying" - }, - { - "type": "doc", - "id": "developer/split-merge" - }, - { - "type": "doc", - "id": "developer/burning" - }, - { - "type": "doc", - "id": "developer/supported-networks" - }, - { - "type": "doc", - "id": "devops/index" - }, - { - "type": "category", - "label": "API Reference", - "collapsed": true, - "items": [ - { - "type": "category", - "label": "Contracts", - "collapsed": true, - "items": [ - { - "type": "autogenerated", - "dirName": "developer/api/contracts" - } - ] - }, - { - "type": "category", - "label": "SDK", - "collapsed": true, - "items": [ - { - "type": "autogenerated", - "dirName": "developer/api/sdk" - } - ] - } - ] - } - ] - }, - { - "type": "category", - "label": "Minting Guide", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "minting-guide/minting-guide-start" - }, - { - "type": "doc", - "id": "minting-guide/step-by-step" - }, - { - "type": "doc", - "id": "minting-guide/gitcoin-round" - } - ] - }, - { - "type": "category", - "label": "Implementation", - "collapsed": true, - "items": [ - { - "type": "doc", - "id": "implementation/token-standard" - }, - { - "type": "doc", - "id": "implementation/metadata" - }, - { - "type": "doc", - "id": "implementation/glossary" - } - ] - }, - { - "type": "doc", - "id": "faq" - }, - { - "type": "doc", - "id": "further-resources" - } - ] -} diff --git a/docs/versions.json b/docs/versions.json deleted file mode 100644 index 2342f886..00000000 --- a/docs/versions.json +++ /dev/null @@ -1 +0,0 @@ -["1.4.1"] diff --git a/sdk/RELEASE.md b/sdk/RELEASE.md index d6c2c1ea..5f65a06f 100644 --- a/sdk/RELEASE.md +++ b/sdk/RELEASE.md @@ -4,6 +4,8 @@ - Improve ESM support by exporting `index.mjs` instead of `index.js`. @baumstern - Added dweb IPFS gateway links and use `Promise.any` call to try and fetch data from multiple gateways. +- Expose timeout on HTTP requests from storage layer up to client wrapper methods as optional config. +- Default timeout on calls of 0 ms (no timeout) to avoid issues with large files or multiple IPFS calls. ## New contributors diff --git a/sdk/package.json b/sdk/package.json index 878ff303..152b446b 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "1.4.2-alpha.0", + "version": "1.4.2-alpha.1", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", diff --git a/sdk/src/client.ts b/sdk/src/client.ts index 3531d76d..f05c8db6 100644 --- a/sdk/src/client.ts +++ b/sdk/src/client.ts @@ -145,7 +145,7 @@ export class HypercertClient implements HypercertClientInterface { const { account } = this.getWallet(); // validate and store metadata - const metadataCID = await this.storage.storeMetadata(metaData); + const metadataCID = await this.storage.storeMetadata(metaData, { timeout: overrides?.timeout }); const request = await this.simulateRequest( account, @@ -259,11 +259,13 @@ export class HypercertClient implements HypercertClientInterface { const tree = parseAllowListEntriesToMerkleTree(allowList); // store allowlist on IPFS - const allowListCID = await this.storage.storeAllowList(allowList, totalUnits); + const allowListCID = await this.storage.storeAllowList(allowList, totalUnits, { timeout: overrides?.timeout }); // store metadata on IPFS - const metadataCID = await this.storage.storeMetadata({ ...metaData, allowList: allowListCID }); - + const metadataCID = await this.storage.storeMetadata( + { ...metaData, allowList: allowListCID }, + { timeout: overrides?.timeout }, + ); const request = await this.simulateRequest( account, "createAllowlist", diff --git a/sdk/src/storage.ts b/sdk/src/storage.ts index a9741939..4458f26c 100644 --- a/sdk/src/storage.ts +++ b/sdk/src/storage.ts @@ -5,6 +5,7 @@ import { MalformedDataError, StorageError, AllowlistEntry, + StorageConfigOverrides, } from "./types"; import { logger, getFromIPFS, parseAllowListEntriesToMerkleTree } from "./utils"; import { uploadAllowlist, uploadMetadata } from "./utils/apis"; @@ -26,11 +27,17 @@ export class HypercertsStorage implements HypercertStorageInterface { * If the metadata is valid, it creates a new Blob from the metadata and stores it using the hypercerts API. If the storage operation fails, it throws a `StorageError`. * * @param {AllowlistEntry[]} allowList - The allowList to store. + * @param {bigin} totalUnits - The total number of units in the allowlist. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns {Promise} A promise that resolves to the CID of the stored metadata. * @throws {StorageError} Will throw a `StorageError` if the storage operation fails. * @throws {MalformedDataError} Will throw a `MalformedDataError` if the provided metadata is invalid. */ - public async storeAllowList(allowList: AllowlistEntry[], totalUnits: bigint): Promise { + public async storeAllowList( + allowList: AllowlistEntry[], + totalUnits: bigint, + config: StorageConfigOverrides = { timeout: 0 }, + ): Promise { const { valid, data, errors: allowlistErrors } = validateAllowlist(allowList, totalUnits); if (!valid) { throw new MalformedDataError(`Invalid allowList.`, { errors: allowlistErrors }); @@ -42,10 +49,13 @@ export class HypercertsStorage implements HypercertStorageInterface { logger.debug("Allowlist tree: ", "storage", [tree]); - const { data: resData, errors: uploadAllowlistErrors } = await uploadAllowlist({ - allowList: JSON.stringify(tree.dump()), - totalUnits: totalUnits.toString(), - }); + const { data: resData, errors: uploadAllowlistErrors } = await uploadAllowlist( + { + allowList: JSON.stringify(tree.dump()), + totalUnits: totalUnits.toString(), + }, + config, + ); const allowlistCID = resData?.cid; @@ -65,11 +75,15 @@ export class HypercertsStorage implements HypercertStorageInterface { * If the metadata is valid, it creates a new Blob from the metadata and stores it using the hypercerts API. If the storage operation fails, it throws a `StorageError`. * * @param {HypercertMetadata} data - The Hypercert metadata to store. This should be an object that conforms to the HypercertMetadata type. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns {Promise} A promise that resolves to the CID of the stored metadata. * @throws {StorageError} Will throw a `StorageError` if the storage operation fails. * @throws {MalformedDataError} Will throw a `MalformedDataError` if the provided metadata is invalid. */ - public async storeMetadata(metadata: HypercertMetadata): Promise { + public async storeMetadata( + metadata: HypercertMetadata, + config: StorageConfigOverrides = { timeout: 0 }, + ): Promise { const { data, valid, errors: validationErrors } = validateMetaData(metadata); if (!valid) { throw new MalformedDataError(`Invalid metadata.`, { errors: validationErrors }); @@ -77,7 +91,7 @@ export class HypercertsStorage implements HypercertStorageInterface { logger.debug("Storing HypercertMetaData: ", "storage", [data]); - const { errors, data: resData } = await uploadMetadata(metadata); + const { errors, data: resData } = await uploadMetadata(metadata, config); const cid = resData?.cid; @@ -97,11 +111,15 @@ export class HypercertsStorage implements HypercertStorageInterface { * If the data is valid, it returns the data as a `HypercertMetadata` object. * * @param {string} cidOrIpfsUri - The CID or IPFS URI of the metadata to retrieve. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns {Promise} A promise that resolves to the retrieved metadata. * @throws {MalformedDataError} Will throw a `MalformedDataError` if the retrieved data is invalid. */ - public async getMetadata(cidOrIpfsUri: string): Promise { - const res = await getFromIPFS(cidOrIpfsUri); + public async getMetadata( + cidOrIpfsUri: string, + config: StorageConfigOverrides = { timeout: 0 }, + ): Promise { + const res = await getFromIPFS(cidOrIpfsUri, config.timeout); const validation = validateMetaData(res); if (!validation.valid) { @@ -117,14 +135,14 @@ export class HypercertsStorage implements HypercertStorageInterface { * This method first retrieves the data from IPFS using the `getFromIPFS` function. It then parses the retrieved data as JSON and returns it. * * @param {string} cidOrIpfsUri - The CID or IPFS URI of the data to retrieve. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns {Promise} A promise that resolves to the retrieved data. * @throws {FetchError} Will throw a `FetchError` if the retrieval operation fails. * @throws {MalformedDataError} Will throw a `MalformedDataError` if the retrieved data is not a single file. * * @remarkts Note: The original implementation using the Web3 Storage client is currently commented out due to issues with upstream repos. This will be replaced once those issues are resolved. */ - public async getData(cidOrIpfsUri: string): Promise { - // TODO: replace current temporary fix or just using NFT.Storage IPFS gateway - return await getFromIPFS(cidOrIpfsUri); + public async getData(cidOrIpfsUri: string, config: StorageConfigOverrides = { timeout: 0 }): Promise { + return await getFromIPFS(cidOrIpfsUri, config.timeout); } } diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index ae786509..d0c498a6 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -7,13 +7,37 @@ import { HypercertMetadata } from "./metadata"; import { ByteArray, Chain, Hex, PublicClient, WalletClient, GetContractReturnType } from "viem"; import { HypercertMinterAbi } from "@hypercerts-org/contracts"; +/** + * Enum to verify the supported chainIds + * + * @note 10 = Optimism, 42220 = Celo, 11155111 = Sepolia + */ export type SupportedChainIds = 10 | 42220 | 11155111; -export type SupportedOverrides = { + +export type SupportedOverrides = ContractOverrides & StorageConfigOverrides; + +/** + * Configuration options for the contract interactions. + * + * @param value The value to send with the transaction (in wei). + * @param gasPrice The gas price to use for the transaction (in wei). + * @param gasLimit The gas limit to use for the transaction (in wei). + */ +export type ContractOverrides = { value?: bigint; gasPrice?: bigint; gasLimit?: bigint; }; +/** + * Configuration options for the Hypercert storage layer. + * @param timeout The timeout (im ms) for the HTTP request; for example for uploading metadata or fetching allowlists. + */ +export type StorageConfigOverrides = { + // Axios timout in ms + timeout?: number; +}; + export type Contracts = | "HypercertMinterUUPS" | "TransferManager" @@ -84,30 +108,34 @@ export interface HypercertStorageInterface { /** * Stores the allowlost for a hypercert. * @param allowList The metadata to store. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns A Promise that resolves to the CID of the stored metadata. */ - storeAllowList: (allowList: AllowlistEntry[], totalUnits: bigint) => Promise; + storeAllowList: (allowList: AllowlistEntry[], totalUnits: bigint, config?: StorageConfigOverrides) => Promise; /** * Stores the metadata for a hypercert. * @param metadata The metadata to store. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns A Promise that resolves to the CID of the stored metadata. */ - storeMetadata: (metadata: HypercertMetadata) => Promise; + storeMetadata: (metadata: HypercertMetadata, config?: StorageConfigOverrides) => Promise; /** * Retrieves the metadata for a hypercerts. * @param cidOrIpfsUri The CID or IPFS URI of the metadata to retrieve. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns A Promise that resolves to the retrieved metadata. */ - getMetadata: (cidOrIpfsUri: string) => Promise; + getMetadata: (cidOrIpfsUri: string, config?: StorageConfigOverrides) => Promise; /** * Retrieves arbitrary data from IPFS. * @param cidOrIpfsUri The CID or IPFS URI of the data to retrieve. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns A Promise that resolves to the retrieved data. */ - getData: (cidOrIpfsUri: string) => Promise; + getData: (cidOrIpfsUri: string, config?: StorageConfigOverrides) => Promise; } /** diff --git a/sdk/src/utils/apis.ts b/sdk/src/utils/apis.ts index 0ad33e31..f6e84976 100644 --- a/sdk/src/utils/apis.ts +++ b/sdk/src/utils/apis.ts @@ -1,5 +1,5 @@ import axios from "axios"; -import { HypercertMetadata } from "src/types"; +import { HypercertMetadata, StorageConfigOverrides } from "src/types"; /** * Type for the request body when posting to the allowlist endpoint. @@ -22,18 +22,20 @@ type ResponseData = { /** * Axios instance configured with the base URL for the hypercert API. */ -const api = axios.create({ timeout: 10000, headers: { "Content-Type": "application/json" } }); +const api = axios.create({ headers: { "Content-Type": "application/json" } }); /** * Uploads metadata to the API. * - * @param metadata - The metadata to upload. Should be an object that conforms to the HypercertMetadata type. + * @param {HypercertMetadata} metadata - The metadata to upload. Should be an object that conforms to the HypercertMetadata type. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns The response data from the API. */ -const uploadMetadata = async (metadata: HypercertMetadata) => { +const uploadMetadata = async (metadata: HypercertMetadata, config: StorageConfigOverrides = { timeout: 0 }) => { const response = await api.post>( "https://hypercerts-api-production.up.railway.app/api/v1/web3up/metadata", metadata, + config, ); return response.data; @@ -42,14 +44,16 @@ const uploadMetadata = async (metadata: HypercertMetadata) => { /** * Uploads an allowlist to the API. * - * @param req - The request body containing the allowlist and total units. The allowList should be a stringified Merkle tree dump. + * @param {HypercertMetadata} req - The request body containing the allowlist and total units. The allowList should be a stringified Merkle tree dump. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns The response data from the API. * */ -const uploadAllowlist = async (req: AllowListPostRequest) => { +const uploadAllowlist = async (req: AllowListPostRequest, config: StorageConfigOverrides = { timeout: 0 }) => { const response = await api.post>( "https://hypercerts-api-production.up.railway.app/api/v1/web3up/allowlist", req, + config, ); return response.data; diff --git a/sdk/src/utils/fetchers.ts b/sdk/src/utils/fetchers.ts index d6608e1f..9f57717a 100644 --- a/sdk/src/utils/fetchers.ts +++ b/sdk/src/utils/fetchers.ts @@ -9,7 +9,7 @@ import axios from "axios"; * If the data cannot be fetched from any gateway, it throws a `StorageError`. * * @param {string} cidOrIpfsUri - The CID or IPFS URI of the data to fetch. - * @param {number} [timeout=10000] - The timeout for the fetch request in milliseconds. Defaults to 10000ms. + * @param {StorageConfigOverrides} [config] - An optional configuration object. * @returns {Promise} The data fetched from IPFS. * @throws {StorageError} Will throw a `StoragjeError` if the data cannot be fetched from either gateway. * @async