Skip to content

Commit ce88355

Browse files
committed
allow public client opts
1 parent e24ed63 commit ce88355

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@perennial/sdk",
3-
"version": "0.0.4-alpha.4",
3+
"version": "0.0.4-alpha.5",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/Perennial/index.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import { HermesClient } from '@pythnetwork/hermes-client'
22
import { GraphQLClient } from 'graphql-request'
3-
import { Address, Chain, PublicClient, Transport, WalletClient, createPublicClient, http } from 'viem'
3+
import {
4+
Address,
5+
Chain,
6+
PublicClient,
7+
PublicClientConfig,
8+
Transport,
9+
WalletClient,
10+
createPublicClient,
11+
http,
12+
} from 'viem'
413

514
import { ChainMarkets, SupportedChainId, SupportedMarket } from '..'
615
import { BackupPythClient, DefaultChain, chainIdToChainMap } from '../constants/network'
@@ -24,6 +33,7 @@ export type SDKConfig = {
2433
walletClient?: WalletClient
2534
operatingFor?: Address
2635
supportedMarkets?: SupportedMarket[]
36+
publicClientOpts?: Partial<Omit<PublicClientConfig, 'transport' | 'chain'>>
2737
}
2838

2939
/**
@@ -70,6 +80,7 @@ export default class PerennialSDK {
7080
batch: {
7181
multicall: true,
7282
},
83+
...config.publicClientOpts,
7384
})
7485
this._oracleClients = {
7586
pyth: this.buildPythClients(config.pythUrl),

0 commit comments

Comments
 (0)