@provable-games/budokan-sdk 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,8 @@ interface BudokanClientConfig {
6
6
  apiBaseUrl: string;
7
7
  wsUrl?: string;
8
8
  rpcUrl?: string;
9
+ /** Custom headers to send with every RPC request (e.g. Authorization). */
10
+ rpcHeaders?: Record<string, string>;
9
11
  chain?: "mainnet" | "sepolia";
10
12
  provider?: RpcProvider;
11
13
  viewerAddress?: string;
@@ -6,6 +6,8 @@ interface BudokanClientConfig {
6
6
  apiBaseUrl: string;
7
7
  wsUrl?: string;
8
8
  rpcUrl?: string;
9
+ /** Custom headers to send with every RPC request (e.g. Authorization). */
10
+ rpcHeaders?: Record<string, string>;
9
11
  chain?: "mainnet" | "sepolia";
10
12
  provider?: RpcProvider;
11
13
  viewerAddress?: string;
package/dist/index.cjs CHANGED
@@ -596,15 +596,15 @@ var CHAINS = {
596
596
  rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
597
597
  apiBaseUrl: "https://budokan-api-production.up.railway.app",
598
598
  wsUrl: "wss://budokan-api-production.up.railway.app/ws",
599
- budokanAddress: "0x06137ee50f57d08e1d0d758045e45982e2f5ef4826091ed4db136e7afbafecce",
600
- viewerAddress: "0x075d1b9f1a9751e6b8f8b5a4ca8e721f10c58d87607e703cda062e512a434443"
599
+ budokanAddress: "0x020239968a74f3e190d1b5aa0c6316845062a00cb98f787d661fd4aa860553de",
600
+ viewerAddress: "0x00ace1cce7933fbf0d7a2f32c3b5d4c36e63462f81c7845b6d7ac5d8dbdbefa4"
601
601
  },
602
602
  sepolia: {
603
603
  rpcUrl: "https://starknet-sepolia.public.blastapi.io",
604
604
  apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
605
605
  wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
606
- budokanAddress: "0x0072a26c29ba5021508bbbb8487663a2a536b8a926acf388d3d772961bd063e0",
607
- viewerAddress: "0x06bef644110a02c1b075b539953c707cd03b4bb32b42f5f1b0b0090b5139529f"
606
+ budokanAddress: "0x02a97de0b33fb115f5c32a58232d9941c4a5b2598aa71d30c094076cc592f94d",
607
+ viewerAddress: "0x001f2be7ed811bfa859f8f6cf72d2458f36103ac172ff8e65a630bbcc6cf98c9"
608
608
  }
609
609
  };
610
610
  function getChainConfig(chain) {
@@ -790,9 +790,12 @@ async function getStarknet() {
790
790
  }
791
791
  return starknetModule;
792
792
  }
793
- async function createProvider(rpcUrl) {
793
+ async function createProvider(rpcUrl, headers) {
794
794
  const { RpcProvider: StarknetRpcProvider } = await getStarknet();
795
- const provider = new StarknetRpcProvider({ nodeUrl: rpcUrl });
795
+ const provider = new StarknetRpcProvider({
796
+ nodeUrl: rpcUrl,
797
+ ...headers && { headers }
798
+ });
796
799
  return provider;
797
800
  }
798
801
  async function createContract(abi, address, provider) {
@@ -2421,7 +2424,10 @@ var BudokanClient = class {
2421
2424
  this.cachedProvider = this.resolvedConfig.provider;
2422
2425
  return this.cachedProvider;
2423
2426
  }
2424
- this.cachedProvider = await createProvider(this.resolvedConfig.rpcUrl);
2427
+ this.cachedProvider = await createProvider(
2428
+ this.resolvedConfig.rpcUrl,
2429
+ this.resolvedConfig.rpcHeaders
2430
+ );
2425
2431
  return this.cachedProvider;
2426
2432
  }
2427
2433
  async getViewerContract() {