@provable-games/budokan-sdk 0.1.15 → 0.1.17

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.
@@ -151,6 +151,9 @@ interface Prize {
151
151
  tokenId: string | null;
152
152
  distributionType: string | null;
153
153
  distributionWeight: number | null;
154
+ /** Populated only when `distributionType === "custom"`. Each entry is a u16
155
+ * basis-point share summing to 10000, one per paid position. */
156
+ distributionShares: number[] | null;
154
157
  distributionCount: number | null;
155
158
  sponsorAddress: string;
156
159
  }
@@ -151,6 +151,9 @@ interface Prize {
151
151
  tokenId: string | null;
152
152
  distributionType: string | null;
153
153
  distributionWeight: number | null;
154
+ /** Populated only when `distributionType === "custom"`. Each entry is a u16
155
+ * basis-point share summing to 10000, one per paid position. */
156
+ distributionShares: number[] | null;
154
157
  distributionCount: number | null;
155
158
  sponsorAddress: string;
156
159
  }
package/dist/index.cjs CHANGED
@@ -600,15 +600,15 @@ var CHAINS = {
600
600
  rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
601
601
  apiBaseUrl: "https://budokan-api-production.up.railway.app",
602
602
  wsUrl: "wss://budokan-api-production.up.railway.app/ws",
603
- budokanAddress: "0x0765e6f07c1a5cebe08aba7f840741242dffb1ed77ac619120501f540ec9a52a",
604
- viewerAddress: "0x0232fb32bd06e38f3555000f255c01812198418d5fced3b6246900725bf2f4d1"
603
+ budokanAddress: "0x00f4941e73cc38f67f79ae1f7cdae48f28ca5a6c0e013f6136818e777f61c6ee",
604
+ viewerAddress: "0x027c264f4417dfd25d0626bce7304e9b3140ab06afeaf639b2678d2a05f1beb3"
605
605
  },
606
606
  sepolia: {
607
607
  rpcUrl: "https://starknet-sepolia.public.blastapi.io",
608
608
  apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
609
609
  wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
610
- budokanAddress: "0x0105573bf9184f0a3da78dda70a87055e6aafc7b3fb6e331732a0d25675b7be5",
611
- viewerAddress: "0x0414fe2f48db1e3598a83f017d17b4d06cec180b160141fea9244054267c1ff1"
610
+ budokanAddress: "0x0169083e63f3caff2c15f83eb238b1f4ab8f74903c0e6b5d433b448972c578d4",
611
+ viewerAddress: "0x02cc4473948170cf42c2f3abc6391fd4401650375ee8e4661b7b6966cda4f15e"
612
612
  }
613
613
  };
614
614
  function getChainConfig(chain) {
@@ -1014,6 +1014,7 @@ function parsePrize(raw) {
1014
1014
  let tokenId = null;
1015
1015
  let distributionType = null;
1016
1016
  let distributionWeight = null;
1017
+ let distributionShares = null;
1017
1018
  let distributionCount = null;
1018
1019
  let payoutPosition = 0;
1019
1020
  if (tokenTypeData) {
@@ -1032,7 +1033,11 @@ function parsePrize(raw) {
1032
1033
  if (distType) {
1033
1034
  distributionType = distType.toLowerCase();
1034
1035
  const distValue = distVariant[distType];
1035
- distributionWeight = distValue != null ? Number(distValue) : null;
1036
+ if (distributionType === "custom") {
1037
+ distributionShares = Array.isArray(distValue) ? distValue.map((v) => Number(v)) : null;
1038
+ } else {
1039
+ distributionWeight = distValue != null ? Number(distValue) : null;
1040
+ }
1036
1041
  }
1037
1042
  }
1038
1043
  const countOption = erc20?.distribution_count;
@@ -1053,6 +1058,7 @@ function parsePrize(raw) {
1053
1058
  tokenId,
1054
1059
  distributionType,
1055
1060
  distributionWeight,
1061
+ distributionShares,
1056
1062
  distributionCount,
1057
1063
  sponsorAddress: starknet.num.toHex(obj.sponsor_address)
1058
1064
  };