@xgamesfun/solana 0.0.0-stage → 0.24.0
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/DISCLAIMER.md +41 -0
- package/LICENSE +202 -0
- package/NOTICE +13 -0
- package/README.md +172 -2
- package/bin/xsolana.mjs +189 -0
- package/examples/artwork-auction.json +51 -0
- package/examples/blind-forge.json +128 -0
- package/examples/coin-flip-arena.json +103 -0
- package/examples/duel-arena.json +137 -0
- package/examples/elements-set.json +274 -0
- package/examples/event-badges.json +67 -0
- package/examples/expedition-guild.json +154 -0
- package/examples/fair-presale.json +48 -0
- package/examples/falling-drop.json +90 -0
- package/examples/guild-missions.json +137 -0
- package/examples/halving-seasons.json +107 -0
- package/examples/hero-trials.json +93 -0
- package/examples/ideas.json +789 -0
- package/examples/level-ladder.json +65 -0
- package/examples/merge-2048.json +128 -0
- package/examples/nft-raffle.json +33 -0
- package/examples/paper-hands-farm.json +44 -0
- package/examples/partner-vault.json +112 -0
- package/examples/sacrifice-raffle.json +118 -0
- package/examples/scorched-treasury.json +84 -0
- package/examples/shelter-fair.json +164 -0
- package/examples/spark-pity.json +153 -0
- package/examples/stakers-draw.json +118 -0
- package/examples/star-fleet.json +150 -0
- package/examples/starforce.json +116 -0
- package/examples/stud-farm.json +134 -0
- package/examples/team-vesting.json +70 -0
- package/examples/trade-in-shop.json +168 -0
- package/js/approve/details.mjs +263 -0
- package/js/approve/ed25519.mjs +36 -0
- package/js/approve/live-check.mjs +144 -0
- package/js/approve/page.html +86 -0
- package/js/approve/page.js +203 -0
- package/js/approve/server.mjs +726 -0
- package/js/chain/base58.js +73 -0
- package/js/chain/borsh.js +270 -0
- package/js/chain/bytes.js +141 -0
- package/js/chain/core.js +181 -0
- package/js/chain/curve.js +52 -0
- package/js/chain/lookup.js +279 -0
- package/js/chain/mint.js +96 -0
- package/js/chain/pda.js +66 -0
- package/js/chain/programs.js +102 -0
- package/js/chain/rpc.js +219 -0
- package/js/chain/sha256.js +68 -0
- package/js/chain/token.js +85 -0
- package/js/chain/token2022.js +247 -0
- package/js/chain/tx.js +224 -0
- package/js/client/accounts.js +679 -0
- package/js/client/compressed.js +46 -0
- package/js/client/grant.js +299 -0
- package/js/client/idl/loot.js +2 -0
- package/js/client/idl/loot.json +17206 -0
- package/js/client/index.js +10 -0
- package/js/client/ix.js +2887 -0
- package/js/client/pda.js +114 -0
- package/js/client/policy.js +69 -0
- package/js/client/random.js +70 -0
- package/js/client/sizes.js +297 -0
- package/js/client/traits.js +44 -0
- package/js/connect/connect.mjs +182 -0
- package/js/economy/check.mjs +2236 -0
- package/js/economy/cost.mjs +185 -0
- package/js/economy/examples.mjs +114 -0
- package/js/economy/explain.mjs +239 -0
- package/js/economy/guide.mjs +232 -0
- package/js/economy/legal.mjs +15 -0
- package/js/economy/live.mjs +130 -0
- package/js/economy/model.mjs +698 -0
- package/js/economy/plan.mjs +1155 -0
- package/js/economy/schema.json +3071 -0
- package/js/economy/secrets.mjs +60 -0
- package/js/economy/simulate.mjs +1019 -0
- package/js/economy/txsize.mjs +45 -0
- package/js/economy/validate.mjs +85 -0
- package/js/index.js +10 -0
- package/js/mcp/server.mjs +113 -0
- package/js/mcp/tools.mjs +485 -0
- package/js/play/index.js +2855 -0
- package/js/play/keys.js +167 -0
- package/js/results/index.js +184 -0
- package/js/results/wire.js +90 -0
- package/package.json +100 -4
- package/release.json +8 -0
- package/skills/xsolana-economy/SKILL.md +109 -0
- package/skills/xsolana-economy/references/after-launch.md +124 -0
- package/skills/xsolana-economy/references/apps.md +193 -0
- package/skills/xsolana-economy/references/sentence-to-spec.md +180 -0
- package/skills/xsolana-economy/references/telling-the-person.md +134 -0
- package/types/chain/base58.d.ts +10 -0
- package/types/chain/borsh.d.ts +23 -0
- package/types/chain/bytes.d.ts +45 -0
- package/types/chain/core.d.ts +52 -0
- package/types/chain/curve.d.ts +1 -0
- package/types/chain/lookup.d.ts +194 -0
- package/types/chain/mint.d.ts +25 -0
- package/types/chain/pda.d.ts +25 -0
- package/types/chain/programs.d.ts +65 -0
- package/types/chain/rpc.d.ts +68 -0
- package/types/chain/sha256.d.ts +1 -0
- package/types/chain/token.d.ts +141 -0
- package/types/chain/token2022.d.ts +53 -0
- package/types/chain/tx.d.ts +60 -0
- package/types/client/accounts.d.ts +318 -0
- package/types/client/compressed.d.ts +29 -0
- package/types/client/grant.d.ts +170 -0
- package/types/client/idl/loot.d.ts +4498 -0
- package/types/client/index.d.ts +9 -0
- package/types/client/ix.d.ts +5315 -0
- package/types/client/pda.d.ts +95 -0
- package/types/client/policy.d.ts +48 -0
- package/types/client/random.d.ts +26 -0
- package/types/client/sizes.d.ts +101 -0
- package/types/client/traits.d.ts +12 -0
- package/types/economy/check.d.mts +100 -0
- package/types/economy/cost.d.mts +69 -0
- package/types/economy/examples.d.mts +27 -0
- package/types/economy/explain.d.mts +19 -0
- package/types/economy/guide.d.mts +140 -0
- package/types/economy/legal.d.mts +12 -0
- package/types/economy/live.d.mts +124 -0
- package/types/economy/model.d.mts +431 -0
- package/types/economy/plan.d.mts +1014 -0
- package/types/economy/secrets.d.mts +4 -0
- package/types/economy/simulate.d.mts +164 -0
- package/types/economy/txsize.d.mts +17 -0
- package/types/economy/validate.d.mts +3 -0
- package/types/index.d.ts +9 -0
- package/types/mcp/tools.d.mts +635 -0
- package/types/play/index.d.ts +880 -0
- package/types/play/keys.d.ts +51 -0
- package/types/results/index.d.ts +155 -0
- package/types/results/wire.d.ts +122 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** An Ed25519 key from its 32-byte seed: { address, sign(message) }. */
|
|
2
|
+
export declare function keyFromSeed(seed: any, name?: null): Promise<{
|
|
3
|
+
address: string;
|
|
4
|
+
name: null;
|
|
5
|
+
sign: (message: any) => Promise<Uint8Array<ArrayBuffer>>;
|
|
6
|
+
}>;
|
|
7
|
+
/** The text a wallet signs once a session for its settle keys. It moves nothing and says so. */
|
|
8
|
+
export declare const settleKeysText: (project: any, wallet: any) => string;
|
|
9
|
+
/**
|
|
10
|
+
* The page's storage of keys that can't be made again (`localStorage`), and a device key that encrypts them, kept in
|
|
11
|
+
* IndexedDB as a non-extractable AES-GCM key. Null where either is missing (then keys live in memory only).
|
|
12
|
+
*/
|
|
13
|
+
export declare function browserStore(): {
|
|
14
|
+
get: (k: any) => string | null;
|
|
15
|
+
set: (k: any, v: any) => void;
|
|
16
|
+
remove: (k: any) => void;
|
|
17
|
+
keys: () => (string | null)[];
|
|
18
|
+
cryptoKey: () => any;
|
|
19
|
+
} | null;
|
|
20
|
+
/**
|
|
21
|
+
* The keys of `wallet` ({ address, signMessage? }) in `project`. `store`: `browserStore()`'s shape ({ get, set, remove,
|
|
22
|
+
* keys, cryptoKey }), or null. `key(name)` makes the key named by an address (asking the wallet for its signature the
|
|
23
|
+
* first time in a session); `again(name)` makes it again for a job left unfinished, or finds it stored, or null;
|
|
24
|
+
* `stored()` lists the names of keys stored; `forget(name)` drops a stored key once its job is done and it is empty.
|
|
25
|
+
* `how()` says how keys are made: 'derived', 'stored' or 'memory'.
|
|
26
|
+
*/
|
|
27
|
+
export declare function keyring({ wallet, project, store }: {
|
|
28
|
+
project: any;
|
|
29
|
+
store?: null | undefined;
|
|
30
|
+
wallet: any;
|
|
31
|
+
}): {
|
|
32
|
+
how(): Promise<"derived" | "memory" | "stored">;
|
|
33
|
+
/** The key named `name` (an address) for a new job. */
|
|
34
|
+
key(name: any): Promise<{
|
|
35
|
+
address: string;
|
|
36
|
+
name: null;
|
|
37
|
+
sign: (message: any) => Promise<Uint8Array<ArrayBuffer>>;
|
|
38
|
+
}>;
|
|
39
|
+
/** The key named `name` again, for a job left unfinished: made again from the wallet's signature, or read from
|
|
40
|
+
* storage; null when neither can. `ask`: false to make it only from a signature already given this session. */
|
|
41
|
+
again(name: any, { ask }?: {
|
|
42
|
+
ask?: boolean | undefined;
|
|
43
|
+
}): Promise<{
|
|
44
|
+
address: string;
|
|
45
|
+
name: null;
|
|
46
|
+
sign: (message: any) => Promise<Uint8Array<ArrayBuffer>>;
|
|
47
|
+
} | null>;
|
|
48
|
+
/** The names of the keys this page stored for the wallet (none when keys are made from its signature). */
|
|
49
|
+
stored(): any;
|
|
50
|
+
forget(name: any): void;
|
|
51
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export { canonicalJson, CERT_KINDS, CLUSTERS, drawText, entryText, giveawayHostText, hostCertText, lockText, NO_GRANT, RESULT_DOMAIN, resultBytes, revokeGiveawayText, revokeText, rosterHash } from './wire.js';
|
|
2
|
+
/** games.fun's results server, on its play host (devnet until the program's audit). */
|
|
3
|
+
export declare const RESULTS_SERVER = "https://play.xgames.fun/xsolana";
|
|
4
|
+
/** A fresh round id: 16 random bytes, in hex. Make it when the round starts. */
|
|
5
|
+
export declare const newRound: () => string;
|
|
6
|
+
/**
|
|
7
|
+
* A fresh Ed25519 key: { address, sign(bytes) → Promise<64 bytes>, secret }. `secret` is its 32-byte seed in base58,
|
|
8
|
+
* for a host server to keep in its secret store; a page's session key never needs it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function newKey(): Promise<{
|
|
11
|
+
address: string;
|
|
12
|
+
secret: string;
|
|
13
|
+
sign: (message: any) => Promise<Uint8Array<ArrayBuffer>>;
|
|
14
|
+
}>;
|
|
15
|
+
/** The key a host server kept (`secret`: its seed in base58). */
|
|
16
|
+
export declare function keyFromSecret(secret: any): Promise<{
|
|
17
|
+
address: string;
|
|
18
|
+
secret: string;
|
|
19
|
+
sign: (message: any) => Promise<Uint8Array<ArrayBuffer>>;
|
|
20
|
+
}>;
|
|
21
|
+
/** One signer's signature of a result: { key, signature }. `signer` is a key from newKey, or anything with sign(). */
|
|
22
|
+
export declare function signResult(signer: any, result: any, cluster?: string): Promise<{
|
|
23
|
+
key: any;
|
|
24
|
+
signature: string;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* A host server reports a round. `cert`: the owner's { text, signature } certifying `signer`, the host key. Retrying
|
|
28
|
+
* with the same result is safe: it is the same answer. Returns the server's answer, { result, vouchers }, or throws its
|
|
29
|
+
* { code, why }.
|
|
30
|
+
*/
|
|
31
|
+
export declare function report({ server, cert, signer, game, round, endedAt, winners, cluster, fetchImpl }: {
|
|
32
|
+
cert: any;
|
|
33
|
+
cluster?: string | undefined;
|
|
34
|
+
endedAt: any;
|
|
35
|
+
fetchImpl?: typeof fetch | undefined;
|
|
36
|
+
game: any;
|
|
37
|
+
round: any;
|
|
38
|
+
server: any;
|
|
39
|
+
signer: any;
|
|
40
|
+
winners: any;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
/** A wallet's vouchers for a round it won: [{ grant, publicKey, signature, round, expires, … }]. */
|
|
43
|
+
export declare function fetchVouchers({ server, game, round, wallet, fetchImpl }: {
|
|
44
|
+
fetchImpl?: typeof fetch | undefined;
|
|
45
|
+
game: any;
|
|
46
|
+
round: any;
|
|
47
|
+
server: any;
|
|
48
|
+
wallet: any;
|
|
49
|
+
}): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* A loot grant voucher the host key signs itself, for a host server whose key the grant names (no results server
|
|
52
|
+
* involved): the program checks it and pays only `wallet`, within the grant's limits. `round` is the result's round id
|
|
53
|
+
* (16 bytes hex): the program pays a wallet each round once, ever, so the voucher may be signed again, any time, and
|
|
54
|
+
* still pays once. `incarnation` is the grant's (`Grant.incarnation`): a voucher pays only the grant it was signed
|
|
55
|
+
* for, never one written again at the same address. `now` is the cluster's clock (unix s); the voucher lives
|
|
56
|
+
* `seconds` from it, 30 days at most. `amount`: the tokens this claim gives, in base units, for a grant of a fixed amount
|
|
57
|
+
* of tokens (a rank's reward), at most the grant's; 0 (the default) gives the grant's prize as it is.
|
|
58
|
+
* Returns { wallet, grant, incarnation, publicKey, signature, round, expires, personHash, amount } for js/play claimGrant,
|
|
59
|
+
* plain JSON (`incarnation` and `amount` as decimal text), so a server can send it as it is.
|
|
60
|
+
*/
|
|
61
|
+
export declare function signVoucher({ signer, game, grant, incarnation, wallet, round, now, seconds, personHash, amount }: {
|
|
62
|
+
amount?: bigint | undefined;
|
|
63
|
+
game: any;
|
|
64
|
+
grant: any;
|
|
65
|
+
incarnation: any;
|
|
66
|
+
now: any;
|
|
67
|
+
personHash?: null | undefined;
|
|
68
|
+
round: any;
|
|
69
|
+
seconds?: number | undefined;
|
|
70
|
+
signer: any;
|
|
71
|
+
wallet: any;
|
|
72
|
+
}): Promise<{
|
|
73
|
+
wallet: any;
|
|
74
|
+
grant: any;
|
|
75
|
+
incarnation: string;
|
|
76
|
+
publicKey: any;
|
|
77
|
+
signature: string;
|
|
78
|
+
round: any;
|
|
79
|
+
expires: number;
|
|
80
|
+
personHash: string;
|
|
81
|
+
amount: string;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* A draw, from the organizer's side and the players'. `signMessage(text) → signature bytes` is the organizer's wallet
|
|
85
|
+
* (its signMessage) or a host key's sign; `by` its address; `cert` the owner's host certificate when `by` is a host key.
|
|
86
|
+
*/
|
|
87
|
+
export declare const draws: {
|
|
88
|
+
open: ({ server, signMessage, by, cert, rates, fetchImpl, ...spec }: {
|
|
89
|
+
[x: string]: any;
|
|
90
|
+
by: any;
|
|
91
|
+
cert?: null | undefined;
|
|
92
|
+
fetchImpl?: typeof fetch | undefined;
|
|
93
|
+
rates?: null | undefined;
|
|
94
|
+
server: any;
|
|
95
|
+
signMessage: any;
|
|
96
|
+
}) => Promise<any>;
|
|
97
|
+
/** A player enters with their play-host token, or with their wallet's signature (`wallet`, `signMessage`). */
|
|
98
|
+
enter: ({ server, game, draw, token, wallet, signMessage, cluster, fetchImpl }: {
|
|
99
|
+
cluster?: string | undefined;
|
|
100
|
+
draw: any;
|
|
101
|
+
fetchImpl?: typeof fetch | undefined;
|
|
102
|
+
game: any;
|
|
103
|
+
server: any;
|
|
104
|
+
signMessage?: null | undefined;
|
|
105
|
+
token?: null | undefined;
|
|
106
|
+
wallet?: null | undefined;
|
|
107
|
+
}) => Promise<any>;
|
|
108
|
+
/** Locks the players the server holds now to `beacon`, a drand round still to come. Checks their hash itself. */
|
|
109
|
+
lock: ({ server, game, draw, beacon, signMessage, by, cert, cluster, net, fetchImpl }: {
|
|
110
|
+
beacon: any;
|
|
111
|
+
by: any;
|
|
112
|
+
cert?: null | undefined;
|
|
113
|
+
cluster?: string | undefined;
|
|
114
|
+
draw: any;
|
|
115
|
+
fetchImpl?: typeof fetch | undefined;
|
|
116
|
+
game: any;
|
|
117
|
+
net?: string | undefined;
|
|
118
|
+
server: any;
|
|
119
|
+
signMessage: any;
|
|
120
|
+
}) => Promise<any>;
|
|
121
|
+
/** The draw as anyone may check it; settled, with its result, once its beacon round is out. */
|
|
122
|
+
get: ({ server, game, draw, fetchImpl }: {
|
|
123
|
+
draw: any;
|
|
124
|
+
fetchImpl?: typeof fetch | undefined;
|
|
125
|
+
game: any;
|
|
126
|
+
server: any;
|
|
127
|
+
}) => Promise<any>;
|
|
128
|
+
};
|
|
129
|
+
/** A giveaway, from its appointed host's page. */
|
|
130
|
+
export declare const giveaways: {
|
|
131
|
+
/** Opens one: `cert` the owner's appointment, `token` the host's play-host sign-in, `session` a key from newKey(). */
|
|
132
|
+
open: ({ server, game, cert, token, giveaway, winners, endsBy, session, fetchImpl }: {
|
|
133
|
+
cert: any;
|
|
134
|
+
endsBy: any;
|
|
135
|
+
fetchImpl?: typeof fetch | undefined;
|
|
136
|
+
game: any;
|
|
137
|
+
giveaway: any;
|
|
138
|
+
server: any;
|
|
139
|
+
session: any;
|
|
140
|
+
token: any;
|
|
141
|
+
winners: any;
|
|
142
|
+
}) => Promise<any>;
|
|
143
|
+
/** Reports its result, signed by its session key. `grant`: the host's grant (each winner is paid from it). */
|
|
144
|
+
report: ({ server, game, giveaway, session, endedAt, winners, grant, cluster, fetchImpl }: {
|
|
145
|
+
cluster?: string | undefined;
|
|
146
|
+
endedAt: any;
|
|
147
|
+
fetchImpl?: typeof fetch | undefined;
|
|
148
|
+
game: any;
|
|
149
|
+
giveaway: any;
|
|
150
|
+
grant: any;
|
|
151
|
+
server: any;
|
|
152
|
+
session: any;
|
|
153
|
+
winners: any;
|
|
154
|
+
}) => Promise<any>;
|
|
155
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const RESULT_DOMAIN = "loot-result-v1";
|
|
2
|
+
export declare const NO_GRANT = 65535;
|
|
3
|
+
export declare const CLUSTERS: Readonly<{
|
|
4
|
+
devnet: 0;
|
|
5
|
+
mainnet: 1;
|
|
6
|
+
}>;
|
|
7
|
+
/** Each certificate's first line, and the lines that follow it, in order. */
|
|
8
|
+
export declare const CERT_KINDS: Readonly<{
|
|
9
|
+
host: {
|
|
10
|
+
title: string;
|
|
11
|
+
fields: string[];
|
|
12
|
+
};
|
|
13
|
+
revoke: {
|
|
14
|
+
title: string;
|
|
15
|
+
fields: string[];
|
|
16
|
+
};
|
|
17
|
+
draw: {
|
|
18
|
+
title: string;
|
|
19
|
+
fields: string[];
|
|
20
|
+
};
|
|
21
|
+
lock: {
|
|
22
|
+
title: string;
|
|
23
|
+
fields: string[];
|
|
24
|
+
};
|
|
25
|
+
entry: {
|
|
26
|
+
title: string;
|
|
27
|
+
fields: string[];
|
|
28
|
+
};
|
|
29
|
+
giveaway: {
|
|
30
|
+
title: string;
|
|
31
|
+
fields: string[];
|
|
32
|
+
};
|
|
33
|
+
revokeGiveaway: {
|
|
34
|
+
title: string;
|
|
35
|
+
fields: string[];
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
/** The text the owner signs to let `host` report `game`'s results until `until` (unix seconds). */
|
|
39
|
+
export declare const hostCertText: ({ cluster, game, host, until }: {
|
|
40
|
+
cluster?: string | undefined;
|
|
41
|
+
game: any;
|
|
42
|
+
host: any;
|
|
43
|
+
until: any;
|
|
44
|
+
}) => string;
|
|
45
|
+
/** The text the owner signs to take `host` back. */
|
|
46
|
+
export declare const revokeText: ({ cluster, game, host }: {
|
|
47
|
+
cluster?: string | undefined;
|
|
48
|
+
game: any;
|
|
49
|
+
host: any;
|
|
50
|
+
}) => string;
|
|
51
|
+
/**
|
|
52
|
+
* The text the organizer (the game's owner or authority, or a host key they certified) signs to open a draw: a round
|
|
53
|
+
* whose winners an engine computes from the locked players and a future beacon value. `prizes`: [{ place, grant }];
|
|
54
|
+
* `payout`: 'vouchers' (the server vouches for each winner) or 'list' (the owner writes the winners' list on the grant);
|
|
55
|
+
* `identity`: 'linked' (a play-host sign-in linked to X, one entry a person) or 'wallet' (a wallet's own signature);
|
|
56
|
+
* `slug`: the game's play-host name (its tokens' audience), or '-'; `rates`: the sha256 of the engine's rates (canonical
|
|
57
|
+
* JSON), or 'default'.
|
|
58
|
+
*/
|
|
59
|
+
export declare const drawText: ({ cluster, game, draw, engine, winners, prizes, payout, identity, slug, rates }: {
|
|
60
|
+
cluster?: string | undefined;
|
|
61
|
+
draw: any;
|
|
62
|
+
engine: any;
|
|
63
|
+
game: any;
|
|
64
|
+
identity?: string | undefined;
|
|
65
|
+
payout?: string | undefined;
|
|
66
|
+
prizes?: never[] | undefined;
|
|
67
|
+
rates?: string | undefined;
|
|
68
|
+
slug?: string | undefined;
|
|
69
|
+
winners: any;
|
|
70
|
+
}) => string;
|
|
71
|
+
/** The text the organizer signs to lock a draw's players (`roster`: rosterHash) to a beacon round still to come. */
|
|
72
|
+
export declare const lockText: ({ cluster, game, draw, roster, players, beacon, net }: {
|
|
73
|
+
beacon: any;
|
|
74
|
+
cluster?: string | undefined;
|
|
75
|
+
draw: any;
|
|
76
|
+
game: any;
|
|
77
|
+
net?: string | undefined;
|
|
78
|
+
players: any;
|
|
79
|
+
roster: any;
|
|
80
|
+
}) => string;
|
|
81
|
+
/** The text a player's wallet signs to enter a draw (identity 'wallet'). */
|
|
82
|
+
export declare const entryText: ({ cluster, game, draw }: {
|
|
83
|
+
cluster?: string | undefined;
|
|
84
|
+
draw: any;
|
|
85
|
+
game: any;
|
|
86
|
+
}) => string;
|
|
87
|
+
/**
|
|
88
|
+
* The text the owner (or authority) signs to appoint a giveaway host: `who` is "x:<X account id>" (the host signs in
|
|
89
|
+
* with that X account through the play host) or a wallet address; their giveaways pay from grant `grant` alone.
|
|
90
|
+
*/
|
|
91
|
+
export declare const giveawayHostText: ({ cluster, game, who, slug, grant, until }: {
|
|
92
|
+
cluster?: string | undefined;
|
|
93
|
+
game: any;
|
|
94
|
+
grant: any;
|
|
95
|
+
slug: any;
|
|
96
|
+
until: any;
|
|
97
|
+
who: any;
|
|
98
|
+
}) => string;
|
|
99
|
+
/** The text the owner (or authority) signs to take a giveaway host back. */
|
|
100
|
+
export declare const revokeGiveawayText: ({ cluster, game, who }: {
|
|
101
|
+
cluster?: string | undefined;
|
|
102
|
+
game: any;
|
|
103
|
+
who: any;
|
|
104
|
+
}) => string;
|
|
105
|
+
/** A draw's players, as one hash: each `id<TAB>wallet`, sorted by id, one a line; sha256, hex. */
|
|
106
|
+
export declare function rosterHash(entries: any): Promise<string>;
|
|
107
|
+
/** JSON with every object's keys sorted: one text for one value, so its hash means one thing. */
|
|
108
|
+
export declare function canonicalJson(value: any): any;
|
|
109
|
+
/**
|
|
110
|
+
* The bytes a result's signers sign:
|
|
111
|
+
* "loot-result-v1" | cluster (1) | game (32) | round (16) | endedAt (u64 LE)
|
|
112
|
+
* | winners (u8 count; each wallet (32) | place (u8) | grant id (u16 LE, 0xffff: none))
|
|
113
|
+
* Every field has one length, so one set of bytes means one result: an unknown cluster, a round that is not 16 bytes, a
|
|
114
|
+
* place past 255 and more than 255 winners are refused, never written as something else.
|
|
115
|
+
*/
|
|
116
|
+
export declare function resultBytes({ cluster, game, round, endedAt, winners }: {
|
|
117
|
+
cluster?: string | undefined;
|
|
118
|
+
endedAt: any;
|
|
119
|
+
game: any;
|
|
120
|
+
round: any;
|
|
121
|
+
winners: any;
|
|
122
|
+
}): Uint8Array<any>;
|