Skip to content

Commit

Permalink
feat(client): optional public client
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Jun 12, 2024
1 parent 59d86c9 commit f3f894e
Show file tree
Hide file tree
Showing 9 changed files with 483 additions and 1,744 deletions.
2,067 changes: 398 additions & 1,669 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions sdk/.env.template
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# Specifies the contract address to use for the Hypercert system.
CONTRACT_ADDRESS=0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07

# Specifies the private key to use for signing transactions.
PRIVATE_KEY=your-private-key

# Specifies the NFT.storage API token to use for storing Hypercert metadata.
NFT_STORAGE_TOKEN=your-nft-storage-token

## OR ##

# Specifies the NFT.storage API token to use for storing Hypercert metadata in a Next.js application.
NEXT_PUBLIC_NFT_STORAGE_TOKEN=your-next-public-nft-storage-token

# Specifies the Web3.storage API token to use for storing Hypercert data.
WEB3_STORAGE_TOKEN=your-web3-storage-token

## OR ##

# Specifies the Web3.storage API token to use for storing Hypercert data in a Next.js application.
NEXT_PUBLIC_WEB3_STORAGE_TOKEN=your-next-public-web3-storage-token

# Specifies the log level output threshold.
# "error"
Expand Down
10 changes: 6 additions & 4 deletions sdk/migrationV1_V2.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Updated environment initialization

- Initialize the client with `{environment: "test"` or `{environment: "production"}` instead of providing a chainID.
- Initialize the client with `{environment: "test"}` or `{environment: "production"}` instead of providing a chainID.
This will enable queries to the correct graph.
- For reading evm state, we follow the publicClient's connected chain.
- WalletClient is not required. When initializing without a walletClient, or when the walletClient is set to a chain not
supported in the environment, the SDK will default to read only mode.
- `WalletClient` is not required. When initializing without a wallet client, or when the wallet client is set to a chain
not supported in the environment, the SDK will default to read only mode.
- `PublicClient` is not required. This client is mostly used for transaction simulation. When initializing without a
publicClient, the SDK will default to a public client provided by `viem` for the chain specified by the
`WalletClient`.

# Updated Graph client and queries

Expand Down
6 changes: 3 additions & 3 deletions sdk/src/__generated__/gql/gql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/src/__generated__/gql/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f3f894e

Please sign in to comment.