From f3cd63ef043cd0e3b812140bda7a32a8f49e0457 Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Thu, 28 Mar 2024 22:47:01 +0100 Subject: [PATCH] fix(lib): celo deploy, viem, evm deps --- contracts/.openzeppelin/celo.json | 366 ++++++ .../developer/api/sdk/classes/ClientError.md | 4 +- .../api/sdk/classes/ConfigurationError.md | 4 +- .../api/sdk/classes/ContractError.md | 4 +- .../developer/api/sdk/classes/FetchError.md | 4 +- .../api/sdk/classes/HypercertClient.md | 365 +++--- .../api/sdk/classes/HypercertsStorage.md | 8 +- .../api/sdk/classes/InvalidOrMissingError.md | 4 +- .../api/sdk/classes/MalformedDataError.md | 4 +- .../developer/api/sdk/classes/MintingError.md | 4 +- .../developer/api/sdk/classes/StorageError.md | 4 +- .../api/sdk/classes/UnknownSchemaError.md | 4 +- .../api/sdk/classes/UnsupportedChainError.md | 4 +- .../api/sdk/interfaces/CustomError.md | 2 +- .../api/sdk/interfaces/DuplicateEvaluation.md | 8 +- .../api/sdk/interfaces/EASEvaluation.md | 8 +- .../api/sdk/interfaces/HypercertClaimdata.md | 12 +- .../interfaces/HypercertClientInterface.md | 48 +- .../sdk/interfaces/HypercertClientMethods.md | 26 +- .../sdk/interfaces/HypercertClientState.md | 16 +- .../interfaces/HypercertEvaluationSchema.md | 6 +- .../interfaces/HypercertIndexerInterface.md | 14 +- .../api/sdk/interfaces/HypercertMetadata.md | 18 +- .../api/sdk/interfaces/HypercertPointer.md | 6 +- .../interfaces/HypercertStorageInterface.md | 8 +- .../api/sdk/interfaces/IPFSEvaluation.md | 4 +- .../sdk/interfaces/SimpleTextEvaluation.md | 6 +- docs/docs/developer/api/sdk/modules.md | 467 +++---- frontend/components/dapp-context.tsx | 142 +-- frontend/components/dapp-state.tsx | 5 +- frontend/components/ftc-purchase.tsx | 65 +- frontend/components/zuzalu-purchase.tsx | 152 +-- frontend/hooks/checkWriteable.ts | 23 +- frontend/hooks/createBlueprintInRegistry.ts | 35 - frontend/hooks/hypercerts-client.ts | 6 +- frontend/hooks/mergeFractionUnits.ts | 3 +- frontend/hooks/mintClaim.ts | 11 +- frontend/hooks/mintClaimAllowlist.ts | 3 +- frontend/hooks/mintFractionAllowlist.ts | 99 -- frontend/hooks/mintFractionAllowlistBatch.ts | 6 +- frontend/hooks/readTransferRestriction.ts | 25 +- frontend/hooks/splitClaimUnits.ts | 3 +- frontend/hooks/transferFraction.ts | 52 +- frontend/package.json | 10 +- frontend/types/web3.ts | 2 +- graph/generated/schema.ts | 413 ------- pnpm-lock.yaml | 1075 +++++++++++++---- sdk/package.json | 6 +- sdk/src/client.ts | 34 +- sdk/src/indexer/gql/graphql.ts | 7 + sdk/src/types/client.ts | 6 +- sdk/src/validator/index.ts | 4 +- 52 files changed, 1934 insertions(+), 1681 deletions(-) delete mode 100644 frontend/hooks/createBlueprintInRegistry.ts delete mode 100644 frontend/hooks/mintFractionAllowlist.ts diff --git a/contracts/.openzeppelin/celo.json b/contracts/.openzeppelin/celo.json index 1ce42cd6..4a23e2d6 100644 --- a/contracts/.openzeppelin/celo.json +++ b/contracts/.openzeppelin/celo.json @@ -739,6 +739,372 @@ }, "namespaces": {} } + }, + "125db54394ee349f18c5e7b6f717dff5868c4ccab68a96eeef38a6321b3f05b2": { + "address": "0xcE48266260761F1Ae2FcEc0A7852f355Ea6401B9", + "txHash": "0x06791bfa435395ed5456022fb124d63bc2e314347de8c090b9f79099650fd3a9", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol:36" + }, + { + "label": "__gap", + "offset": 0, + "slot": "51", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC165Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/utils/introspection/ERC165Upgradeable.sol:41" + }, + { + "label": "_balances", + "offset": 0, + "slot": "101", + "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:25" + }, + { + "label": "_operatorApprovals", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:28" + }, + { + "label": "_uri", + "offset": 0, + "slot": "103", + "type": "t_string_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:31" + }, + { + "label": "__gap", + "offset": 0, + "slot": "104", + "type": "t_array(t_uint256)47_storage", + "contract": "ERC1155Upgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/ERC1155Upgradeable.sol:528" + }, + { + "label": "__gap", + "offset": 0, + "slot": "151", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1155BurnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155BurnableUpgradeable.sol:52" + }, + { + "label": "_baseURI", + "offset": 0, + "slot": "201", + "type": "t_string_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:27" + }, + { + "label": "_tokenURIs", + "offset": 0, + "slot": "202", + "type": "t_mapping(t_uint256,t_string_storage)", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:30" + }, + { + "label": "__gap", + "offset": 0, + "slot": "203", + "type": "t_array(t_uint256)48_storage", + "contract": "ERC1155URIStorageUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/token/ERC1155/extensions/ERC1155URIStorageUpgradeable.sol:77" + }, + { + "label": "_owner", + "offset": 0, + "slot": "251", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol:94" + }, + { + "label": "__gap", + "offset": 0, + "slot": "301", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC1967UpgradeUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol:211" + }, + { + "label": "__gap", + "offset": 0, + "slot": "351", + "type": "t_array(t_uint256)50_storage", + "contract": "UUPSUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/UUPSUpgradeable.sol:107" + }, + { + "label": "typeCounter", + "offset": 0, + "slot": "401", + "type": "t_uint256", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:27" + }, + { + "label": "owners", + "offset": 0, + "slot": "402", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:38" + }, + { + "label": "creators", + "offset": 0, + "slot": "403", + "type": "t_mapping(t_uint256,t_address)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:41" + }, + { + "label": "tokenValues", + "offset": 0, + "slot": "404", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:44" + }, + { + "label": "maxIndex", + "offset": 0, + "slot": "405", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:47" + }, + { + "label": "__gap", + "offset": 0, + "slot": "406", + "type": "t_array(t_uint256)25_storage", + "contract": "SemiFungible1155", + "src": "src/protocol/SemiFungible1155.sol:648" + }, + { + "label": "merkleRoots", + "offset": 0, + "slot": "431", + "type": "t_mapping(t_uint256,t_bytes32)", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:17" + }, + { + "label": "hasBeenClaimed", + "offset": 0, + "slot": "432", + "type": "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:18" + }, + { + "label": "maxUnits", + "offset": 0, + "slot": "433", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:19" + }, + { + "label": "minted", + "offset": 0, + "slot": "434", + "type": "t_mapping(t_uint256,t_uint256)", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "435", + "type": "t_array(t_uint256)26_storage", + "contract": "AllowlistMinter", + "src": "src/protocol/AllowlistMinter.sol:75" + }, + { + "label": "_paused", + "offset": 0, + "slot": "461", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "462", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "lib/openzeppelin-contracts-upgradeable/contracts/security/PausableUpgradeable.sol:116" + }, + { + "label": "typeRestrictions", + "offset": 0, + "slot": "511", + "type": "t_mapping(t_uint256,t_enum(TransferRestrictions)19459)", + "contract": "HypercertMinter", + "src": "src/protocol/HypercertMinter.sol:20" + }, + { + "label": "__gap", + "offset": 0, + "slot": "512", + "type": "t_array(t_uint256)29_storage", + "contract": "HypercertMinter", + "src": "src/protocol/HypercertMinter.sol:258" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)25_storage": { + "label": "uint256[25]", + "numberOfBytes": "800" + }, + "t_array(t_uint256)26_storage": { + "label": "uint256[26]", + "numberOfBytes": "832" + }, + "t_array(t_uint256)29_storage": { + "label": "uint256[29]", + "numberOfBytes": "928" + }, + "t_array(t_uint256)47_storage": { + "label": "uint256[47]", + "numberOfBytes": "1504" + }, + "t_array(t_uint256)48_storage": { + "label": "uint256[48]", + "numberOfBytes": "1536" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_enum(TransferRestrictions)19459": { + "label": "enum IHypercertToken.TransferRestrictions", + "members": [ + "AllowAll", + "DisallowAll", + "FromCreatorOnly" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bool)": { + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_address)": { + "label": "mapping(uint256 => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_bytes32)": { + "label": "mapping(uint256 => bytes32)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_enum(TransferRestrictions)19459)": { + "label": "mapping(uint256 => enum IHypercertToken.TransferRestrictions)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { + "label": "mapping(uint256 => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_mapping(t_bytes32,t_bool))": { + "label": "mapping(uint256 => mapping(bytes32 => bool))", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_string_storage)": { + "label": "mapping(uint256 => string)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_uint256)": { + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + }, + "namespaces": {} + } } } } diff --git a/docs/docs/developer/api/sdk/classes/ClientError.md b/docs/docs/developer/api/sdk/classes/ClientError.md index e693102e..83664672 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/efdb2e8/sdk/src/types/errors.ts#L27) +[sdk/src/types/errors.ts:27](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L20) +[sdk/src/types/errors.ts:20](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 d7a4e44e..7d40d8b9 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/efdb2e8/sdk/src/types/errors.ts#L188) +[sdk/src/types/errors.ts:188](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L187) +[sdk/src/types/errors.ts:187](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 2155e94f..a1a50a4c 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/efdb2e8/sdk/src/types/errors.ts#L43) +[sdk/src/types/errors.ts:43](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L41) +[sdk/src/types/errors.ts:41](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 52a4240a..60154918 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/efdb2e8/sdk/src/types/errors.ts#L65) +[sdk/src/types/errors.ts:65](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L58) +[sdk/src/types/errors.ts:58](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 6b39f325..5ac108d9 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/efdb2e8/sdk/src/client.ts#L58) +[sdk/src/client.ts:65](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L65) ## 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/efdb2e8/sdk/src/client.ts#L41) +[sdk/src/client.ts:48](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L48) --- @@ -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/efdb2e8/sdk/src/client.ts#L44) +[sdk/src/client.ts:51](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L51) --- @@ -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/efdb2e8/sdk/src/client.ts#L45) +[sdk/src/client.ts:52](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L52) --- @@ -94,71 +94,73 @@ Will throw a `ClientError` if the public client cannot be connected. #### 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), }) ` | +| 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 - 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', }) ` | +| `ccipRead?` | `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `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). - Docs: https://viem.sh/docs/actions/public/createBlockFilter - 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) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs). - Docs: https://viem.sh/docs/contract/createContractEventFilter **`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#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges). - Docs: https://viem.sh/docs/actions/public/createEventFilter - 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). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter - 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`<`abi`, `functionName`, `args`, `TChain`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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 **`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`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas - 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 **`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 - 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). `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) ` | +| `getBlobBaseFee` | () => `Promise`<`bigint`\> | Returns the base fee per blob gas in wei. - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getBlobBaseFee } from 'viem/public' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blobBaseFee = await client.getBlobBaseFee() ` | +| `getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<\{ number: TBlockTag extends "pending" ? null : bigint; nonce: TBlockTag extends "pending" ? null : \`0x$\{string}\`; hash: TBlockTag extends "pending" ? null : \`0x$\{string}\`; ... 22 more ...; transactions: TIncludeTransactions extends true ? (\{ ...; } \| ... 2 more ... \| \{ ...; })[] : \`0x$\{string}\`[]; }\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock - 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 - 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 - 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 - 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 - 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`<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>) => `Promise`<`GetContractEventsReturnType`<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents - 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; gatewayUrls?: string[] \| undefined; name: string; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress - 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) 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; gatewayUrls?: string[] \| undefined; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; assetGatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) 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) 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}\`; gatewayUrls?: string[] \| undefined; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName - 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 - 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) 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; gatewayUrls?: string[] \| undefined; key: string; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver - 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) 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 - 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 - 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) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) 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 - 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 - 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 - 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 - 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 - 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`<\{ type: "legacy"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice: bigint; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null :... \| \{ type: "eip2930"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice: bigint; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null ... \| \{ type: "eip1559"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice?: undefined; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null : nu... \| \{ type: "eip4844"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice?: undefined; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null : number...\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction - 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 - 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#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount - 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#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt - 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`<`contracts`, `allowFailure`\>) => `Promise`<`MulticallReturnType`<`contracts`, `allowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract), 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 **`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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest **`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`<`abi`, `functionName`, `args`\>) => `Promise`<`ReadContractReturnType`<`abi`, `functionName`, `args`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract - 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) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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 - 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`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `chainOverride`, `accountOverride`\>) => `Promise`<`SimulateContractReturnType`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`, `accountOverride`\>\> | 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 - 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), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) - Docs: https://viem.sh/docs/actions/public/uninstallFilter - 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#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt - 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 - 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 - 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`, `Transport`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) 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) 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`, `Transport`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent - 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#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter) 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) 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 - 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#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions#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/efdb2e8/sdk/src/client.ts#L46) +[sdk/src/client.ts:53](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L53) --- @@ -168,7 +170,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/efdb2e8/sdk/src/client.ts#L42) +[sdk/src/client.ts:49](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L49) --- @@ -178,41 +180,42 @@ Will throw a `ClientError` if the public client cannot be connected. #### 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) ` | +| 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 - 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. | +| `ccipRead?` | `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `chain` | `undefined` \| `Chain` | Chain for the client. | +| `deployContract` | (`args`: `DeployContractParameters`<`abi`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - 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 - 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 - 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 - 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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest **`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 - 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 - 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 - 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`, `TRequest`\>) => `Promise`<\`0x$\{string}\`\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - 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 - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) 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`<\`0x02$\{string}\` \| \`0x01$\{string}\` \| \`0x03$\{string}\` \| `TransactionSerializedLegacy`\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - 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 - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#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 - 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 - 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`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - 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) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **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#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/efdb2e8/sdk/src/client.ts#L47) +[sdk/src/client.ts:54](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L54) --- @@ -228,7 +231,7 @@ Whether the client is in read-only mode. #### Defined in -[sdk/src/client.ts:48](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L48) +[sdk/src/client.ts:55](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L55) ## Accessors @@ -246,33 +249,7 @@ The client config. #### Defined in -[sdk/src/client.ts:82](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/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/efdb2e8/sdk/src/client.ts#L107) +[sdk/src/client.ts:89](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L89) --- @@ -294,7 +271,7 @@ The indexer. #### Defined in -[sdk/src/client.ts:98](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L98) +[sdk/src/client.ts:105](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L105) --- @@ -316,7 +293,7 @@ The storage layer. #### Defined in -[sdk/src/client.ts:90](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L90) +[sdk/src/client.ts:97](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L97) ## Methods @@ -355,7 +332,7 @@ Will throw an `InvalidOrMissingError` if any of the proofs are invalid. #### Defined in -[sdk/src/client.ts:456](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L456) +[sdk/src/client.ts:449](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L449) --- @@ -388,7 +365,7 @@ A promise that resolves to the transaction hash. #### Defined in -[sdk/src/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L216) +[sdk/src/client.ts:209](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L209) --- @@ -425,7 +402,7 @@ Will throw a `ClientError` if the claim is not owned by the account. #### Defined in -[sdk/src/client.ts:379](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L379) +[sdk/src/client.ts:372](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L372) --- @@ -466,7 +443,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/efdb2e8/sdk/src/client.ts#L249) +[sdk/src/client.ts:242](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L242) --- @@ -486,7 +463,7 @@ Will throw a `MalformedDataError` if the provided allowlist or metadata is inval #### Defined in -[sdk/src/client.ts:487](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L487) +[sdk/src/client.ts:480](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L480) --- @@ -506,27 +483,38 @@ Will throw a `MalformedDataError` if the provided allowlist or metadata is inval #### Defined in -[sdk/src/client.ts:504](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L504) +[sdk/src/client.ts:497](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L497) --- ### 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`\> +▸ **getContractConfig**(): `Object` #### 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`\> +`Object` + +| Name | Type | Description | +| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `abi` | (\{ `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" })[] | - | +| `address` | \`0x$\{string}\` | - | +| `createEventFilter` | {} | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs). **`Example`** `ts import { createPublicClient, getContract, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const publicClient = createPublicClient({ chain: mainnet, transport: http(), }) const contract = getContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), client: publicClient, }) const filter = await contract.createEventFilter.Transfer() ` | +| `estimateGas` | {} | Estimates the gas necessary to complete a transaction without submitting it to the network. **`Example`** `ts import { createPublicClient, getContract, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const publicClient = createPublicClient({ chain: mainnet, transport: http(), }) const contract = getContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), client: publicClient, }) const gas = await contract.estimateGas.mint({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | +| `getEvents` | {} | Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs). **`Example`** `ts import { createPublicClient, getContract, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const publicClient = createPublicClient({ chain: mainnet, transport: http(), }) const contract = getContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), client: publicClient, }) const filter = await contract.createEventFilter.Transfer() ` | +| `read` | {} | Calls a read-only function on a contract, and returns the response. 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, `read` uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`Example`** `ts import { createPublicClient, getContract, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const publicClient = createPublicClient({ chain: mainnet, transport: http(), }) const contract = getContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi([ 'function balanceOf(address owner) view returns (uint256)', ]), client: publicClient, }) const result = await contract.read.balanceOf(['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e']) // 424122n ` | +| `simulate` | {} | Simulates/validates a contract interaction. This is useful for retrieving return data and revert reasons of contract write functions. 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), but also supports contract write functions. Internally, `simulate` uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`Example`** `ts import { createPublicClient, getContract, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const publicClient = createPublicClient({ chain: mainnet, transport: http(), }) const contract = getContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint() public']), client: publicClient, }) const result = await contract.simulate.mint({ account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', }) ` | +| `watchEvent` | {} | Watches and returns emitted contract event logs. This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) 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) instead. **`Example`** `ts import { createPublicClient, getContract, http, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const publicClient = createPublicClient({ chain: mainnet, transport: http(), }) const contract = getContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']), client: publicClient, }) const filter = await contract.createEventFilter.Transfer() const unwatch = contract.watchEvent.Transfer( { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' }, { onLogs: (logs) => console.log(logs) }, ) ` | #### Defined in -[sdk/src/client.ts:493](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L493) +[sdk/src/client.ts:486](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L486) --- -### getDeployment +### getDeployments -▸ **getDeployment**(`chainId`): `Partial`<[`Deployment`](../modules.md#deployment)\> +▸ **getDeployments**(`chainId`): `Partial`<[`Deployment`](../modules.md#deployment)\> Gets the contract addresses and graph urls for the provided `chainId` @@ -542,17 +530,13 @@ Gets the contract addresses and graph urls for the provided `chainId` The addresses, graph name and graph url. -**`Deprecated`** - -Use getDeployments instead. - #### Implementation of -[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[getDeployment](../interfaces/HypercertClientInterface.md#getdeployment) +[HypercertClientInterface](../interfaces/HypercertClientInterface.md).[getDeployments](../interfaces/HypercertClientInterface.md#getdeployments) #### Defined in -[sdk/src/client.ts:120](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L120) +[sdk/src/client.ts:113](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L113) --- @@ -582,7 +566,7 @@ a Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/client.ts:168](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L168) +[sdk/src/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L161) --- @@ -594,43 +578,44 @@ a Promise that resolves to the applicable transfer restrictions. `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}\`\> | +| Name | Type | +| :--------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account` | `Account` | +| `walletClient` | \{ `account`: `undefined` \| `Account` ; `addChain`: (`args`: `AddChainParameters`) => `Promise`<`void`\> ; `batch?`: \{ `multicall?`: `boolean` \| \{ batchSize?: number \| undefined; wait?: number \| undefined; } } ; `cacheTime`: `number` ; `ccipRead?`: `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } ; `chain`: `undefined` \| `Chain` ; `deployContract`: (`args`: `DeployContractParameters`<`abi`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`\>) => `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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> ; `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`, `TRequest`\>) => `Promise`<\`0x$\{string}\`\> ; `signMessage`: (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> ; `signTransaction`: (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x02$\{string}\` \| \`0x01$\{string}\` \| \`0x03$\{string}\` \| `TransactionSerializedLegacy`\> ; `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`<`abi`, `functionName`, `args`, `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.ccipRead?` | `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } | +| `walletClient.chain` | `undefined` \| `Chain` | +| `walletClient.deployContract` | (`args`: `DeployContractParameters`<`abi`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`\>) => `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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> | +| `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`, `TRequest`\>) => `Promise`<\`0x$\{string}\`\> | +| `walletClient.signMessage` | (`args`: `SignMessageParameters`<`undefined` \| `Account`\>) => `Promise`<\`0x$\{string}\`\> | +| `walletClient.signTransaction` | (`args`: `SignTransactionParameters`<`undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x02$\{string}\` \| \`0x01$\{string}\` \| \`0x03$\{string}\` \| `TransactionSerializedLegacy`\> | +| `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`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | #### Defined in -[sdk/src/client.ts:514](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L514) +[sdk/src/client.ts:507](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L507) --- @@ -667,7 +652,7 @@ Will throw a `ClientError` if any of the fractions are not owned by the account. #### Defined in -[sdk/src/client.ts:338](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L338) +[sdk/src/client.ts:331](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L331) --- @@ -707,7 +692,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/efdb2e8/sdk/src/client.ts#L139) +[sdk/src/client.ts:132](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L132) --- @@ -746,13 +731,13 @@ Will throw an `InvalidOrMissingError` if the proof is invalid. #### Defined in -[sdk/src/client.ts:412](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L412) +[sdk/src/client.ts:405](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L405) --- ### 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` }\> +▸ **simulateRequest**(`account`, `functionName`, `args`, `overrides?`): `Promise`<\{ `abi`: readonly [`never`] ; `accessList?`: `undefined` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: ``"legacy"`` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `undefined` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: `"legacy"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: ``"eip2930"`` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: `"eip2930"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: ``"eip1559"`` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"eip1559"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs`: readonly \`0x$\{string}\`[] \| readonly `Uint8Array`[] ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"eip4844"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs`: readonly \`0x$\{string}\`[] \| readonly `Uint8Array`[] ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"eip4844"` ; `value?`: `bigint` }\> #### Parameters @@ -765,11 +750,11 @@ Will throw an `InvalidOrMissingError` if the proof is invalid. #### 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` }\> +`Promise`<\{ `abi`: readonly [`never`] ; `accessList?`: `undefined` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: ``"legacy"`` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `undefined` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: `"legacy"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: ``"eip2930"`` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `bigint` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `undefined` ; `maxPriorityFeePerGas?`: `undefined` ; `nonce?`: `number` ; `type?`: `"eip2930"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: ``"eip1559"`` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs?`: `undefined` ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas?`: `undefined` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"eip1559"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `JsonRpcAccount`<\`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs`: readonly \`0x$\{string}\`[] \| readonly `Uint8Array`[] ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"eip4844"` ; `value?`: `bigint` } \| \{ `abi`: readonly [`never`] ; `accessList?`: `AccessList` ; `account`: `LocalAccount`<`string`, \`0x$\{string}\`\> ; `address`: \`0x$\{string}\` ; `args?`: readonly `unknown`[] ; `blobs`: readonly \`0x$\{string}\`[] \| readonly `Uint8Array`[] ; `chain`: `undefined` \| `Chain` ; `dataSuffix?`: \`0x$\{string}\` ; `functionName`: `string` ; `gas?`: `bigint` ; `gasPrice?`: `undefined` ; `maxFeePerBlobGas`: `bigint` ; `maxFeePerGas?`: `bigint` ; `maxPriorityFeePerGas?`: `bigint` ; `nonce?`: `number` ; `type?`: `"eip4844"` ; `value?`: `bigint` }\> #### Defined in -[sdk/src/client.ts:524](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L524) +[sdk/src/client.ts:517](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L517) --- @@ -808,7 +793,7 @@ Will throw a `ClientError` if the fraction is not owned by the account or if the #### Defined in -[sdk/src/client.ts:293](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L293) +[sdk/src/client.ts:286](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L286) --- @@ -838,7 +823,7 @@ Will throw a `ClientError` if the request fails. #### Defined in -[sdk/src/client.ts:555](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L555) +[sdk/src/client.ts:553](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L553) --- @@ -871,4 +856,4 @@ A promise that resolves to the transaction hash. #### Defined in -[sdk/src/client.ts:188](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/client.ts#L188) +[sdk/src/client.ts:181](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/client.ts#L181) diff --git a/docs/docs/developer/api/sdk/classes/HypercertsStorage.md b/docs/docs/developer/api/sdk/classes/HypercertsStorage.md index 816fd298..e02a7312 100644 --- a/docs/docs/developer/api/sdk/classes/HypercertsStorage.md +++ b/docs/docs/developer/api/sdk/classes/HypercertsStorage.md @@ -72,7 +72,7 @@ Note: The original implementation using the Web3 Storage client is currently com #### Defined in -[sdk/src/storage.ts:145](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L145) +[sdk/src/storage.ts:145](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/storage.ts#L145) --- @@ -108,7 +108,7 @@ Will throw a `MalformedDataError` if the retrieved data is invalid. #### Defined in -[sdk/src/storage.ts:118](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L118) +[sdk/src/storage.ts:118](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/storage.ts#L118) --- @@ -149,7 +149,7 @@ Will throw a `MalformedDataError` if the provided metadata is invalid. #### Defined in -[sdk/src/storage.ts:36](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L36) +[sdk/src/storage.ts:36](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/storage.ts#L36) --- @@ -189,4 +189,4 @@ Will throw a `MalformedDataError` if the provided metadata is invalid. #### Defined in -[sdk/src/storage.ts:83](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/storage.ts#L83) +[sdk/src/storage.ts:83](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 a33dc36f..1afe756d 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/efdb2e8/sdk/src/types/errors.ts#L83) +[sdk/src/types/errors.ts:83](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L76) +[sdk/src/types/errors.ts:76](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 c5ba6c49..0de91938 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/efdb2e8/sdk/src/types/errors.ts#L155) +[sdk/src/types/errors.ts:155](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L148) +[sdk/src/types/errors.ts:148](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 582df458..12ad336a 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/efdb2e8/sdk/src/types/errors.ts#L101) +[sdk/src/types/errors.ts:101](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L94) +[sdk/src/types/errors.ts:94](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 9721d091..9bf362a9 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/efdb2e8/sdk/src/types/errors.ts#L119) +[sdk/src/types/errors.ts:119](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L112) +[sdk/src/types/errors.ts:112](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 8d131dfa..2ba0903b 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/efdb2e8/sdk/src/types/errors.ts#L137) +[sdk/src/types/errors.ts:137](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L130) +[sdk/src/types/errors.ts:130](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 7fc91766..9bb9e830 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/efdb2e8/sdk/src/types/errors.ts#L174) +[sdk/src/types/errors.ts:174](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/errors.ts#L167) +[sdk/src/types/errors.ts:167](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/errors.ts#L167) --- diff --git a/docs/docs/developer/api/sdk/interfaces/CustomError.md b/docs/docs/developer/api/sdk/interfaces/CustomError.md index 91fa7655..5e5afc63 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/efdb2e8/sdk/src/types/errors.ts#L10) +[sdk/src/types/errors.ts:10](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 5c608703..5aa6b7ae 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/efdb2e8/sdk/src/types/evaluation.d.ts#L22) +[sdk/src/types/evaluation.d.ts:22](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L24) +[sdk/src/types/evaluation.d.ts:24](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L23) +[sdk/src/types/evaluation.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L21) +[sdk/src/types/evaluation.d.ts:21](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 43f03596..7ca1a54e 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/efdb2e8/sdk/src/types/evaluation.d.ts#L41) +[sdk/src/types/evaluation.d.ts:41](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L42) +[sdk/src/types/evaluation.d.ts:42](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L40) +[sdk/src/types/evaluation.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L43) +[sdk/src/types/evaluation.d.ts:43](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 7cca1e03..8927ec3e 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/efdb2e8/sdk/src/types/claimdata.d.ts#L53) +[sdk/src/types/claimdata.d.ts:53](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/claimdata.d.ts#L15) +[sdk/src/types/claimdata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/claimdata.d.ts#L44) +[sdk/src/types/claimdata.d.ts:44](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/claimdata.d.ts#L62) +[sdk/src/types/claimdata.d.ts:62](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/claimdata.d.ts#L25) +[sdk/src/types/claimdata.d.ts:25](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/claimdata.d.ts#L35) +[sdk/src/types/claimdata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 08e1a21a..7ae6754b 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:283](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L283) +[sdk/src/types/client.ts:282](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L282) --- @@ -96,7 +96,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:217](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L217) +[sdk/src/types/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L216) --- @@ -128,21 +128,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:258](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L258) - ---- - -### 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:164](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L164) +[sdk/src/types/client.ts:257](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L257) --- @@ -177,13 +163,13 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:231](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L231) +[sdk/src/types/client.ts:230](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L230) --- -### getDeployment +### getDeployments -• **getDeployment**: (`chainId`: [`SupportedChainIds`](../modules.md#supportedchainids)) => `Partial`<[`Deployment`](../modules.md#deployment)\> +• **getDeployments**: (`chainId`: [`SupportedChainIds`](../modules.md#supportedchainids)) => `Partial`<[`Deployment`](../modules.md#deployment)\> #### Type declaration @@ -205,11 +191,11 @@ The addresses, graph name and graph url. #### Inherited from -[HypercertClientMethods](HypercertClientMethods.md).[getDeployment](HypercertClientMethods.md#getdeployment) +[HypercertClientMethods](HypercertClientMethods.md).[getDeployments](HypercertClientMethods.md#getdeployments) #### Defined in -[sdk/src/types/client.ts:175](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L175) +[sdk/src/types/client.ts:174](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L174) --- @@ -241,7 +227,7 @@ A Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/types/client.ts:195](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L195) +[sdk/src/types/client.ts:194](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L194) --- @@ -257,7 +243,7 @@ The indexer used by the client. #### Defined in -[sdk/src/types/client.ts:163](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L163) +[sdk/src/types/client.ts:163](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L163) --- @@ -289,7 +275,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:251](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L251) +[sdk/src/types/client.ts:250](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L250) --- @@ -323,7 +309,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:184](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L184) +[sdk/src/types/client.ts:183](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L183) --- @@ -357,7 +343,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:267](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L267) +[sdk/src/types/client.ts:266](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L266) --- @@ -373,7 +359,7 @@ Whether the client is in read-only mode. #### Defined in -[sdk/src/types/client.ts:159](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L159) +[sdk/src/types/client.ts:159](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L159) --- @@ -406,7 +392,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:244](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L244) +[sdk/src/types/client.ts:243](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L243) --- @@ -422,7 +408,7 @@ The storage layer used by the client. #### Defined in -[sdk/src/types/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L161) +[sdk/src/types/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L161) --- @@ -456,4 +442,4 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:204](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L204) +[sdk/src/types/client.ts:203](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L203) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertClientMethods.md b/docs/docs/developer/api/sdk/interfaces/HypercertClientMethods.md index 260622af..05e837ec 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:283](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L283) +[sdk/src/types/client.ts:282](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L282) --- @@ -82,7 +82,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:217](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L217) +[sdk/src/types/client.ts:216](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L216) --- @@ -110,7 +110,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:258](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L258) +[sdk/src/types/client.ts:257](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L257) --- @@ -141,13 +141,13 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:231](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L231) +[sdk/src/types/client.ts:230](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L230) --- -### getDeployment +### getDeployments -• **getDeployment**: (`chainId`: [`SupportedChainIds`](../modules.md#supportedchainids)) => `Partial`<[`Deployment`](../modules.md#deployment)\> +• **getDeployments**: (`chainId`: [`SupportedChainIds`](../modules.md#supportedchainids)) => `Partial`<[`Deployment`](../modules.md#deployment)\> #### Type declaration @@ -169,7 +169,7 @@ The addresses, graph name and graph url. #### Defined in -[sdk/src/types/client.ts:175](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L175) +[sdk/src/types/client.ts:174](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L174) --- @@ -197,7 +197,7 @@ A Promise that resolves to the applicable transfer restrictions. #### Defined in -[sdk/src/types/client.ts:195](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L195) +[sdk/src/types/client.ts:194](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L194) --- @@ -225,7 +225,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:251](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L251) +[sdk/src/types/client.ts:250](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L250) --- @@ -255,7 +255,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:184](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L184) +[sdk/src/types/client.ts:183](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L183) --- @@ -285,7 +285,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:267](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L267) +[sdk/src/types/client.ts:266](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L266) --- @@ -314,7 +314,7 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:244](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L244) +[sdk/src/types/client.ts:243](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L243) --- @@ -344,4 +344,4 @@ A Promise that resolves to the transaction hash #### Defined in -[sdk/src/types/client.ts:204](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L204) +[sdk/src/types/client.ts:203](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L203) diff --git a/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md b/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md index 430c65c1..ec6e3e2e 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertClientState.md @@ -16,16 +16,6 @@ The state of the Hypercert client. ## 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:164](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L164) - ---- - ### indexer • **indexer**: `HypercertIndexer` @@ -34,7 +24,7 @@ The indexer used by the client. #### Defined in -[sdk/src/types/client.ts:163](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L163) +[sdk/src/types/client.ts:163](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L163) --- @@ -46,7 +36,7 @@ Whether the client is in read-only mode. #### Defined in -[sdk/src/types/client.ts:159](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L159) +[sdk/src/types/client.ts:159](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L159) --- @@ -58,4 +48,4 @@ The storage layer used by the client. #### Defined in -[sdk/src/types/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L161) +[sdk/src/types/client.ts:161](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 49f13d2b..4baf5531 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/efdb2e8/sdk/src/types/evaluation.d.ts#L15) +[sdk/src/types/evaluation.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L16) +[sdk/src/types/evaluation.d.ts:16](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L17) +[sdk/src/types/evaluation.d.ts:17](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 71fc12b6..08e975fd 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/efdb2e8/sdk/src/types/indexer.ts#L20) +[sdk/src/types/indexer.ts:20](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/indexer.ts#L19) +[sdk/src/types/indexer.ts:19](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/indexer.ts#L21) +[sdk/src/types/indexer.ts:21](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/indexer.ts#L24) +[sdk/src/types/indexer.ts:24](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/indexer.ts#L23) +[sdk/src/types/indexer.ts:23](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/indexer.ts#L22) +[sdk/src/types/indexer.ts:22](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/indexer.ts#L18) +[sdk/src/types/indexer.ts:18](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 d1f19951..2afcbdca 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/efdb2e8/sdk/src/types/metadata.d.ts#L39) +[sdk/src/types/metadata.d.ts:39](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L19) +[sdk/src/types/metadata.d.ts:19](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L23) +[sdk/src/types/metadata.d.ts:23](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L45) +[sdk/src/types/metadata.d.ts:45](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L27) +[sdk/src/types/metadata.d.ts:27](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L15) +[sdk/src/types/metadata.d.ts:15](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L40) +[sdk/src/types/metadata.d.ts:40](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L35) +[sdk/src/types/metadata.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/metadata.d.ts#L31) +[sdk/src/types/metadata.d.ts:31](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 627f67c6..165f0139 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/efdb2e8/sdk/src/types/evaluation.d.ts#L28) +[sdk/src/types/evaluation.d.ts:28](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L30) +[sdk/src/types/evaluation.d.ts:30](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L29) +[sdk/src/types/evaluation.d.ts:29](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 31f846a0..c1c5abdb 100644 --- a/docs/docs/developer/api/sdk/interfaces/HypercertStorageInterface.md +++ b/docs/docs/developer/api/sdk/interfaces/HypercertStorageInterface.md @@ -39,7 +39,7 @@ A Promise that resolves to the retrieved data. #### Defined in -[sdk/src/types/client.ts:138](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L138) +[sdk/src/types/client.ts:138](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L138) --- @@ -68,7 +68,7 @@ A Promise that resolves to the retrieved metadata. #### Defined in -[sdk/src/types/client.ts:130](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L130) +[sdk/src/types/client.ts:130](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L130) --- @@ -98,7 +98,7 @@ A Promise that resolves to the CID of the stored metadata. #### Defined in -[sdk/src/types/client.ts:114](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L114) +[sdk/src/types/client.ts:114](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L114) --- @@ -127,4 +127,4 @@ A Promise that resolves to the CID of the stored metadata. #### Defined in -[sdk/src/types/client.ts:122](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L122) +[sdk/src/types/client.ts:122](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 a54bf4a9..18fa4e05 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/efdb2e8/sdk/src/types/evaluation.d.ts#L48) +[sdk/src/types/evaluation.d.ts:48](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L47) +[sdk/src/types/evaluation.d.ts:47](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 7d6bdd8b..efb05435 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/efdb2e8/sdk/src/types/evaluation.d.ts#L35) +[sdk/src/types/evaluation.d.ts:35](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L36) +[sdk/src/types/evaluation.d.ts:36](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/types/evaluation.d.ts#L34) +[sdk/src/types/evaluation.d.ts:34](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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 d6f88192..917357b7 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/efdb2e8/sdk/src/types/hypercerts.ts#L24) +[sdk/src/types/hypercerts.ts:24](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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/efdb2e8/sdk/src/indexer/gql/graphql.ts#L195) +[sdk/src/indexer/gql/graphql.ts:205](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L205) --- @@ -97,7 +97,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1156](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1156) +[sdk/src/indexer/gql/graphql.ts:1179](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L1179) --- @@ -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/efdb2e8/sdk/src/indexer/gql/graphql.ts#L208) +[sdk/src/indexer/gql/graphql.ts:218](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L218) --- @@ -136,7 +136,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1205](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1205) +[sdk/src/indexer/gql/graphql.ts:1206](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L1206) --- @@ -153,7 +153,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1196](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1196) +[sdk/src/indexer/gql/graphql.ts:1199](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L1199) --- @@ -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/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1177) +[sdk/src/indexer/gql/graphql.ts:1189](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L1189) --- @@ -187,7 +187,7 @@ Represents an entry in an allowlist. #### Defined in -[sdk/src/indexer/gql/graphql.ts:1118](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1118) +[sdk/src/indexer/gql/graphql.ts:1163](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L1163) --- @@ -219,7 +219,7 @@ The gas limit to use for the transaction (in wei). #### Defined in -[sdk/src/types/client.ts:26](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L26) +[sdk/src/types/client.ts:26](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L26) --- @@ -229,7 +229,7 @@ The gas limit to use for the transaction (in wei). #### Defined in -[sdk/src/types/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L41) +[sdk/src/types/client.ts:41](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L41) --- @@ -250,7 +250,7 @@ Represents a deployment of a contract on a specific network. #### Defined in -[sdk/src/types/client.ts:59](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L59) +[sdk/src/types/client.ts:59](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L59) --- @@ -266,7 +266,7 @@ Represents a deployment of a contract on a specific network. #### Defined in -[sdk/src/indexer/gql/gql.ts:53](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L53) +[sdk/src/indexer/gql/gql.ts:47](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/gql.ts#L47) --- @@ -280,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/efdb2e8/sdk/src/types/evaluation.d.ts#L8) +[sdk/src/types/evaluation.d.ts:8](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/evaluation.d.ts#L8) --- @@ -290,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/efdb2e8/sdk/src/types/evaluation.d.ts#L9) +[sdk/src/types/evaluation.d.ts:9](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/evaluation.d.ts#L9) --- @@ -306,7 +306,7 @@ and run json-schema-to-typescript to regenerate this file. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:5](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L5) +[sdk/src/indexer/gql/fragment-masking.ts:6](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L6) --- @@ -318,7 +318,7 @@ Configuration options for the Hypercert client. #### Defined in -[sdk/src/types/client.ts:71](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L71) +[sdk/src/types/client.ts:71](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L71) --- @@ -336,7 +336,7 @@ The props for the Hypercert client. #### Defined in -[sdk/src/types/client.ts:144](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L144) +[sdk/src/types/client.ts:144](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L144) --- @@ -352,7 +352,7 @@ The signer is required for submitting evaluations. #### Defined in -[sdk/src/types/client.ts:100](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L100) +[sdk/src/types/client.ts:100](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L100) --- @@ -378,7 +378,7 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/types/client.ts:91](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L91) +[sdk/src/types/client.ts:91](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L91) --- @@ -388,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/efdb2e8/sdk/src/types/errors.ts#L195) +[sdk/src/types/errors.ts:195](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/errors.ts#L195) --- @@ -410,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/efdb2e8/sdk/src/types/indexer.ts#L10) +[sdk/src/types/indexer.ts:10](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/indexer.ts#L10) --- @@ -427,7 +427,7 @@ nft.storage and web3.storage are no longer used #### Defined in -[sdk/src/indexer/gql/graphql.ts:1138](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/graphql.ts#L1138) +[sdk/src/indexer/gql/graphql.ts:1172](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/graphql.ts#L1172) --- @@ -449,23 +449,23 @@ The timeout (im ms) for the HTTP request; for example for uploading metadata or #### Defined in -[sdk/src/types/client.ts:36](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L36) +[sdk/src/types/client.ts:36](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L36) --- ### SupportedChainIds -Ƭ **SupportedChainIds**: `10` \| `42220` \| `11155111` +Ƭ **SupportedChainIds**: `10` \| `42220` \| `11155111` \| `84532` \| `8453` Enum to verify the supported chainIds **`Note`** -10 = Optimism, 42220 = Celo, 11155111 = Sepolia +10 = Optimism, 42220 = Celo, 11155111 = Sepolia, 84532 = Base Sepolia, 8453 = Base Mainnet #### Defined in -[sdk/src/types/client.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L15) +[sdk/src/types/client.ts:15](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L15) --- @@ -475,7 +475,7 @@ Enum to verify the supported chainIds #### Defined in -[sdk/src/types/client.ts:17](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/client.ts#L17) +[sdk/src/types/client.ts:17](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/client.ts#L17) --- @@ -485,9 +485,9 @@ Enum to verify the supported chainIds #### Defined in -[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:9](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/hypercerts.ts#L9) -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L15) +[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/hypercerts.ts#L15) ## Variables @@ -497,7 +497,7 @@ Enum to verify the supported chainIds #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5790 --- @@ -507,7 +507,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6914 --- @@ -517,7 +517,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:1234 --- @@ -527,7 +527,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:43 --- @@ -537,7 +537,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3079 --- @@ -547,7 +547,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:4593 --- @@ -557,7 +557,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5118 --- @@ -567,7 +567,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5863 --- @@ -577,7 +577,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6388 --- @@ -587,7 +587,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:5387 --- @@ -597,7 +597,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:6657 --- @@ -607,7 +607,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3516 --- @@ -617,7 +617,7 @@ node_modules/.pnpm/@hypercerts-org+contracts@1.1.1-alpha.0_ts-node@10.9.1_typesc #### Defined in -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 +node_modules/.pnpm/@hypercerts-org+contracts@1.1.2_ts-node@10.9.1_typescript@5.3.2/node_modules/@hypercerts-org/contracts/dist/index.d.ts:3982 --- @@ -637,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/efdb2e8/sdk/src/types/hypercerts.ts#L9) +[sdk/src/types/hypercerts.ts:9](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/hypercerts.ts#L9) -[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/types/hypercerts.ts#L15) +[sdk/src/types/hypercerts.ts:15](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/types/hypercerts.ts#L15) --- @@ -653,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/efdb2e8/sdk/src/constants.ts#L12) +[sdk/src/constants.ts:12](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/constants.ts#L12) --- @@ -663,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/efdb2e8/sdk/src/constants.ts#L18) +[sdk/src/constants.ts:18](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/constants.ts#L18) --- @@ -682,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/efdb2e8/sdk/src/utils/logger.ts#L24) +[sdk/src/utils/logger.ts:24](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/logger.ts#L24) ## Functions @@ -721,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/efdb2e8/sdk/src/utils/formatter.ts#L27) +[sdk/src/utils/formatter.ts:27](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/formatter.ts#L27) --- @@ -733,69 +733,71 @@ Utility method to parse a hypercert mint transaction (createAllowlist, mintClaim #### 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 | +| 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 - 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.ccipRead?` | `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `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). - Docs: https://viem.sh/docs/actions/public/createBlockFilter - 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) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs). - Docs: https://viem.sh/docs/contract/createContractEventFilter **`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#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges). - Docs: https://viem.sh/docs/actions/public/createEventFilter - 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). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter - 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`<`abi`, `functionName`, `args`, `TChain`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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 **`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`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas - 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 **`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 - 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). `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.getBlobBaseFee` | () => `Promise`<`bigint`\> | Returns the base fee per blob gas in wei. - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getBlobBaseFee } from 'viem/public' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blobBaseFee = await client.getBlobBaseFee() ` | +| `client.getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<\{ number: TBlockTag extends "pending" ? null : bigint; nonce: TBlockTag extends "pending" ? null : \`0x$\{string}\`; hash: TBlockTag extends "pending" ? null : \`0x$\{string}\`; ... 22 more ...; transactions: TIncludeTransactions extends true ? (\{ ...; } \| ... 2 more ... \| \{ ...; })[] : \`0x$\{string}\`[]; }\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock - 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 - 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 - 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 - 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 - 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`<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>) => `Promise`<`GetContractEventsReturnType`<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents - 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; gatewayUrls?: string[] \| undefined; name: string; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress - 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) 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; gatewayUrls?: string[] \| undefined; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; assetGatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) 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) 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}\`; gatewayUrls?: string[] \| undefined; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName - 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 - 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) 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; gatewayUrls?: string[] \| undefined; key: string; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver - 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) 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 - 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 - 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) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) 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 - 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 - 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 - 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 - 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 - 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`<\{ type: "legacy"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice: bigint; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null :... \| \{ type: "eip2930"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice: bigint; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null ... \| \{ type: "eip1559"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice?: undefined; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null : nu... \| \{ type: "eip4844"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice?: undefined; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null : number...\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction - 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 - 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#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount - 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#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt - 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`<`contracts`, `allowFailure`\>) => `Promise`<`MulticallReturnType`<`contracts`, `allowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract), 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 **`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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest **`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`<`abi`, `functionName`, `args`\>) => `Promise`<`ReadContractReturnType`<`abi`, `functionName`, `args`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract - 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) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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 - 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`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `chainOverride`, `accountOverride`\>) => `Promise`<`SimulateContractReturnType`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`, `accountOverride`\>\> | 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 - 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), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) - Docs: https://viem.sh/docs/actions/public/uninstallFilter - 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#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt - 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 - 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 - 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`, `Transport`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) 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) 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`, `Transport`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent - 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#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter) 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) 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 - 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#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions#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 @@ -809,7 +811,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/efdb2e8/sdk/src/utils/txParser.ts#L26) +[sdk/src/utils/txParser.ts:26](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/txParser.ts#L26) --- @@ -843,7 +845,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/efdb2e8/sdk/src/utils/fetchers.ts#L17) +[sdk/src/utils/fetchers.ts:17](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/fetchers.ts#L17) --- @@ -878,7 +880,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/efdb2e8/sdk/src/utils/allowlist.ts#L43) +[sdk/src/utils/allowlist.ts:43](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/allowlist.ts#L43) --- @@ -917,7 +919,7 @@ Please regenerate the types. #### Defined in -[sdk/src/indexer/gql/gql.ts:34](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L34) +[sdk/src/indexer/gql/gql.ts:32](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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}"``] @@ -935,7 +937,7 @@ typeof `documents`[``"query ClaimsByOwner($owner: Bytes = \"\", $orderDirection: #### Defined in -[sdk/src/indexer/gql/gql.ts:39](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L39) +[sdk/src/indexer/gql/gql.ts:37](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/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}"``] @@ -953,7 +955,7 @@ typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirec #### Defined in -[sdk/src/indexer/gql/gql.ts:45](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/gql.ts#L45) +[sdk/src/indexer/gql/gql.ts:41](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/gql.ts#L41) --- @@ -973,7 +975,7 @@ typeof `documents`[``"query ClaimTokensByOwner($owner: Bytes = \"\", $orderDirec #### Defined in -[sdk/src/utils/errors.ts:39](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/errors.ts#L39) +[sdk/src/utils/errors.ts:39](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/errors.ts#L39) --- @@ -995,7 +997,7 @@ Method to catch errors and log them #### Defined in -[sdk/src/utils/errors.ts:22](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/errors.ts#L22) +[sdk/src/utils/errors.ts:22](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/errors.ts#L22) --- @@ -1024,7 +1026,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/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L51) +[sdk/src/indexer/gql/fragment-masking.ts:51](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L51) --- @@ -1052,7 +1054,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/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L45) +[sdk/src/indexer/gql/fragment-masking.ts:45](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L45) --- @@ -1072,7 +1074,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/efdb2e8/sdk/src/utils/allowlist.ts#L6) +[sdk/src/utils/allowlist.ts:6](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/allowlist.ts#L6) --- @@ -1091,68 +1093,70 @@ 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), }) ` | +| 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 - 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.ccipRead?` | `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `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). - Docs: https://viem.sh/docs/actions/public/createBlockFilter - 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) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs). - Docs: https://viem.sh/docs/contract/createContractEventFilter **`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#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges). - Docs: https://viem.sh/docs/actions/public/createEventFilter - 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). - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter - 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`<`abi`, `functionName`, `args`, `TChain`\>) => `Promise`<`bigint`\> | Estimates the gas required to successfully execute a contract write function call. - Docs: https://viem.sh/docs/contract/estimateContractGas **`Remarks`** Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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 **`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`\>) => `Promise`<`bigint`\> | Estimates the gas necessary to complete a transaction without submitting it to the network. - Docs: https://viem.sh/docs/actions/public/estimateGas - 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 **`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 - 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). `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.getBlobBaseFee` | () => `Promise`<`bigint`\> | Returns the base fee per blob gas in wei. - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee) **`Example`** `ts import { createPublicClient, http } from 'viem' import { mainnet } from 'viem/chains' import { getBlobBaseFee } from 'viem/public' const client = createPublicClient({ chain: mainnet, transport: http(), }) const blobBaseFee = await client.getBlobBaseFee() ` | +| `publicClient.getBlock` | (`args?`: `GetBlockParameters`<`TIncludeTransactions`, `TBlockTag`\>) => `Promise`<\{ number: TBlockTag extends "pending" ? null : bigint; nonce: TBlockTag extends "pending" ? null : \`0x$\{string}\`; hash: TBlockTag extends "pending" ? null : \`0x$\{string}\`; ... 22 more ...; transactions: TIncludeTransactions extends true ? (\{ ...; } \| ... 2 more ... \| \{ ...; })[] : \`0x$\{string}\`[]; }\> | Returns information about a block at a block number, hash, or tag. - Docs: https://viem.sh/docs/actions/public/getBlock - 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 - 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 - 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 - 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 - 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`<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>) => `Promise`<`GetContractEventsReturnType`<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> | Returns a list of event logs emitted by a contract. - Docs: https://viem.sh/docs/actions/public/getContractEvents - 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; gatewayUrls?: string[] \| undefined; name: string; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsAddressReturnType`\> | Gets address for ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAddress - 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) 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; gatewayUrls?: string[] \| undefined; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; assetGatewayUrls?: AssetGatewayUrls \| undefined; }) => `Promise`<`GetEnsAvatarReturnType`\> | Gets the avatar of an ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens **`Remarks`** Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) 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) 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}\`; gatewayUrls?: string[] \| undefined; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsNameReturnType`\> | Gets primary name for specified address. - Docs: https://viem.sh/docs/ens/actions/getEnsName - 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 - 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) 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; gatewayUrls?: string[] \| undefined; key: string; strict?: boolean \| undefined; universalResolverAddress?: \`0x$\{string}\` \| undefined; }) => `Promise`<`GetEnsTextReturnType`\> | Gets a text record for specified ENS name. - Docs: https://viem.sh/docs/ens/actions/getEnsResolver - 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) 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 - 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 - 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) - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) 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 - 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 - 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 - 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 - 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 - 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`<\{ type: "legacy"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice: bigint; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null :... \| \{ type: "eip2930"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice: bigint; maxFeePerBlobGas?: undefined; maxFeePerGas?: undefined; maxPriorityFeePerGas?: undefined; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null ... \| \{ type: "eip1559"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice?: undefined; maxFeePerBlobGas?: undefined; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null : nu... \| \{ type: "eip4844"; to: \`0x$\{string}\` \| null; from: \`0x$\{string}\`; gas: bigint; nonce: number; value: bigint; gasPrice?: undefined; maxFeePerBlobGas: bigint; maxFeePerGas: bigint; maxPriorityFeePerGas: bigint; ... 12 more ...; transactionIndex: (TBlockTag extends "pending" ? true : false) extends true ? null : number...\> | Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier. - Docs: https://viem.sh/docs/actions/public/getTransaction - 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 - 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#transaction) an Account has broadcast / sent. - Docs: https://viem.sh/docs/actions/public/getTransactionCount - 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#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt - 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`<`contracts`, `allowFailure`\>) => `Promise`<`MulticallReturnType`<`contracts`, `allowFailure`\>\> | Similar to [`readContract`](https://viem.sh/docs/contract/readContract), 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 **`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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest **`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`<`abi`, `functionName`, `args`\>) => `Promise`<`ReadContractReturnType`<`abi`, `functionName`, `args`\>\> | Calls a read-only function on a contract, and returns the response. - Docs: https://viem.sh/docs/contract/readContract - 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) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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 - 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`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `chainOverride`, `accountOverride`\>) => `Promise`<`SimulateContractReturnType`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`, `accountOverride`\>\> | 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 - 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), but also supports contract write functions. Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **`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) - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter) - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter) - Docs: https://viem.sh/docs/actions/public/uninstallFilter - 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#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt). If the Transaction reverts, then the action will throw an error. - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt - 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 - 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 - 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`, `Transport`\>) => `WatchContractEventReturnType` | Watches and returns emitted contract event logs. - Docs: https://viem.sh/docs/contract/watchContractEvent **`Remarks`** This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent#onLogs). `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) 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) 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`, `Transport`\>) => `WatchEventReturnType` | Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log). - Docs: https://viem.sh/docs/actions/public/watchEvent - 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#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent#onLogs). `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter) 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) 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 - 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#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions#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 @@ -1162,7 +1166,7 @@ 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/efdb2e8/sdk/src/utils/adapters.ts#L19) +[sdk/src/utils/adapters.ts:19](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/adapters.ts#L19) --- @@ -1187,7 +1191,7 @@ The response data from the API. #### Defined in -[sdk/src/utils/apis.ts:52](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/apis.ts#L52) +[sdk/src/utils/apis.ts:52](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/apis.ts#L52) --- @@ -1212,7 +1216,7 @@ The response data from the API. #### Defined in -[sdk/src/utils/apis.ts:34](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/utils/apis.ts#L34) +[sdk/src/utils/apis.ts:34](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/apis.ts#L34) --- @@ -1239,7 +1243,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:15](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L15) +[sdk/src/indexer/gql/fragment-masking.ts:18](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L18) ▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `TType` \| `null` \| `undefined` @@ -1262,7 +1266,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:20](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L20) +[sdk/src/indexer/gql/fragment-masking.ts:23](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L23) ▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> @@ -1285,7 +1289,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:25](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L25) +[sdk/src/indexer/gql/fragment-masking.ts:28](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L28) ▸ **useFragment**<`TType`\>(`_documentNode`, `fragmentType`): `ReadonlyArray`<`TType`\> \| `null` \| `undefined` @@ -1308,7 +1312,7 @@ The response data from the API. #### Defined in -[sdk/src/indexer/gql/fragment-masking.ts:30](https://github.com/hypercerts-org/hypercerts/blob/efdb2e8/sdk/src/indexer/gql/fragment-masking.ts#L30) +[sdk/src/indexer/gql/fragment-masking.ts:33](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/indexer/gql/fragment-masking.ts#L33) --- @@ -1336,7 +1340,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/efdb2e8/sdk/src/validator/index.ts#L108) +[sdk/src/validator/index.ts:108](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L108) --- @@ -1364,7 +1368,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/efdb2e8/sdk/src/validator/index.ts#L77) +[sdk/src/validator/index.ts:77](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L77) --- @@ -1392,7 +1396,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/efdb2e8/sdk/src/validator/index.ts#L143) +[sdk/src/validator/index.ts:143](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L143) --- @@ -1420,7 +1424,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/efdb2e8/sdk/src/validator/index.ts#L46) +[sdk/src/validator/index.ts:46](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L46) --- @@ -1448,7 +1452,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/efdb2e8/sdk/src/validator/index.ts#L173) +[sdk/src/validator/index.ts:173](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L173) --- @@ -1480,7 +1484,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/efdb2e8/sdk/src/validator/index.ts#L205) +[sdk/src/validator/index.ts:205](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L205) --- @@ -1512,7 +1516,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/efdb2e8/sdk/src/validator/index.ts#L228) +[sdk/src/validator/index.ts:228](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/validator/index.ts#L228) --- @@ -1530,38 +1534,39 @@ 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) ` | +| 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 - 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.ccipRead?` | `false` \| \{ `request?`: (`parameters`: `CcipRequestParameters`) => `Promise`<\`0x$\{string}\`\> } | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `walletClient.chain` | `undefined` \| `Chain` | Chain for the client. | +| `walletClient.deployContract` | (`args`: `DeployContractParameters`<`abi`, `undefined` \| `Chain`, `undefined` \| `Account`, `chainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - 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 - 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 - 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 - 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`, `TAccountOverride`, `TRequest`\>) => `Promise`<\{ [K in keyof (UnionRequiredBy, "transactionRequest", TransactionRequest\>, "from"\> & (DeriveChain<...\> extends Chain ? \{ ...; } : \{ ...; }) & (DeriveAccount<...\> extends Account ? \{ ...; } : \{ ...; }), IsNever<...\> extends true ? un...\> | Prepares a transaction request for signing. - Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest **`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 - 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 - 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 - 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`, `TRequest`\>) => `Promise`<\`0x$\{string}\`\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - 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 - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) 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`<\`0x02$\{string}\` \| \`0x01$\{string}\` \| \`0x03$\{string}\` \| `TransactionSerializedLegacy`\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - 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 - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#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 - 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 - 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`<`abi`, `functionName`, `args`, `undefined` \| `Chain`, `undefined` \| `Account`, `TChainOverride`\>) => `Promise`<\`0x$\{string}\`\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - 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) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). **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#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 @@ -1571,4 +1576,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/efdb2e8/sdk/src/utils/adapters.ts#L51) +[sdk/src/utils/adapters.ts:51](https://github.com/hypercerts-org/hypercerts/blob/ffe5811/sdk/src/utils/adapters.ts#L51) diff --git a/frontend/components/dapp-context.tsx b/frontend/components/dapp-context.tsx index 69a461c4..1d711362 100644 --- a/frontend/components/dapp-context.tsx +++ b/frontend/components/dapp-context.tsx @@ -1,9 +1,5 @@ import { isProduction, WALLETCONNECT_ID } from "../lib/config"; import { ContractInteractionDialogProvider } from "./contract-interaction-dialog-context"; -import { - RainbowKitProvider, - connectorsForWallets, -} from "@rainbow-me/rainbowkit"; import "@rainbow-me/rainbowkit/styles.css"; import { argentWallet, @@ -30,75 +26,87 @@ import { } from "@rainbow-me/rainbowkit/wallets"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; -import React, { ReactNode, useEffect } from "react"; -import { celo, Chain, optimism, sepolia, baseSepolia, base } from "viem/chains"; -import { configureChains, WagmiConfig, createConfig } from "wagmi"; -import { publicProvider } from "wagmi/providers/public"; - +import React, { ReactNode } from "react"; +import { createConfig, http, WagmiProvider } from "wagmi"; +import { base, baseSepolia, celo, optimism, sepolia } from "wagmi/chains"; import { - Valora, - CeloWallet, - CeloTerminal, - MetaMask as CeloMetaMask, -} from "@celo/rainbowkit-celo/wallets"; + Chain, + connectorsForWallets, + RainbowKitProvider, +} from "@rainbow-me/rainbowkit"; + +import { Transport } from "viem"; const queryClient = new QueryClient(); -const TEST_CHAINS = [sepolia, baseSepolia]; -const PROD_CHAINS = [optimism, celo, base]; +const TEST_CHAINS = [sepolia, baseSepolia] as const; +const PROD_CHAINS = [optimism, celo, base] as const; -export const CHAINS = (isProduction ? PROD_CHAINS : TEST_CHAINS) as Chain[]; +export const chains: readonly [Chain, ...Chain[]] = isProduction + ? PROD_CHAINS + : TEST_CHAINS; -const { publicClient, chains } = configureChains(CHAINS, [publicProvider()]); +const transports: Record = isProduction + ? ({ + [celo.id]: http(), + [optimism.id]: http(), + [base.id]: http(), + } as const) + : ({ + [sepolia.id]: http(), + [baseSepolia.id]: http(), + } as const); const projectId = WALLETCONNECT_ID; -const connectors = connectorsForWallets([ - { - groupName: "Recommended", - wallets: [ - argentWallet({ chains, projectId }), - bitskiWallet({ chains }), - braveWallet({ chains }), - coinbaseWallet({ chains, appName: "Hypercerts" }), - dawnWallet({ chains }), - imTokenWallet({ chains, projectId }), - ledgerWallet({ chains, projectId }), - metaMaskWallet({ chains, projectId }), - mewWallet({ chains }), - okxWallet({ chains, projectId }), - omniWallet({ chains, projectId }), - phantomWallet({ chains }), - rabbyWallet({ chains }), - rainbowWallet({ projectId, chains }), - walletConnectWallet({ projectId, chains }), - safeWallet({ chains }), - tahoWallet({ chains }), - trustWallet({ chains, projectId }), - xdefiWallet({ chains }), - zerionWallet({ chains, projectId }), - ], - }, +// For current state of Celo wallets see https://github.com/celo-org/rainbowkit-celo/issues/86 +const connectors = connectorsForWallets( + [ + { + groupName: "Recommended", + wallets: [ + argentWallet, + bitskiWallet, + braveWallet, + coinbaseWallet, + dawnWallet, + imTokenWallet, + ledgerWallet, + metaMaskWallet, + mewWallet, + okxWallet, + omniWallet, + phantomWallet, + rabbyWallet, + rainbowWallet, + walletConnectWallet, + safeWallet, + tahoWallet, + trustWallet, + xdefiWallet, + zerionWallet, + ], + }, + { + groupName: "Recommended with CELO", + wallets: [metaMaskWallet, walletConnectWallet], + }, + { + groupName: "Injected", + wallets: [injectedWallet], + }, + ], { - groupName: "Recommended with CELO", - wallets: [ - Valora({ chains, projectId }), - CeloWallet({ chains, projectId }), - CeloTerminal({ chains, projectId }), - CeloMetaMask({ chains, projectId }), - walletConnectWallet({ projectId, chains }), - ], + appName: "Hypercerts", + projectId, }, - { - groupName: "Injected", - wallets: [injectedWallet({ chains })], - }, -]); +); const wagmiConfig = createConfig({ - autoConnect: false, - publicClient, connectors, + chains, + transports, + ssr: true, }); export interface DappContextProps { @@ -106,21 +114,17 @@ export interface DappContextProps { } export function DappContext({ children }: DappContextProps) { - useEffect(() => { - wagmiConfig.autoConnect(); - }, []); - return ( - - - + + + {children} - - - + + + ); } diff --git a/frontend/components/dapp-state.tsx b/frontend/components/dapp-state.tsx index 31e45512..437e494e 100644 --- a/frontend/components/dapp-state.tsx +++ b/frontend/components/dapp-state.tsx @@ -6,7 +6,7 @@ import { DataProvider } from "@plasmicapp/loader-nextjs"; import "@rainbow-me/rainbowkit/styles.css"; import React, { ReactNode } from "react"; import { optimism, hardhat, Chain, sepolia } from "viem/chains"; -import { useNetwork } from "wagmi"; +import { useAccount } from "wagmi"; const DAPP_STATE_NAME = "DappState"; @@ -51,7 +51,7 @@ export function DappState(props: DappStateProps) { const inEditor = React.useContext(PlasmicCanvasContext); const { address } = useAccountLowerCase(); - const { chain, chains } = useNetwork(); + const { chain } = useAccount(); const { writeable } = useCheckWriteable(); const data: DappStateData = useTestData && testData && inEditor @@ -59,7 +59,6 @@ export function DappState(props: DappStateProps) { : { myAddress: address, chain, - chains, waitToClaim, writeable, }; diff --git a/frontend/components/ftc-purchase.tsx b/frontend/components/ftc-purchase.tsx index 48a67e97..b5b3481f 100644 --- a/frontend/components/ftc-purchase.tsx +++ b/frontend/components/ftc-purchase.tsx @@ -1,5 +1,4 @@ import { useAccountLowerCase } from "../hooks/account"; -import { supabase } from "../lib/supabase-client"; import { useConfetti } from "./confetti"; import { FormContext } from "./forms"; import { DataProvider } from "@plasmicapp/loader-nextjs"; @@ -8,13 +7,8 @@ import _ from "lodash"; import { useRouter } from "next/router"; import React, { ReactNode, useEffect } from "react"; import { toast } from "react-toastify"; -import { isAddress, parseEther } from "viem"; -import { - useBalance, - useNetwork, - usePrepareSendTransaction, - useSendTransaction, -} from "wagmi"; +import { isAddress } from "viem"; +import { useAccount, useBalance } from "wagmi"; import * as Yup from "yup"; /** @@ -177,26 +171,12 @@ export function FtcPurchaseForm(props: FtcPurchaseFormProps) { const { className, children } = props; const { address, isConnected } = useAccountLowerCase(); const { data: balance } = useBalance({ address: address as `0x${string}` }); - const { chain } = useNetwork(); + const { chain } = useAccount(); const { push } = useRouter(); const confetti = useConfetti(); const [ethValue, setEthValue] = React.useState(0); const [wagmiErr, setWagmiErr] = React.useState(); - const { config } = usePrepareSendTransaction({ - to: DESTINATION_ADDRESS, - value: parseEther(`${ethValue}`), - enabled: writeable, - onError(error) { - setWagmiErr(error); - }, - }); - const { sendTransaction } = useSendTransaction({ - ...config, - onError(error) { - setWagmiErr(error); - }, - }); const checkWriteable = async () => { setWriteable(false); @@ -311,41 +291,10 @@ export function FtcPurchaseForm(props: FtcPurchaseFormProps) { initialValues={{ ...DEFAULT_FORM_DATA }} enableReinitialize onSubmit={async (values, { setSubmitting }) => { - if (ethValue <= 0) { - console.warn("No values selected"); - toast(`Please select some hypercerts`, { type: "error" }); - return; - } - - // Write to supabase - const { error: supabaseError } = await supabase - .from("ftc-purchase") - .insert({ - address, - ethValue, - values, - textForSponsor: values.textForSponsor, - }); - if (supabaseError) { - console.error("Supabase error", supabaseError); - toast(`Error writing to database`, { type: "error" }); - return; - } else if (!sendTransaction) { - console.error("Unable to send transaction: ", wagmiErr?.message); - toast(wagmiErr?.message ?? "Unable to send transaction", { - type: "error", - }); - return; - } - - await sendTransaction(); - - confetti && - (await confetti.addConfetti({ - emojis: ["🌈", "⚡️", "💥", "✨", "💫", "🌸"], - })); - setSubmitting(false); - push("/app/ftc/confirm"); + console.error("FTC purchases are disabled"); + toast("FTC purchases are disabled", { + type: "error", + }); }} > {(formikProps: FormikProps) => ( diff --git a/frontend/components/zuzalu-purchase.tsx b/frontend/components/zuzalu-purchase.tsx index 5f8ad162..3f86c68b 100644 --- a/frontend/components/zuzalu-purchase.tsx +++ b/frontend/components/zuzalu-purchase.tsx @@ -1,20 +1,9 @@ -import { useAccountLowerCase } from "../hooks/account"; -import { supabase } from "../lib/supabase-client"; -import { useConfetti } from "./confetti"; import { FormContext } from "./forms"; import { DataProvider } from "@plasmicapp/loader-nextjs"; import { Formik, FormikErrors, FormikProps } from "formik"; import _ from "lodash"; -import { useRouter } from "next/router"; -import React, { ReactNode, useEffect } from "react"; +import React, { ReactNode } from "react"; import { toast } from "react-toastify"; -import { isAddress, parseEther } from "viem"; -import { - useBalance, - useNetwork, - usePrepareSendTransaction, - useSendTransaction, -} from "wagmi"; import * as Yup from "yup"; /** @@ -171,108 +160,17 @@ export interface ZuzaluPurchaseFormProps { } export function ZuzaluPurchaseForm(props: ZuzaluPurchaseFormProps) { - const [writeable, setWriteable] = React.useState(false); - const [errors, setErrors] = React.useState<{ [key: string]: string }>(); - const { className, children } = props; - const { address, isConnected } = useAccountLowerCase(); - const { data: balance } = useBalance({ address: address as `0x${string}` }); - const { chain } = useNetwork(); - const { push } = useRouter(); - const confetti = useConfetti(); - - const [ethValue, setEthValue] = React.useState(0); - const [wagmiErr, setWagmiErr] = React.useState(); - const { config } = usePrepareSendTransaction({ - to: DESTINATION_ADDRESS, - value: parseEther(`${ethValue}`), - enabled: writeable, - onError(error) { - setWagmiErr(error); - }, - }); - const { sendTransaction } = useSendTransaction({ - ...config, - onError(error) { - setWagmiErr(error); - }, - }); - - const checkWriteable = async () => { - setWriteable(false); - const currentErrors: { [key: string]: string } = {}; - - if (!isConnected) { - console.log("User not connected"); - currentErrors["connection"] = - "You appear to not be connected. Please connect your wallet"; - } - - if (!address || !isAddress(address)) { - console.log("No address found"); - currentErrors[ - "address" - ] = `No -valid- address found [${address}]. Please connect your wallet`; - } - - if (!balance || balance.value == 0n) { - console.log("No balance"); - currentErrors["balance"] = "Please add funds to your wallet"; - } - - if (!chain) { - console.log("No chain found"); - currentErrors["chain"] = - "No connected chain found. Please connect your wallet"; - } - - if (chain && chain.id !== CHAIN_ID) { - console.log(`On wrong network HERE. Expect ${CHAIN_ID} Saw ${chain?.id}`); - - currentErrors["chain"] = `Wrong network. Please connect to ${CHAIN_ID}`; - } - - if (Object.keys(currentErrors).length == 0) { - console.log("no errors"); - setWriteable(true); - } else { - console.log("errors detected"); - setWriteable(false); - } - setErrors(currentErrors); - }; - - useEffect(() => { - checkWriteable(); - }, [address, balance, chain]); const checkCanSubmit = ( formValues: ZuzaluPurchaseFormData, formErrors: FormikErrors, onSubmit: () => void, ) => { - if (errors && Object.keys(errors).length > 0) { - console.error(errors); - for (const error in errors) { - toast(errors[error], { - type: "error", - }); - } - - return; - } - - if (!writeable) { - toast("Cannot execute transaction. Check logs for errors", { - type: "error", - }); - return; - } - - console.log("Submitting form..."); - console.log("Form values: ", formValues); - console.log("Form errors: ", formErrors); - onSubmit(); + console.error("FTC purchases are disabled"); + toast("FTC purchases are disabled", { + type: "error", + }); }; return ( @@ -306,46 +204,14 @@ export function ZuzaluPurchaseForm(props: ZuzaluPurchaseFormProps) { // Calculate equivalent total ETH const totalUSD = _.sum(dollarArray); const totalETH = totalUSD / ETH_PRICE; - setEthValue(totalETH); }} initialValues={{ ...DEFAULT_FORM_DATA }} enableReinitialize onSubmit={async (values, { setSubmitting }) => { - if (ethValue <= 0) { - console.warn("No values selected"); - toast(`Please select some hypercerts`, { type: "error" }); - return; - } - - // Write to supabase - const { error: supabaseError } = await supabase - .from("zuzalu-purchase") - .insert({ - address, - ethValue, - values, - textForSponsor: values.textForSponsor, - }); - if (supabaseError) { - console.error("Supabase error", supabaseError); - toast(`Error writing to database`, { type: "error" }); - return; - } else if (!sendTransaction) { - console.error("Unable to send transaction: ", wagmiErr?.message); - toast(wagmiErr?.message ?? "Unable to send transaction", { - type: "error", - }); - return; - } - - await sendTransaction(); - - confetti && - (await confetti.addConfetti({ - emojis: ["🌈", "⚡️", "💥", "✨", "💫", "🌸"], - })); - setSubmitting(false); - push("/app/zuzalu/confirm"); + console.error("FTC purchases are disabled"); + toast("FTC purchases are disabled", { + type: "error", + }); }} > {(formikProps: FormikProps) => ( diff --git a/frontend/hooks/checkWriteable.ts b/frontend/hooks/checkWriteable.ts index 19be41f3..3f994f21 100644 --- a/frontend/hooks/checkWriteable.ts +++ b/frontend/hooks/checkWriteable.ts @@ -1,16 +1,15 @@ import { isAddress } from "viem"; -import { CHAINS } from "../components/dapp-context"; +import { chains } from "../components/dapp-context"; import { useHypercertClient } from "./hypercerts-client"; import { useEffect, useState } from "react"; -import { useAccount, useBalance, useNetwork } from "wagmi"; +import { useAccount, useBalance } from "wagmi"; const useCheckWriteable = () => { - const { address, isConnected } = useAccount(); - const { chain } = useNetwork(); + const { address, isConnected, chain } = useAccount(); const { client } = useHypercertClient(); const { data: balance } = useBalance({ address, - enabled: !!address, + query: { enabled: !!address }, }); const [checking, setChecking] = useState(false); const [writeable, setWriteable] = useState(false); @@ -57,17 +56,17 @@ const useCheckWriteable = () => { console.log(chain); } - if (chain && !CHAINS.map((c) => c.id).includes(chain.id)) { + if (chain && !chains.map((c) => c.id).includes(chain.id)) { console.log( - `On wrong network. Expected one of "${CHAINS.map((c) => c.id).join( - ", ", - )}". Saw ${chain?.id}`, + `On wrong network. Expected one of "${chains + .map((c) => c.id) + .join(", ")}". Saw ${chain?.id}`, ); currentErrors[ "chain" - ] = `Wrong network. Please connect to one of "${CHAINS.map( - (c) => c.id, - ).join(", ")}"`; + ] = `Wrong network. Please connect to one of "${chains + .map((c) => c.id) + .join(", ")}"`; } if (!client || client.readonly) { diff --git a/frontend/hooks/createBlueprintInRegistry.ts b/frontend/hooks/createBlueprintInRegistry.ts deleted file mode 100644 index d1d5d8d0..00000000 --- a/frontend/hooks/createBlueprintInRegistry.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { supabase } from "../lib/supabase-client"; -import { useMutation } from "wagmi"; - -export const useMintBlueprintToRegistry = ({ - onComplete, -}: { - onComplete?: () => void; -}) => { - return useMutation( - ["mintBlueprintToRegistry"], - async ({ - registryId, - minterAddress, - value, - }: { - registryId: string; - minterAddress: string; - value: string; - }) => { - supabase - .from("claim-blueprints-optimism") - .insert({ - registry_id: registryId, - minter_address: minterAddress, - form_values: value, - }) - .then((res) => { - if (res.error) { - throw res.error; - } - return true; - }); - }, - ); -}; diff --git a/frontend/hooks/hypercerts-client.ts b/frontend/hooks/hypercerts-client.ts index fafcae20..33c6a94b 100644 --- a/frontend/hooks/hypercerts-client.ts +++ b/frontend/hooks/hypercerts-client.ts @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import { HypercertClient, HypercertClientConfig } from "@hypercerts-org/sdk"; -import { useWalletClient, useNetwork } from "wagmi"; +import { useWalletClient, useAccount } from "wagmi"; const isSupportedChain = (chainId: number) => { const supportedChainIds = [10, 42220, 11155111, 84532, 8453]; // Replace with actual chain IDs @@ -13,7 +13,7 @@ export const useHypercertClient = ({ }: { overrideChainId?: number; } = {}) => { - const { chain } = useNetwork(); + const { chain } = useAccount(); const clientConfig = { chain: overrideChainId ? { id: overrideChainId } : chain, }; @@ -59,5 +59,7 @@ export const useHypercertClient = ({ setIsLoading(false); }, [chain?.id, overrideChainId, walletClient, walletClientLoading]); + console.log({ client }); + return { client, isLoading }; }; diff --git a/frontend/hooks/mergeFractionUnits.ts b/frontend/hooks/mergeFractionUnits.ts index 4ad8a250..f9d09f81 100644 --- a/frontend/hooks/mergeFractionUnits.ts +++ b/frontend/hooks/mergeFractionUnits.ts @@ -4,6 +4,7 @@ import { useParseBlockchainError } from "../lib/parse-blockchain-error"; import { toast } from "react-toastify"; import { useHypercertClient } from "./hypercerts-client"; import { useState } from "react"; +import { usePublicClient } from "wagmi"; export const useMergeFractionUnits = ({ onComplete, @@ -13,6 +14,7 @@ export const useMergeFractionUnits = ({ const [txPending, setTxPending] = useState(false); const { client, isLoading } = useHypercertClient(); + const publicClient = usePublicClient(); const stepDescriptions = { preparing: "Preparing to merge fraction values", @@ -45,7 +47,6 @@ export const useMergeFractionUnits = ({ return; } - const publicClient = client.config.publicClient; const receipt = await publicClient?.waitForTransactionReceipt({ confirmations: 3, hash, diff --git a/frontend/hooks/mintClaim.ts b/frontend/hooks/mintClaim.ts index 30c13296..3b47f361 100644 --- a/frontend/hooks/mintClaim.ts +++ b/frontend/hooks/mintClaim.ts @@ -5,11 +5,13 @@ import { HypercertMetadata, TransferRestrictions } from "@hypercerts-org/sdk"; import { toast } from "react-toastify"; import { useHypercertClient } from "./hypercerts-client"; import { useState } from "react"; +import { usePublicClient } from "wagmi"; export const useMintClaim = ({ onComplete }: { onComplete?: () => void }) => { const [txPending, setTxPending] = useState(false); const { client, isLoading } = useHypercertClient(); + const publicClient = usePublicClient(); const stepDescriptions = { preparing: "Preparing to mint hypercert", @@ -50,11 +52,10 @@ export const useMintClaim = ({ onComplete }: { onComplete?: () => void }) => { return; } - const receipt = - await client.config.publicClient?.waitForTransactionReceipt({ - confirmations: 3, - hash, - }); + const receipt = await publicClient?.waitForTransactionReceipt({ + confirmations: 3, + hash, + }); setStep("waiting"); diff --git a/frontend/hooks/mintClaimAllowlist.ts b/frontend/hooks/mintClaimAllowlist.ts index 6e3536cd..47441bd9 100644 --- a/frontend/hooks/mintClaimAllowlist.ts +++ b/frontend/hooks/mintClaimAllowlist.ts @@ -12,6 +12,7 @@ import { AllowlistEntry, } from "@hypercerts-org/sdk"; import { toast } from "react-toastify"; +import { usePublicClient } from "wagmi"; export const DEFAULT_ALLOWLIST_PERCENTAGE = 50; @@ -35,6 +36,7 @@ export const useMintClaimAllowlist = ({ const { address } = useAccountLowerCase(); const { setStep, showModal, hideModal } = useContractModal(); const parseError = useParseBlockchainError(); + const publicClient = usePublicClient(); const getAndUpdateAllowlist = async ( allowlistUrl: string, @@ -143,7 +145,6 @@ export const useMintClaimAllowlist = ({ return; } - const publicClient = client.config.publicClient; const receipt = await publicClient?.waitForTransactionReceipt({ confirmations: 3, hash, diff --git a/frontend/hooks/mintFractionAllowlist.ts b/frontend/hooks/mintFractionAllowlist.ts deleted file mode 100644 index 457e17a3..00000000 --- a/frontend/hooks/mintFractionAllowlist.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { useContractModal } from "../components/contract-interaction-dialog-context"; -import { mintInteractionLabels } from "../content/chainInteractions"; -import { useParseBlockchainError } from "../lib/parse-blockchain-error"; -import { toast } from "react-toastify"; -import { useHypercertClient } from "./hypercerts-client"; -import { useState } from "react"; - -export const useMintFractionAllowlist = ({ - onComplete, - enabled, -}: { - onComplete?: () => void; - enabled: boolean; -}) => { - const [txPending, setTxPending] = useState(false); - - const { client, isLoading } = useHypercertClient(); - - const { setStep, showModal, hideModal } = useContractModal(); - - const stepDescriptions = { - initial: "Initializing interaction", - minting: "Minting fraction", - waiting: "Awaiting confirmation", - complete: "Done minting", - }; - - const parseError = useParseBlockchainError(); - - const initializeWrite = async ( - claimID: bigint, - units: bigint, - proof: `0x${string}`[], - ) => { - setStep("minting"); - try { - setTxPending(true); - - if (!client) { - toast("No client found", { - type: "error", - }); - return; - } - - const hash = await client.mintClaimFractionFromAllowlist( - claimID, - units, - proof, - ); - - if (!hash) { - toast("No tx hash returned", { - type: "error", - }); - return; - } - - const publicClient = client.config.publicClient; - const receipt = await publicClient?.waitForTransactionReceipt({ - confirmations: 3, - hash, - }); - - setStep("waiting"); - - if (receipt?.status === "reverted") { - toast("Minting failed", { - type: "error", - }); - console.error(receipt); - } - if (receipt?.status === "success") { - toast(mintInteractionLabels.toastSuccess, { type: "success" }); - - setStep("complete"); - onComplete?.(); - } - } catch (error) { - toast(parseError(error, mintInteractionLabels.toastError), { - type: "error", - }); - console.error(error); - } finally { - hideModal(); - setTxPending(false); - } - }; - - return { - write: async (proof: `0x${string}`[], claimId: bigint, units: bigint) => { - showModal({ stepDescriptions }); - setStep("initial"); - await initializeWrite(claimId, units, proof); - }, - txPending, - readOnly: !enabled || isLoading || !client || client.readonly, - }; -}; diff --git a/frontend/hooks/mintFractionAllowlistBatch.ts b/frontend/hooks/mintFractionAllowlistBatch.ts index d8a84471..952182b5 100644 --- a/frontend/hooks/mintFractionAllowlistBatch.ts +++ b/frontend/hooks/mintFractionAllowlistBatch.ts @@ -1,4 +1,4 @@ -import { useNetwork } from "wagmi"; +import { useAccount, usePublicClient } from "wagmi"; import { useContractModal } from "../components/contract-interaction-dialog-context"; import { mintInteractionLabels } from "../content/chainInteractions"; import { SUPABASE_TABLE } from "../lib/config"; @@ -23,9 +23,10 @@ export const useMintFractionAllowlistBatch = ({ const { address } = useAccountLowerCase(); const { verifyFractionClaim } = useVerifyFractionClaim(); const { client, isLoading } = useHypercertClient(); - const { chain } = useNetwork(); + const { chain } = useAccount(); const { data: claimIds } = useGetAllEligibility(address ?? "", chain?.id); const parseError = useParseBlockchainError(); + const publicClient = usePublicClient(); const stepDescriptions = { initial: "Initializing interaction", @@ -87,7 +88,6 @@ export const useMintFractionAllowlistBatch = ({ return; } - const publicClient = client.config.publicClient; const receipt = await publicClient?.waitForTransactionReceipt({ confirmations: 3, hash, diff --git a/frontend/hooks/readTransferRestriction.ts b/frontend/hooks/readTransferRestriction.ts index 8133140c..12757727 100644 --- a/frontend/hooks/readTransferRestriction.ts +++ b/frontend/hooks/readTransferRestriction.ts @@ -1,24 +1,33 @@ import { useHypercertClient } from "./hypercerts-client"; -import { useWalletClient } from "wagmi"; +import { useAccount, usePublicClient, useWalletClient } from "wagmi"; import { useQuery } from "@tanstack/react-query"; -import { readContract } from "viem/actions"; +import { SupportedChainIds, HypercertMinterAbi } from "@hypercerts-org/sdk"; +import { isAddress } from "viem"; export const useReadTransferRestrictions = (tokenId?: bigint) => { const { client } = useHypercertClient(); - const { data: walletClient } = useWalletClient(); + const publicClient = usePublicClient(); + const { chain } = useAccount(); return useQuery( ["read-transfer-restrictions", tokenId], async () => { if (!client) return null; if (!tokenId) return null; - if (!walletClient) return null; - const contract = client.contract; + if (!publicClient) return null; - if (!contract) return null; + const chainId = chain?.id; - return (await readContract(walletClient, { - ...contract, + if (!chainId) return null; + const deployments = client.getDeployments(chainId as SupportedChainIds); + const contractAddress = deployments?.addresses?.HypercertMinterUUPS; + + if (!contractAddress || !isAddress(contractAddress.toLowerCase())) + return null; + + return (await publicClient.readContract({ + abi: HypercertMinterAbi, + address: contractAddress, functionName: "readTransferRestriction", args: [tokenId], })) as string; diff --git a/frontend/hooks/splitClaimUnits.ts b/frontend/hooks/splitClaimUnits.ts index 06d2a19a..1dc927f8 100644 --- a/frontend/hooks/splitClaimUnits.ts +++ b/frontend/hooks/splitClaimUnits.ts @@ -4,6 +4,7 @@ import { useParseBlockchainError } from "../lib/parse-blockchain-error"; import { toast } from "react-toastify"; import { useHypercertClient } from "./hypercerts-client"; import { useState } from "react"; +import { usePublicClient } from "wagmi"; export const useSplitFractionUnits = ({ onComplete, @@ -13,6 +14,7 @@ export const useSplitFractionUnits = ({ const [txPending, setTxPending] = useState(false); const { client, isLoading } = useHypercertClient(); + const publicClient = usePublicClient(); const stepDescriptions = { splitting: "Splitting fraction units on-chain", @@ -45,7 +47,6 @@ export const useSplitFractionUnits = ({ } setStep("waiting"); - const publicClient = client.config.publicClient; const receipt = await publicClient?.waitForTransactionReceipt({ confirmations: 3, hash, diff --git a/frontend/hooks/transferFraction.ts b/frontend/hooks/transferFraction.ts index e8d1509a..1a265d31 100644 --- a/frontend/hooks/transferFraction.ts +++ b/frontend/hooks/transferFraction.ts @@ -3,8 +3,10 @@ import { useParseBlockchainError } from "../lib/parse-blockchain-error"; import { toast } from "react-toastify"; import { useHypercertClient } from "./hypercerts-client"; import { useState } from "react"; -import { waitForTransactionReceipt, writeContract } from "viem/actions"; -import { useAccount, useWalletClient } from "wagmi"; +import { useAccount, usePublicClient, useWalletClient } from "wagmi"; +import { HypercertMinterAbi } from "@hypercerts-org/contracts"; +import { SupportedChainIds } from "@hypercerts-org/sdk"; +import { isAddress } from "viem"; export const useTransferFraction = ({ onComplete, @@ -14,9 +16,10 @@ export const useTransferFraction = ({ const [txPending, setTxPending] = useState(false); const { client, isLoading } = useHypercertClient(); - const { data: walletClient } = useWalletClient(); - const { address } = useAccount(); + const { address, chain } = useAccount(); + const publicClient = usePublicClient(); + const { data: walletClient } = useWalletClient(); const stepDescriptions = { transferring: "Transferring", waiting: "Awaiting confirmation", @@ -28,14 +31,14 @@ export const useTransferFraction = ({ const initializeWrite = async (fractionId: bigint, to: string) => { if (!client) { - toast("No client found", { + toast("No hypercerts SDK client found", { type: "error", }); return; } - if (!walletClient) { - toast("No wallet client found", { + if (!publicClient) { + toast("No evm client found", { type: "error", }); return; @@ -48,20 +51,39 @@ export const useTransferFraction = ({ return; } - const hypercertMinterContract = client.contract; + const chainId = chain?.id; + + if (!chainId) return null; + const deployments = client.getDeployments(chainId as SupportedChainIds); + const contractAddress = deployments?.addresses?.HypercertMinterUUPS; + + if (!contractAddress || !isAddress(contractAddress.toLowerCase())) + return null; + + const { request } = await publicClient.simulateContract({ + abi: HypercertMinterAbi, + address: contractAddress, + functionName: "safeTransferFrom", + args: [address, to, fractionId, 1, ""], + }); showModal({ stepDescriptions }); setStep("transferring"); try { setTxPending(true); - const tx = await writeContract(walletClient, { - ...hypercertMinterContract, - functionName: "safeTransferFrom", - args: [address, to, fractionId, 1, ""], - }); + const hash = await walletClient?.writeContract(request); + setStep("waiting"); - const receipt = await waitForTransactionReceipt(walletClient, { - hash: tx, + + if (!hash) { + toast("No tx hash returned", { + type: "error", + }); + return; + } + + const receipt = await publicClient.waitForTransactionReceipt({ + hash, }); if (receipt?.status === "reverted") { diff --git a/frontend/package.json b/frontend/package.json index 0f149720..216c7a91 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,13 +19,13 @@ }, "dependencies": { "@apollo/client": "^3.7.4", - "@celo/rainbowkit-celo": "^1.1.2", + "@celo/rainbowkit-celo": "^1.2.0", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@graphprotocol/client-cli": "^2.2.16", "@hypercerts-org/contracts": "1.1.2", "@hypercerts-org/observabletreemap": "workspace: *", - "@hypercerts-org/sdk": "1.4.3", + "@hypercerts-org/sdk": "1.5.0", "@mui/icons-material": "^5.11.9", "@mui/material": "^5.11.2", "@mui/x-date-pickers": "^5.0.12", @@ -34,7 +34,7 @@ "@openzeppelin/merkle-tree": "^1.0.2", "@plasmicapp/host": "^1.0.171", "@plasmicapp/loader-nextjs": "^1.0.345", - "@rainbow-me/rainbowkit": "1.3.1", + "@rainbow-me/rainbowkit": "2.0.4", "@sentry/nextjs": "^7.73.0", "@sentry/utils": "^7.73.0", "@supabase/supabase-js": "^2.1.2", @@ -66,8 +66,8 @@ "react-toastify": "^9.1.1", "react-use": "^17.4.0", "serve": "^14.0.1", - "viem": "1.21.4", - "wagmi": "1.4.12", + "viem": "2.9.4", + "wagmi": "2.5.13", "yup": "^0.32.11" }, "devDependencies": { diff --git a/frontend/types/web3.ts b/frontend/types/web3.ts index ca407d66..d135258d 100644 --- a/frontend/types/web3.ts +++ b/frontend/types/web3.ts @@ -1,3 +1,3 @@ -import { Address } from "wagmi"; +import { Address } from "viem"; export type HexString = Address; diff --git a/graph/generated/schema.ts b/graph/generated/schema.ts index cf492abf..a1ae231d 100644 --- a/graph/generated/schema.ts +++ b/graph/generated/schema.ts @@ -331,417 +331,4 @@ export class ClaimToken extends Entity { set units(value: BigInt) { this.set("units", Value.fromBigInt(value)); } - - get offers(): OfferLoader { - return new OfferLoader("ClaimToken", this.get("id")!.toString(), "offers"); - } -} - -export class Token extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id != null, "Cannot save Token entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Token must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, - ); - store.set("Token", id.toString(), this); - } - } - - static loadInBlock(id: string): Token | null { - return changetype(store.get_in_block("Token", id)); - } - - static load(id: string): Token | null { - return changetype(store.get("Token", id)); - } - - get id(): string { - let value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get name(): string { - let value = this.get("name"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set name(value: string) { - this.set("name", Value.fromString(value)); - } - - get symbol(): string | null { - let value = this.get("symbol"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toString(); - } - } - - set symbol(value: string | null) { - if (!value) { - this.unset("symbol"); - } else { - this.set("symbol", Value.fromString(value)); - } - } - - get decimals(): BigInt | null { - let value = this.get("decimals"); - if (!value || value.kind == ValueKind.NULL) { - return null; - } else { - return value.toBigInt(); - } - } - - set decimals(value: BigInt | null) { - if (!value) { - this.unset("decimals"); - } else { - this.set("decimals", Value.fromBigInt(value)); - } - } -} - -export class AcceptedToken extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id != null, "Cannot save AcceptedToken entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type AcceptedToken must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, - ); - store.set("AcceptedToken", id.toString(), this); - } - } - - static loadInBlock(id: string): AcceptedToken | null { - return changetype( - store.get_in_block("AcceptedToken", id), - ); - } - - static load(id: string): AcceptedToken | null { - return changetype(store.get("AcceptedToken", id)); - } - - get id(): string { - let value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get token(): string { - let value = this.get("token"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set token(value: string) { - this.set("token", Value.fromString(value)); - } - - get minimumAmountPerUnit(): BigInt { - let value = this.get("minimumAmountPerUnit"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set minimumAmountPerUnit(value: BigInt) { - this.set("minimumAmountPerUnit", Value.fromBigInt(value)); - } - - get accepted(): boolean { - let value = this.get("accepted"); - if (!value || value.kind == ValueKind.NULL) { - return false; - } else { - return value.toBoolean(); - } - } - - set accepted(value: boolean) { - this.set("accepted", Value.fromBoolean(value)); - } -} - -export class Offer extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id != null, "Cannot save Offer entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Offer must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, - ); - store.set("Offer", id.toString(), this); - } - } - - static loadInBlock(id: string): Offer | null { - return changetype(store.get_in_block("Offer", id)); - } - - static load(id: string): Offer | null { - return changetype(store.get("Offer", id)); - } - - get id(): string { - let value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get fractionID(): string { - let value = this.get("fractionID"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set fractionID(value: string) { - this.set("fractionID", Value.fromString(value)); - } - - get unitsAvailable(): BigInt { - let value = this.get("unitsAvailable"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set unitsAvailable(value: BigInt) { - this.set("unitsAvailable", Value.fromBigInt(value)); - } - - get minUnitsPerTrade(): BigInt { - let value = this.get("minUnitsPerTrade"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set minUnitsPerTrade(value: BigInt) { - this.set("minUnitsPerTrade", Value.fromBigInt(value)); - } - - get maxUnitsPerTrade(): BigInt { - let value = this.get("maxUnitsPerTrade"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set maxUnitsPerTrade(value: BigInt) { - this.set("maxUnitsPerTrade", Value.fromBigInt(value)); - } - - get status(): string { - let value = this.get("status"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set status(value: string) { - this.set("status", Value.fromString(value)); - } - - get acceptedTokens(): Array { - let value = this.get("acceptedTokens"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toStringArray(); - } - } - - set acceptedTokens(value: Array) { - this.set("acceptedTokens", Value.fromStringArray(value)); - } -} - -export class Trade extends Entity { - constructor(id: string) { - super(); - this.set("id", Value.fromString(id)); - } - - save(): void { - let id = this.get("id"); - assert(id != null, "Cannot save Trade entity without an ID"); - if (id) { - assert( - id.kind == ValueKind.STRING, - `Entities of type Trade must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`, - ); - store.set("Trade", id.toString(), this); - } - } - - static loadInBlock(id: string): Trade | null { - return changetype(store.get_in_block("Trade", id)); - } - - static load(id: string): Trade | null { - return changetype(store.get("Trade", id)); - } - - get id(): string { - let value = this.get("id"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set id(value: string) { - this.set("id", Value.fromString(value)); - } - - get buyer(): Bytes { - let value = this.get("buyer"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBytes(); - } - } - - set buyer(value: Bytes) { - this.set("buyer", Value.fromBytes(value)); - } - - get offerID(): string { - let value = this.get("offerID"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set offerID(value: string) { - this.set("offerID", Value.fromString(value)); - } - - get unitsSold(): BigInt { - let value = this.get("unitsSold"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set unitsSold(value: BigInt) { - this.set("unitsSold", Value.fromBigInt(value)); - } - - get token(): string { - let value = this.get("token"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toString(); - } - } - - set token(value: string) { - this.set("token", Value.fromString(value)); - } - - get amountPerUnit(): BigInt { - let value = this.get("amountPerUnit"); - if (!value || value.kind == ValueKind.NULL) { - throw new Error("Cannot return null for a required field."); - } else { - return value.toBigInt(); - } - } - - set amountPerUnit(value: BigInt) { - this.set("amountPerUnit", Value.fromBigInt(value)); - } -} - -export class OfferLoader extends Entity { - _entity: string; - _field: string; - _id: string; - - constructor(entity: string, id: string, field: string) { - super(); - this._entity = entity; - this._id = id; - this._field = field; - } - - load(): Offer[] { - let value = store.loadRelated(this._entity, this._id, this._field); - return changetype(value); - } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17a77b2f..99988fd2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -333,8 +333,8 @@ importers: specifier: ^3.7.4 version: 3.8.6(graphql@16.8.1)(react-dom@18.2.0)(react@18.2.0) '@celo/rainbowkit-celo': - specifier: ^1.1.2 - version: 1.1.2(@rainbow-me/rainbowkit@1.3.1)(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(wagmi@1.4.12)(zod@3.22.4) + specifier: ^1.2.0 + version: 1.2.0(@rainbow-me/rainbowkit@2.0.4)(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(wagmi@2.5.13)(zod@3.22.4) '@emotion/react': specifier: ^11.10.5 version: 11.11.1(@types/react@18.2.33)(react@18.2.0) @@ -351,8 +351,8 @@ importers: specifier: 'workspace: *' version: link:../vendor/observabletreemap '@hypercerts-org/sdk': - specifier: 1.4.3 - version: 1.4.3(react@18.2.0)(typescript@5.1.6)(zod@3.22.4) + specifier: 1.5.0 + version: 1.5.0(react@18.2.0)(typescript@5.1.6)(zod@3.22.4) '@mui/icons-material': specifier: ^5.11.9 version: 5.14.15(@mui/material@5.14.15)(@types/react@18.2.33)(react@18.2.0) @@ -378,8 +378,8 @@ importers: specifier: ^1.0.345 version: 1.0.345(next@13.5.6)(react-dom@18.2.0)(react@18.2.0) '@rainbow-me/rainbowkit': - specifier: 1.3.1 - version: 1.3.1(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.21.4)(wagmi@1.4.12) + specifier: 2.0.4 + version: 2.0.4(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@2.9.4)(wagmi@2.5.13) '@sentry/nextjs': specifier: ^7.73.0 version: 7.75.1(next@13.5.6)(react@18.2.0)(webpack@5.89.0) @@ -474,11 +474,11 @@ importers: specifier: ^14.0.1 version: 14.2.1 viem: - specifier: 1.21.4 - version: 1.21.4(typescript@5.1.6)(zod@3.22.4) + specifier: 2.9.4 + version: 2.9.4(typescript@5.1.6)(zod@3.22.4) wagmi: - specifier: 1.4.12 - version: 1.4.12(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4) + specifier: 2.5.13 + version: 2.5.13(@tanstack/react-query@4.36.1)(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) yup: specifier: ^0.32.11 version: 0.32.11 @@ -601,8 +601,8 @@ importers: specifier: ^4.0.6 version: 4.0.6(graphql@16.8.1)(react@18.2.0) viem: - specifier: ^1.21.4 - version: 1.21.4(typescript@5.3.2) + specifier: ^2.9.4 + version: 2.9.4(typescript@5.3.2) devDependencies: '@babel/core': specifier: ^7.23.5 @@ -647,8 +647,8 @@ importers: specifier: ^0.0.6 version: 0.0.6 abitype: - specifier: ^0.10.3 - version: 0.10.3(typescript@5.3.2) + specifier: ^1.0.2 + version: 1.0.2(typescript@5.3.2) chai: specifier: ^4.3.7 version: 4.3.10 @@ -2577,18 +2577,18 @@ packages: resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} dev: false - /@celo/rainbowkit-celo@1.1.2(@rainbow-me/rainbowkit@1.3.1)(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(wagmi@1.4.12)(zod@3.22.4): - resolution: {integrity: sha512-g5JyhRscwc7OMtBA7Huos8tgwwfhGEKiMZWTzG5K0Lcan5N9as02CtN8v2F+plQQ7v2IRROTmDw0O1xRjQF4GQ==} + /@celo/rainbowkit-celo@1.2.0(@rainbow-me/rainbowkit@2.0.4)(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(wagmi@2.5.13)(zod@3.22.4): + resolution: {integrity: sha512-qil8mb//lIJAXd6b4ct7Dc5cv05NugKy56SahzgdeJ5i7KZOldplSgeNSvZnX5SiVGhgmZ4v08WQ5JPBrEHV+Q==} peerDependencies: - '@rainbow-me/rainbowkit': '>=1.0.2 && <=2.0.0' - viem: '>=1.2.8 && <=2.0.0' - wagmi: '>=1.4.12 && <=2.0.0' + '@rainbow-me/rainbowkit': ^1.3.6 + viem: ^1.21.4 + wagmi: ^1.4.13 dependencies: '@metamask/providers': 11.1.2 - '@rainbow-me/rainbowkit': 1.3.1(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.21.4)(wagmi@1.4.12) - '@wagmi/connectors': 3.1.10(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4) - viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) - wagmi: 1.4.12(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4) + '@rainbow-me/rainbowkit': 2.0.4(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@2.9.4)(wagmi@2.5.13) + '@wagmi/connectors': 3.1.11(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) + wagmi: 2.5.13(@tanstack/react-query@4.36.1)(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -2605,7 +2605,6 @@ packages: - '@vercel/kv' - bufferutil - encoding - - lokijs - react - supports-color - typescript @@ -2690,6 +2689,22 @@ packages: - utf-8-validate dev: false + /@coinbase/wallet-sdk@3.9.1: + resolution: {integrity: sha512-cGUE8wm1/cMI8irRMVOqbFWYcnNugqCtuy2lnnHfgloBg+GRLs9RsrkOUDMdv/StfUeeKhCDyYudsXXvcL1xIA==} + dependencies: + bn.js: 5.2.1 + buffer: 6.0.3 + clsx: 1.2.1 + eth-block-tracker: 7.1.0 + eth-json-rpc-filters: 6.0.1 + eventemitter3: 5.0.1 + keccak: 3.0.4 + preact: 10.18.1 + sha.js: 2.4.11 + transitivePeerDependencies: + - supports-color + dev: false + /@colors/colors@1.5.0: resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -4203,10 +4218,6 @@ packages: stylis: 4.2.0 dev: false - /@emotion/hash@0.8.0: - resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==} - dev: false - /@emotion/hash@0.9.1: resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} dev: false @@ -5112,11 +5123,17 @@ packages: ethereumjs-util: 7.1.5 dev: true + /@ethereumjs/common@3.2.0: + resolution: {integrity: sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA==} + dependencies: + '@ethereumjs/util': 8.1.0 + crc-32: 1.2.2 + dev: false + /@ethereumjs/rlp@4.0.1: resolution: {integrity: sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==} engines: {node: '>=14'} hasBin: true - dev: true /@ethereumjs/tx@3.5.2: resolution: {integrity: sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==} @@ -5125,6 +5142,16 @@ packages: ethereumjs-util: 7.1.5 dev: true + /@ethereumjs/tx@4.2.0: + resolution: {integrity: sha512-1nc6VO4jtFd172BbSnTnDQVr9IYBFl1y4xPzZdtkrkKIncBCkdbgfdRV+MiTkJYAtTxvV12GRZLqBFT1PNK6Yw==} + engines: {node: '>=14'} + dependencies: + '@ethereumjs/common': 3.2.0 + '@ethereumjs/rlp': 4.0.1 + '@ethereumjs/util': 8.1.0 + ethereum-cryptography: 2.1.2 + dev: false + /@ethereumjs/util@8.1.0: resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} engines: {node: '>=14'} @@ -5132,7 +5159,6 @@ packages: '@ethereumjs/rlp': 4.0.1 ethereum-cryptography: 2.1.2 micro-ftch: 0.3.1 - dev: true /@ethersproject/abi@5.0.7: resolution: {integrity: sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw==} @@ -7348,8 +7374,8 @@ packages: - utf-8-validate dev: false - /@hypercerts-org/sdk@1.4.3(react@18.2.0)(typescript@5.1.6)(zod@3.22.4): - resolution: {integrity: sha512-9K/2dY/r5dXZiFPlM9rg06P36aH49grpetsvisi9HxJMJYTIQy6ZKvB/ix3zC7LS+zSv8fhz13AEoQVlmP3Svw==} + /@hypercerts-org/sdk@1.5.0(react@18.2.0)(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-WyMNQPtYL8/FeJ5QIrtc2ToM4WV5nL1TJE0JTi325zY0r7Xgz2R1Xb3g3x2rLuqKodr0NXYFaJkfofc6zwukoA==} dependencies: '@ethereum-attestation-service/eas-sdk': 1.3.7(typescript@5.1.6) '@ethersproject/abstract-signer': 5.7.0 @@ -7365,7 +7391,7 @@ packages: graphql: 16.8.1 loglevel: 1.8.1 urql: 4.0.6(graphql@16.8.1)(react@18.2.0) - viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - bufferutil - debug @@ -7770,6 +7796,17 @@ packages: react: 18.2.0 dev: false + /@metamask/eth-json-rpc-provider@1.0.1: + resolution: {integrity: sha512-whiUMPlAOrVGmX8aKYVPvlKyG4CpQXiNNyt74vE1xb5sPvmx5oA7B/kOi/JdBvhGQq97U1/AVdXEdk2zkP8qyA==} + engines: {node: '>=14.0.0'} + dependencies: + '@metamask/json-rpc-engine': 7.3.3 + '@metamask/safe-event-emitter': 3.0.0 + '@metamask/utils': 5.0.2 + transitivePeerDependencies: + - supports-color + dev: false + /@metamask/eth-sig-util@4.0.1: resolution: {integrity: sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==} engines: {node: '>=12.0.0'} @@ -7780,6 +7817,17 @@ packages: tweetnacl: 1.0.3 tweetnacl-util: 0.15.1 + /@metamask/json-rpc-engine@7.3.3: + resolution: {integrity: sha512-dwZPq8wx9yV3IX2caLi9q9xZBw2XeIoYqdyihDDDpuHVCEiqadJLwqM3zy+uwf6F1QYQ65A8aOMQg1Uw7LMLNg==} + engines: {node: '>=16.0.0'} + dependencies: + '@metamask/rpc-errors': 6.2.1 + '@metamask/safe-event-emitter': 3.0.0 + '@metamask/utils': 8.4.0 + transitivePeerDependencies: + - supports-color + dev: false + /@metamask/object-multiplex@1.3.0: resolution: {integrity: sha512-czcQeVYdSNtabd+NcYQnrM69MciiJyd1qvKH8WM2Id3C0ZiUUX5Xa/MK+/VUk633DBhVOwdNzAKIQ33lGyA+eQ==} engines: {node: '>=12.0.0'} @@ -7789,6 +7837,40 @@ packages: readable-stream: 2.3.8 dev: false + /@metamask/onboarding@1.0.1: + resolution: {integrity: sha512-FqHhAsCI+Vacx2qa5mAFcWNSrTcVGMNjzxVgaX8ECSny/BJ9/vgXP9V7WF/8vb9DltPeQkxr+Fnfmm6GHfmdTQ==} + dependencies: + bowser: 2.11.0 + dev: false + + /@metamask/post-message-stream@6.2.0: + resolution: {integrity: sha512-WunZ0bruClF862mvbKQGETn5SM0XKGmocPMQR1Ew6sYix9/FDzeoZnoI8RkXk01E+70FCdxhTE/r8kk5SFOuTw==} + engines: {node: '>=14.0.0'} + dependencies: + '@metamask/utils': 5.0.2 + readable-stream: 2.3.3 + transitivePeerDependencies: + - supports-color + dev: false + + /@metamask/providers@10.2.1: + resolution: {integrity: sha512-p2TXw2a1Nb8czntDGfeIYQnk4LLVbd5vlcb3GY//lylYlKdSqp+uUTegCvxiFblRDOT68jsY8Ib1VEEzVUOolA==} + engines: {node: '>=14.0.0'} + dependencies: + '@metamask/object-multiplex': 1.3.0 + '@metamask/safe-event-emitter': 2.0.0 + '@types/chrome': 0.0.136 + detect-browser: 5.3.0 + eth-rpc-errors: 4.0.3 + extension-port-stream: 2.1.1 + fast-deep-equal: 2.0.1 + is-stream: 2.0.1 + json-rpc-engine: 6.1.0 + json-rpc-middleware-stream: 4.2.3 + pump: 3.0.0 + webextension-polyfill-ts: 0.25.0 + dev: false + /@metamask/providers@11.1.2: resolution: {integrity: sha512-xjE4cKrGpKZjripkMKMStc0H4LXrWJPijfbaj1kKeDLVhRH2Yu3ZecV3iIhf1EIJePeA+Kx6Pcm7d0IVJ+ea7g==} engines: {node: '>=16.0.0'} @@ -7806,6 +7888,16 @@ packages: webextension-polyfill: 0.10.0 dev: false + /@metamask/rpc-errors@6.2.1: + resolution: {integrity: sha512-VTgWkjWLzb0nupkFl1duQi9Mk8TGT9rsdnQg6DeRrYEFxtFOh0IF8nAwxM/4GWqDl6uIB06lqUBgUrAVWl62Bw==} + engines: {node: '>=16.0.0'} + dependencies: + '@metamask/utils': 8.4.0 + fast-safe-stringify: 2.1.1 + transitivePeerDependencies: + - supports-color + dev: false + /@metamask/safe-event-emitter@2.0.0: resolution: {integrity: sha512-/kSXhY692qiV1MXu6EeOZvg5nECLclxNXcKCxJ3cXQgYuRymRHpdx/t7JXfsK+JLjwA1e1c1/SBrlQYpusC29Q==} dev: false @@ -7815,6 +7907,85 @@ packages: engines: {node: '>=12.0.0'} dev: false + /@metamask/sdk-communication-layer@0.14.3: + resolution: {integrity: sha512-yjSbj8y7fFbQXv2HBzUX6D9C8BimkCYP6BDV7hdw53W8b/GlYCtXVxUFajQ9tuO1xPTRjR/xt/dkdr2aCi6WGw==} + dependencies: + bufferutil: 4.0.8 + cross-fetch: 3.1.8 + date-fns: 2.30.0 + eciesjs: 0.3.18 + eventemitter2: 6.4.7 + socket.io-client: 4.7.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) + utf-8-validate: 6.0.3 + uuid: 8.3.2 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /@metamask/sdk-install-modal-web@0.14.1(@types/react@18.2.33)(react-native@0.72.6): + resolution: {integrity: sha512-emT8HKbnfVwGhPxyUfMja6DWzvtJvDEBQxqCVx93H0HsyrrOzOC43iGCAosslw6o5h7gOfRKLqWmK8V7jQAS2Q==} + dependencies: + '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + i18next: 22.5.1 + qr-code-styling: 1.6.0-rc.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-i18next: 13.5.0(i18next@22.5.1)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - react-native + dev: false + + /@metamask/sdk@0.14.3(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0): + resolution: {integrity: sha512-BYLs//nY2wioVSih78gOQI6sLIYY3vWkwVqXGYUgkBV+bi49bv+9S0m+hZ2cwiRaxfMYtKs0KvhAQ8weiYwDrg==} + peerDependencies: + react: ^18.2.0 + react-native: '*' + peerDependenciesMeta: + react: + optional: true + react-native: + optional: true + dependencies: + '@metamask/onboarding': 1.0.1 + '@metamask/post-message-stream': 6.2.0 + '@metamask/providers': 10.2.1 + '@metamask/sdk-communication-layer': 0.14.3 + '@metamask/sdk-install-modal-web': 0.14.1(@types/react@18.2.33)(react-native@0.72.6) + '@react-native-async-storage/async-storage': 1.23.1(react-native@0.72.6) + '@types/dom-screen-wake-lock': 1.0.3 + bowser: 2.11.0 + cross-fetch: 4.0.0 + eciesjs: 0.3.18 + eth-rpc-errors: 4.0.3 + eventemitter2: 6.4.7 + extension-port-stream: 2.1.1 + i18next: 22.5.1 + i18next-browser-languagedetector: 7.2.0 + obj-multiplex: 1.0.0 + pump: 3.0.0 + qrcode-terminal-nooctal: 0.12.1 + react: 18.2.0 + react-i18next: 13.5.0(i18next@22.5.1)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) + react-native-webview: 11.26.1(react-native@0.72.6)(react@18.2.0) + readable-stream: 2.3.8 + rollup-plugin-visualizer: 5.12.0 + socket.io-client: 4.7.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) + util: 0.12.5 + uuid: 8.3.2 + transitivePeerDependencies: + - '@types/react' + - bufferutil + - encoding + - react-dom + - rollup + - supports-color + - utf-8-validate + dev: false + /@metamask/utils@3.6.0: resolution: {integrity: sha512-9cIRrfkWvHblSiNDVXsjivqa9Ak0RYo/1H6tqTqTbAx+oBK2Sva0lWDHxGchOqA7bySGUJKAWSNJvH6gdHZ0gQ==} engines: {node: '>=14.0.0'} @@ -7827,6 +7998,36 @@ packages: - supports-color dev: false + /@metamask/utils@5.0.2: + resolution: {integrity: sha512-yfmE79bRQtnMzarnKfX7AEJBwFTxvTyw3nBQlu/5rmGXrjAeAMltoGxO62TFurxrQAFMNa/fEjIHNvungZp0+g==} + engines: {node: '>=14.0.0'} + dependencies: + '@ethereumjs/tx': 4.2.0 + '@types/debug': 4.1.10 + debug: 4.3.4(supports-color@8.1.1) + semver: 7.5.4 + superstruct: 1.0.3 + transitivePeerDependencies: + - supports-color + dev: false + + /@metamask/utils@8.4.0: + resolution: {integrity: sha512-dbIc3C7alOe0agCuBHM1h71UaEaEqOk2W8rAtEn8QGz4haH2Qq7MoK6i7v2guzvkJVVh79c+QCzIqphC3KvrJg==} + engines: {node: '>=16.0.0'} + dependencies: + '@ethereumjs/tx': 4.2.0 + '@noble/hashes': 1.3.2 + '@scure/base': 1.1.3 + '@types/debug': 4.1.10 + debug: 4.3.4(supports-color@8.1.1) + pony-cause: 2.1.10 + semver: 7.5.4 + superstruct: 1.0.3 + uuid: 9.0.1 + transitivePeerDependencies: + - supports-color + dev: false + /@miniflare/cache@2.11.0: resolution: {integrity: sha512-L/kc9AzidPwFuk2fwHpAEePi0kNBk6FWUq3ln+9beRCDrPEpfVrDRFpNleF1NFZz5//oeVMuo8F0IVUQGzR7+Q==} engines: {node: '>=16.13'} @@ -8054,6 +8255,7 @@ packages: /@motionone/vue@10.16.4: resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} + deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion dependencies: '@motionone/dom': 10.16.4 tslib: 2.6.2 @@ -8395,7 +8597,6 @@ packages: resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} dependencies: '@noble/hashes': 1.3.1 - dev: true /@noble/curves@1.2.0: resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} @@ -8412,7 +8613,6 @@ packages: /@noble/hashes@1.3.1: resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} engines: {node: '>= 16'} - dev: true /@noble/hashes@1.3.2: resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} @@ -9586,7 +9786,7 @@ packages: resolution: {integrity: sha512-rkPHPFyafxoFZm/klub2mCo0pRIIjr24shuO6/LTjPwncz3w5XxrJ4Rv/H9F+paV0+wjo43t0tBYmUmu82yRjg==} engines: {node: '>=10'} dependencies: - socket.io-client: 4.7.2 + socket.io-client: 4.7.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) transitivePeerDependencies: - bufferutil - supports-color @@ -9682,31 +9882,39 @@ packages: resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==} dev: true - /@rainbow-me/rainbowkit@1.3.1(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@1.21.4)(wagmi@1.4.12): - resolution: {integrity: sha512-4Upi+S12ZHosimzlUpCiOocg4dtfGU2wkzcpxeat/FYHrvhVIOgm0TuzbsIM96W1p7OXabosd7xuxPvwduUygQ==} + /@rainbow-me/rainbowkit@2.0.4(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(viem@2.9.4)(wagmi@2.5.13): + resolution: {integrity: sha512-kZdTXY0ZkFIgiHQKSCWs8wcTPAB//T9WPdxq0gSq7lzpVpDRl99X4qTe0Oq4WRoBM5QEzXKRKKgkyVNiLC6kwg==} engines: {node: '>=12.4'} peerDependencies: react: '>=17' react-dom: '>=17' - viem: ~0.3.19 || ^1.0.0 - wagmi: ~1.0.1 || ~1.1.0 || ~1.2.0 || ~1.3.0 || ~1.4.0 - dependencies: - '@vanilla-extract/css': 1.9.1 - '@vanilla-extract/dynamic': 2.0.2 - '@vanilla-extract/sprinkles': 1.5.0(@vanilla-extract/css@1.9.1) - clsx: 1.1.1 - i18n-js: 4.3.2 - qrcode: 1.5.0 + viem: 2.x + wagmi: 2.x + dependencies: + '@vanilla-extract/css': 1.14.0 + '@vanilla-extract/dynamic': 2.1.0 + '@vanilla-extract/sprinkles': 1.6.1(@vanilla-extract/css@1.14.0) + clsx: 2.1.0 + qrcode: 1.5.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-remove-scroll: 2.5.4(@types/react@18.2.33)(react@18.2.0) - ua-parser-js: 1.0.36 - viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) - wagmi: 1.4.12(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4) + react-remove-scroll: 2.5.7(@types/react@18.2.33)(react@18.2.0) + ua-parser-js: 1.0.37 + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) + wagmi: 2.5.13(@tanstack/react-query@4.36.1)(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) transitivePeerDependencies: - '@types/react' dev: false + /@react-native-async-storage/async-storage@1.23.1(react-native@0.72.6): + resolution: {integrity: sha512-Qd2kQ3yi6Y3+AcUlrHxSLlnBvpdCEMVGFlVBneVOjaFaPU61g1huc38g339ysXspwY1QZA2aNhrk/KlHGO+ewA==} + peerDependencies: + react-native: ^0.0.0-0 || >=0.60 <1.0 + dependencies: + merge-options: 3.0.4 + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) + dev: false + /@react-native-community/cli-clean@11.3.7: resolution: {integrity: sha512-twtsv54ohcRyWVzPXL3F9VHGb4Qhn3slqqRs3wEuRzjR7cTmV2TIO2b1VhaqF4HlCgNd+cGuirvLtK2JJyaxMg==} dependencies: @@ -10351,7 +10559,6 @@ packages: '@noble/curves': 1.1.0 '@noble/hashes': 1.3.2 '@scure/base': 1.1.3 - dev: true /@scure/bip32@1.3.2: resolution: {integrity: sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==} @@ -11144,18 +11351,6 @@ packages: resolution: {integrity: sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==} dev: false - /@tanstack/query-persist-client-core@4.36.1: - resolution: {integrity: sha512-eocgCeI7D7TRv1IUUBMfVwOI0wdSmMkBIbkKhqEdTrnUHUQEeOaYac8oeZk2cumAWJdycu6P/wB+WqGynTnzXg==} - dependencies: - '@tanstack/query-core': 4.36.1 - dev: false - - /@tanstack/query-sync-storage-persister@4.36.1: - resolution: {integrity: sha512-yMEt5hWe2+1eclf1agMtXHnPIkxEida0lYWkfdhR8U6KXk/lO4Vca6piJmhKI85t0NHlx3l/z6zX+t/Fn5O9NA==} - dependencies: - '@tanstack/query-persist-client-core': 4.36.1 - dev: false - /@tanstack/react-query-devtools@4.36.1(@tanstack/react-query@4.36.1)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-WYku83CKP3OevnYSG8Y/QO9g0rT75v1om5IvcWUwiUZJ4LanYGLVCZ8TdFG5jfsq4Ej/lu2wwDAULEUnRIMBSw==} peerDependencies: @@ -11171,15 +11366,6 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /@tanstack/react-query-persist-client@4.36.1(@tanstack/react-query@4.36.1): - resolution: {integrity: sha512-32I5b9aAu4NCiXZ7Te/KEQLfHbYeTNriVPrKYcvEThnZ9tlW01vLcSoxpUIsMYRsembvJUUAkzYBAiZHLOd6pQ==} - peerDependencies: - '@tanstack/react-query': ^4.36.1 - dependencies: - '@tanstack/query-persist-client-core': 4.36.1 - '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) - dev: false - /@tanstack/react-query@4.36.1(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0): resolution: {integrity: sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==} peerDependencies: @@ -11490,6 +11676,13 @@ packages: resolution: {integrity: sha512-69TtiDzu0bcmKQv3yg1Zx409/Kd7r0b5F1PfpYJfSHzLGtB53547V4u+9iqKYsTu/O2ai6KTb0TInNpvuQ3qmg==} dev: true + /@types/chrome@0.0.136: + resolution: {integrity: sha512-XDEiRhLkMd+SB7Iw3ZUIj/fov3wLd4HyTdLltVszkgl1dBfc3Rb7oPMVZ2Mz2TLqnF7Ow+StbR8E7r9lqpb4DA==} + dependencies: + '@types/filesystem': 0.0.36 + '@types/har-format': 1.2.15 + dev: false + /@types/cli-progress@3.11.4: resolution: {integrity: sha512-yufTxeeNCZuEIxx2uebK8lpSAsJM4lvzakm/VxzYhDtqhXCzwH9jpn7nPCxzrROuEbLATqhFq4MIPoG0tlrsvw==} dependencies: @@ -11533,6 +11726,10 @@ packages: '@types/ms': 0.7.33 dev: false + /@types/dom-screen-wake-lock@1.0.3: + resolution: {integrity: sha512-3Iten7X3Zgwvk6kh6/NRdwN7WbZ760YgFCsF5AxDifltUQzW1RaW+WRmcVtgwFzLjaNu64H+0MPJ13yRa8g3Dw==} + dev: false + /@types/eslint-scope@3.7.6: resolution: {integrity: sha512-zfM4ipmxVKWdxtDaJ3MP3pBurDXOCoyjvlpE3u6Qzrmw4BPbfm4/ambIeTk/r/J0iq/+2/xp0Fmt+gFvXJY2PQ==} dependencies: @@ -11570,6 +11767,16 @@ packages: '@types/qs': 6.9.9 '@types/serve-static': 1.15.4 + /@types/filesystem@0.0.36: + resolution: {integrity: sha512-vPDXOZuannb9FZdxgHnqSwAG/jvdGM8Wq+6N4D/d80z+D4HWH+bItqsZaVRQykAn6WEVeEkLm2oQigyHtgb0RA==} + dependencies: + '@types/filewriter': 0.0.33 + dev: false + + /@types/filewriter@0.0.33: + resolution: {integrity: sha512-xFU8ZXTw4gd358lb2jw25nxY9QAgqn2+bKKjKOYfNCzN4DKCFetK7sPtrlpg66Ywe3vWY9FNxprZawAh9wfJ3g==} + dev: false + /@types/form-data@0.0.33: resolution: {integrity: sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==} dependencies: @@ -11599,6 +11806,10 @@ packages: resolution: {integrity: sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==} dev: false + /@types/har-format@1.2.15: + resolution: {integrity: sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==} + dev: false + /@types/hast@2.3.7: resolution: {integrity: sha512-EVLigw5zInURhzfXUM65eixfadfsHKomGKUakToXo84t8gGIJuTcD2xooM2See7GyQ7DRtYjhCHnSUQez8JaLw==} dependencies: @@ -12328,24 +12539,24 @@ packages: - graphql dev: false - /@vanilla-extract/css@1.9.1: - resolution: {integrity: sha512-pu2SFiff5jRhPwvGoj8cM5l/qIyLvigOmy22ss5DGjwV5pJYezRjDLxWumi2luIwioMWvh9EozCjyfH8nq+7fQ==} + /@vanilla-extract/css@1.14.0: + resolution: {integrity: sha512-rYfm7JciWZ8PFzBM/HDiE2GLnKI3xJ6/vdmVJ5BSgcCZ5CxRlM9Cjqclni9lGzF3eMOijnUhCd/KV8TOzyzbMA==} dependencies: - '@emotion/hash': 0.8.0 + '@emotion/hash': 0.9.1 '@vanilla-extract/private': 1.0.3 - ahocorasick: 1.0.2 chalk: 4.1.2 - css-what: 5.1.0 + css-what: 6.1.0 cssesc: 3.0.0 csstype: 3.1.2 deep-object-diff: 1.1.9 deepmerge: 4.3.1 media-query-parser: 2.0.2 + modern-ahocorasick: 1.0.1 outdent: 0.8.0 dev: false - /@vanilla-extract/dynamic@2.0.2: - resolution: {integrity: sha512-U4nKaEQ8Kuz+exXEr51DUpyaOuzo24/S/k1YbDPQR06cYcNjQqvwFRnwWtZ+9ImocqM1wTKtzrdUgSTtLGIwAg==} + /@vanilla-extract/dynamic@2.1.0: + resolution: {integrity: sha512-8zl0IgBYRtgD1h+56Zu13wHTiMTJSVEa4F7RWX9vTB/5Xe2KtjoiqApy/szHPVFA56c+ex6A4GpCQjT1bKXbYw==} dependencies: '@vanilla-extract/private': 1.0.3 dev: false @@ -12354,12 +12565,12 @@ packages: resolution: {integrity: sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==} dev: false - /@vanilla-extract/sprinkles@1.5.0(@vanilla-extract/css@1.9.1): - resolution: {integrity: sha512-W58f2Rzz5lLmk0jbhgStVlZl5wEiPB1Ur3fRvUaBM+MrifZ3qskmFq/CiH//fEYeG5Dh9vF1qRviMMH46cX9Nw==} + /@vanilla-extract/sprinkles@1.6.1(@vanilla-extract/css@1.14.0): + resolution: {integrity: sha512-N/RGKwGAAidBupZ436RpuweRQHEFGU+mvAqBo8PRMAjJEmHoPDttV8RObaMLrJHWLqvX+XUMinHUnD0hFRQISw==} peerDependencies: '@vanilla-extract/css': ^1.0.0 dependencies: - '@vanilla-extract/css': 1.9.1 + '@vanilla-extract/css': 1.14.0 dev: false /@viem/anvil@0.0.5(debug@4.3.4): @@ -12521,8 +12732,8 @@ packages: typescript: 5.3.2 dev: true - /@wagmi/connectors@3.1.10(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4): - resolution: {integrity: sha512-ZLJC1QaeiZarkF07Cr9mOlVjPO1Lf5TBx+JKBms2y5fUIXlKrxCfQgO/gDCureboI+Us2X3IRI659+XacSGpbA==} + /@wagmi/connectors@3.1.11(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4): + resolution: {integrity: sha512-wzxp9f9PtSUFjDUP/QDjc1t7HON4D8wrVKsw35ejdO8hToDpx1gU9lwH/47Zo/1zExGezQc392sjoHSszYd7OA==} peerDependencies: typescript: '>=5.0.4' viem: '>=0.3.35' @@ -12533,14 +12744,14 @@ packages: '@coinbase/wallet-sdk': 3.7.2 '@safe-global/safe-apps-provider': 0.18.1(typescript@5.1.6)(zod@3.22.4) '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.1.6)(zod@3.22.4) - '@walletconnect/ethereum-provider': 2.10.6(@types/react@18.2.33)(react@18.2.0) + '@walletconnect/ethereum-provider': 2.11.0(@types/react@18.2.33)(react@18.2.0) '@walletconnect/legacy-provider': 2.0.0 '@walletconnect/modal': 2.6.2(@types/react@18.2.33)(react@18.2.0) - '@walletconnect/utils': 2.10.2 + '@walletconnect/utils': 2.11.0 abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) eventemitter3: 4.0.7 typescript: 5.1.6 - viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -12557,28 +12768,31 @@ packages: - '@vercel/kv' - bufferutil - encoding - - lokijs - react - supports-color - utf-8-validate - zod dev: false - /@wagmi/core@1.4.12(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4): - resolution: {integrity: sha512-bLcYmmGgjtl3jAGo8X3Sm6oUwsdjbVxFMu9SWnwHdE4S9JdYeWM57dEhQgq8SYul2yQ7yY2/gimBf1Or0Ky3dQ==} + /@wagmi/connectors@4.1.19(@types/react@18.2.33)(@wagmi/core@2.6.10)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4): + resolution: {integrity: sha512-7OmdvepGCmzjGlY+pT7SgItgDd+eo7J2q50PywtnZ8xIdIEJUiwDm37izwQH0S7ZH8EL/9XkmOuz9hV5ORwn8Q==} peerDependencies: + '@wagmi/core': 2.6.10 typescript: '>=5.0.4' - viem: '>=0.3.35' + viem: 2.x peerDependenciesMeta: typescript: optional: true dependencies: - '@wagmi/connectors': 3.1.10(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4) - abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) - eventemitter3: 4.0.7 + '@coinbase/wallet-sdk': 3.9.1 + '@metamask/sdk': 0.14.3(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) + '@safe-global/safe-apps-provider': 0.18.1(typescript@5.1.6)(zod@3.22.4) + '@safe-global/safe-apps-sdk': 8.1.0(typescript@5.1.6)(zod@3.22.4) + '@wagmi/core': 2.6.10(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) + '@walletconnect/ethereum-provider': 2.11.2(@types/react@18.2.33)(react@18.2.0) + '@walletconnect/modal': 2.6.2(@types/react@18.2.33)(react@18.2.0) typescript: 5.1.6 - viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) - zustand: 4.4.4(@types/react@18.2.33)(react@18.2.0) + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -12595,16 +12809,43 @@ packages: - '@vercel/kv' - bufferutil - encoding - - immer - - lokijs - react + - react-dom + - react-native + - rollup - supports-color - utf-8-validate - zod dev: false - /@walletconnect/core@2.10.6: - resolution: {integrity: sha512-Z4vh4ZdfcoQjgPEOxeuF9HUZCVLtV3MgRbS/awLIj/omDrFnOwlBhxi5Syr4Y8muVGC0ocRetQYHae0/gX5crQ==} + /@wagmi/core@2.6.10(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4): + resolution: {integrity: sha512-CwY6T5MZgvhahNltArxVUpeh9Fk+zPeumqXyA+MIB0bdudOaxw0BjHyUOWGwcE8BH+uzT8YuTigeFVW3sKecVg==} + peerDependencies: + '@tanstack/query-core': '>=5.0.0' + typescript: '>=5.0.4' + viem: 2.x + peerDependenciesMeta: + '@tanstack/query-core': + optional: true + typescript: + optional: true + dependencies: + eventemitter3: 5.0.1 + mipd: 0.0.5(typescript@5.1.6)(zod@3.22.4) + typescript: 5.1.6 + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) + zustand: 4.4.1(@types/react@18.2.33)(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - bufferutil + - immer + - react + - utf-8-validate + - zod + dev: false + + /@walletconnect/core@2.11.0: + resolution: {integrity: sha512-2Tjp5BCevI7dbmqo/OrCjX4tqgMqwJNQLlQAlphqPfvwlF9+tIu6pGcVbSN3U9zyXzWIZCeleqEaWUeSeET4Ew==} dependencies: '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-provider': 1.0.13 @@ -12617,9 +12858,10 @@ packages: '@walletconnect/relay-auth': 1.0.4 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.6 - '@walletconnect/utils': 2.10.6 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 events: 3.3.0 + isomorphic-unfetch: 3.1.0 lodash.isequal: 4.5.0 uint8arrays: 3.1.1 transitivePeerDependencies: @@ -12636,6 +12878,46 @@ packages: - '@upstash/redis' - '@vercel/kv' - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: false + + /@walletconnect/core@2.11.2: + resolution: {integrity: sha512-bB4SiXX8hX3/hyBfVPC5gwZCXCl+OPj+/EDVM71iAO3TDsh78KPbrVAbDnnsbHzZVHlsMohtXX3j5XVsheN3+g==} + dependencies: + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/jsonrpc-ws-connection': 1.0.14 + '@walletconnect/keyvaluestorage': 1.1.1 + '@walletconnect/logger': 2.0.1 + '@walletconnect/relay-api': 1.0.9 + '@walletconnect/relay-auth': 1.0.4 + '@walletconnect/safe-json': 1.0.2 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.11.2 + '@walletconnect/utils': 2.11.2 + events: 3.3.0 + isomorphic-unfetch: 3.1.0 + lodash.isequal: 4.5.0 + uint8arrays: 3.1.1 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding - supports-color - utf-8-validate dev: false @@ -12665,18 +12947,52 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/ethereum-provider@2.10.6(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-bBQ+yUfxLv8VxNttgNKY7nED35gSVayO/BnLHbNKvyV1gpvSCla5mWB9MsXuQs70MK0g+/qtgRVSrOtdSubaNQ==} + /@walletconnect/ethereum-provider@2.11.0(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-YrTeHVjuSuhlUw7SQ6xBJXDuJ6iAC+RwINm9nVhoKYJSHAy3EVSJZOofMKrnecL0iRMtD29nj57mxAInIBRuZA==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.7 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/modal': 2.6.2(@types/react@18.2.33)(react@18.2.0) - '@walletconnect/sign-client': 2.10.6 - '@walletconnect/types': 2.10.6 - '@walletconnect/universal-provider': 2.10.6 - '@walletconnect/utils': 2.10.6 + '@walletconnect/sign-client': 2.11.0 + '@walletconnect/types': 2.11.0 + '@walletconnect/universal-provider': 2.11.0 + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@types/react' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - react + - supports-color + - utf-8-validate + dev: false + + /@walletconnect/ethereum-provider@2.11.2(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-BUDqee0Uy2rCZVkW5Ao3q6Ado/3fePYnFdryVF+YL6bPhj+xQZ5OfKodl+uvs7Rwq++O5wTX2RqOTzpW7+v+Mg==} + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.7 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/modal': 2.6.2(@types/react@18.2.33)(react@18.2.0) + '@walletconnect/sign-client': 2.11.2 + '@walletconnect/types': 2.11.2 + '@walletconnect/universal-provider': 2.11.2 + '@walletconnect/utils': 2.11.2 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -12760,21 +13076,6 @@ packages: - utf-8-validate dev: false - /@walletconnect/keyvaluestorage@1.0.2: - resolution: {integrity: sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ==} - peerDependencies: - '@react-native-async-storage/async-storage': 1.x - lokijs: 1.x - peerDependenciesMeta: - '@react-native-async-storage/async-storage': - optional: true - lokijs: - optional: true - dependencies: - safe-json-utils: 1.1.1 - tslib: 1.14.1 - dev: false - /@walletconnect/keyvaluestorage@1.1.1: resolution: {integrity: sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==} peerDependencies: @@ -12929,17 +13230,48 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/sign-client@2.10.6: - resolution: {integrity: sha512-EvUWjaZBQu2yKnH5/5F2qzbuiIuUN9ZgrNKgvXkw5z1Dq5RJCks0S9/MFlKH/ZSGqXnLl7uAzBXtoX4sMgbCMA==} + /@walletconnect/sign-client@2.11.0: + resolution: {integrity: sha512-H2ukscibBS+6WrzQWh+WyVBqO5z4F5et12JcwobdwgHnJSlqIoZxqnUYYWNCI5rUR5UKsKWaUyto4AE9N5dw4Q==} + dependencies: + '@walletconnect/core': 2.11.0 + '@walletconnect/events': 1.0.1 + '@walletconnect/heartbeat': 1.2.1 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.0.1 + '@walletconnect/time': 1.0.2 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: false + + /@walletconnect/sign-client@2.11.2: + resolution: {integrity: sha512-MfBcuSz2GmMH+P7MrCP46mVE5qhP0ZyWA0FyIH6/WuxQ6G+MgKsGfaITqakpRPsykWOJq8tXMs3XvUPDU413OQ==} dependencies: - '@walletconnect/core': 2.10.6 + '@walletconnect/core': 2.11.2 '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.6 - '@walletconnect/utils': 2.10.6 + '@walletconnect/types': 2.11.2 + '@walletconnect/utils': 2.11.2 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -12955,6 +13287,7 @@ packages: - '@upstash/redis' - '@vercel/kv' - bufferutil + - encoding - supports-color - utf-8-validate dev: false @@ -12965,22 +13298,33 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/types@2.10.2: - resolution: {integrity: sha512-luNV+07Wdla4STi9AejseCQY31tzWKQ5a7C3zZZaRK/di+rFaAAb7YW04OP4klE7tw/mJRGPTlekZElmHxO8kQ==} + /@walletconnect/types@2.11.0: + resolution: {integrity: sha512-AB5b1lrEbCGHxqS2vqfCkIoODieH+ZAUp9rA1O2ftrhnqDJiJK983Df87JhYhECsQUBHHfALphA8ydER0q+9sw==} dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/keyvaluestorage': 1.0.2 + '@walletconnect/keyvaluestorage': 1.1.1 '@walletconnect/logger': 2.0.1 events: 3.3.0 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' - - lokijs + - '@upstash/redis' + - '@vercel/kv' + - supports-color dev: false - /@walletconnect/types@2.10.6: - resolution: {integrity: sha512-WgHfiTG1yakmxheaBRiXhUdEmgxwrvsAdOIWaMf/spvrzVKYh6sHI3oyEEky5qj5jjiMiyQBeB57QamzCotbcQ==} + /@walletconnect/types@2.11.2: + resolution: {integrity: sha512-p632MFB+lJbip2cvtXPBQslpUdiw1sDtQ5y855bOlAGquay+6fZ4h1DcDePeKQDQM3P77ax2a9aNPZxV6y/h1Q==} dependencies: '@walletconnect/events': 1.0.1 '@walletconnect/heartbeat': 1.2.1 @@ -13004,17 +13348,48 @@ packages: - supports-color dev: false - /@walletconnect/universal-provider@2.10.6: - resolution: {integrity: sha512-CEivusqqoD31BhCTKp08DnrccfGjwD9MFjZs5BNRorDteRFE8zVm9LmP6DSiNJCw82ZajGlZThggLQ/BAATfwA==} + /@walletconnect/universal-provider@2.11.0: + resolution: {integrity: sha512-zgJv8jDvIMP4Qse/D9oIRXGdfoNqonsrjPZanQ/CHNe7oXGOBiQND2IIeX+tS0H7uNA0TPvctljCLiIN9nw4eA==} + dependencies: + '@walletconnect/jsonrpc-http-connection': 1.0.7 + '@walletconnect/jsonrpc-provider': 1.0.13 + '@walletconnect/jsonrpc-types': 1.0.3 + '@walletconnect/jsonrpc-utils': 1.0.8 + '@walletconnect/logger': 2.0.1 + '@walletconnect/sign-client': 2.11.0 + '@walletconnect/types': 2.11.0 + '@walletconnect/utils': 2.11.0 + events: 3.3.0 + transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' + - '@react-native-async-storage/async-storage' + - '@upstash/redis' + - '@vercel/kv' + - bufferutil + - encoding + - supports-color + - utf-8-validate + dev: false + + /@walletconnect/universal-provider@2.11.2: + resolution: {integrity: sha512-cNtIn5AVoDxKAJ4PmB8m5adnf5mYQMUamEUPKMVvOPscfGtIMQEh9peKsh2AN5xcRVDbgluC01Id545evFyymw==} dependencies: '@walletconnect/jsonrpc-http-connection': 1.0.7 '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 '@walletconnect/logger': 2.0.1 - '@walletconnect/sign-client': 2.10.6 - '@walletconnect/types': 2.10.6 - '@walletconnect/utils': 2.10.6 + '@walletconnect/sign-client': 2.11.2 + '@walletconnect/types': 2.11.2 + '@walletconnect/utils': 2.11.2 events: 3.3.0 transitivePeerDependencies: - '@azure/app-configuration' @@ -13035,8 +13410,8 @@ packages: - utf-8-validate dev: false - /@walletconnect/utils@2.10.2: - resolution: {integrity: sha512-syxXRpc2yhSknMu3IfiBGobxOY7fLfLTJuw+ppKaeO6WUdZpIit3wfuGOcc0Ms3ZPFCrGfyGOoZsCvgdXtptRg==} + /@walletconnect/utils@2.11.0: + resolution: {integrity: sha512-hxkHPlTlDQILHfIKXlmzgNJau/YcSBC3XHUSuZuKZbNEw3duFT6h6pm3HT/1+j1a22IG05WDsNBuTCRkwss+BQ==} dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 @@ -13046,19 +13421,30 @@ packages: '@walletconnect/relay-api': 1.0.9 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.2 + '@walletconnect/types': 2.11.0 '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0 query-string: 7.1.3 uint8arrays: 3.1.1 transitivePeerDependencies: + - '@azure/app-configuration' + - '@azure/cosmos' + - '@azure/data-tables' + - '@azure/identity' + - '@azure/keyvault-secrets' + - '@azure/storage-blob' + - '@capacitor/preferences' + - '@netlify/blobs' + - '@planetscale/database' - '@react-native-async-storage/async-storage' - - lokijs + - '@upstash/redis' + - '@vercel/kv' + - supports-color dev: false - /@walletconnect/utils@2.10.6: - resolution: {integrity: sha512-oRsWWhN2+hi3aiDXrQEOfysz6FHQJGXLsNQPVt+WIBJplO6Szmdau9dbleD88u1iiT4GKPqE0R9FOYvvPm1H/w==} + /@walletconnect/utils@2.11.2: + resolution: {integrity: sha512-LyfdmrnZY6dWqlF4eDrx5jpUwsB2bEPjoqR5Z6rXPiHJKUOdJt7az+mNOn5KTSOlRpd1DmozrBrWr+G9fFLYVw==} dependencies: '@stablelib/chacha20poly1305': 1.0.1 '@stablelib/hkdf': 1.0.1 @@ -13068,7 +13454,7 @@ packages: '@walletconnect/relay-api': 1.0.9 '@walletconnect/safe-json': 1.0.2 '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.10.6 + '@walletconnect/types': 2.11.2 '@walletconnect/window-getters': 1.0.1 '@walletconnect/window-metadata': 1.0.1 detect-browser: 5.3.0 @@ -13345,20 +13731,6 @@ packages: resolution: {integrity: sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==} dev: true - /abitype@0.10.3(typescript@5.3.2): - resolution: {integrity: sha512-tRN+7XIa7J9xugdbRzFv/95ka5ivR/sRe01eiWvM0HWWjHuigSZEACgKa0sj4wGuekTDtghCx+5Izk/cOi78pQ==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.22.0 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - dependencies: - typescript: 5.3.2 - dev: true - /abitype@0.8.7(typescript@5.1.6)(zod@3.22.4): resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} peerDependencies: @@ -13413,11 +13785,26 @@ packages: zod: 3.22.4 dev: false - /abitype@0.9.8(typescript@5.3.2): - resolution: {integrity: sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==} + /abitype@1.0.0(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.19.1 + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 5.1.6 + zod: 3.22.4 + dev: false + + /abitype@1.0.0(typescript@5.3.2): + resolution: {integrity: sha512-NMeMah//6bJ56H5XRj8QCV4AwuW6hB6zqz2LnhhLdcWVQOsXki6/Pn3APeqxCma62nXIcmZWdu1DlHWS74umVQ==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.22.0 peerDependenciesMeta: typescript: optional: true @@ -13427,6 +13814,20 @@ packages: typescript: 5.3.2 dev: false + /abitype@1.0.2(typescript@5.3.2): + resolution: {integrity: sha512-aFt4k2H+eiAKy/zxtnORa9iIb10BMBeWL18l8v4+QuwYEBXPxxjSB1bFZCzQmKPoj8m7j68K705l3uY+E2gAjg==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + dependencies: + typescript: 5.3.2 + dev: true + /abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -13538,10 +13939,6 @@ packages: clean-stack: 2.2.0 indent-string: 4.0.0 - /ahocorasick@1.0.2: - resolution: {integrity: sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA==} - dev: false - /ajv-formats@2.1.1(ajv@8.12.0): resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} peerDependencies: @@ -14476,6 +14873,7 @@ packages: /bignumber.js@9.1.2: resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + dev: true /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} @@ -14605,6 +15003,10 @@ packages: text-encoding-utf-8: 1.0.2 dev: false + /bowser@2.11.0: + resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} + dev: false + /boxen@6.2.1: resolution: {integrity: sha512-H4PEsJXfFI/Pt8sjDWbHlQPx4zL/bvSQjcilJmaulGt5mLDorHOHpmdXAJcBcmru7PhYSp/cDMWRko4ZUMFkSw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -15415,11 +15817,6 @@ packages: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} - /clsx@1.1.1: - resolution: {integrity: sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==} - engines: {node: '>=6'} - dev: false - /clsx@1.2.1: resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} engines: {node: '>=6'} @@ -15430,6 +15827,11 @@ packages: engines: {node: '>=6'} dev: false + /clsx@2.1.0: + resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==} + engines: {node: '>=6'} + dev: false + /cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} @@ -16023,7 +16425,6 @@ packages: node-fetch: 2.7.0 transitivePeerDependencies: - encoding - dev: true /cross-inspect@1.0.0: resolution: {integrity: sha512-4PFfn4b5ZN6FMNGSZlyb7wUhuN8wvj8t/VQHZdM4JsDcruGJ8L2kf9zao98QIrBPFCpdk27qst/AGTl7pL3ypQ==} @@ -16150,11 +16551,6 @@ packages: source-map: 0.6.1 dev: false - /css-what@5.1.0: - resolution: {integrity: sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==} - engines: {node: '>= 6'} - dev: false - /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} @@ -16166,6 +16562,7 @@ packages: /cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} + hasBin: true dev: false /cssnano-preset-advanced@5.3.10(postcss@8.4.32): @@ -16689,6 +17086,13 @@ packages: /dataloader@2.2.2: resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} + /date-fns@2.30.0: + resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} + engines: {node: '>=0.11'} + dependencies: + '@babel/runtime': 7.23.2 + dev: false + /dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} @@ -17379,6 +17783,14 @@ packages: safer-buffer: 2.1.2 dev: true + /eciesjs@0.3.18: + resolution: {integrity: sha512-RQhegEtLSyIiGJmFTZfvCTHER/fymipXFVx6OwSRYD6hOuy+6Kjpk0dGvIfP9kxn/smBpxQy71uxpGO406ITCw==} + dependencies: + '@types/secp256k1': 4.0.5 + futoin-hkdf: 1.5.3 + secp256k1: 5.0.0 + dev: false + /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -17468,13 +17880,13 @@ packages: dependencies: once: 1.4.0 - /engine.io-client@6.5.2: + /engine.io-client@6.5.2(bufferutil@4.0.8)(utf-8-validate@6.0.3): resolution: {integrity: sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg==} dependencies: '@socket.io/component-emitter': 3.1.0 debug: 4.3.4(supports-color@8.1.1) engine.io-parser: 5.2.1 - ws: 8.11.0 + ws: 8.11.0(bufferutil@4.0.8)(utf-8-validate@6.0.3) xmlhttprequest-ssl: 2.0.0 transitivePeerDependencies: - bufferutil @@ -18315,6 +18727,19 @@ packages: - supports-color dev: false + /eth-block-tracker@7.1.0: + resolution: {integrity: sha512-8YdplnuE1IK4xfqpf4iU7oBxnOYAc35934o083G8ao+8WM8QQtt/mVlAY6yIAdY1eMeLqg4Z//PZjJGmWGPMRg==} + engines: {node: '>=14.0.0'} + dependencies: + '@metamask/eth-json-rpc-provider': 1.0.1 + '@metamask/safe-event-emitter': 3.0.0 + '@metamask/utils': 5.0.2 + json-rpc-random-id: 1.0.1 + pify: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: false + /eth-ens-namehash@2.0.8: resolution: {integrity: sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==} dependencies: @@ -18360,6 +18785,17 @@ packages: pify: 5.0.0 dev: false + /eth-json-rpc-filters@6.0.1: + resolution: {integrity: sha512-ITJTvqoCw6OVMLs7pI8f4gG92n/St6x80ACtHodeS+IXmO0w+t1T5OOzfSt7KLSMLRkVUoexV7tztLgDxg+iig==} + engines: {node: '>=14.0.0'} + dependencies: + '@metamask/safe-event-emitter': 3.0.0 + async-mutex: 0.2.6 + eth-query: 2.1.2 + json-rpc-engine: 6.1.0 + pify: 5.0.0 + dev: false + /eth-lib@0.1.29: resolution: {integrity: sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ==} dependencies: @@ -18442,7 +18878,6 @@ packages: '@noble/hashes': 1.3.1 '@scure/bip32': 1.3.1 '@scure/bip39': 1.2.1 - dev: true /ethereumjs-abi@0.6.8: resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==} @@ -18587,7 +19022,6 @@ packages: /eventemitter2@6.4.7: resolution: {integrity: sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==} - dev: true /eventemitter3@4.0.4: resolution: {integrity: sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==} @@ -18598,7 +19032,6 @@ packages: /eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} - dev: true /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} @@ -18829,6 +19262,10 @@ packages: /fast-decode-uri-component@1.0.1: resolution: {integrity: sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==} + /fast-deep-equal@2.0.1: + resolution: {integrity: sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==} + dev: false + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -19558,6 +19995,11 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true + /futoin-hkdf@1.5.3: + resolution: {integrity: sha512-SewY5KdMpaoCeh7jachEWFsh1nNlaDjNHZXWqL5IGwtpEYHTgkr2+AMCgNwKWkcc0wpSYrZfR7he4WdmHFtDxQ==} + engines: {node: '>=8'} + dev: false + /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -20985,6 +21427,12 @@ packages: terser: 5.22.0 dev: false + /html-parse-stringify@3.0.1: + resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} + dependencies: + void-elements: 3.1.0 + dev: false + /html-rewriter-wasm@0.4.1: resolution: {integrity: sha512-lNovG8CMCCmcVB1Q7xggMSf7tqPCijZXaH4gL6iE8BFghdQCbaY5Met9i1x2Ex8m/cZHDUtXK9H6/znKamRP8Q==} dev: true @@ -21256,12 +21704,16 @@ packages: resolution: {integrity: sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==} dev: false - /i18n-js@4.3.2: - resolution: {integrity: sha512-n8gbEbQEueym2/q2yrZk5/xKWjFcKtg3/Escw4JHSVWa8qtKqP8j7se3UjkRbHlO/REqFA0V/MG1q8tEfyHeOA==} + /i18next-browser-languagedetector@7.2.0: + resolution: {integrity: sha512-U00DbDtFIYD3wkWsr2aVGfXGAj2TgnELzOX9qv8bT0aJtvPV9CRO77h+vgmHFBMe7LAxdwvT/7VkCWGya6L3tA==} dependencies: - bignumber.js: 9.1.2 - lodash: 4.17.21 - make-plural: 7.3.0 + '@babel/runtime': 7.23.2 + dev: false + + /i18next@22.5.1: + resolution: {integrity: sha512-8TGPgM3pAD+VRsMtUMNknRz3kzqwp/gPALrWMsDnmC1mKqJwpWyooQRLMcbTwq8z8YwSmuj+ZYvc+xCuEpkssA==} + dependencies: + '@babel/runtime': 7.23.2 dev: false /iconv-lite@0.4.24: @@ -23901,10 +24353,6 @@ packages: /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - /make-plural@7.3.0: - resolution: {integrity: sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==} - dev: false - /makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} dependencies: @@ -24419,7 +24867,6 @@ packages: engines: {node: '>=10'} dependencies: is-plain-obj: 2.1.0 - dev: true /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -24804,7 +25251,6 @@ packages: /micro-ftch@0.3.1: resolution: {integrity: sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==} - dev: true /micromark-core-commonmark@1.1.0: resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} @@ -25662,6 +26108,22 @@ packages: yallist: 4.0.0 dev: true + /mipd@0.0.5(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-gbKA784D2WKb5H/GtqEv+Ofd1S9Zj+Z/PGDIl1u1QAbswkxD28BQ5bSXQxkeBzPBABg1iDSbiwGG1XqlOxRspA==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 5.1.6 + viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: false + /mkdirp-classic@0.5.3: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} requiresBuild: true @@ -25734,6 +26196,10 @@ packages: resolution: {integrity: sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==} dev: true + /modern-ahocorasick@1.0.1: + resolution: {integrity: sha512-yoe+JbhTClckZ67b2itRtistFKf8yPYelHLc7e5xAwtNAXxM6wJTUx2C7QeVSJFDzKT7bCIFyBVybPMKvmB9AA==} + dev: false + /module-error@1.0.2: resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} engines: {node: '>=10'} @@ -26023,6 +26489,10 @@ packages: /node-addon-api@2.0.2: resolution: {integrity: sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==} + /node-addon-api@5.1.0: + resolution: {integrity: sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==} + dev: false + /node-addon-api@7.0.0: resolution: {integrity: sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==} dev: false @@ -26269,6 +26739,14 @@ packages: engines: {node: '>=16'} dev: false + /obj-multiplex@1.0.0: + resolution: {integrity: sha512-0GNJAOsHoBHeNTvl5Vt6IWnpUEcc3uSRxzBri7EDyIcMgYvnY2JL2qdeV5zTMjWQX5OHcD5amcW2HFfDh0gjIA==} + dependencies: + end-of-stream: 1.4.4 + once: 1.4.0 + readable-stream: 2.3.8 + dev: false + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -27070,6 +27548,11 @@ packages: engines: {node: '>=10.13.0'} dev: false + /pony-cause@2.1.10: + resolution: {integrity: sha512-3IKLNXclQgkU++2fSi93sQ6BznFuxSLB11HdvZQ6JW/spahf/P1pAHBQEahr20rs0htZW0UDkM1HmA+nZkXKsw==} + engines: {node: '>=12.0.0'} + dev: false + /postcss-calc@8.2.4(postcss@8.4.32): resolution: {integrity: sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==} peerDependencies: @@ -27623,6 +28106,10 @@ packages: engines: {node: '>=6'} dev: false + /process-nextick-args@1.0.7: + resolution: {integrity: sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==} + dev: false + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -27790,7 +28277,7 @@ packages: /puppeteer@18.2.1: resolution: {integrity: sha512-7+UhmYa7wxPh2oMRwA++k8UGVDxh3YdWFB52r9C3tM81T6BU7cuusUSxImz0GEYSOYUKk/YzIhkQ6+vc0gHbxQ==} engines: {node: '>=14.1.0'} - deprecated: < 21.5.0 is no longer supported + deprecated: < 21.8.0 is no longer supported requiresBuild: true dependencies: https-proxy-agent: 5.0.1 @@ -27818,15 +28305,19 @@ packages: resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} engines: {node: '>=6.0.0'} - /qrcode@1.5.0: - resolution: {integrity: sha512-9MgRpgVc+/+47dFvQeD6U2s0Z92EsKzcHogtum4QB+UNd025WOJSHvn/hjk9xmzj7Stj95CyUAs31mrjxliEsQ==} - engines: {node: '>=10.13.0'} - hasBin: true + /qr-code-styling@1.6.0-rc.1: + resolution: {integrity: sha512-ModRIiW6oUnsP18QzrRYZSc/CFKFKIdj7pUs57AEVH20ajlglRpN3HukjHk0UbNMTlKGuaYl7Gt6/O5Gg2NU2Q==} dependencies: - dijkstrajs: 1.0.3 - encode-utf8: 1.0.3 - pngjs: 5.0.0 - yargs: 15.4.1 + qrcode-generator: 1.4.4 + dev: false + + /qrcode-generator@1.4.4: + resolution: {integrity: sha512-HM7yY8O2ilqhmULxGMpcHSF1EhJJ9yBj8gvDEuZ6M+KGJ0YY2hKpnXvRD+hZPLrDVck3ExIGhmPtSdcjC+guuw==} + dev: false + + /qrcode-terminal-nooctal@0.12.1: + resolution: {integrity: sha512-jy/kkD0iIMDjTucB+5T6KBsnirlhegDH47vHgrj5MejchSQmi/EAMM0xMFeePgV9CJkkAapNakpVUWYgHvtdKg==} + hasBin: true dev: false /qrcode@1.5.3: @@ -28073,6 +28564,27 @@ packages: react-fast-compare: 3.2.2 shallowequal: 1.1.0 + /react-i18next@13.5.0(i18next@22.5.1)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0): + resolution: {integrity: sha512-CFJ5NDGJ2MUyBohEHxljOq/39NQ972rh1ajnadG9BjTk+UXbHLq4z5DKEbEQBDoIhUmmbuS/fIMJKo6VOax1HA==} + peerDependencies: + i18next: '>= 23.2.3' + react: '>= 16.8.0' + react-dom: '*' + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@babel/runtime': 7.23.2 + html-parse-stringify: 3.0.1 + i18next: 22.5.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) + dev: false + /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -28154,6 +28666,18 @@ packages: resolution: {integrity: sha512-WJr256xBquk7X2O83QYWKqgLg43Zg3SrgjPc/kr0gCD2LoXA+2L72BW4cmstH12GbGeutqs/eXk3jgDQ2iCSvQ==} dev: false + /react-native-webview@11.26.1(react-native@0.72.6)(react@18.2.0): + resolution: {integrity: sha512-hC7BkxOpf+z0UKhxFSFTPAM4shQzYmZHoELa6/8a/MspcjEP7ukYKpuSUTLDywQditT8yI9idfcKvfZDKQExGw==} + peerDependencies: + react: '*' + react-native: '*' + dependencies: + escape-string-regexp: 2.0.0 + invariant: 2.2.4 + react: 18.2.0 + react-native: 0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0) + dev: false + /react-native@0.72.6(@babel/core@7.23.5)(@babel/preset-env@7.23.5)(react@18.2.0): resolution: {integrity: sha512-RafPY2gM7mcrFySS8TL8x+TIO3q7oAlHpzEmC7Im6pmXni6n1AuufGaVh0Narbr1daxstw7yW7T9BKW5dpVc2A==} engines: {node: '>=16'} @@ -28228,8 +28752,8 @@ packages: tslib: 2.6.2 dev: false - /react-remove-scroll@2.5.4(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-xGVKJJr0SJGQVirVFAUZ2k1QLyO6m+2fy0l8Qawbp5Jgrv3DeLalrfMNBFSlmz5kriGGzsVBtGVnf4pTKIhhWA==} + /react-remove-scroll@2.5.7(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} engines: {node: '>=10'} peerDependencies: '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -28419,6 +28943,18 @@ packages: string_decoder: 0.10.31 dev: true + /readable-stream@2.3.3: + resolution: {integrity: sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 1.0.7 + safe-buffer: 5.1.2 + string_decoder: 1.0.3 + util-deprecate: 1.0.2 + dev: false + /readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} dependencies: @@ -29134,6 +29670,22 @@ packages: rollup-plugin-inject: 3.0.2 dev: true + /rollup-plugin-visualizer@5.12.0: + resolution: {integrity: sha512-8/NU9jXcHRs7Nnj07PF2o4gjxmm9lXIrZ8r175bT9dK8qoLlvKTwRMArRCMgpMGlq8CTLugRvEmyMeMXIU2pNQ==} + engines: {node: '>=14'} + hasBin: true + peerDependencies: + rollup: 2.x || 3.x || 4.x + peerDependenciesMeta: + rollup: + optional: true + dependencies: + open: 8.4.2 + picomatch: 2.3.1 + source-map: 0.7.4 + yargs: 17.7.2 + dev: false + /rollup-pluginutils@2.8.2: resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} dependencies: @@ -29284,10 +29836,6 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - /safe-json-utils@1.1.1: - resolution: {integrity: sha512-SAJWGKDs50tAbiDXLf89PDwt9XYkWyANFWVzn4dTXl5QyI8t2o/bW5/OJl3lvc2WVU4MEpTo9Yz5NVFNsp+OJQ==} - dev: false - /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: @@ -29401,6 +29949,16 @@ packages: node-addon-api: 2.0.2 node-gyp-build: 4.6.1 + /secp256k1@5.0.0: + resolution: {integrity: sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA==} + engines: {node: '>=14.0.0'} + requiresBuild: true + dependencies: + elliptic: 6.5.4 + node-addon-api: 5.1.0 + node-gyp-build: 4.6.1 + dev: false + /section-matter@1.0.0: resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} engines: {node: '>=4'} @@ -29625,6 +30183,7 @@ packages: /sha.js@2.4.11: resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true dependencies: inherits: 2.0.4 safe-buffer: 5.2.1 @@ -29816,13 +30375,13 @@ packages: dot-case: 3.0.4 tslib: 2.6.2 - /socket.io-client@4.7.2: + /socket.io-client@4.7.2(bufferutil@4.0.8)(utf-8-validate@6.0.3): resolution: {integrity: sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w==} engines: {node: '>=10.0.0'} dependencies: '@socket.io/component-emitter': 3.1.0 debug: 4.3.4(supports-color@8.1.1) - engine.io-client: 6.5.2 + engine.io-client: 6.5.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) socket.io-parser: 4.2.4 transitivePeerDependencies: - bufferutil @@ -30342,6 +30901,12 @@ packages: resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} dev: true + /string_decoder@1.0.3: + resolution: {integrity: sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==} + dependencies: + safe-buffer: 5.1.2 + dev: false + /string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} dependencies: @@ -31586,6 +32151,10 @@ packages: /ua-parser-js@1.0.36: resolution: {integrity: sha512-znuyCIXzl8ciS3+y3fHJI/2OhQIXbXw9MWC/o3qwyR+RGppjZHrM27CGFSKCJXi2Kctiz537iOu2KnXs1lMQhw==} + /ua-parser-js@1.0.37: + resolution: {integrity: sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==} + dev: false + /ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} @@ -32093,6 +32662,14 @@ packages: dependencies: node-gyp-build: 4.6.1 + /utf-8-validate@6.0.3: + resolution: {integrity: sha512-uIuGf9TWQ/y+0Lp+KGZCMuJWc3N9BHA+l/UmHd/oUHwJJDeysyTRxNQVkbzsIWfGFbRe3OcgML/i0mvVRPOyDA==} + engines: {node: '>=6.14.2'} + requiresBuild: true + dependencies: + node-gyp-build: 4.6.1 + dev: false + /utf8@3.0.0: resolution: {integrity: sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==} @@ -32343,8 +32920,31 @@ packages: - zod dev: false - /viem@1.21.4(typescript@5.3.2): - resolution: {integrity: sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==} + /viem@2.9.4(typescript@5.1.6)(zod@3.22.4): + resolution: {integrity: sha512-j239PwRYc9WU7GOogfJ5Iu/5jwYaidpR85gLxKCwQmuXkNILKiRHntEM15EAtC9bcgaa9oklYwQ+/MlLU593/A==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.10.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@scure/bip32': 1.3.2 + '@scure/bip39': 1.2.1 + abitype: 1.0.0(typescript@5.1.6)(zod@3.22.4) + isows: 1.0.3(ws@8.13.0) + typescript: 5.1.6 + ws: 8.13.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: false + + /viem@2.9.4(typescript@5.3.2): + resolution: {integrity: sha512-j239PwRYc9WU7GOogfJ5Iu/5jwYaidpR85gLxKCwQmuXkNILKiRHntEM15EAtC9bcgaa9oklYwQ+/MlLU593/A==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -32356,7 +32956,7 @@ packages: '@noble/hashes': 1.3.2 '@scure/bip32': 1.3.2 '@scure/bip39': 1.2.1 - abitype: 0.9.8(typescript@5.3.2) + abitype: 1.0.0(typescript@5.3.2) isows: 1.0.3(ws@8.13.0) typescript: 5.3.2 ws: 8.13.0 @@ -32599,6 +33199,11 @@ packages: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} dev: false + /void-elements@3.1.0: + resolution: {integrity: sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==} + engines: {node: '>=0.10.0'} + dev: false + /vscode-oniguruma@1.7.0: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} dev: false @@ -32618,25 +33223,24 @@ packages: resolution: {integrity: sha512-8l7sIOd3i5GWfTWciPL0+ff/FK/deVK2Q6FN+MPz4vfUcD78i2M/49XJTwF6aml91uIiuXJEsLKWMB2cw/mtKg==} dev: true - /wagmi@1.4.12(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4): - resolution: {integrity: sha512-QRxpjhdMlZmbYTfn9VQkQMKq+l3kwA1O7tF10vaykPrjbGX+IIlyn72ib9oqW9BfQO7n/Sf/mnVz1zbxRhGPWA==} + /wagmi@2.5.13(@tanstack/react-query@4.36.1)(@types/react@18.2.33)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4): + resolution: {integrity: sha512-0+38DUGfLqwrzYx9Aza5ed+v2pO1qKN04egrcICaH4ff1N0Nj3iGlPBZ7HHyu+20r8qEKXIkW//6TPQMlc64YQ==} peerDependencies: - react: '>=17.0.0' + '@tanstack/react-query': '>=5.0.0' + react: '>=18' typescript: '>=5.0.4' - viem: '>=0.3.35' + viem: 2.x peerDependenciesMeta: typescript: optional: true dependencies: - '@tanstack/query-sync-storage-persister': 4.36.1 '@tanstack/react-query': 4.36.1(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0) - '@tanstack/react-query-persist-client': 4.36.1(@tanstack/react-query@4.36.1) - '@wagmi/core': 1.4.12(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@1.21.4)(zod@3.22.4) - abitype: 0.8.7(typescript@5.1.6)(zod@3.22.4) + '@wagmi/connectors': 4.1.19(@types/react@18.2.33)(@wagmi/core@2.6.10)(react-dom@18.2.0)(react-native@0.72.6)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) + '@wagmi/core': 2.6.10(@types/react@18.2.33)(react@18.2.0)(typescript@5.1.6)(viem@2.9.4)(zod@3.22.4) react: 18.2.0 typescript: 5.1.6 use-sync-external-store: 1.2.0(react@18.2.0) - viem: 1.21.4(typescript@5.1.6)(zod@3.22.4) + viem: 2.9.4(typescript@5.1.6)(zod@3.22.4) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -32648,15 +33252,16 @@ packages: - '@netlify/blobs' - '@planetscale/database' - '@react-native-async-storage/async-storage' + - '@tanstack/query-core' - '@types/react' - '@upstash/redis' - '@vercel/kv' - bufferutil - encoding - immer - - lokijs - react-dom - react-native + - rollup - supports-color - utf-8-validate - zod @@ -33012,10 +33617,21 @@ packages: pvtsutils: 1.3.5 tslib: 2.6.2 + /webextension-polyfill-ts@0.25.0: + resolution: {integrity: sha512-ikQhwwHYkpBu00pFaUzIKY26I6L87DeRI+Q6jBT1daZUNuu8dSrg5U9l/ZbqdaQ1M/TTSPKeAa3kolP5liuedw==} + deprecated: This project has moved to @types/webextension-polyfill + dependencies: + webextension-polyfill: 0.7.0 + dev: false + /webextension-polyfill@0.10.0: resolution: {integrity: sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g==} dev: false + /webextension-polyfill@0.7.0: + resolution: {integrity: sha512-su48BkMLxqzTTvPSE1eWxKToPS2Tv5DLGxKexLEVpwFd6Po6N8hhSLIvG6acPAg7qERoEaDL+Y5HQJeJeml5Aw==} + dev: false + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -33514,7 +34130,7 @@ packages: utf-8-validate: optional: true - /ws@8.11.0: + /ws@8.11.0(bufferutil@4.0.8)(utf-8-validate@6.0.3): resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} engines: {node: '>=10.0.0'} peerDependencies: @@ -33525,6 +34141,9 @@ packages: optional: true utf-8-validate: optional: true + dependencies: + bufferutil: 4.0.8 + utf-8-validate: 6.0.3 dev: false /ws@8.12.0: @@ -33840,8 +34459,8 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false - /zustand@4.4.4(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-5UTUIAiHMNf5+mFp7/AnzJXS7+XxktULFN0+D1sCiZWyX7ZG+AQpqs2qpYrynRij4QvoDdCD+U+bmg/cG3Ucxw==} + /zustand@4.4.1(@types/react@18.2.33)(react@18.2.0): + resolution: {integrity: sha512-QCPfstAS4EBiTQzlaGP1gmorkh/UL1Leaj2tdj+zZCZ/9bm0WS7sI2wnfD5lpOszFqWJ1DcPnGoY8RDL61uokw==} engines: {node: '>=12.7.0'} peerDependencies: '@types/react': '>=16.8' diff --git a/sdk/package.json b/sdk/package.json index 3ac4d84b..f03761f3 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "1.4.3", + "version": "1.5.0", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", @@ -35,7 +35,7 @@ "graphql": "^16.8.1", "loglevel": "^1.8.1", "urql": "^4.0.6", - "viem": "^1.21.4" + "viem": "^2.9.4" }, "devDependencies": { "@babel/core": "^7.23.5", @@ -52,7 +52,7 @@ "@types/node": "^18.11.17", "@types/sinon": "^17.0.2", "@viem/anvil": "^0.0.6", - "abitype": "^0.10.3", + "abitype": "^1.0.2", "chai": "^4.3.7", "chai-assertions-count": "^1.0.2", "chai-subset": "^1.6.0", diff --git a/sdk/src/client.ts b/sdk/src/client.ts index f05c8db6..ac677b92 100644 --- a/sdk/src/client.ts +++ b/sdk/src/client.ts @@ -1,5 +1,5 @@ import { HypercertMinterAbi } from "@hypercerts-org/contracts"; -import { Account, ByteArray, GetContractReturnType, Hex, PublicClient, WalletClient, getContract } from "viem"; +import { Account, ByteArray, Hex, PublicClient, WalletClient, getContract } from "viem"; import { HypercertEvaluator } from "./evaluations"; import { HypercertIndexer } from "./indexer"; import { HypercertsStorage } from "./storage"; @@ -99,25 +99,11 @@ export class HypercertClient implements HypercertClientInterface { return this._indexer; } - /** - * Gets the HypercertMinter contract used by the client. - * @returns The contract. - * @deprecated Use getDeployments instead. - */ - get contract(): GetContractReturnType { - return getContract({ - address: this._config.addresses?.HypercertMinterUUPS as `0x${string}`, - abi: HypercertMinterAbi, - publicClient: this._publicClient, - }); - } - /** * Gets the contract addresses and graph urls for the provided `chainId` * @returns The addresses, graph name and graph url. - * @deprecated Use getDeployments instead. */ - getDeployment = (chainId: SupportedChainIds) => { + getDeployments = (chainId: SupportedChainIds) => { return DEPLOYMENTS[chainId]; }; @@ -168,7 +154,7 @@ export class HypercertClient implements HypercertClientInterface { getTransferRestrictions = async (fractionId: bigint): Promise => { const readContract = getContract({ ...this.getContractConfig(), - publicClient: this._publicClient, + client: { public: this._publicClient }, }); return readContract.read.readTransferRestriction([fractionId]) as Promise; @@ -299,7 +285,7 @@ export class HypercertClient implements HypercertClientInterface { const readContract = getContract({ ...this.getContractConfig(), - publicClient: this._publicClient, + client: { public: this._publicClient }, }); const fractionOwner = (await readContract.read.ownerOf([fractionId])) as `0x${string}`; @@ -343,7 +329,7 @@ export class HypercertClient implements HypercertClientInterface { const readContract = getContract({ ...this.getContractConfig(), - publicClient: this._publicClient, + client: { public: this._publicClient }, }); const fractions = await Promise.all( @@ -381,7 +367,7 @@ export class HypercertClient implements HypercertClientInterface { const readContract = getContract({ ...this.getContractConfig(), - publicClient: this._publicClient, + client: { public: this._publicClient }, }); const claimOwner = (await readContract.read.ownerOf([claimId])) as `0x${string}`; @@ -497,7 +483,7 @@ export class HypercertClient implements HypercertClientInterface { return getContract({ address: this.config.addresses.HypercertMinterUUPS as `0x${string}`, abi: HypercertMinterAbi, - publicClient: this._publicClient, + client: { public: this._publicClient }, }); }; @@ -528,11 +514,15 @@ export class HypercertClient implements HypercertClientInterface { overrides?: SupportedOverrides, ) => { try { + // Need to get the contract config before passing it to the simulateContract method + const config = this.getContractConfig(); + const { request } = await this._publicClient.simulateContract({ functionName, account, args, - ...this.getContractConfig(), + abi: HypercertMinterAbi, + address: config.address, ...this.getCleanedOverrides(overrides), }); diff --git a/sdk/src/indexer/gql/graphql.ts b/sdk/src/indexer/gql/graphql.ts index 16905658..73299a23 100644 --- a/sdk/src/indexer/gql/graphql.ts +++ b/sdk/src/indexer/gql/graphql.ts @@ -22,6 +22,11 @@ export type Scalars = { * */ Int8: { input: any; output: any }; + /** + * A string representation of microseconds UNIX timestamp (16 digits) + * + */ + Timestamp: { input: any; output: any }; }; export type AcceptedToken = { @@ -1085,6 +1090,8 @@ export type _Block_ = { hash?: Maybe; /** The block number */ number: Scalars["Int"]["output"]; + /** The hash of the parent block */ + parentHash?: Maybe; /** Integer representation of the timestamp stored in blocks for the chain */ timestamp?: Maybe; }; diff --git a/sdk/src/types/client.ts b/sdk/src/types/client.ts index fab055bc..4a5b1b90 100644 --- a/sdk/src/types/client.ts +++ b/sdk/src/types/client.ts @@ -4,8 +4,7 @@ import { HypercertIndexer } from "../indexer"; import { AllowlistEntry, TransferRestrictions } from "./hypercerts"; import { HypercertMetadata } from "./metadata"; -import { ByteArray, Chain, Hex, PublicClient, WalletClient, GetContractReturnType } from "viem"; -import { HypercertMinterAbi } from "@hypercerts-org/contracts"; +import { ByteArray, Chain, Hex, PublicClient, WalletClient } from "viem"; /** * Enum to verify the supported chainIds @@ -161,7 +160,6 @@ export interface HypercertClientState { storage: HypercertStorageInterface; /** The indexer used by the client. */ indexer: HypercertIndexer; - contract: GetContractReturnType; } /** @@ -172,7 +170,7 @@ export interface HypercertClientMethods { * Gets the contract addresses and graph urls for the provided `chainId` * @returns The addresses, graph name and graph url. */ - getDeployment: (chainId: SupportedChainIds) => Partial; + getDeployments: (chainId: SupportedChainIds) => Partial; /** * Mints a new claim. diff --git a/sdk/src/validator/index.ts b/sdk/src/validator/index.ts index 6a25b92d..75f2150b 100644 --- a/sdk/src/validator/index.ts +++ b/sdk/src/validator/index.ts @@ -118,7 +118,7 @@ const validateAllowlist = (data: AllowlistEntry[], units: bigint): ValidationRes errors["units"] = "Total units in allowlist must be greater than 0"; } - const filteredAddresses = data.filter((entry) => !isAddress(entry.address)); + const filteredAddresses = data.filter((entry) => !isAddress(entry.address.toLowerCase())); if (filteredAddresses.length > 0) { errors["address"] = filteredAddresses.map((entry) => entry.address); } @@ -203,7 +203,7 @@ const validateSimpleTextEvaluationData = (data: SimpleTextEvaluation): Validatio * @throws {MintingError} Will throw a `MintingError` if the signer address is invalid or if the Merkle proof verification fails. */ function verifyMerkleProof(root: string, signerAddress: string, units: bigint, proof: string[]): void { - if (!isAddress(signerAddress)) { + if (!isAddress(signerAddress.toLowerCase())) { throw new MintingError("Invalid address", { signerAddress }); }