@provable-games/budokan-sdk 0.1.23 → 0.1.24
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/README.md +32 -0
- package/dist/index.cjs +1494 -320
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +538 -3
- package/dist/index.d.ts +538 -3
- package/dist/index.js +1475 -322
- package/dist/index.js.map +1 -1
- package/dist/{player-BUynfv7D.d.cts → player-C2GE9Lop.d.cts} +29 -4
- package/dist/{player-BUynfv7D.d.ts → player-C2GE9Lop.d.ts} +29 -4
- package/dist/react.cjs +893 -249
- 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 +893 -249
- package/dist/react.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var starknet = require('starknet');
|
|
4
|
+
var metagameSdk = require('@provable-games/metagame-sdk');
|
|
4
5
|
|
|
5
6
|
// src/errors/index.ts
|
|
6
7
|
var BudokanError = class extends Error {
|
|
@@ -546,16 +547,32 @@ var CHAINS = {
|
|
|
546
547
|
viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
|
|
547
548
|
},
|
|
548
549
|
sepolia: {
|
|
549
|
-
rpcUrl: "https://starknet
|
|
550
|
+
rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia/rpc/v0_10",
|
|
550
551
|
apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
|
|
551
552
|
wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
|
|
552
|
-
budokanAddress: "
|
|
553
|
-
|
|
553
|
+
budokanAddress: "0x074cc823c382d98e6b8d657aa86776a57d85e1dc2912d54d83a4fef147472683",
|
|
554
|
+
// Redeployed 2026-06-18 to match the upgraded #264/#269 budokan class —
|
|
555
|
+
// the prior viewer (0x03da56…) was built against the old budokan interface
|
|
556
|
+
// (called the removed `tournament_entries`) and reverted RPC reads.
|
|
557
|
+
viewerAddress: "0x06b2773d5f1f8bfa5aa3b698fbbaea0472b30af003ea6058330ed52a1acaa283"
|
|
554
558
|
}
|
|
555
559
|
};
|
|
556
560
|
function getChainConfig(chain) {
|
|
557
561
|
return CHAINS[chain];
|
|
558
562
|
}
|
|
563
|
+
function explorerBaseUrl(chain) {
|
|
564
|
+
if (chain === "sepolia") return "https://sepolia.voyager.online";
|
|
565
|
+
return "https://voyager.online";
|
|
566
|
+
}
|
|
567
|
+
function explorerTxUrl(chain, txHash) {
|
|
568
|
+
return `${explorerBaseUrl(chain)}/tx/${txHash}`;
|
|
569
|
+
}
|
|
570
|
+
function explorerAddressUrl(chain, address) {
|
|
571
|
+
return `${explorerBaseUrl(chain)}/contract/${address}`;
|
|
572
|
+
}
|
|
573
|
+
function tournamentPageUrl(chain, tournamentId) {
|
|
574
|
+
return `https://budokan.gg/tournament/${tournamentId}?network=${chain}`;
|
|
575
|
+
}
|
|
559
576
|
|
|
560
577
|
// src/datasource/health.ts
|
|
561
578
|
var ConnectionStatus = class {
|
|
@@ -851,23 +868,36 @@ function parseTournament(raw, entryCount) {
|
|
|
851
868
|
const lc = obj.leaderboard_config;
|
|
852
869
|
const ascending = Boolean(lc?.ascending);
|
|
853
870
|
const gameMustBeOver = Boolean(lc?.game_must_be_over);
|
|
854
|
-
const
|
|
871
|
+
const entryFeeKind = parseOption(obj.entry_fee);
|
|
855
872
|
let entryFeeToken = null;
|
|
856
873
|
let entryFeeAmount = null;
|
|
857
874
|
let entryFee = null;
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
875
|
+
let entryFeeKindTag = null;
|
|
876
|
+
let entryFeeExtension = null;
|
|
877
|
+
if (entryFeeKind) {
|
|
878
|
+
const variantBag = entryFeeKind.variant ?? entryFeeKind;
|
|
879
|
+
const ef = variantBag.BuiltIn;
|
|
880
|
+
const ext = variantBag.Extension;
|
|
881
|
+
if (ef) {
|
|
882
|
+
entryFeeKindTag = "builtin";
|
|
883
|
+
entryFeeToken = starknet.num.toHex(ef.token_address);
|
|
884
|
+
entryFeeAmount = String(ef.amount ?? "0");
|
|
885
|
+
entryFee = {
|
|
886
|
+
tokenAddress: entryFeeToken,
|
|
887
|
+
amount: entryFeeAmount,
|
|
888
|
+
tournamentCreatorShare: Number(ef.tournament_creator_share ?? 0),
|
|
889
|
+
gameCreatorShare: Number(ef.game_creator_share ?? 0),
|
|
890
|
+
refundShare: Number(ef.refund_share ?? 0),
|
|
891
|
+
distribution: ef.distribution ?? null,
|
|
892
|
+
distributionCount: Number(ef.distribution_count ?? 0)
|
|
893
|
+
};
|
|
894
|
+
} else if (ext) {
|
|
895
|
+
entryFeeKindTag = "extension";
|
|
896
|
+
entryFeeExtension = {
|
|
897
|
+
address: starknet.num.toHex(ext.address),
|
|
898
|
+
config: Array.isArray(ext.config) ? ext.config.map((x) => starknet.num.toHex(x)) : []
|
|
899
|
+
};
|
|
900
|
+
}
|
|
871
901
|
}
|
|
872
902
|
const entryRequirement = parseOption(obj.entry_requirement);
|
|
873
903
|
const hasEntryRequirement = entryRequirement !== null;
|
|
@@ -917,6 +947,8 @@ function parseTournament(raw, entryCount) {
|
|
|
917
947
|
renderer
|
|
918
948
|
},
|
|
919
949
|
entryFee,
|
|
950
|
+
entryFeeKind: entryFeeKindTag,
|
|
951
|
+
entryFeeExtension,
|
|
920
952
|
entryRequirement,
|
|
921
953
|
leaderboardConfig: { ascending, gameMustBeOver },
|
|
922
954
|
entryCount,
|
|
@@ -947,8 +979,40 @@ function parseRegistration(raw, tournamentId) {
|
|
|
947
979
|
};
|
|
948
980
|
}
|
|
949
981
|
function parsePrize(raw) {
|
|
950
|
-
const
|
|
951
|
-
const
|
|
982
|
+
const record = raw;
|
|
983
|
+
const prizeEnum = record.prize;
|
|
984
|
+
if (!prizeEnum) {
|
|
985
|
+
throw new Error(`PrizeRecord missing prize field: ${JSON.stringify(raw)}`);
|
|
986
|
+
}
|
|
987
|
+
const activePrize = typeof prizeEnum.activeVariant === "function" ? prizeEnum.activeVariant() : prizeEnum.Token !== void 0 ? "Token" : prizeEnum.Extension !== void 0 ? "Extension" : null;
|
|
988
|
+
const prizeVariantBag = prizeEnum.variant ?? prizeEnum;
|
|
989
|
+
if (activePrize === "Extension") {
|
|
990
|
+
const ext = prizeVariantBag.Extension;
|
|
991
|
+
return {
|
|
992
|
+
prizeId: String(record.id ?? "0"),
|
|
993
|
+
tournamentId: String(record.context_id ?? "0"),
|
|
994
|
+
payoutPosition: 0,
|
|
995
|
+
tokenAddress: null,
|
|
996
|
+
tokenType: "extension",
|
|
997
|
+
amount: null,
|
|
998
|
+
tokenId: null,
|
|
999
|
+
distributionType: null,
|
|
1000
|
+
distributionWeight: null,
|
|
1001
|
+
distributionShares: null,
|
|
1002
|
+
distributionCount: null,
|
|
1003
|
+
sponsorAddress: starknet.num.toHex(record.sponsor_address),
|
|
1004
|
+
extensionAddress: ext?.address != null ? starknet.num.toHex(ext.address) : null,
|
|
1005
|
+
extensionConfig: Array.isArray(ext?.config) ? ext.config.map((x) => starknet.num.toHex(x)) : null
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
if (activePrize !== "Token") {
|
|
1009
|
+
throw new Error(`Unrecognised Prize variant: ${JSON.stringify(prizeEnum)}`);
|
|
1010
|
+
}
|
|
1011
|
+
const tokenPayload = prizeVariantBag.Token;
|
|
1012
|
+
if (!tokenPayload) {
|
|
1013
|
+
throw new Error(`Prize::Token missing payload: ${JSON.stringify(prizeEnum)}`);
|
|
1014
|
+
}
|
|
1015
|
+
const tokenTypeData = tokenPayload.token_type;
|
|
952
1016
|
let tokenType = "erc20";
|
|
953
1017
|
let amount = null;
|
|
954
1018
|
let tokenId = null;
|
|
@@ -989,10 +1053,10 @@ function parsePrize(raw) {
|
|
|
989
1053
|
}
|
|
990
1054
|
}
|
|
991
1055
|
return {
|
|
992
|
-
prizeId: String(
|
|
993
|
-
tournamentId: String(
|
|
1056
|
+
prizeId: String(record.id ?? "0"),
|
|
1057
|
+
tournamentId: String(record.context_id ?? "0"),
|
|
994
1058
|
payoutPosition,
|
|
995
|
-
tokenAddress: starknet.num.toHex(
|
|
1059
|
+
tokenAddress: starknet.num.toHex(tokenPayload.token_address),
|
|
996
1060
|
tokenType,
|
|
997
1061
|
amount,
|
|
998
1062
|
tokenId,
|
|
@@ -1000,7 +1064,9 @@ function parsePrize(raw) {
|
|
|
1000
1064
|
distributionWeight,
|
|
1001
1065
|
distributionShares,
|
|
1002
1066
|
distributionCount,
|
|
1003
|
-
sponsorAddress: starknet.num.toHex(
|
|
1067
|
+
sponsorAddress: starknet.num.toHex(record.sponsor_address),
|
|
1068
|
+
extensionAddress: null,
|
|
1069
|
+
extensionConfig: null
|
|
1004
1070
|
};
|
|
1005
1071
|
}
|
|
1006
1072
|
function parseOption(raw) {
|
|
@@ -1125,6 +1191,20 @@ async function viewerPrizes(contract, tournamentId) {
|
|
|
1125
1191
|
return result.map(parsePrize);
|
|
1126
1192
|
}, contract.address);
|
|
1127
1193
|
}
|
|
1194
|
+
function rewardClaim(partial) {
|
|
1195
|
+
return {
|
|
1196
|
+
prizeId: null,
|
|
1197
|
+
payoutIndex: null,
|
|
1198
|
+
position: null,
|
|
1199
|
+
refundTokenId: null,
|
|
1200
|
+
extensionTokenId: null,
|
|
1201
|
+
extensionParams: null,
|
|
1202
|
+
...partial
|
|
1203
|
+
};
|
|
1204
|
+
}
|
|
1205
|
+
function spanToHex(v) {
|
|
1206
|
+
return Array.isArray(v) ? v.map((x) => starknet.num.toHex(x)) : [];
|
|
1207
|
+
}
|
|
1128
1208
|
function translateCairoRewardType(rewardType) {
|
|
1129
1209
|
if (!rewardType || typeof rewardType !== "object") {
|
|
1130
1210
|
throw new Error(`Unexpected RewardType payload: ${JSON.stringify(rewardType)}`);
|
|
@@ -1133,70 +1213,70 @@ function translateCairoRewardType(rewardType) {
|
|
|
1133
1213
|
const outer = typeof rt.activeVariant === "function" ? rt.activeVariant() : null;
|
|
1134
1214
|
const innerBag = typeof rt.activeVariant === "function" ? rt.variant : rt;
|
|
1135
1215
|
if (outer === "Prize" || innerBag.Prize !== void 0) {
|
|
1136
|
-
const
|
|
1216
|
+
const prizeClaim = innerBag.Prize;
|
|
1217
|
+
const pcBag = typeof prizeClaim?.activeVariant === "function" ? prizeClaim.variant : prizeClaim;
|
|
1218
|
+
if (pcBag?.Token === void 0 && pcBag?.Extension !== void 0) {
|
|
1219
|
+
const ext = pcBag.Extension;
|
|
1220
|
+
const tokenId = parseOption(ext.token_id);
|
|
1221
|
+
return rewardClaim({
|
|
1222
|
+
claimKind: "prize_extension",
|
|
1223
|
+
prizeId: BigInt(ext.prize_id ?? 0).toString(),
|
|
1224
|
+
extensionTokenId: tokenId != null ? starknet.num.toHex(tokenId) : null,
|
|
1225
|
+
extensionParams: spanToHex(ext.payout_params)
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
const prize = pcBag?.Token ?? prizeClaim;
|
|
1137
1229
|
const subVariant = typeof prize?.activeVariant === "function" ? prize.activeVariant() : null;
|
|
1138
1230
|
const subBag = typeof prize?.activeVariant === "function" ? prize.variant : prize;
|
|
1139
1231
|
if (subVariant === "Single" || subBag?.Single !== void 0) {
|
|
1140
|
-
return {
|
|
1232
|
+
return rewardClaim({
|
|
1141
1233
|
claimKind: "prize_single",
|
|
1142
|
-
prizeId: BigInt(subBag.Single).toString()
|
|
1143
|
-
|
|
1144
|
-
position: null,
|
|
1145
|
-
refundTokenId: null
|
|
1146
|
-
};
|
|
1234
|
+
prizeId: BigInt(subBag.Single).toString()
|
|
1235
|
+
});
|
|
1147
1236
|
}
|
|
1148
1237
|
if (subVariant === "Distributed" || subBag?.Distributed !== void 0) {
|
|
1149
1238
|
const distributed = subBag.Distributed;
|
|
1150
1239
|
const prizeId = distributed?.["0"] ?? distributed?.[0];
|
|
1151
1240
|
const payoutIndex = distributed?.["1"] ?? distributed?.[1];
|
|
1152
|
-
return {
|
|
1241
|
+
return rewardClaim({
|
|
1153
1242
|
claimKind: "prize_distributed",
|
|
1154
1243
|
prizeId: BigInt(prizeId).toString(),
|
|
1155
|
-
payoutIndex: Number(payoutIndex)
|
|
1156
|
-
|
|
1157
|
-
refundTokenId: null
|
|
1158
|
-
};
|
|
1244
|
+
payoutIndex: Number(payoutIndex)
|
|
1245
|
+
});
|
|
1159
1246
|
}
|
|
1160
1247
|
}
|
|
1161
1248
|
if (outer === "EntryFee" || innerBag.EntryFee !== void 0) {
|
|
1162
|
-
const
|
|
1249
|
+
const entryFeeClaim = innerBag.EntryFee;
|
|
1250
|
+
const efBag = typeof entryFeeClaim?.activeVariant === "function" ? entryFeeClaim.variant : entryFeeClaim;
|
|
1251
|
+
if (efBag?.Token === void 0 && efBag?.Extension !== void 0) {
|
|
1252
|
+
const ext = efBag.Extension;
|
|
1253
|
+
const tokenId = parseOption(ext.token_id);
|
|
1254
|
+
return rewardClaim({
|
|
1255
|
+
claimKind: "entry_fee_extension",
|
|
1256
|
+
extensionTokenId: tokenId != null ? starknet.num.toHex(tokenId) : null,
|
|
1257
|
+
extensionParams: spanToHex(ext.claim_params)
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
const entryFee = efBag?.Token ?? entryFeeClaim;
|
|
1163
1261
|
const subVariant = typeof entryFee?.activeVariant === "function" ? entryFee.activeVariant() : null;
|
|
1164
1262
|
const subBag = typeof entryFee?.activeVariant === "function" ? entryFee.variant : entryFee;
|
|
1165
1263
|
if (subVariant === "Position" || subBag?.Position !== void 0) {
|
|
1166
|
-
return {
|
|
1264
|
+
return rewardClaim({
|
|
1167
1265
|
claimKind: "entry_fee_position",
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
position: Number(subBag.Position),
|
|
1171
|
-
refundTokenId: null
|
|
1172
|
-
};
|
|
1266
|
+
position: Number(subBag.Position)
|
|
1267
|
+
});
|
|
1173
1268
|
}
|
|
1174
1269
|
if (subVariant === "TournamentCreator" || subBag?.TournamentCreator !== void 0) {
|
|
1175
|
-
return {
|
|
1176
|
-
claimKind: "entry_fee_tournament_creator",
|
|
1177
|
-
prizeId: null,
|
|
1178
|
-
payoutIndex: null,
|
|
1179
|
-
position: null,
|
|
1180
|
-
refundTokenId: null
|
|
1181
|
-
};
|
|
1270
|
+
return rewardClaim({ claimKind: "entry_fee_tournament_creator" });
|
|
1182
1271
|
}
|
|
1183
1272
|
if (subVariant === "GameCreator" || subBag?.GameCreator !== void 0) {
|
|
1184
|
-
return {
|
|
1185
|
-
claimKind: "entry_fee_game_creator",
|
|
1186
|
-
prizeId: null,
|
|
1187
|
-
payoutIndex: null,
|
|
1188
|
-
position: null,
|
|
1189
|
-
refundTokenId: null
|
|
1190
|
-
};
|
|
1273
|
+
return rewardClaim({ claimKind: "entry_fee_game_creator" });
|
|
1191
1274
|
}
|
|
1192
1275
|
if (subVariant === "Refund" || subBag?.Refund !== void 0) {
|
|
1193
|
-
return {
|
|
1276
|
+
return rewardClaim({
|
|
1194
1277
|
claimKind: "entry_fee_refund",
|
|
1195
|
-
prizeId: null,
|
|
1196
|
-
payoutIndex: null,
|
|
1197
|
-
position: null,
|
|
1198
1278
|
refundTokenId: `0x${BigInt(subBag.Refund).toString(16)}`
|
|
1199
|
-
};
|
|
1279
|
+
});
|
|
1200
1280
|
}
|
|
1201
1281
|
}
|
|
1202
1282
|
throw new Error(
|
|
@@ -1207,13 +1287,15 @@ async function viewerRewardClaims(contract, tournamentId, offset, limit) {
|
|
|
1207
1287
|
return wrapRpcCall(async () => {
|
|
1208
1288
|
const result = await contract.call("tournament_reward_claims", [tournamentId, offset, limit]);
|
|
1209
1289
|
const obj = result;
|
|
1210
|
-
const claims = obj.claims
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1290
|
+
const claims = (obj.claims ?? []).map(
|
|
1291
|
+
(raw) => {
|
|
1292
|
+
const claim = raw;
|
|
1293
|
+
return {
|
|
1294
|
+
...translateCairoRewardType(claim.reward_type),
|
|
1295
|
+
claimed: Boolean(claim.claimed)
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
);
|
|
1217
1299
|
return {
|
|
1218
1300
|
claims,
|
|
1219
1301
|
total: Number(obj.total ?? 0),
|
|
@@ -1493,20 +1575,6 @@ var budokanViewer_default = [
|
|
|
1493
1575
|
}
|
|
1494
1576
|
]
|
|
1495
1577
|
},
|
|
1496
|
-
{
|
|
1497
|
-
type: "enum",
|
|
1498
|
-
name: "core::option::Option::<budokan_interfaces::budokan::EntryFee>",
|
|
1499
|
-
variants: [
|
|
1500
|
-
{
|
|
1501
|
-
name: "Some",
|
|
1502
|
-
type: "budokan_interfaces::budokan::EntryFee"
|
|
1503
|
-
},
|
|
1504
|
-
{
|
|
1505
|
-
name: "None",
|
|
1506
|
-
type: "()"
|
|
1507
|
-
}
|
|
1508
|
-
]
|
|
1509
|
-
},
|
|
1510
1578
|
{
|
|
1511
1579
|
type: "struct",
|
|
1512
1580
|
name: "core::array::Span::<core::felt252>",
|
|
@@ -1531,6 +1599,34 @@ var budokanViewer_default = [
|
|
|
1531
1599
|
}
|
|
1532
1600
|
]
|
|
1533
1601
|
},
|
|
1602
|
+
{
|
|
1603
|
+
type: "enum",
|
|
1604
|
+
name: "budokan_interfaces::budokan::EntryFeeKind",
|
|
1605
|
+
variants: [
|
|
1606
|
+
{
|
|
1607
|
+
name: "BuiltIn",
|
|
1608
|
+
type: "budokan_interfaces::budokan::EntryFee"
|
|
1609
|
+
},
|
|
1610
|
+
{
|
|
1611
|
+
name: "Extension",
|
|
1612
|
+
type: "metagame_extensions_interfaces::extension::ExtensionConfig"
|
|
1613
|
+
}
|
|
1614
|
+
]
|
|
1615
|
+
},
|
|
1616
|
+
{
|
|
1617
|
+
type: "enum",
|
|
1618
|
+
name: "core::option::Option::<budokan_interfaces::budokan::EntryFeeKind>",
|
|
1619
|
+
variants: [
|
|
1620
|
+
{
|
|
1621
|
+
name: "Some",
|
|
1622
|
+
type: "budokan_interfaces::budokan::EntryFeeKind"
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
name: "None",
|
|
1626
|
+
type: "()"
|
|
1627
|
+
}
|
|
1628
|
+
]
|
|
1629
|
+
},
|
|
1534
1630
|
{
|
|
1535
1631
|
type: "enum",
|
|
1536
1632
|
name: "game_components_interfaces::entry_requirement::EntryRequirementType",
|
|
@@ -1621,7 +1717,7 @@ var budokanViewer_default = [
|
|
|
1621
1717
|
},
|
|
1622
1718
|
{
|
|
1623
1719
|
name: "entry_fee",
|
|
1624
|
-
type: "core::option::Option::<budokan_interfaces::budokan::
|
|
1720
|
+
type: "core::option::Option::<budokan_interfaces::budokan::EntryFeeKind>"
|
|
1625
1721
|
},
|
|
1626
1722
|
{
|
|
1627
1723
|
name: "entry_requirement",
|
|
@@ -1777,7 +1873,49 @@ var budokanViewer_default = [
|
|
|
1777
1873
|
},
|
|
1778
1874
|
{
|
|
1779
1875
|
type: "struct",
|
|
1780
|
-
name: "game_components_interfaces::prize::
|
|
1876
|
+
name: "game_components_interfaces::prize::TokenPrizePayload",
|
|
1877
|
+
members: [
|
|
1878
|
+
{
|
|
1879
|
+
name: "token_address",
|
|
1880
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
1881
|
+
},
|
|
1882
|
+
{
|
|
1883
|
+
name: "token_type",
|
|
1884
|
+
type: "game_components_interfaces::prize::TokenTypeData"
|
|
1885
|
+
}
|
|
1886
|
+
]
|
|
1887
|
+
},
|
|
1888
|
+
{
|
|
1889
|
+
type: "struct",
|
|
1890
|
+
name: "game_components_interfaces::prize::ExtensionPrizePayload",
|
|
1891
|
+
members: [
|
|
1892
|
+
{
|
|
1893
|
+
name: "address",
|
|
1894
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
name: "config",
|
|
1898
|
+
type: "core::array::Span::<core::felt252>"
|
|
1899
|
+
}
|
|
1900
|
+
]
|
|
1901
|
+
},
|
|
1902
|
+
{
|
|
1903
|
+
type: "enum",
|
|
1904
|
+
name: "game_components_interfaces::prize::Prize",
|
|
1905
|
+
variants: [
|
|
1906
|
+
{
|
|
1907
|
+
name: "Token",
|
|
1908
|
+
type: "game_components_interfaces::prize::TokenPrizePayload"
|
|
1909
|
+
},
|
|
1910
|
+
{
|
|
1911
|
+
name: "Extension",
|
|
1912
|
+
type: "game_components_interfaces::prize::ExtensionPrizePayload"
|
|
1913
|
+
}
|
|
1914
|
+
]
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
type: "struct",
|
|
1918
|
+
name: "game_components_interfaces::prize::PrizeRecord",
|
|
1781
1919
|
members: [
|
|
1782
1920
|
{
|
|
1783
1921
|
name: "id",
|
|
@@ -1788,16 +1926,12 @@ var budokanViewer_default = [
|
|
|
1788
1926
|
type: "core::integer::u64"
|
|
1789
1927
|
},
|
|
1790
1928
|
{
|
|
1791
|
-
name: "
|
|
1929
|
+
name: "sponsor_address",
|
|
1792
1930
|
type: "core::starknet::contract_address::ContractAddress"
|
|
1793
1931
|
},
|
|
1794
1932
|
{
|
|
1795
|
-
name: "
|
|
1796
|
-
type: "game_components_interfaces::prize::
|
|
1797
|
-
},
|
|
1798
|
-
{
|
|
1799
|
-
name: "sponsor_address",
|
|
1800
|
-
type: "core::starknet::contract_address::ContractAddress"
|
|
1933
|
+
name: "prize",
|
|
1934
|
+
type: "game_components_interfaces::prize::Prize"
|
|
1801
1935
|
}
|
|
1802
1936
|
]
|
|
1803
1937
|
},
|
|
@@ -1815,6 +1949,52 @@ var budokanViewer_default = [
|
|
|
1815
1949
|
}
|
|
1816
1950
|
]
|
|
1817
1951
|
},
|
|
1952
|
+
{
|
|
1953
|
+
type: "enum",
|
|
1954
|
+
name: "core::option::Option::<core::felt252>",
|
|
1955
|
+
variants: [
|
|
1956
|
+
{
|
|
1957
|
+
name: "Some",
|
|
1958
|
+
type: "core::felt252"
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
name: "None",
|
|
1962
|
+
type: "()"
|
|
1963
|
+
}
|
|
1964
|
+
]
|
|
1965
|
+
},
|
|
1966
|
+
{
|
|
1967
|
+
type: "struct",
|
|
1968
|
+
name: "budokan_interfaces::budokan::ExtensionPrizeClaim",
|
|
1969
|
+
members: [
|
|
1970
|
+
{
|
|
1971
|
+
name: "prize_id",
|
|
1972
|
+
type: "core::integer::u64"
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
name: "token_id",
|
|
1976
|
+
type: "core::option::Option::<core::felt252>"
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
name: "payout_params",
|
|
1980
|
+
type: "core::array::Span::<core::felt252>"
|
|
1981
|
+
}
|
|
1982
|
+
]
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
type: "enum",
|
|
1986
|
+
name: "budokan_interfaces::budokan::PrizeClaim",
|
|
1987
|
+
variants: [
|
|
1988
|
+
{
|
|
1989
|
+
name: "Token",
|
|
1990
|
+
type: "game_components_interfaces::prize::PrizeType"
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
name: "Extension",
|
|
1994
|
+
type: "budokan_interfaces::budokan::ExtensionPrizeClaim"
|
|
1995
|
+
}
|
|
1996
|
+
]
|
|
1997
|
+
},
|
|
1818
1998
|
{
|
|
1819
1999
|
type: "enum",
|
|
1820
2000
|
name: "budokan_interfaces::budokan::EntryFeeRewardType",
|
|
@@ -1837,17 +2017,45 @@ var budokanViewer_default = [
|
|
|
1837
2017
|
}
|
|
1838
2018
|
]
|
|
1839
2019
|
},
|
|
2020
|
+
{
|
|
2021
|
+
type: "struct",
|
|
2022
|
+
name: "budokan_interfaces::budokan::ExtensionEntryFeeClaim",
|
|
2023
|
+
members: [
|
|
2024
|
+
{
|
|
2025
|
+
name: "token_id",
|
|
2026
|
+
type: "core::option::Option::<core::felt252>"
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
name: "claim_params",
|
|
2030
|
+
type: "core::array::Span::<core::felt252>"
|
|
2031
|
+
}
|
|
2032
|
+
]
|
|
2033
|
+
},
|
|
2034
|
+
{
|
|
2035
|
+
type: "enum",
|
|
2036
|
+
name: "budokan_interfaces::budokan::EntryFeeClaim",
|
|
2037
|
+
variants: [
|
|
2038
|
+
{
|
|
2039
|
+
name: "Token",
|
|
2040
|
+
type: "budokan_interfaces::budokan::EntryFeeRewardType"
|
|
2041
|
+
},
|
|
2042
|
+
{
|
|
2043
|
+
name: "Extension",
|
|
2044
|
+
type: "budokan_interfaces::budokan::ExtensionEntryFeeClaim"
|
|
2045
|
+
}
|
|
2046
|
+
]
|
|
2047
|
+
},
|
|
1840
2048
|
{
|
|
1841
2049
|
type: "enum",
|
|
1842
2050
|
name: "budokan_interfaces::budokan::RewardType",
|
|
1843
2051
|
variants: [
|
|
1844
2052
|
{
|
|
1845
2053
|
name: "Prize",
|
|
1846
|
-
type: "
|
|
2054
|
+
type: "budokan_interfaces::budokan::PrizeClaim"
|
|
1847
2055
|
},
|
|
1848
2056
|
{
|
|
1849
2057
|
name: "EntryFee",
|
|
1850
|
-
type: "budokan_interfaces::budokan::
|
|
2058
|
+
type: "budokan_interfaces::budokan::EntryFeeClaim"
|
|
1851
2059
|
}
|
|
1852
2060
|
]
|
|
1853
2061
|
},
|
|
@@ -2138,6 +2346,62 @@ var budokanViewer_default = [
|
|
|
2138
2346
|
],
|
|
2139
2347
|
state_mutability: "view"
|
|
2140
2348
|
},
|
|
2349
|
+
{
|
|
2350
|
+
type: "function",
|
|
2351
|
+
name: "tournament_registrations_by_owner",
|
|
2352
|
+
inputs: [
|
|
2353
|
+
{
|
|
2354
|
+
name: "tournament_id",
|
|
2355
|
+
type: "core::integer::u64"
|
|
2356
|
+
},
|
|
2357
|
+
{
|
|
2358
|
+
name: "owner",
|
|
2359
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
2360
|
+
},
|
|
2361
|
+
{
|
|
2362
|
+
name: "offset",
|
|
2363
|
+
type: "core::integer::u32"
|
|
2364
|
+
},
|
|
2365
|
+
{
|
|
2366
|
+
name: "limit",
|
|
2367
|
+
type: "core::integer::u32"
|
|
2368
|
+
}
|
|
2369
|
+
],
|
|
2370
|
+
outputs: [
|
|
2371
|
+
{
|
|
2372
|
+
type: "budokan_interfaces::viewer::RegistrationResult"
|
|
2373
|
+
}
|
|
2374
|
+
],
|
|
2375
|
+
state_mutability: "view"
|
|
2376
|
+
},
|
|
2377
|
+
{
|
|
2378
|
+
type: "function",
|
|
2379
|
+
name: "tournament_registrations_by_token_ids",
|
|
2380
|
+
inputs: [
|
|
2381
|
+
{
|
|
2382
|
+
name: "tournament_id",
|
|
2383
|
+
type: "core::integer::u64"
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
name: "token_ids",
|
|
2387
|
+
type: "core::array::Array::<core::felt252>"
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
name: "offset",
|
|
2391
|
+
type: "core::integer::u32"
|
|
2392
|
+
},
|
|
2393
|
+
{
|
|
2394
|
+
name: "limit",
|
|
2395
|
+
type: "core::integer::u32"
|
|
2396
|
+
}
|
|
2397
|
+
],
|
|
2398
|
+
outputs: [
|
|
2399
|
+
{
|
|
2400
|
+
type: "budokan_interfaces::viewer::RegistrationResult"
|
|
2401
|
+
}
|
|
2402
|
+
],
|
|
2403
|
+
state_mutability: "view"
|
|
2404
|
+
},
|
|
2141
2405
|
{
|
|
2142
2406
|
type: "function",
|
|
2143
2407
|
name: "leaderboard",
|
|
@@ -2173,7 +2437,7 @@ var budokanViewer_default = [
|
|
|
2173
2437
|
],
|
|
2174
2438
|
outputs: [
|
|
2175
2439
|
{
|
|
2176
|
-
type: "core::array::Array::<game_components_interfaces::prize::
|
|
2440
|
+
type: "core::array::Array::<game_components_interfaces::prize::PrizeRecord>"
|
|
2177
2441
|
}
|
|
2178
2442
|
],
|
|
2179
2443
|
state_mutability: "view"
|
|
@@ -2434,26 +2698,60 @@ var budokan_default = [
|
|
|
2434
2698
|
},
|
|
2435
2699
|
{
|
|
2436
2700
|
type: "impl",
|
|
2437
|
-
name: "
|
|
2438
|
-
interface_name: "
|
|
2439
|
-
},
|
|
2440
|
-
{
|
|
2441
|
-
type: "enum",
|
|
2442
|
-
name: "core::bool",
|
|
2443
|
-
variants: [
|
|
2444
|
-
{
|
|
2445
|
-
name: "False",
|
|
2446
|
-
type: "()"
|
|
2447
|
-
},
|
|
2448
|
-
{
|
|
2449
|
-
name: "True",
|
|
2450
|
-
type: "()"
|
|
2451
|
-
}
|
|
2452
|
-
]
|
|
2701
|
+
name: "BudokanRewardsAdminImpl",
|
|
2702
|
+
interface_name: "budokan::budokan::Budokan::IBudokanRewardsAdmin"
|
|
2453
2703
|
},
|
|
2454
2704
|
{
|
|
2455
2705
|
type: "interface",
|
|
2456
|
-
name: "
|
|
2706
|
+
name: "budokan::budokan::Budokan::IBudokanRewardsAdmin",
|
|
2707
|
+
items: [
|
|
2708
|
+
{
|
|
2709
|
+
type: "function",
|
|
2710
|
+
name: "set_rewards_class_hash",
|
|
2711
|
+
inputs: [
|
|
2712
|
+
{
|
|
2713
|
+
name: "new_class_hash",
|
|
2714
|
+
type: "core::starknet::class_hash::ClassHash"
|
|
2715
|
+
}
|
|
2716
|
+
],
|
|
2717
|
+
outputs: [],
|
|
2718
|
+
state_mutability: "external"
|
|
2719
|
+
},
|
|
2720
|
+
{
|
|
2721
|
+
type: "function",
|
|
2722
|
+
name: "rewards_class_hash",
|
|
2723
|
+
inputs: [],
|
|
2724
|
+
outputs: [
|
|
2725
|
+
{
|
|
2726
|
+
type: "core::starknet::class_hash::ClassHash"
|
|
2727
|
+
}
|
|
2728
|
+
],
|
|
2729
|
+
state_mutability: "view"
|
|
2730
|
+
}
|
|
2731
|
+
]
|
|
2732
|
+
},
|
|
2733
|
+
{
|
|
2734
|
+
type: "impl",
|
|
2735
|
+
name: "GameContextImpl",
|
|
2736
|
+
interface_name: "game_components_interfaces::metagame::context::IMetagameContext"
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
type: "enum",
|
|
2740
|
+
name: "core::bool",
|
|
2741
|
+
variants: [
|
|
2742
|
+
{
|
|
2743
|
+
name: "False",
|
|
2744
|
+
type: "()"
|
|
2745
|
+
},
|
|
2746
|
+
{
|
|
2747
|
+
name: "True",
|
|
2748
|
+
type: "()"
|
|
2749
|
+
}
|
|
2750
|
+
]
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
type: "interface",
|
|
2754
|
+
name: "game_components_interfaces::metagame::context::IMetagameContext",
|
|
2457
2755
|
items: [
|
|
2458
2756
|
{
|
|
2459
2757
|
type: "function",
|
|
@@ -2516,11 +2814,11 @@ var budokan_default = [
|
|
|
2516
2814
|
members: [
|
|
2517
2815
|
{
|
|
2518
2816
|
name: "name",
|
|
2519
|
-
type: "core::
|
|
2817
|
+
type: "core::felt252"
|
|
2520
2818
|
},
|
|
2521
2819
|
{
|
|
2522
2820
|
name: "value",
|
|
2523
|
-
type: "core::
|
|
2821
|
+
type: "core::felt252"
|
|
2524
2822
|
}
|
|
2525
2823
|
]
|
|
2526
2824
|
},
|
|
@@ -2748,50 +3046,54 @@ var budokan_default = [
|
|
|
2748
3046
|
]
|
|
2749
3047
|
},
|
|
2750
3048
|
{
|
|
2751
|
-
type: "
|
|
2752
|
-
name: "core::
|
|
2753
|
-
|
|
2754
|
-
{
|
|
2755
|
-
name: "Some",
|
|
2756
|
-
type: "budokan_interfaces::budokan::EntryFee"
|
|
2757
|
-
},
|
|
3049
|
+
type: "struct",
|
|
3050
|
+
name: "core::array::Span::<core::felt252>",
|
|
3051
|
+
members: [
|
|
2758
3052
|
{
|
|
2759
|
-
name: "
|
|
2760
|
-
type: "
|
|
3053
|
+
name: "snapshot",
|
|
3054
|
+
type: "@core::array::Array::<core::felt252>"
|
|
2761
3055
|
}
|
|
2762
3056
|
]
|
|
2763
3057
|
},
|
|
2764
3058
|
{
|
|
2765
3059
|
type: "struct",
|
|
2766
|
-
name: "
|
|
3060
|
+
name: "metagame_extensions_interfaces::extension::ExtensionConfig",
|
|
2767
3061
|
members: [
|
|
2768
3062
|
{
|
|
2769
|
-
name: "
|
|
2770
|
-
type: "
|
|
3063
|
+
name: "address",
|
|
3064
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
3065
|
+
},
|
|
3066
|
+
{
|
|
3067
|
+
name: "config",
|
|
3068
|
+
type: "core::array::Span::<core::felt252>"
|
|
2771
3069
|
}
|
|
2772
3070
|
]
|
|
2773
3071
|
},
|
|
2774
3072
|
{
|
|
2775
|
-
type: "
|
|
2776
|
-
name: "
|
|
2777
|
-
|
|
3073
|
+
type: "enum",
|
|
3074
|
+
name: "budokan_interfaces::budokan::EntryFeeKind",
|
|
3075
|
+
variants: [
|
|
2778
3076
|
{
|
|
2779
|
-
name: "
|
|
2780
|
-
type: "
|
|
3077
|
+
name: "BuiltIn",
|
|
3078
|
+
type: "budokan_interfaces::budokan::EntryFee"
|
|
3079
|
+
},
|
|
3080
|
+
{
|
|
3081
|
+
name: "Extension",
|
|
3082
|
+
type: "metagame_extensions_interfaces::extension::ExtensionConfig"
|
|
2781
3083
|
}
|
|
2782
3084
|
]
|
|
2783
3085
|
},
|
|
2784
3086
|
{
|
|
2785
|
-
type: "
|
|
2786
|
-
name: "
|
|
2787
|
-
|
|
3087
|
+
type: "enum",
|
|
3088
|
+
name: "core::option::Option::<budokan_interfaces::budokan::EntryFeeKind>",
|
|
3089
|
+
variants: [
|
|
2788
3090
|
{
|
|
2789
|
-
name: "
|
|
2790
|
-
type: "
|
|
3091
|
+
name: "Some",
|
|
3092
|
+
type: "budokan_interfaces::budokan::EntryFeeKind"
|
|
2791
3093
|
},
|
|
2792
3094
|
{
|
|
2793
|
-
name: "
|
|
2794
|
-
type: "
|
|
3095
|
+
name: "None",
|
|
3096
|
+
type: "()"
|
|
2795
3097
|
}
|
|
2796
3098
|
]
|
|
2797
3099
|
},
|
|
@@ -2805,7 +3107,7 @@ var budokan_default = [
|
|
|
2805
3107
|
},
|
|
2806
3108
|
{
|
|
2807
3109
|
name: "extension",
|
|
2808
|
-
type: "
|
|
3110
|
+
type: "metagame_extensions_interfaces::extension::ExtensionConfig"
|
|
2809
3111
|
}
|
|
2810
3112
|
]
|
|
2811
3113
|
},
|
|
@@ -2885,7 +3187,7 @@ var budokan_default = [
|
|
|
2885
3187
|
},
|
|
2886
3188
|
{
|
|
2887
3189
|
name: "entry_fee",
|
|
2888
|
-
type: "core::option::Option::<budokan_interfaces::budokan::
|
|
3190
|
+
type: "core::option::Option::<budokan_interfaces::budokan::EntryFeeKind>"
|
|
2889
3191
|
},
|
|
2890
3192
|
{
|
|
2891
3193
|
name: "entry_requirement",
|
|
@@ -2927,6 +3229,20 @@ var budokan_default = [
|
|
|
2927
3229
|
}
|
|
2928
3230
|
]
|
|
2929
3231
|
},
|
|
3232
|
+
{
|
|
3233
|
+
type: "enum",
|
|
3234
|
+
name: "core::option::Option::<core::felt252>",
|
|
3235
|
+
variants: [
|
|
3236
|
+
{
|
|
3237
|
+
name: "Some",
|
|
3238
|
+
type: "core::felt252"
|
|
3239
|
+
},
|
|
3240
|
+
{
|
|
3241
|
+
name: "None",
|
|
3242
|
+
type: "()"
|
|
3243
|
+
}
|
|
3244
|
+
]
|
|
3245
|
+
},
|
|
2930
3246
|
{
|
|
2931
3247
|
type: "struct",
|
|
2932
3248
|
name: "core::integer::u256",
|
|
@@ -2959,10 +3275,6 @@ var budokan_default = [
|
|
|
2959
3275
|
name: "NFT",
|
|
2960
3276
|
type: "game_components_interfaces::entry_requirement::NFTQualification"
|
|
2961
3277
|
},
|
|
2962
|
-
{
|
|
2963
|
-
name: "Address",
|
|
2964
|
-
type: "core::starknet::contract_address::ContractAddress"
|
|
2965
|
-
},
|
|
2966
3278
|
{
|
|
2967
3279
|
name: "Extension",
|
|
2968
3280
|
type: "core::array::Span::<core::felt252>"
|
|
@@ -2983,6 +3295,38 @@ var budokan_default = [
|
|
|
2983
3295
|
}
|
|
2984
3296
|
]
|
|
2985
3297
|
},
|
|
3298
|
+
{
|
|
3299
|
+
type: "enum",
|
|
3300
|
+
name: "core::option::Option::<core::array::Span::<core::felt252>>",
|
|
3301
|
+
variants: [
|
|
3302
|
+
{
|
|
3303
|
+
name: "Some",
|
|
3304
|
+
type: "core::array::Span::<core::felt252>"
|
|
3305
|
+
},
|
|
3306
|
+
{
|
|
3307
|
+
name: "None",
|
|
3308
|
+
type: "()"
|
|
3309
|
+
}
|
|
3310
|
+
]
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
type: "struct",
|
|
3314
|
+
name: "budokan_interfaces::budokan::TournamentRecipientParams",
|
|
3315
|
+
members: [
|
|
3316
|
+
{
|
|
3317
|
+
name: "player_address",
|
|
3318
|
+
type: "core::option::Option::<core::starknet::contract_address::ContractAddress>"
|
|
3319
|
+
},
|
|
3320
|
+
{
|
|
3321
|
+
name: "qualifier",
|
|
3322
|
+
type: "core::option::Option::<core::starknet::contract_address::ContractAddress>"
|
|
3323
|
+
},
|
|
3324
|
+
{
|
|
3325
|
+
name: "qualification",
|
|
3326
|
+
type: "core::option::Option::<game_components_interfaces::entry_requirement::QualificationProof>"
|
|
3327
|
+
}
|
|
3328
|
+
]
|
|
3329
|
+
},
|
|
2986
3330
|
{
|
|
2987
3331
|
type: "enum",
|
|
2988
3332
|
name: "game_components_interfaces::prize::PrizeType",
|
|
@@ -2997,6 +3341,38 @@ var budokan_default = [
|
|
|
2997
3341
|
}
|
|
2998
3342
|
]
|
|
2999
3343
|
},
|
|
3344
|
+
{
|
|
3345
|
+
type: "struct",
|
|
3346
|
+
name: "budokan_interfaces::budokan::ExtensionPrizeClaim",
|
|
3347
|
+
members: [
|
|
3348
|
+
{
|
|
3349
|
+
name: "prize_id",
|
|
3350
|
+
type: "core::integer::u64"
|
|
3351
|
+
},
|
|
3352
|
+
{
|
|
3353
|
+
name: "token_id",
|
|
3354
|
+
type: "core::option::Option::<core::felt252>"
|
|
3355
|
+
},
|
|
3356
|
+
{
|
|
3357
|
+
name: "payout_params",
|
|
3358
|
+
type: "core::array::Span::<core::felt252>"
|
|
3359
|
+
}
|
|
3360
|
+
]
|
|
3361
|
+
},
|
|
3362
|
+
{
|
|
3363
|
+
type: "enum",
|
|
3364
|
+
name: "budokan_interfaces::budokan::PrizeClaim",
|
|
3365
|
+
variants: [
|
|
3366
|
+
{
|
|
3367
|
+
name: "Token",
|
|
3368
|
+
type: "game_components_interfaces::prize::PrizeType"
|
|
3369
|
+
},
|
|
3370
|
+
{
|
|
3371
|
+
name: "Extension",
|
|
3372
|
+
type: "budokan_interfaces::budokan::ExtensionPrizeClaim"
|
|
3373
|
+
}
|
|
3374
|
+
]
|
|
3375
|
+
},
|
|
3000
3376
|
{
|
|
3001
3377
|
type: "enum",
|
|
3002
3378
|
name: "budokan_interfaces::budokan::EntryFeeRewardType",
|
|
@@ -3019,17 +3395,45 @@ var budokan_default = [
|
|
|
3019
3395
|
}
|
|
3020
3396
|
]
|
|
3021
3397
|
},
|
|
3398
|
+
{
|
|
3399
|
+
type: "struct",
|
|
3400
|
+
name: "budokan_interfaces::budokan::ExtensionEntryFeeClaim",
|
|
3401
|
+
members: [
|
|
3402
|
+
{
|
|
3403
|
+
name: "token_id",
|
|
3404
|
+
type: "core::option::Option::<core::felt252>"
|
|
3405
|
+
},
|
|
3406
|
+
{
|
|
3407
|
+
name: "claim_params",
|
|
3408
|
+
type: "core::array::Span::<core::felt252>"
|
|
3409
|
+
}
|
|
3410
|
+
]
|
|
3411
|
+
},
|
|
3412
|
+
{
|
|
3413
|
+
type: "enum",
|
|
3414
|
+
name: "budokan_interfaces::budokan::EntryFeeClaim",
|
|
3415
|
+
variants: [
|
|
3416
|
+
{
|
|
3417
|
+
name: "Token",
|
|
3418
|
+
type: "budokan_interfaces::budokan::EntryFeeRewardType"
|
|
3419
|
+
},
|
|
3420
|
+
{
|
|
3421
|
+
name: "Extension",
|
|
3422
|
+
type: "budokan_interfaces::budokan::ExtensionEntryFeeClaim"
|
|
3423
|
+
}
|
|
3424
|
+
]
|
|
3425
|
+
},
|
|
3022
3426
|
{
|
|
3023
3427
|
type: "enum",
|
|
3024
3428
|
name: "budokan_interfaces::budokan::RewardType",
|
|
3025
3429
|
variants: [
|
|
3026
3430
|
{
|
|
3027
3431
|
name: "Prize",
|
|
3028
|
-
type: "
|
|
3432
|
+
type: "budokan_interfaces::budokan::PrizeClaim"
|
|
3029
3433
|
},
|
|
3030
3434
|
{
|
|
3031
3435
|
name: "EntryFee",
|
|
3032
|
-
type: "budokan_interfaces::budokan::
|
|
3436
|
+
type: "budokan_interfaces::budokan::EntryFeeClaim"
|
|
3033
3437
|
}
|
|
3034
3438
|
]
|
|
3035
3439
|
},
|
|
@@ -3091,16 +3495,8 @@ var budokan_default = [
|
|
|
3091
3495
|
},
|
|
3092
3496
|
{
|
|
3093
3497
|
type: "struct",
|
|
3094
|
-
name: "game_components_interfaces::prize::
|
|
3498
|
+
name: "game_components_interfaces::prize::TokenPrizePayload",
|
|
3095
3499
|
members: [
|
|
3096
|
-
{
|
|
3097
|
-
name: "id",
|
|
3098
|
-
type: "core::integer::u64"
|
|
3099
|
-
},
|
|
3100
|
-
{
|
|
3101
|
-
name: "context_id",
|
|
3102
|
-
type: "core::integer::u64"
|
|
3103
|
-
},
|
|
3104
3500
|
{
|
|
3105
3501
|
name: "token_address",
|
|
3106
3502
|
type: "core::starknet::contract_address::ContractAddress"
|
|
@@ -3108,10 +3504,34 @@ var budokan_default = [
|
|
|
3108
3504
|
{
|
|
3109
3505
|
name: "token_type",
|
|
3110
3506
|
type: "game_components_interfaces::prize::TokenTypeData"
|
|
3111
|
-
}
|
|
3507
|
+
}
|
|
3508
|
+
]
|
|
3509
|
+
},
|
|
3510
|
+
{
|
|
3511
|
+
type: "struct",
|
|
3512
|
+
name: "game_components_interfaces::prize::ExtensionPrizePayload",
|
|
3513
|
+
members: [
|
|
3112
3514
|
{
|
|
3113
|
-
name: "
|
|
3515
|
+
name: "address",
|
|
3114
3516
|
type: "core::starknet::contract_address::ContractAddress"
|
|
3517
|
+
},
|
|
3518
|
+
{
|
|
3519
|
+
name: "config",
|
|
3520
|
+
type: "core::array::Span::<core::felt252>"
|
|
3521
|
+
}
|
|
3522
|
+
]
|
|
3523
|
+
},
|
|
3524
|
+
{
|
|
3525
|
+
type: "enum",
|
|
3526
|
+
name: "game_components_interfaces::prize::Prize",
|
|
3527
|
+
variants: [
|
|
3528
|
+
{
|
|
3529
|
+
name: "Token",
|
|
3530
|
+
type: "game_components_interfaces::prize::TokenPrizePayload"
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
name: "Extension",
|
|
3534
|
+
type: "game_components_interfaces::prize::ExtensionPrizePayload"
|
|
3115
3535
|
}
|
|
3116
3536
|
]
|
|
3117
3537
|
},
|
|
@@ -3146,38 +3566,6 @@ var budokan_default = [
|
|
|
3146
3566
|
],
|
|
3147
3567
|
state_mutability: "view"
|
|
3148
3568
|
},
|
|
3149
|
-
{
|
|
3150
|
-
type: "function",
|
|
3151
|
-
name: "tournament_entries",
|
|
3152
|
-
inputs: [
|
|
3153
|
-
{
|
|
3154
|
-
name: "tournament_id",
|
|
3155
|
-
type: "core::integer::u64"
|
|
3156
|
-
}
|
|
3157
|
-
],
|
|
3158
|
-
outputs: [
|
|
3159
|
-
{
|
|
3160
|
-
type: "core::integer::u32"
|
|
3161
|
-
}
|
|
3162
|
-
],
|
|
3163
|
-
state_mutability: "view"
|
|
3164
|
-
},
|
|
3165
|
-
{
|
|
3166
|
-
type: "function",
|
|
3167
|
-
name: "get_leaderboard",
|
|
3168
|
-
inputs: [
|
|
3169
|
-
{
|
|
3170
|
-
name: "tournament_id",
|
|
3171
|
-
type: "core::integer::u64"
|
|
3172
|
-
}
|
|
3173
|
-
],
|
|
3174
|
-
outputs: [
|
|
3175
|
-
{
|
|
3176
|
-
type: "core::array::Array::<core::felt252>"
|
|
3177
|
-
}
|
|
3178
|
-
],
|
|
3179
|
-
state_mutability: "view"
|
|
3180
|
-
},
|
|
3181
3569
|
{
|
|
3182
3570
|
type: "function",
|
|
3183
3571
|
name: "current_phase",
|
|
@@ -3232,7 +3620,7 @@ var budokan_default = [
|
|
|
3232
3620
|
},
|
|
3233
3621
|
{
|
|
3234
3622
|
name: "entry_fee",
|
|
3235
|
-
type: "core::option::Option::<budokan_interfaces::budokan::
|
|
3623
|
+
type: "core::option::Option::<budokan_interfaces::budokan::EntryFeeKind>"
|
|
3236
3624
|
},
|
|
3237
3625
|
{
|
|
3238
3626
|
name: "entry_requirement",
|
|
@@ -3268,16 +3656,24 @@ var budokan_default = [
|
|
|
3268
3656
|
},
|
|
3269
3657
|
{
|
|
3270
3658
|
name: "player_name",
|
|
3271
|
-
type: "core::felt252"
|
|
3659
|
+
type: "core::option::Option::<core::felt252>"
|
|
3272
3660
|
},
|
|
3273
3661
|
{
|
|
3274
3662
|
name: "player_address",
|
|
3275
|
-
type: "core::starknet::contract_address::ContractAddress"
|
|
3663
|
+
type: "core::option::Option::<core::starknet::contract_address::ContractAddress>"
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
name: "qualifier",
|
|
3667
|
+
type: "core::option::Option::<core::starknet::contract_address::ContractAddress>"
|
|
3276
3668
|
},
|
|
3277
3669
|
{
|
|
3278
3670
|
name: "qualification",
|
|
3279
3671
|
type: "core::option::Option::<game_components_interfaces::entry_requirement::QualificationProof>"
|
|
3280
3672
|
},
|
|
3673
|
+
{
|
|
3674
|
+
name: "entry_fee_pay_params",
|
|
3675
|
+
type: "core::option::Option::<core::array::Span::<core::felt252>>"
|
|
3676
|
+
},
|
|
3281
3677
|
{
|
|
3282
3678
|
name: "salt",
|
|
3283
3679
|
type: "core::integer::u16"
|
|
@@ -3296,7 +3692,39 @@ var budokan_default = [
|
|
|
3296
3692
|
},
|
|
3297
3693
|
{
|
|
3298
3694
|
type: "function",
|
|
3299
|
-
name: "
|
|
3695
|
+
name: "enter_tournament_for_recipients",
|
|
3696
|
+
inputs: [
|
|
3697
|
+
{
|
|
3698
|
+
name: "tournament_id",
|
|
3699
|
+
type: "core::integer::u64"
|
|
3700
|
+
},
|
|
3701
|
+
{
|
|
3702
|
+
name: "recipients",
|
|
3703
|
+
type: "core::array::Array::<budokan_interfaces::budokan::TournamentRecipientParams>"
|
|
3704
|
+
},
|
|
3705
|
+
{
|
|
3706
|
+
name: "player_name",
|
|
3707
|
+
type: "core::option::Option::<core::felt252>"
|
|
3708
|
+
},
|
|
3709
|
+
{
|
|
3710
|
+
name: "salt",
|
|
3711
|
+
type: "core::integer::u16"
|
|
3712
|
+
},
|
|
3713
|
+
{
|
|
3714
|
+
name: "metadata_value",
|
|
3715
|
+
type: "core::integer::u16"
|
|
3716
|
+
}
|
|
3717
|
+
],
|
|
3718
|
+
outputs: [
|
|
3719
|
+
{
|
|
3720
|
+
type: "core::array::Array::<core::felt252>"
|
|
3721
|
+
}
|
|
3722
|
+
],
|
|
3723
|
+
state_mutability: "external"
|
|
3724
|
+
},
|
|
3725
|
+
{
|
|
3726
|
+
type: "function",
|
|
3727
|
+
name: "ban_entry",
|
|
3300
3728
|
inputs: [
|
|
3301
3729
|
{
|
|
3302
3730
|
name: "tournament_id",
|
|
@@ -3359,12 +3787,8 @@ var budokan_default = [
|
|
|
3359
3787
|
type: "core::integer::u64"
|
|
3360
3788
|
},
|
|
3361
3789
|
{
|
|
3362
|
-
name: "
|
|
3363
|
-
type: "
|
|
3364
|
-
},
|
|
3365
|
-
{
|
|
3366
|
-
name: "token_type",
|
|
3367
|
-
type: "game_components_interfaces::prize::TokenTypeData"
|
|
3790
|
+
name: "prize",
|
|
3791
|
+
type: "game_components_interfaces::prize::Prize"
|
|
3368
3792
|
},
|
|
3369
3793
|
{
|
|
3370
3794
|
name: "position",
|
|
@@ -3373,7 +3797,7 @@ var budokan_default = [
|
|
|
3373
3797
|
],
|
|
3374
3798
|
outputs: [
|
|
3375
3799
|
{
|
|
3376
|
-
type: "
|
|
3800
|
+
type: "core::integer::u64"
|
|
3377
3801
|
}
|
|
3378
3802
|
],
|
|
3379
3803
|
state_mutability: "external"
|
|
@@ -3547,6 +3971,14 @@ var budokan_default = [
|
|
|
3547
3971
|
{
|
|
3548
3972
|
name: "additional_shares",
|
|
3549
3973
|
type: "core::array::Span::<game_components_interfaces::entry_fee::AdditionalShare>"
|
|
3974
|
+
},
|
|
3975
|
+
{
|
|
3976
|
+
name: "distribution",
|
|
3977
|
+
type: "core::option::Option::<game_components_interfaces::distribution::Distribution>"
|
|
3978
|
+
},
|
|
3979
|
+
{
|
|
3980
|
+
name: "distribution_count",
|
|
3981
|
+
type: "core::integer::u32"
|
|
3550
3982
|
}
|
|
3551
3983
|
]
|
|
3552
3984
|
},
|
|
@@ -3644,60 +4076,330 @@ var budokan_default = [
|
|
|
3644
4076
|
],
|
|
3645
4077
|
outputs: [
|
|
3646
4078
|
{
|
|
3647
|
-
type: "game_components_interfaces::entry_requirement::QualificationEntries"
|
|
4079
|
+
type: "game_components_interfaces::entry_requirement::QualificationEntries"
|
|
4080
|
+
}
|
|
4081
|
+
],
|
|
4082
|
+
state_mutability: "view"
|
|
4083
|
+
}
|
|
4084
|
+
]
|
|
4085
|
+
},
|
|
4086
|
+
{
|
|
4087
|
+
type: "impl",
|
|
4088
|
+
name: "PrizeImpl",
|
|
4089
|
+
interface_name: "game_components_interfaces::prize::IPrize"
|
|
4090
|
+
},
|
|
4091
|
+
{
|
|
4092
|
+
type: "struct",
|
|
4093
|
+
name: "game_components_interfaces::prize::PrizeRecord",
|
|
4094
|
+
members: [
|
|
4095
|
+
{
|
|
4096
|
+
name: "id",
|
|
4097
|
+
type: "core::integer::u64"
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
name: "context_id",
|
|
4101
|
+
type: "core::integer::u64"
|
|
4102
|
+
},
|
|
4103
|
+
{
|
|
4104
|
+
name: "sponsor_address",
|
|
4105
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
4106
|
+
},
|
|
4107
|
+
{
|
|
4108
|
+
name: "prize",
|
|
4109
|
+
type: "game_components_interfaces::prize::Prize"
|
|
4110
|
+
}
|
|
4111
|
+
]
|
|
4112
|
+
},
|
|
4113
|
+
{
|
|
4114
|
+
type: "interface",
|
|
4115
|
+
name: "game_components_interfaces::prize::IPrize",
|
|
4116
|
+
items: [
|
|
4117
|
+
{
|
|
4118
|
+
type: "function",
|
|
4119
|
+
name: "get_prize",
|
|
4120
|
+
inputs: [
|
|
4121
|
+
{
|
|
4122
|
+
name: "prize_id",
|
|
4123
|
+
type: "core::integer::u64"
|
|
4124
|
+
}
|
|
4125
|
+
],
|
|
4126
|
+
outputs: [
|
|
4127
|
+
{
|
|
4128
|
+
type: "game_components_interfaces::prize::PrizeRecord"
|
|
4129
|
+
}
|
|
4130
|
+
],
|
|
4131
|
+
state_mutability: "view"
|
|
4132
|
+
},
|
|
4133
|
+
{
|
|
4134
|
+
type: "function",
|
|
4135
|
+
name: "get_total_prizes",
|
|
4136
|
+
inputs: [],
|
|
4137
|
+
outputs: [
|
|
4138
|
+
{
|
|
4139
|
+
type: "core::integer::u64"
|
|
4140
|
+
}
|
|
4141
|
+
],
|
|
4142
|
+
state_mutability: "view"
|
|
4143
|
+
},
|
|
4144
|
+
{
|
|
4145
|
+
type: "function",
|
|
4146
|
+
name: "is_prize_claimed",
|
|
4147
|
+
inputs: [
|
|
4148
|
+
{
|
|
4149
|
+
name: "context_id",
|
|
4150
|
+
type: "core::integer::u64"
|
|
4151
|
+
},
|
|
4152
|
+
{
|
|
4153
|
+
name: "prize_type",
|
|
4154
|
+
type: "game_components_interfaces::prize::PrizeType"
|
|
4155
|
+
}
|
|
4156
|
+
],
|
|
4157
|
+
outputs: [
|
|
4158
|
+
{
|
|
4159
|
+
type: "core::bool"
|
|
4160
|
+
}
|
|
4161
|
+
],
|
|
4162
|
+
state_mutability: "view"
|
|
4163
|
+
}
|
|
4164
|
+
]
|
|
4165
|
+
},
|
|
4166
|
+
{
|
|
4167
|
+
type: "impl",
|
|
4168
|
+
name: "RegistrationImpl",
|
|
4169
|
+
interface_name: "game_components_interfaces::registration::IRegistration"
|
|
4170
|
+
},
|
|
4171
|
+
{
|
|
4172
|
+
type: "struct",
|
|
4173
|
+
name: "game_components_interfaces::registration::Registration",
|
|
4174
|
+
members: [
|
|
4175
|
+
{
|
|
4176
|
+
name: "context_id",
|
|
4177
|
+
type: "core::integer::u64"
|
|
4178
|
+
},
|
|
4179
|
+
{
|
|
4180
|
+
name: "entry_id",
|
|
4181
|
+
type: "core::integer::u32"
|
|
4182
|
+
},
|
|
4183
|
+
{
|
|
4184
|
+
name: "game_token_id",
|
|
4185
|
+
type: "core::felt252"
|
|
4186
|
+
},
|
|
4187
|
+
{
|
|
4188
|
+
name: "has_submitted",
|
|
4189
|
+
type: "core::bool"
|
|
4190
|
+
},
|
|
4191
|
+
{
|
|
4192
|
+
name: "is_banned",
|
|
4193
|
+
type: "core::bool"
|
|
4194
|
+
}
|
|
4195
|
+
]
|
|
4196
|
+
},
|
|
4197
|
+
{
|
|
4198
|
+
type: "interface",
|
|
4199
|
+
name: "game_components_interfaces::registration::IRegistration",
|
|
4200
|
+
items: [
|
|
4201
|
+
{
|
|
4202
|
+
type: "function",
|
|
4203
|
+
name: "get_entry",
|
|
4204
|
+
inputs: [
|
|
4205
|
+
{
|
|
4206
|
+
name: "context_id",
|
|
4207
|
+
type: "core::integer::u64"
|
|
4208
|
+
},
|
|
4209
|
+
{
|
|
4210
|
+
name: "entry_id",
|
|
4211
|
+
type: "core::integer::u32"
|
|
4212
|
+
}
|
|
4213
|
+
],
|
|
4214
|
+
outputs: [
|
|
4215
|
+
{
|
|
4216
|
+
type: "game_components_interfaces::registration::Registration"
|
|
4217
|
+
}
|
|
4218
|
+
],
|
|
4219
|
+
state_mutability: "view"
|
|
4220
|
+
},
|
|
4221
|
+
{
|
|
4222
|
+
type: "function",
|
|
4223
|
+
name: "entry_exists",
|
|
4224
|
+
inputs: [
|
|
4225
|
+
{
|
|
4226
|
+
name: "context_id",
|
|
4227
|
+
type: "core::integer::u64"
|
|
4228
|
+
},
|
|
4229
|
+
{
|
|
4230
|
+
name: "entry_id",
|
|
4231
|
+
type: "core::integer::u32"
|
|
4232
|
+
}
|
|
4233
|
+
],
|
|
4234
|
+
outputs: [
|
|
4235
|
+
{
|
|
4236
|
+
type: "core::bool"
|
|
4237
|
+
}
|
|
4238
|
+
],
|
|
4239
|
+
state_mutability: "view"
|
|
4240
|
+
},
|
|
4241
|
+
{
|
|
4242
|
+
type: "function",
|
|
4243
|
+
name: "is_token_banned",
|
|
4244
|
+
inputs: [
|
|
4245
|
+
{
|
|
4246
|
+
name: "token_id",
|
|
4247
|
+
type: "core::felt252"
|
|
4248
|
+
}
|
|
4249
|
+
],
|
|
4250
|
+
outputs: [
|
|
4251
|
+
{
|
|
4252
|
+
type: "core::bool"
|
|
4253
|
+
}
|
|
4254
|
+
],
|
|
4255
|
+
state_mutability: "view"
|
|
4256
|
+
},
|
|
4257
|
+
{
|
|
4258
|
+
type: "function",
|
|
4259
|
+
name: "get_entry_count",
|
|
4260
|
+
inputs: [
|
|
4261
|
+
{
|
|
4262
|
+
name: "context_id",
|
|
4263
|
+
type: "core::integer::u64"
|
|
4264
|
+
}
|
|
4265
|
+
],
|
|
4266
|
+
outputs: [
|
|
4267
|
+
{
|
|
4268
|
+
type: "core::integer::u32"
|
|
4269
|
+
}
|
|
4270
|
+
],
|
|
4271
|
+
state_mutability: "view"
|
|
4272
|
+
}
|
|
4273
|
+
]
|
|
4274
|
+
},
|
|
4275
|
+
{
|
|
4276
|
+
type: "impl",
|
|
4277
|
+
name: "LeaderboardImpl",
|
|
4278
|
+
interface_name: "game_components_interfaces::leaderboard::ILeaderboard"
|
|
4279
|
+
},
|
|
4280
|
+
{
|
|
4281
|
+
type: "struct",
|
|
4282
|
+
name: "game_components_interfaces::structs::leaderboard::LeaderboardEntry",
|
|
4283
|
+
members: [
|
|
4284
|
+
{
|
|
4285
|
+
name: "id",
|
|
4286
|
+
type: "core::felt252"
|
|
4287
|
+
},
|
|
4288
|
+
{
|
|
4289
|
+
name: "score",
|
|
4290
|
+
type: "core::integer::u64"
|
|
4291
|
+
}
|
|
4292
|
+
]
|
|
4293
|
+
},
|
|
4294
|
+
{
|
|
4295
|
+
type: "struct",
|
|
4296
|
+
name: "game_components_interfaces::structs::leaderboard::LeaderboardStoreConfig",
|
|
4297
|
+
members: [
|
|
4298
|
+
{
|
|
4299
|
+
name: "max_entries",
|
|
4300
|
+
type: "core::integer::u32"
|
|
4301
|
+
},
|
|
4302
|
+
{
|
|
4303
|
+
name: "ascending",
|
|
4304
|
+
type: "core::bool"
|
|
4305
|
+
},
|
|
4306
|
+
{
|
|
4307
|
+
name: "game_address",
|
|
4308
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
4309
|
+
}
|
|
4310
|
+
]
|
|
4311
|
+
},
|
|
4312
|
+
{
|
|
4313
|
+
type: "interface",
|
|
4314
|
+
name: "game_components_interfaces::leaderboard::ILeaderboard",
|
|
4315
|
+
items: [
|
|
4316
|
+
{
|
|
4317
|
+
type: "function",
|
|
4318
|
+
name: "get_leaderboard_entries",
|
|
4319
|
+
inputs: [
|
|
4320
|
+
{
|
|
4321
|
+
name: "context_id",
|
|
4322
|
+
type: "core::integer::u64"
|
|
4323
|
+
}
|
|
4324
|
+
],
|
|
4325
|
+
outputs: [
|
|
4326
|
+
{
|
|
4327
|
+
type: "core::array::Array::<game_components_interfaces::structs::leaderboard::LeaderboardEntry>"
|
|
4328
|
+
}
|
|
4329
|
+
],
|
|
4330
|
+
state_mutability: "view"
|
|
4331
|
+
},
|
|
4332
|
+
{
|
|
4333
|
+
type: "function",
|
|
4334
|
+
name: "get_leaderboard_entry",
|
|
4335
|
+
inputs: [
|
|
4336
|
+
{
|
|
4337
|
+
name: "context_id",
|
|
4338
|
+
type: "core::integer::u64"
|
|
4339
|
+
},
|
|
4340
|
+
{
|
|
4341
|
+
name: "position",
|
|
4342
|
+
type: "core::integer::u32"
|
|
4343
|
+
}
|
|
4344
|
+
],
|
|
4345
|
+
outputs: [
|
|
4346
|
+
{
|
|
4347
|
+
type: "game_components_interfaces::structs::leaderboard::LeaderboardEntry"
|
|
3648
4348
|
}
|
|
3649
4349
|
],
|
|
3650
4350
|
state_mutability: "view"
|
|
3651
|
-
}
|
|
3652
|
-
]
|
|
3653
|
-
},
|
|
3654
|
-
{
|
|
3655
|
-
type: "impl",
|
|
3656
|
-
name: "PrizeImpl",
|
|
3657
|
-
interface_name: "game_components_interfaces::prize::IPrize"
|
|
3658
|
-
},
|
|
3659
|
-
{
|
|
3660
|
-
type: "interface",
|
|
3661
|
-
name: "game_components_interfaces::prize::IPrize",
|
|
3662
|
-
items: [
|
|
4351
|
+
},
|
|
3663
4352
|
{
|
|
3664
4353
|
type: "function",
|
|
3665
|
-
name: "
|
|
4354
|
+
name: "get_top_leaderboard_entries",
|
|
3666
4355
|
inputs: [
|
|
3667
4356
|
{
|
|
3668
|
-
name: "
|
|
4357
|
+
name: "context_id",
|
|
3669
4358
|
type: "core::integer::u64"
|
|
4359
|
+
},
|
|
4360
|
+
{
|
|
4361
|
+
name: "count",
|
|
4362
|
+
type: "core::integer::u32"
|
|
3670
4363
|
}
|
|
3671
4364
|
],
|
|
3672
4365
|
outputs: [
|
|
3673
4366
|
{
|
|
3674
|
-
type: "game_components_interfaces::
|
|
4367
|
+
type: "core::array::Array::<game_components_interfaces::structs::leaderboard::LeaderboardEntry>"
|
|
3675
4368
|
}
|
|
3676
4369
|
],
|
|
3677
4370
|
state_mutability: "view"
|
|
3678
4371
|
},
|
|
3679
4372
|
{
|
|
3680
4373
|
type: "function",
|
|
3681
|
-
name: "
|
|
3682
|
-
inputs: [
|
|
3683
|
-
outputs: [
|
|
4374
|
+
name: "get_position",
|
|
4375
|
+
inputs: [
|
|
3684
4376
|
{
|
|
4377
|
+
name: "context_id",
|
|
3685
4378
|
type: "core::integer::u64"
|
|
4379
|
+
},
|
|
4380
|
+
{
|
|
4381
|
+
name: "token_id",
|
|
4382
|
+
type: "core::felt252"
|
|
4383
|
+
}
|
|
4384
|
+
],
|
|
4385
|
+
outputs: [
|
|
4386
|
+
{
|
|
4387
|
+
type: "core::option::Option::<core::integer::u32>"
|
|
3686
4388
|
}
|
|
3687
4389
|
],
|
|
3688
4390
|
state_mutability: "view"
|
|
3689
4391
|
},
|
|
3690
4392
|
{
|
|
3691
4393
|
type: "function",
|
|
3692
|
-
name: "
|
|
4394
|
+
name: "qualifies",
|
|
3693
4395
|
inputs: [
|
|
3694
4396
|
{
|
|
3695
4397
|
name: "context_id",
|
|
3696
4398
|
type: "core::integer::u64"
|
|
3697
4399
|
},
|
|
3698
4400
|
{
|
|
3699
|
-
name: "
|
|
3700
|
-
type: "
|
|
4401
|
+
name: "score",
|
|
4402
|
+
type: "core::integer::u64"
|
|
3701
4403
|
}
|
|
3702
4404
|
],
|
|
3703
4405
|
outputs: [
|
|
@@ -3706,116 +4408,75 @@ var budokan_default = [
|
|
|
3706
4408
|
}
|
|
3707
4409
|
],
|
|
3708
4410
|
state_mutability: "view"
|
|
3709
|
-
}
|
|
3710
|
-
]
|
|
3711
|
-
},
|
|
3712
|
-
{
|
|
3713
|
-
type: "impl",
|
|
3714
|
-
name: "RegistrationImpl",
|
|
3715
|
-
interface_name: "game_components_interfaces::registration::IRegistration"
|
|
3716
|
-
},
|
|
3717
|
-
{
|
|
3718
|
-
type: "struct",
|
|
3719
|
-
name: "game_components_interfaces::registration::Registration",
|
|
3720
|
-
members: [
|
|
3721
|
-
{
|
|
3722
|
-
name: "context_id",
|
|
3723
|
-
type: "core::integer::u64"
|
|
3724
|
-
},
|
|
3725
|
-
{
|
|
3726
|
-
name: "entry_id",
|
|
3727
|
-
type: "core::integer::u32"
|
|
3728
|
-
},
|
|
3729
|
-
{
|
|
3730
|
-
name: "game_token_id",
|
|
3731
|
-
type: "core::felt252"
|
|
3732
|
-
},
|
|
3733
|
-
{
|
|
3734
|
-
name: "has_submitted",
|
|
3735
|
-
type: "core::bool"
|
|
3736
4411
|
},
|
|
3737
|
-
{
|
|
3738
|
-
name: "is_banned",
|
|
3739
|
-
type: "core::bool"
|
|
3740
|
-
}
|
|
3741
|
-
]
|
|
3742
|
-
},
|
|
3743
|
-
{
|
|
3744
|
-
type: "interface",
|
|
3745
|
-
name: "game_components_interfaces::registration::IRegistration",
|
|
3746
|
-
items: [
|
|
3747
4412
|
{
|
|
3748
4413
|
type: "function",
|
|
3749
|
-
name: "
|
|
4414
|
+
name: "is_full",
|
|
3750
4415
|
inputs: [
|
|
3751
4416
|
{
|
|
3752
4417
|
name: "context_id",
|
|
3753
4418
|
type: "core::integer::u64"
|
|
3754
|
-
},
|
|
3755
|
-
{
|
|
3756
|
-
name: "entry_id",
|
|
3757
|
-
type: "core::integer::u32"
|
|
3758
4419
|
}
|
|
3759
4420
|
],
|
|
3760
4421
|
outputs: [
|
|
3761
4422
|
{
|
|
3762
|
-
type: "
|
|
4423
|
+
type: "core::bool"
|
|
3763
4424
|
}
|
|
3764
4425
|
],
|
|
3765
4426
|
state_mutability: "view"
|
|
3766
4427
|
},
|
|
3767
4428
|
{
|
|
3768
4429
|
type: "function",
|
|
3769
|
-
name: "
|
|
4430
|
+
name: "get_leaderboard_length",
|
|
3770
4431
|
inputs: [
|
|
3771
4432
|
{
|
|
3772
4433
|
name: "context_id",
|
|
3773
4434
|
type: "core::integer::u64"
|
|
3774
|
-
},
|
|
3775
|
-
{
|
|
3776
|
-
name: "entry_id",
|
|
3777
|
-
type: "core::integer::u32"
|
|
3778
4435
|
}
|
|
3779
4436
|
],
|
|
3780
4437
|
outputs: [
|
|
3781
4438
|
{
|
|
3782
|
-
type: "core::
|
|
4439
|
+
type: "core::integer::u32"
|
|
3783
4440
|
}
|
|
3784
4441
|
],
|
|
3785
4442
|
state_mutability: "view"
|
|
3786
4443
|
},
|
|
3787
4444
|
{
|
|
3788
4445
|
type: "function",
|
|
3789
|
-
name: "
|
|
4446
|
+
name: "get_config",
|
|
3790
4447
|
inputs: [
|
|
3791
4448
|
{
|
|
3792
4449
|
name: "context_id",
|
|
3793
4450
|
type: "core::integer::u64"
|
|
3794
|
-
},
|
|
3795
|
-
{
|
|
3796
|
-
name: "entry_id",
|
|
3797
|
-
type: "core::integer::u32"
|
|
3798
4451
|
}
|
|
3799
4452
|
],
|
|
3800
4453
|
outputs: [
|
|
3801
4454
|
{
|
|
3802
|
-
type: "
|
|
4455
|
+
type: "game_components_interfaces::structs::leaderboard::LeaderboardStoreConfig"
|
|
3803
4456
|
}
|
|
3804
4457
|
],
|
|
3805
4458
|
state_mutability: "view"
|
|
3806
4459
|
},
|
|
3807
4460
|
{
|
|
3808
4461
|
type: "function",
|
|
3809
|
-
name: "
|
|
4462
|
+
name: "find_position",
|
|
3810
4463
|
inputs: [
|
|
3811
4464
|
{
|
|
3812
4465
|
name: "context_id",
|
|
3813
4466
|
type: "core::integer::u64"
|
|
4467
|
+
},
|
|
4468
|
+
{
|
|
4469
|
+
name: "score",
|
|
4470
|
+
type: "core::integer::u64"
|
|
4471
|
+
},
|
|
4472
|
+
{
|
|
4473
|
+
name: "token_id",
|
|
4474
|
+
type: "core::felt252"
|
|
3814
4475
|
}
|
|
3815
4476
|
],
|
|
3816
4477
|
outputs: [
|
|
3817
4478
|
{
|
|
3818
|
-
type: "core::integer::u32"
|
|
4479
|
+
type: "core::option::Option::<core::integer::u32>"
|
|
3819
4480
|
}
|
|
3820
4481
|
],
|
|
3821
4482
|
state_mutability: "view"
|
|
@@ -3959,6 +4620,12 @@ var budokan_default = [
|
|
|
3959
4620
|
kind: "enum",
|
|
3960
4621
|
variants: []
|
|
3961
4622
|
},
|
|
4623
|
+
{
|
|
4624
|
+
type: "event",
|
|
4625
|
+
name: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
|
|
4626
|
+
kind: "enum",
|
|
4627
|
+
variants: []
|
|
4628
|
+
},
|
|
3962
4629
|
{
|
|
3963
4630
|
type: "event",
|
|
3964
4631
|
name: "budokan::events::TournamentCreated",
|
|
@@ -3974,11 +4641,6 @@ var budokan_default = [
|
|
|
3974
4641
|
type: "core::starknet::contract_address::ContractAddress",
|
|
3975
4642
|
kind: "key"
|
|
3976
4643
|
},
|
|
3977
|
-
{
|
|
3978
|
-
name: "created_at",
|
|
3979
|
-
type: "core::integer::u64",
|
|
3980
|
-
kind: "data"
|
|
3981
|
-
},
|
|
3982
4644
|
{
|
|
3983
4645
|
name: "created_by",
|
|
3984
4646
|
type: "core::starknet::contract_address::ContractAddress",
|
|
@@ -3995,28 +4657,28 @@ var budokan_default = [
|
|
|
3995
4657
|
kind: "data"
|
|
3996
4658
|
},
|
|
3997
4659
|
{
|
|
3998
|
-
name: "
|
|
3999
|
-
type: "
|
|
4660
|
+
name: "config",
|
|
4661
|
+
type: "core::felt252",
|
|
4000
4662
|
kind: "data"
|
|
4001
4663
|
},
|
|
4002
4664
|
{
|
|
4003
|
-
name: "
|
|
4004
|
-
type: "
|
|
4665
|
+
name: "client_url",
|
|
4666
|
+
type: "core::option::Option::<core::byte_array::ByteArray>",
|
|
4005
4667
|
kind: "data"
|
|
4006
4668
|
},
|
|
4007
4669
|
{
|
|
4008
|
-
name: "
|
|
4009
|
-
type: "core::option::Option::<
|
|
4670
|
+
name: "renderer",
|
|
4671
|
+
type: "core::option::Option::<core::starknet::contract_address::ContractAddress>",
|
|
4010
4672
|
kind: "data"
|
|
4011
4673
|
},
|
|
4012
4674
|
{
|
|
4013
|
-
name: "
|
|
4014
|
-
type: "core::option::Option::<
|
|
4675
|
+
name: "entry_fee",
|
|
4676
|
+
type: "core::option::Option::<budokan_interfaces::budokan::EntryFeeKind>",
|
|
4015
4677
|
kind: "data"
|
|
4016
4678
|
},
|
|
4017
4679
|
{
|
|
4018
|
-
name: "
|
|
4019
|
-
type: "
|
|
4680
|
+
name: "entry_requirement",
|
|
4681
|
+
type: "core::option::Option::<game_components_interfaces::entry_requirement::EntryRequirement>",
|
|
4020
4682
|
kind: "data"
|
|
4021
4683
|
}
|
|
4022
4684
|
]
|
|
@@ -4036,11 +4698,6 @@ var budokan_default = [
|
|
|
4036
4698
|
type: "core::felt252",
|
|
4037
4699
|
kind: "key"
|
|
4038
4700
|
},
|
|
4039
|
-
{
|
|
4040
|
-
name: "game_address",
|
|
4041
|
-
type: "core::starknet::contract_address::ContractAddress",
|
|
4042
|
-
kind: "data"
|
|
4043
|
-
},
|
|
4044
4701
|
{
|
|
4045
4702
|
name: "player_address",
|
|
4046
4703
|
type: "core::starknet::contract_address::ContractAddress",
|
|
@@ -4050,22 +4707,12 @@ var budokan_default = [
|
|
|
4050
4707
|
name: "entry_number",
|
|
4051
4708
|
type: "core::integer::u32",
|
|
4052
4709
|
kind: "data"
|
|
4053
|
-
},
|
|
4054
|
-
{
|
|
4055
|
-
name: "has_submitted",
|
|
4056
|
-
type: "core::bool",
|
|
4057
|
-
kind: "data"
|
|
4058
|
-
},
|
|
4059
|
-
{
|
|
4060
|
-
name: "is_banned",
|
|
4061
|
-
type: "core::bool",
|
|
4062
|
-
kind: "data"
|
|
4063
4710
|
}
|
|
4064
4711
|
]
|
|
4065
4712
|
},
|
|
4066
4713
|
{
|
|
4067
4714
|
type: "event",
|
|
4068
|
-
name: "budokan::events::
|
|
4715
|
+
name: "budokan::events::TournamentEntryStateChanged",
|
|
4069
4716
|
kind: "struct",
|
|
4070
4717
|
members: [
|
|
4071
4718
|
{
|
|
@@ -4074,8 +4721,18 @@ var budokan_default = [
|
|
|
4074
4721
|
kind: "key"
|
|
4075
4722
|
},
|
|
4076
4723
|
{
|
|
4077
|
-
name: "
|
|
4078
|
-
type: "core::
|
|
4724
|
+
name: "game_token_id",
|
|
4725
|
+
type: "core::felt252",
|
|
4726
|
+
kind: "key"
|
|
4727
|
+
},
|
|
4728
|
+
{
|
|
4729
|
+
name: "has_submitted",
|
|
4730
|
+
type: "core::bool",
|
|
4731
|
+
kind: "data"
|
|
4732
|
+
},
|
|
4733
|
+
{
|
|
4734
|
+
name: "is_banned",
|
|
4735
|
+
type: "core::bool",
|
|
4079
4736
|
kind: "data"
|
|
4080
4737
|
}
|
|
4081
4738
|
]
|
|
@@ -4101,13 +4758,8 @@ var budokan_default = [
|
|
|
4101
4758
|
kind: "data"
|
|
4102
4759
|
},
|
|
4103
4760
|
{
|
|
4104
|
-
name: "
|
|
4105
|
-
type: "
|
|
4106
|
-
kind: "data"
|
|
4107
|
-
},
|
|
4108
|
-
{
|
|
4109
|
-
name: "token_type",
|
|
4110
|
-
type: "game_components_interfaces::prize::TokenTypeData",
|
|
4761
|
+
name: "prize",
|
|
4762
|
+
type: "game_components_interfaces::prize::Prize",
|
|
4111
4763
|
kind: "data"
|
|
4112
4764
|
},
|
|
4113
4765
|
{
|
|
@@ -4216,6 +4868,11 @@ var budokan_default = [
|
|
|
4216
4868
|
type: "game_components_metagame::prize::prize_component::PrizeComponent::Event",
|
|
4217
4869
|
kind: "flat"
|
|
4218
4870
|
},
|
|
4871
|
+
{
|
|
4872
|
+
name: "ReentrancyGuardEvent",
|
|
4873
|
+
type: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
|
|
4874
|
+
kind: "flat"
|
|
4875
|
+
},
|
|
4219
4876
|
{
|
|
4220
4877
|
name: "TournamentCreated",
|
|
4221
4878
|
type: "budokan::events::TournamentCreated",
|
|
@@ -4227,8 +4884,8 @@ var budokan_default = [
|
|
|
4227
4884
|
kind: "nested"
|
|
4228
4885
|
},
|
|
4229
4886
|
{
|
|
4230
|
-
name: "
|
|
4231
|
-
type: "budokan::events::
|
|
4887
|
+
name: "TournamentEntryStateChanged",
|
|
4888
|
+
type: "budokan::events::TournamentEntryStateChanged",
|
|
4232
4889
|
kind: "nested"
|
|
4233
4890
|
},
|
|
4234
4891
|
{
|
|
@@ -4396,6 +5053,7 @@ var BudokanClient = class {
|
|
|
4396
5053
|
if (prizes.length === 0) return t;
|
|
4397
5054
|
const tokenMap = /* @__PURE__ */ new Map();
|
|
4398
5055
|
for (const p of prizes) {
|
|
5056
|
+
if (p.tokenType === "extension" || p.tokenAddress == null) continue;
|
|
4399
5057
|
const key = p.tokenAddress;
|
|
4400
5058
|
const existing = tokenMap.get(key);
|
|
4401
5059
|
if (existing) {
|
|
@@ -4711,6 +5369,501 @@ function createBudokanClient(config) {
|
|
|
4711
5369
|
return new BudokanClient(config);
|
|
4712
5370
|
}
|
|
4713
5371
|
|
|
5372
|
+
// src/games/whitelist.ts
|
|
5373
|
+
var STRK = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d";
|
|
5374
|
+
var MAINNET_GAMES_RAW = [
|
|
5375
|
+
{
|
|
5376
|
+
contractAddress: "0x4de0351ceab4ecd50be6ee09329b0dcb3b96a9da88cc158f453823a389722fa",
|
|
5377
|
+
name: "Death Mountain",
|
|
5378
|
+
url: "https://deathmountain.gg/",
|
|
5379
|
+
playUrl: "https://deathmountain.gg/play?id=",
|
|
5380
|
+
watchLink: "https://deathmountain.gg/watch?id=",
|
|
5381
|
+
replayLink: "https://deathmountain.gg/replay?id=",
|
|
5382
|
+
controllerOnly: true,
|
|
5383
|
+
minEntryFeeUsd: 0.25,
|
|
5384
|
+
defaultEntryFeeToken: STRK,
|
|
5385
|
+
defaultGameFeePercentage: 5,
|
|
5386
|
+
averageGasCostUsd: 0.25
|
|
5387
|
+
},
|
|
5388
|
+
{
|
|
5389
|
+
contractAddress: "0x642f228f70b1ca7edb4ab7ff0bab067369c2e276ddc2570ca18802d4e758edc",
|
|
5390
|
+
name: "zKube",
|
|
5391
|
+
imageUrl: "https://zkube-budokan-sepolia.vercel.app/assets/logo.png",
|
|
5392
|
+
url: "https://zkube.io",
|
|
5393
|
+
playUrl: "https://zkube.io/play/",
|
|
5394
|
+
minEntryFeeUsd: 0.25,
|
|
5395
|
+
defaultEntryFeeToken: STRK
|
|
5396
|
+
}
|
|
5397
|
+
];
|
|
5398
|
+
var SEPOLIA_GAMES_RAW = [
|
|
5399
|
+
{
|
|
5400
|
+
contractAddress: "0x04359aee29873cd9603207d29b4140468bac3e042aa10daab2e1a8b2dd60ef7b",
|
|
5401
|
+
name: "Dark Shuffle",
|
|
5402
|
+
imageUrl: "https://darkshuffle.dev/favicon.svg",
|
|
5403
|
+
url: "https://darkshuffle.dev",
|
|
5404
|
+
controllerOnly: true,
|
|
5405
|
+
minEntryFeeUsd: 0.25,
|
|
5406
|
+
defaultEntryFeeToken: STRK
|
|
5407
|
+
},
|
|
5408
|
+
{
|
|
5409
|
+
contractAddress: "0x07ae26eecf0274aabb31677753ff3a4e15beec7268fa1b104f73ce3c89202831",
|
|
5410
|
+
name: "Death Mountain",
|
|
5411
|
+
imageUrl: "https://darkshuffle.dev/favicon.svg",
|
|
5412
|
+
url: "https://lootsurvivor.io/",
|
|
5413
|
+
playUrl: "https://lootsurvivor.io/survivor/play?id=",
|
|
5414
|
+
controllerOnly: true,
|
|
5415
|
+
minEntryFeeUsd: 0.25,
|
|
5416
|
+
defaultEntryFeeToken: STRK
|
|
5417
|
+
},
|
|
5418
|
+
{
|
|
5419
|
+
contractAddress: "0x012ccc9a2d76c836d088203f6e9d62e22d1a9f7479d1aea8b503a1036c0f4487",
|
|
5420
|
+
name: "Nums",
|
|
5421
|
+
url: "https://nums-blond.vercel.app/",
|
|
5422
|
+
playUrl: "https://nums-blond.vercel.app/",
|
|
5423
|
+
controllerOnly: true,
|
|
5424
|
+
minEntryFeeUsd: 0.25,
|
|
5425
|
+
defaultEntryFeeToken: STRK
|
|
5426
|
+
},
|
|
5427
|
+
{
|
|
5428
|
+
contractAddress: "0x3a2ea07f0f49c770035eed9a010eb3d1e1bc3cb92e1d47eef2ad75a25c6bdb2",
|
|
5429
|
+
name: "Number Guess",
|
|
5430
|
+
url: "https://funfactory.gg/games/1",
|
|
5431
|
+
playUrl: "https://funfactory.gg/tokens/{tokenId}/play",
|
|
5432
|
+
controllerOnly: true,
|
|
5433
|
+
minEntryFeeUsd: 0.25,
|
|
5434
|
+
defaultEntryFeeToken: STRK,
|
|
5435
|
+
objectImage: true
|
|
5436
|
+
},
|
|
5437
|
+
{
|
|
5438
|
+
contractAddress: "0x5e02a1f750b3fa0e835d454705b664ecb23166cdb49459b1c96c1e3eaf9a2f4",
|
|
5439
|
+
name: "zKube",
|
|
5440
|
+
imageUrl: "https://zkube-budokan-sepolia.vercel.app/assets/logo.png",
|
|
5441
|
+
url: "https://zkube-budokan-sepolia.vercel.app",
|
|
5442
|
+
playUrl: "https://zkube-budokan-sepolia.vercel.app/play/",
|
|
5443
|
+
controllerOnly: true,
|
|
5444
|
+
minEntryFeeUsd: 0.25,
|
|
5445
|
+
defaultEntryFeeToken: STRK
|
|
5446
|
+
}
|
|
5447
|
+
];
|
|
5448
|
+
var MAINNET_GAMES = MAINNET_GAMES_RAW.map(canonicalize);
|
|
5449
|
+
var SEPOLIA_GAMES = SEPOLIA_GAMES_RAW.map(canonicalize);
|
|
5450
|
+
function canonicalize(game) {
|
|
5451
|
+
return {
|
|
5452
|
+
...game,
|
|
5453
|
+
contractAddress: normalizeAddress(game.contractAddress),
|
|
5454
|
+
defaultEntryFeeToken: game.defaultEntryFeeToken ? normalizeAddress(game.defaultEntryFeeToken) : void 0
|
|
5455
|
+
};
|
|
5456
|
+
}
|
|
5457
|
+
function getWhitelistedGames(chain) {
|
|
5458
|
+
const list = chain === "mainnet" ? MAINNET_GAMES : SEPOLIA_GAMES;
|
|
5459
|
+
return list.map((g) => ({ ...g })).sort((a, b) => {
|
|
5460
|
+
const aDisabled = a.disabled ?? false;
|
|
5461
|
+
const bDisabled = b.disabled ?? false;
|
|
5462
|
+
if (aDisabled !== bDisabled) return aDisabled ? 1 : -1;
|
|
5463
|
+
return a.name.localeCompare(b.name);
|
|
5464
|
+
});
|
|
5465
|
+
}
|
|
5466
|
+
function findWhitelistedGame(chain, contractAddress) {
|
|
5467
|
+
const target = normalizeAddress(contractAddress);
|
|
5468
|
+
return getWhitelistedGames(chain).find((g) => g.contractAddress === target);
|
|
5469
|
+
}
|
|
5470
|
+
function isGameWhitelisted(chain, contractAddress) {
|
|
5471
|
+
return findWhitelistedGame(chain, contractAddress) !== void 0;
|
|
5472
|
+
}
|
|
5473
|
+
function getGameDefaults(chain, contractAddress) {
|
|
5474
|
+
const game = findWhitelistedGame(chain, contractAddress);
|
|
5475
|
+
return {
|
|
5476
|
+
minEntryFeeUsd: game?.minEntryFeeUsd ?? 0.25,
|
|
5477
|
+
defaultEntryFeeToken: game?.defaultEntryFeeToken ?? STRK,
|
|
5478
|
+
defaultGameFeePercentage: game?.defaultGameFeePercentage ?? 1,
|
|
5479
|
+
averageGasCostUsd: game?.averageGasCostUsd,
|
|
5480
|
+
leaderboardAscending: game?.leaderboardAscending ?? false,
|
|
5481
|
+
leaderboardGameMustBeOver: game?.leaderboardGameMustBeOver ?? false
|
|
5482
|
+
};
|
|
5483
|
+
}
|
|
5484
|
+
function buildErc20ApproveCall(tokenAddress, spender, amount) {
|
|
5485
|
+
return {
|
|
5486
|
+
contractAddress: tokenAddress,
|
|
5487
|
+
entrypoint: "approve",
|
|
5488
|
+
calldata: starknet.CallData.compile([spender, starknet.uint256.bnToUint256(amount)])
|
|
5489
|
+
};
|
|
5490
|
+
}
|
|
5491
|
+
function buildEnterTournamentCall(budokanAddress, args) {
|
|
5492
|
+
const calldata = [
|
|
5493
|
+
starknet.num.toHex(args.tournamentId)
|
|
5494
|
+
// tournament_id u64
|
|
5495
|
+
];
|
|
5496
|
+
if (args.playerName) {
|
|
5497
|
+
calldata.push("0x0", felt252FromShortString(args.playerName));
|
|
5498
|
+
} else {
|
|
5499
|
+
calldata.push("0x1");
|
|
5500
|
+
}
|
|
5501
|
+
if (args.playerAddress) {
|
|
5502
|
+
calldata.push("0x0", args.playerAddress);
|
|
5503
|
+
} else {
|
|
5504
|
+
calldata.push("0x1");
|
|
5505
|
+
}
|
|
5506
|
+
if (args.qualifier) {
|
|
5507
|
+
calldata.push("0x0", args.qualifier);
|
|
5508
|
+
} else {
|
|
5509
|
+
calldata.push("0x1");
|
|
5510
|
+
}
|
|
5511
|
+
calldata.push("0x1");
|
|
5512
|
+
if (args.entryFeePayParams && args.entryFeePayParams.length > 0) {
|
|
5513
|
+
calldata.push(
|
|
5514
|
+
"0x0",
|
|
5515
|
+
starknet.num.toHex(args.entryFeePayParams.length),
|
|
5516
|
+
...args.entryFeePayParams
|
|
5517
|
+
);
|
|
5518
|
+
} else {
|
|
5519
|
+
calldata.push("0x1");
|
|
5520
|
+
}
|
|
5521
|
+
calldata.push(starknet.num.toHex(args.salt ?? 0));
|
|
5522
|
+
calldata.push(starknet.num.toHex(args.metadataValue ?? 0));
|
|
5523
|
+
return {
|
|
5524
|
+
contractAddress: budokanAddress,
|
|
5525
|
+
entrypoint: "enter_tournament",
|
|
5526
|
+
calldata
|
|
5527
|
+
};
|
|
5528
|
+
}
|
|
5529
|
+
function buildSubmitScoreCall(budokanAddress, args) {
|
|
5530
|
+
return {
|
|
5531
|
+
contractAddress: budokanAddress,
|
|
5532
|
+
entrypoint: "submit_score",
|
|
5533
|
+
calldata: starknet.CallData.compile([args.tournamentId, args.tokenId, args.position])
|
|
5534
|
+
};
|
|
5535
|
+
}
|
|
5536
|
+
function buildClaimRewardCall(budokanAddress, args) {
|
|
5537
|
+
const calldata = [starknet.num.toHex(args.tournamentId)];
|
|
5538
|
+
pushRewardTypeFelts(calldata, args.reward);
|
|
5539
|
+
return {
|
|
5540
|
+
contractAddress: budokanAddress,
|
|
5541
|
+
entrypoint: "claim_reward",
|
|
5542
|
+
calldata
|
|
5543
|
+
};
|
|
5544
|
+
}
|
|
5545
|
+
function buildCreateTournamentCall(budokanAddress, args) {
|
|
5546
|
+
const calldata = starknet.CallData.compile({
|
|
5547
|
+
creator_rewards_address: args.creatorRewardsAddress,
|
|
5548
|
+
metadata: {
|
|
5549
|
+
// name is a felt252 (≤31 ASCII bytes). starknet.js packs short
|
|
5550
|
+
// ASCII strings into a single felt automatically.
|
|
5551
|
+
name: args.name,
|
|
5552
|
+
// description is a Cairo ByteArray (multi-felt: data words +
|
|
5553
|
+
// pending word + pending word length). A plain JS string serializes
|
|
5554
|
+
// to a single felt and the deserializer reverts — wrap explicitly.
|
|
5555
|
+
description: starknet.byteArray.byteArrayFromString(args.description)
|
|
5556
|
+
},
|
|
5557
|
+
schedule: {
|
|
5558
|
+
registration_start_delay: args.schedule.registrationStartDelay,
|
|
5559
|
+
registration_end_delay: args.schedule.registrationEndDelay,
|
|
5560
|
+
game_start_delay: args.schedule.gameStartDelay,
|
|
5561
|
+
game_end_delay: args.schedule.gameEndDelay,
|
|
5562
|
+
submission_duration: args.schedule.submissionDuration
|
|
5563
|
+
},
|
|
5564
|
+
game_config: {
|
|
5565
|
+
game_address: args.gameAddress,
|
|
5566
|
+
settings_id: args.settingsId,
|
|
5567
|
+
soulbound: false,
|
|
5568
|
+
paymaster: false,
|
|
5569
|
+
// Options must be CairoOption — see file header for why.
|
|
5570
|
+
client_url: new starknet.CairoOption(starknet.CairoOptionVariant.None),
|
|
5571
|
+
renderer: new starknet.CairoOption(starknet.CairoOptionVariant.None)
|
|
5572
|
+
},
|
|
5573
|
+
entry_fee: encodeEntryFeeOption(args.entryFee),
|
|
5574
|
+
entry_requirement: encodeEntryRequirementOption(args.entryRequirement),
|
|
5575
|
+
leaderboard_config: {
|
|
5576
|
+
ascending: args.leaderboard.ascending,
|
|
5577
|
+
game_must_be_over: args.leaderboard.gameMustBeOver
|
|
5578
|
+
},
|
|
5579
|
+
salt: args.salt ?? 0,
|
|
5580
|
+
metadata_value: args.metadataValue ?? 0
|
|
5581
|
+
});
|
|
5582
|
+
return {
|
|
5583
|
+
contractAddress: budokanAddress,
|
|
5584
|
+
entrypoint: "create_tournament",
|
|
5585
|
+
calldata
|
|
5586
|
+
};
|
|
5587
|
+
}
|
|
5588
|
+
function buildAddPrizeCall(budokanAddress, args) {
|
|
5589
|
+
const prize = encodePrize(args.prize);
|
|
5590
|
+
const position = args.prize.kind === "token" && args.prize.position !== void 0 ? new starknet.CairoOption(starknet.CairoOptionVariant.Some, args.prize.position) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
5591
|
+
const calldata = starknet.CallData.compile({
|
|
5592
|
+
tournament_id: args.tournamentId,
|
|
5593
|
+
prize,
|
|
5594
|
+
position
|
|
5595
|
+
});
|
|
5596
|
+
return {
|
|
5597
|
+
contractAddress: budokanAddress,
|
|
5598
|
+
entrypoint: "add_prize",
|
|
5599
|
+
calldata
|
|
5600
|
+
};
|
|
5601
|
+
}
|
|
5602
|
+
function encodePrize(spec) {
|
|
5603
|
+
if (spec.kind === "token") {
|
|
5604
|
+
return new starknet.CairoCustomEnum({
|
|
5605
|
+
Token: {
|
|
5606
|
+
token_address: spec.tokenAddress,
|
|
5607
|
+
token_type: encodeTokenType(spec.tokenType)
|
|
5608
|
+
},
|
|
5609
|
+
Extension: void 0
|
|
5610
|
+
});
|
|
5611
|
+
}
|
|
5612
|
+
return new starknet.CairoCustomEnum({
|
|
5613
|
+
Token: void 0,
|
|
5614
|
+
Extension: {
|
|
5615
|
+
address: spec.address,
|
|
5616
|
+
config: spec.config
|
|
5617
|
+
}
|
|
5618
|
+
});
|
|
5619
|
+
}
|
|
5620
|
+
function encodeTokenType(spec) {
|
|
5621
|
+
if (spec.kind === "erc20") {
|
|
5622
|
+
if (spec.distribution && spec.distributionCount === void 0) {
|
|
5623
|
+
throw new Error(
|
|
5624
|
+
"TokenTypeSpec.erc20: distributionCount is required when distribution is set"
|
|
5625
|
+
);
|
|
5626
|
+
}
|
|
5627
|
+
const distribution = spec.distribution ? new starknet.CairoOption(
|
|
5628
|
+
starknet.CairoOptionVariant.Some,
|
|
5629
|
+
encodeDistribution(spec.distribution)
|
|
5630
|
+
) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
5631
|
+
const distributionCount = spec.distribution && spec.distributionCount !== void 0 ? new starknet.CairoOption(
|
|
5632
|
+
starknet.CairoOptionVariant.Some,
|
|
5633
|
+
spec.distributionCount
|
|
5634
|
+
) : new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
5635
|
+
return new starknet.CairoCustomEnum({
|
|
5636
|
+
erc20: {
|
|
5637
|
+
amount: spec.amount,
|
|
5638
|
+
distribution,
|
|
5639
|
+
distribution_count: distributionCount
|
|
5640
|
+
},
|
|
5641
|
+
erc721: void 0
|
|
5642
|
+
});
|
|
5643
|
+
}
|
|
5644
|
+
return new starknet.CairoCustomEnum({
|
|
5645
|
+
erc20: void 0,
|
|
5646
|
+
erc721: { id: spec.tokenId }
|
|
5647
|
+
});
|
|
5648
|
+
}
|
|
5649
|
+
function encodeEntryFeeOption(fee) {
|
|
5650
|
+
if (!fee) return new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
5651
|
+
const builtIn = {
|
|
5652
|
+
token_address: fee.tokenAddress,
|
|
5653
|
+
amount: fee.amount,
|
|
5654
|
+
tournament_creator_share: fee.tournamentCreatorShare,
|
|
5655
|
+
game_creator_share: fee.gameCreatorShare,
|
|
5656
|
+
refund_share: fee.refundShare,
|
|
5657
|
+
distribution: encodeDistribution(fee.distribution),
|
|
5658
|
+
distribution_count: fee.distributionCount
|
|
5659
|
+
};
|
|
5660
|
+
return new starknet.CairoOption(
|
|
5661
|
+
starknet.CairoOptionVariant.Some,
|
|
5662
|
+
new starknet.CairoCustomEnum({ BuiltIn: builtIn, Extension: void 0 })
|
|
5663
|
+
);
|
|
5664
|
+
}
|
|
5665
|
+
function encodeEntryRequirementOption(req) {
|
|
5666
|
+
if (!req)
|
|
5667
|
+
return new starknet.CairoOption(starknet.CairoOptionVariant.None);
|
|
5668
|
+
return new starknet.CairoOption(starknet.CairoOptionVariant.Some, {
|
|
5669
|
+
entry_limit: req.entryLimit,
|
|
5670
|
+
entry_requirement_type: encodeEntryRequirementType(req.type)
|
|
5671
|
+
});
|
|
5672
|
+
}
|
|
5673
|
+
function encodeEntryRequirementType(spec) {
|
|
5674
|
+
if (spec.kind === "token") {
|
|
5675
|
+
return new starknet.CairoCustomEnum({
|
|
5676
|
+
token: spec.tokenAddress,
|
|
5677
|
+
extension: void 0
|
|
5678
|
+
});
|
|
5679
|
+
}
|
|
5680
|
+
if (spec.kind === "extension") {
|
|
5681
|
+
return new starknet.CairoCustomEnum({
|
|
5682
|
+
token: void 0,
|
|
5683
|
+
extension: {
|
|
5684
|
+
address: spec.address,
|
|
5685
|
+
config: spec.config
|
|
5686
|
+
}
|
|
5687
|
+
});
|
|
5688
|
+
}
|
|
5689
|
+
throw new Error(
|
|
5690
|
+
`Unsupported entry requirement kind: ${spec.kind}`
|
|
5691
|
+
);
|
|
5692
|
+
}
|
|
5693
|
+
function scaleWeight(client) {
|
|
5694
|
+
return Math.round(client * 10);
|
|
5695
|
+
}
|
|
5696
|
+
function encodeDistribution(d) {
|
|
5697
|
+
if (d.kind === "linear") {
|
|
5698
|
+
return new starknet.CairoCustomEnum({
|
|
5699
|
+
Linear: scaleWeight(d.weight),
|
|
5700
|
+
Exponential: void 0,
|
|
5701
|
+
Uniform: void 0,
|
|
5702
|
+
Custom: void 0
|
|
5703
|
+
});
|
|
5704
|
+
}
|
|
5705
|
+
if (d.kind === "exponential") {
|
|
5706
|
+
return new starknet.CairoCustomEnum({
|
|
5707
|
+
Linear: void 0,
|
|
5708
|
+
Exponential: scaleWeight(d.weight),
|
|
5709
|
+
Uniform: void 0,
|
|
5710
|
+
Custom: void 0
|
|
5711
|
+
});
|
|
5712
|
+
}
|
|
5713
|
+
return new starknet.CairoCustomEnum({
|
|
5714
|
+
Linear: void 0,
|
|
5715
|
+
Exponential: void 0,
|
|
5716
|
+
Uniform: {},
|
|
5717
|
+
Custom: void 0
|
|
5718
|
+
});
|
|
5719
|
+
}
|
|
5720
|
+
function pushRewardTypeFelts(out, reward) {
|
|
5721
|
+
switch (reward.kind) {
|
|
5722
|
+
case "prize_single":
|
|
5723
|
+
out.push("0x0", "0x0", "0x0", starknet.num.toHex(reward.prizeId));
|
|
5724
|
+
return;
|
|
5725
|
+
case "prize_distributed":
|
|
5726
|
+
out.push(
|
|
5727
|
+
"0x0",
|
|
5728
|
+
"0x0",
|
|
5729
|
+
"0x1",
|
|
5730
|
+
starknet.num.toHex(reward.prizeId),
|
|
5731
|
+
starknet.num.toHex(reward.payoutPosition)
|
|
5732
|
+
);
|
|
5733
|
+
return;
|
|
5734
|
+
case "prize_extension":
|
|
5735
|
+
out.push("0x0", "0x1", starknet.num.toHex(reward.prizeId));
|
|
5736
|
+
if (reward.tokenId !== void 0) {
|
|
5737
|
+
out.push("0x0", reward.tokenId);
|
|
5738
|
+
} else {
|
|
5739
|
+
out.push("0x1");
|
|
5740
|
+
}
|
|
5741
|
+
out.push(
|
|
5742
|
+
starknet.num.toHex(reward.payoutParams.length),
|
|
5743
|
+
...reward.payoutParams.map((p) => starknet.num.toHex(p))
|
|
5744
|
+
);
|
|
5745
|
+
return;
|
|
5746
|
+
case "entry_fee_position":
|
|
5747
|
+
out.push("0x1", "0x0", "0x0", starknet.num.toHex(reward.position));
|
|
5748
|
+
return;
|
|
5749
|
+
case "entry_fee_tournament_creator":
|
|
5750
|
+
out.push("0x1", "0x0", "0x1");
|
|
5751
|
+
return;
|
|
5752
|
+
case "entry_fee_game_creator":
|
|
5753
|
+
out.push("0x1", "0x0", "0x2");
|
|
5754
|
+
return;
|
|
5755
|
+
case "entry_fee_refund":
|
|
5756
|
+
out.push("0x1", "0x0", "0x3", starknet.num.toHex(reward.tokenId));
|
|
5757
|
+
return;
|
|
5758
|
+
case "entry_fee_extension": {
|
|
5759
|
+
out.push("0x1", "0x1");
|
|
5760
|
+
if (reward.tokenId !== void 0) {
|
|
5761
|
+
out.push("0x0", reward.tokenId);
|
|
5762
|
+
} else {
|
|
5763
|
+
out.push("0x1");
|
|
5764
|
+
}
|
|
5765
|
+
out.push(
|
|
5766
|
+
starknet.num.toHex(reward.claimParams.length),
|
|
5767
|
+
...reward.claimParams.map((p) => starknet.num.toHex(p))
|
|
5768
|
+
);
|
|
5769
|
+
return;
|
|
5770
|
+
}
|
|
5771
|
+
}
|
|
5772
|
+
}
|
|
5773
|
+
var TOURNAMENT_CREATED_SELECTOR = starknet.hash.getSelectorFromName(
|
|
5774
|
+
"TournamentCreated"
|
|
5775
|
+
);
|
|
5776
|
+
function parseTournamentIdFromReceipt(receipt, budokanAddress) {
|
|
5777
|
+
const normalise = (addr) => addr.toLowerCase().replace(/^0x0*/, "0x");
|
|
5778
|
+
const normContract = normalise(budokanAddress);
|
|
5779
|
+
const createdSelector = BigInt(TOURNAMENT_CREATED_SELECTOR);
|
|
5780
|
+
for (const event of receipt.events ?? []) {
|
|
5781
|
+
if (!event.from_address || !event.keys || event.keys.length < 2) continue;
|
|
5782
|
+
if (normalise(event.from_address) !== normContract) continue;
|
|
5783
|
+
if (BigInt(event.keys[0]) !== createdSelector) continue;
|
|
5784
|
+
return BigInt(event.keys[1]);
|
|
5785
|
+
}
|
|
5786
|
+
return void 0;
|
|
5787
|
+
}
|
|
5788
|
+
function felt252FromShortString(s) {
|
|
5789
|
+
if (s.length > 31)
|
|
5790
|
+
throw new Error(`String too long for felt252: ${s.length} bytes`);
|
|
5791
|
+
let value = 0n;
|
|
5792
|
+
for (const char of s) {
|
|
5793
|
+
const code = char.charCodeAt(0);
|
|
5794
|
+
if (code > 127) throw new Error("Felt252 short strings must be ASCII");
|
|
5795
|
+
value = value << 8n | BigInt(code);
|
|
5796
|
+
}
|
|
5797
|
+
return "0x" + value.toString(16);
|
|
5798
|
+
}
|
|
5799
|
+
function sdkChainId(chain) {
|
|
5800
|
+
return chain === "mainnet" ? "SN_MAIN" : "SN_SEPOLIA";
|
|
5801
|
+
}
|
|
5802
|
+
function extensionAddressFor(chain, kind) {
|
|
5803
|
+
const table = metagameSdk.getExtensionAddresses(sdkChainId(chain));
|
|
5804
|
+
switch (kind) {
|
|
5805
|
+
case "merkle":
|
|
5806
|
+
if (!table.merkleValidator)
|
|
5807
|
+
throw new Error(`No merkleValidator address for ${chain}`);
|
|
5808
|
+
return table.merkleValidator;
|
|
5809
|
+
case "erc20Balance":
|
|
5810
|
+
if (!table.erc20BalanceValidator)
|
|
5811
|
+
throw new Error(`No erc20BalanceValidator address for ${chain}`);
|
|
5812
|
+
return table.erc20BalanceValidator;
|
|
5813
|
+
case "opusTroves":
|
|
5814
|
+
if (!table.opusTrovesValidator)
|
|
5815
|
+
throw new Error(`No opusTrovesValidator address for ${chain}`);
|
|
5816
|
+
return table.opusTrovesValidator;
|
|
5817
|
+
case "tournament":
|
|
5818
|
+
if (!table.tournamentValidator)
|
|
5819
|
+
throw new Error(`No tournamentValidator address for ${chain}`);
|
|
5820
|
+
return table.tournamentValidator;
|
|
5821
|
+
}
|
|
5822
|
+
}
|
|
5823
|
+
var U256_MAX = (1n << 256n) - 1n;
|
|
5824
|
+
function u256ToLowHigh(value) {
|
|
5825
|
+
if (value < 0n) throw new Error("u256 cannot be negative");
|
|
5826
|
+
if (value > U256_MAX)
|
|
5827
|
+
throw new Error(`Value exceeds u256 max: ${value.toString()}`);
|
|
5828
|
+
const MASK = (1n << 128n) - 1n;
|
|
5829
|
+
return [(value & MASK).toString(), (value >> 128n).toString()];
|
|
5830
|
+
}
|
|
5831
|
+
function buildErc20BalanceConfig(cfg) {
|
|
5832
|
+
const [minLo, minHi] = u256ToLowHigh(cfg.minThreshold);
|
|
5833
|
+
const [maxLo, maxHi] = u256ToLowHigh(cfg.maxThreshold);
|
|
5834
|
+
const [vpeLo, vpeHi] = u256ToLowHigh(cfg.valuePerEntry);
|
|
5835
|
+
return [
|
|
5836
|
+
cfg.tokenAddress,
|
|
5837
|
+
minLo,
|
|
5838
|
+
minHi,
|
|
5839
|
+
maxLo,
|
|
5840
|
+
maxHi,
|
|
5841
|
+
vpeLo,
|
|
5842
|
+
vpeHi,
|
|
5843
|
+
String(cfg.maxEntries),
|
|
5844
|
+
cfg.bannable ? "1" : "0"
|
|
5845
|
+
];
|
|
5846
|
+
}
|
|
5847
|
+
function buildOpusTrovesConfig(cfg) {
|
|
5848
|
+
return [
|
|
5849
|
+
String(cfg.assetAddresses.length),
|
|
5850
|
+
...cfg.assetAddresses,
|
|
5851
|
+
cfg.threshold.toString(),
|
|
5852
|
+
cfg.valuePerEntry.toString(),
|
|
5853
|
+
String(cfg.maxEntries),
|
|
5854
|
+
cfg.bannable ? "1" : "0"
|
|
5855
|
+
];
|
|
5856
|
+
}
|
|
5857
|
+
function buildMerkleConfig(cfg) {
|
|
5858
|
+
return [String(cfg.treeId)];
|
|
5859
|
+
}
|
|
5860
|
+
function buildTournamentValidatorConfig(cfg) {
|
|
5861
|
+
const qualifierType = cfg.requirement === "won" ? "1" : "0";
|
|
5862
|
+
const qualifyingMode = String(cfg.qualifyingMode ?? 0);
|
|
5863
|
+
const topPositions = cfg.requirement === "won" ? String(cfg.topPositions) : "0";
|
|
5864
|
+
return [qualifierType, qualifyingMode, topPositions, ...cfg.tournamentIds];
|
|
5865
|
+
}
|
|
5866
|
+
|
|
4714
5867
|
exports.BudokanApiError = BudokanApiError;
|
|
4715
5868
|
exports.BudokanClient = BudokanClient;
|
|
4716
5869
|
exports.BudokanConnectionError = BudokanConnectionError;
|
|
@@ -4722,10 +5875,26 @@ exports.DataSourceError = DataSourceError;
|
|
|
4722
5875
|
exports.RpcError = RpcError;
|
|
4723
5876
|
exports.TournamentNotFoundError = TournamentNotFoundError;
|
|
4724
5877
|
exports.WSManager = WSManager;
|
|
5878
|
+
exports.buildAddPrizeCall = buildAddPrizeCall;
|
|
5879
|
+
exports.buildClaimRewardCall = buildClaimRewardCall;
|
|
5880
|
+
exports.buildCreateTournamentCall = buildCreateTournamentCall;
|
|
5881
|
+
exports.buildEnterTournamentCall = buildEnterTournamentCall;
|
|
5882
|
+
exports.buildErc20ApproveCall = buildErc20ApproveCall;
|
|
5883
|
+
exports.buildErc20BalanceConfig = buildErc20BalanceConfig;
|
|
5884
|
+
exports.buildMerkleConfig = buildMerkleConfig;
|
|
5885
|
+
exports.buildOpusTrovesConfig = buildOpusTrovesConfig;
|
|
5886
|
+
exports.buildSubmitScoreCall = buildSubmitScoreCall;
|
|
5887
|
+
exports.buildTournamentValidatorConfig = buildTournamentValidatorConfig;
|
|
4725
5888
|
exports.camelToSnake = camelToSnake;
|
|
4726
5889
|
exports.createBudokanClient = createBudokanClient;
|
|
5890
|
+
exports.explorerAddressUrl = explorerAddressUrl;
|
|
5891
|
+
exports.explorerBaseUrl = explorerBaseUrl;
|
|
5892
|
+
exports.explorerTxUrl = explorerTxUrl;
|
|
5893
|
+
exports.extensionAddressFor = extensionAddressFor;
|
|
5894
|
+
exports.findWhitelistedGame = findWhitelistedGame;
|
|
4727
5895
|
exports.getActivityStats = getActivityStats;
|
|
4728
5896
|
exports.getChainConfig = getChainConfig;
|
|
5897
|
+
exports.getGameDefaults = getGameDefaults;
|
|
4729
5898
|
exports.getGameStats = getGameStats;
|
|
4730
5899
|
exports.getGameTournaments = getGameTournaments;
|
|
4731
5900
|
exports.getPrizeStats = getPrizeStats;
|
|
@@ -4737,8 +5906,13 @@ exports.getTournamentRegistrations = getTournamentRegistrations;
|
|
|
4737
5906
|
exports.getTournamentRewardClaims = getTournamentRewardClaims;
|
|
4738
5907
|
exports.getTournamentRewardClaimsSummary = getTournamentRewardClaimsSummary;
|
|
4739
5908
|
exports.getTournaments = getTournaments;
|
|
5909
|
+
exports.getWhitelistedGames = getWhitelistedGames;
|
|
5910
|
+
exports.isGameWhitelisted = isGameWhitelisted;
|
|
4740
5911
|
exports.normalizeAddress = normalizeAddress;
|
|
5912
|
+
exports.parseTournamentIdFromReceipt = parseTournamentIdFromReceipt;
|
|
4741
5913
|
exports.snakeToCamel = snakeToCamel;
|
|
5914
|
+
exports.tournamentPageUrl = tournamentPageUrl;
|
|
5915
|
+
exports.u256ToLowHigh = u256ToLowHigh;
|
|
4742
5916
|
exports.withRetry = withRetry;
|
|
4743
5917
|
//# sourceMappingURL=index.cjs.map
|
|
4744
5918
|
//# sourceMappingURL=index.cjs.map
|