@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.
- package/dist/{client-eg3Ink5N.d.cts → client-CYj1Iw_w.d.cts} +2 -0
- package/dist/{client-eg3Ink5N.d.ts → client-CYj1Iw_w.d.ts} +2 -0
- package/dist/index.cjs +13 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +13 -7
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +13 -7
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
|
@@ -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: "
|
|
600
|
-
viewerAddress: "
|
|
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: "
|
|
607
|
-
viewerAddress: "
|
|
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({
|
|
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(
|
|
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() {
|