@xgamesfun/solana 0.0.0-stage → 0.20.1

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.
Files changed (134) hide show
  1. package/DISCLAIMER.md +41 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +13 -0
  4. package/README.md +172 -2
  5. package/bin/xsolana.mjs +189 -0
  6. package/examples/artwork-auction.json +51 -0
  7. package/examples/blind-forge.json +128 -0
  8. package/examples/coin-flip-arena.json +108 -0
  9. package/examples/duel-arena.json +137 -0
  10. package/examples/elements-set.json +281 -0
  11. package/examples/event-badges.json +67 -0
  12. package/examples/expedition-guild.json +161 -0
  13. package/examples/fair-presale.json +48 -0
  14. package/examples/falling-drop.json +90 -0
  15. package/examples/guild-missions.json +144 -0
  16. package/examples/halving-seasons.json +112 -0
  17. package/examples/hero-trials.json +96 -0
  18. package/examples/ideas.json +789 -0
  19. package/examples/level-ladder.json +65 -0
  20. package/examples/merge-2048.json +128 -0
  21. package/examples/nft-raffle.json +33 -0
  22. package/examples/paper-hands-farm.json +56 -0
  23. package/examples/partner-vault.json +115 -0
  24. package/examples/sacrifice-raffle.json +118 -0
  25. package/examples/scorched-treasury.json +84 -0
  26. package/examples/shelter-fair.json +164 -0
  27. package/examples/spark-pity.json +153 -0
  28. package/examples/stakers-draw.json +125 -0
  29. package/examples/star-fleet.json +157 -0
  30. package/examples/starforce.json +116 -0
  31. package/examples/stud-farm.json +134 -0
  32. package/examples/team-vesting.json +70 -0
  33. package/examples/trade-in-shop.json +168 -0
  34. package/js/approve/details.mjs +262 -0
  35. package/js/approve/ed25519.mjs +36 -0
  36. package/js/approve/live-check.mjs +144 -0
  37. package/js/approve/page.html +86 -0
  38. package/js/approve/page.js +203 -0
  39. package/js/approve/server.mjs +711 -0
  40. package/js/chain/base58.js +73 -0
  41. package/js/chain/borsh.js +261 -0
  42. package/js/chain/bytes.js +141 -0
  43. package/js/chain/core.js +169 -0
  44. package/js/chain/curve.js +52 -0
  45. package/js/chain/lookup.js +273 -0
  46. package/js/chain/mint.js +96 -0
  47. package/js/chain/pda.js +66 -0
  48. package/js/chain/programs.js +102 -0
  49. package/js/chain/rpc.js +217 -0
  50. package/js/chain/sha256.js +68 -0
  51. package/js/chain/token.js +85 -0
  52. package/js/chain/token2022.js +247 -0
  53. package/js/chain/tx.js +224 -0
  54. package/js/client/accounts.js +347 -0
  55. package/js/client/compressed.js +46 -0
  56. package/js/client/grant.js +240 -0
  57. package/js/client/idl/loot.js +2 -0
  58. package/js/client/idl/loot.json +17064 -0
  59. package/js/client/index.js +9 -0
  60. package/js/client/ix.js +2156 -0
  61. package/js/client/pda.js +110 -0
  62. package/js/client/policy.js +48 -0
  63. package/js/client/sizes.js +54 -0
  64. package/js/client/traits.js +44 -0
  65. package/js/connect/connect.mjs +182 -0
  66. package/js/economy/check.mjs +1991 -0
  67. package/js/economy/cost.mjs +170 -0
  68. package/js/economy/examples.mjs +114 -0
  69. package/js/economy/explain.mjs +235 -0
  70. package/js/economy/guide.mjs +231 -0
  71. package/js/economy/legal.mjs +15 -0
  72. package/js/economy/live.mjs +107 -0
  73. package/js/economy/model.mjs +583 -0
  74. package/js/economy/plan.mjs +887 -0
  75. package/js/economy/schema.json +2923 -0
  76. package/js/economy/secrets.mjs +60 -0
  77. package/js/economy/simulate.mjs +952 -0
  78. package/js/economy/txsize.mjs +45 -0
  79. package/js/economy/validate.mjs +85 -0
  80. package/js/index.js +10 -0
  81. package/js/mcp/server.mjs +113 -0
  82. package/js/mcp/tools.mjs +479 -0
  83. package/js/play/index.js +2109 -0
  84. package/js/results/index.js +184 -0
  85. package/js/results/wire.js +90 -0
  86. package/package.json +100 -4
  87. package/release.json +8 -0
  88. package/skills/xsolana-economy/SKILL.md +105 -0
  89. package/skills/xsolana-economy/references/after-launch.md +114 -0
  90. package/skills/xsolana-economy/references/apps.md +157 -0
  91. package/skills/xsolana-economy/references/sentence-to-spec.md +172 -0
  92. package/skills/xsolana-economy/references/telling-the-person.md +93 -0
  93. package/types/chain/base58.d.ts +10 -0
  94. package/types/chain/borsh.d.ts +23 -0
  95. package/types/chain/bytes.d.ts +45 -0
  96. package/types/chain/core.d.ts +50 -0
  97. package/types/chain/curve.d.ts +1 -0
  98. package/types/chain/lookup.d.ts +191 -0
  99. package/types/chain/mint.d.ts +25 -0
  100. package/types/chain/pda.d.ts +25 -0
  101. package/types/chain/programs.d.ts +65 -0
  102. package/types/chain/rpc.d.ts +66 -0
  103. package/types/chain/sha256.d.ts +1 -0
  104. package/types/chain/token.d.ts +141 -0
  105. package/types/chain/token2022.d.ts +53 -0
  106. package/types/chain/tx.d.ts +60 -0
  107. package/types/client/accounts.d.ts +178 -0
  108. package/types/client/compressed.d.ts +29 -0
  109. package/types/client/grant.d.ts +125 -0
  110. package/types/client/idl/loot.d.ts +4467 -0
  111. package/types/client/index.d.ts +8 -0
  112. package/types/client/ix.d.ts +1687 -0
  113. package/types/client/pda.d.ts +91 -0
  114. package/types/client/policy.d.ts +23 -0
  115. package/types/client/sizes.d.ts +13 -0
  116. package/types/client/traits.d.ts +12 -0
  117. package/types/economy/check.d.mts +105 -0
  118. package/types/economy/cost.d.mts +68 -0
  119. package/types/economy/examples.d.mts +27 -0
  120. package/types/economy/explain.d.mts +19 -0
  121. package/types/economy/guide.d.mts +140 -0
  122. package/types/economy/legal.d.mts +12 -0
  123. package/types/economy/live.d.mts +109 -0
  124. package/types/economy/model.d.mts +363 -0
  125. package/types/economy/plan.d.mts +1013 -0
  126. package/types/economy/secrets.d.mts +4 -0
  127. package/types/economy/simulate.d.mts +156 -0
  128. package/types/economy/txsize.d.mts +17 -0
  129. package/types/economy/validate.d.mts +3 -0
  130. package/types/index.d.ts +9 -0
  131. package/types/mcp/tools.d.mts +627 -0
  132. package/types/play/index.d.ts +469 -0
  133. package/types/results/index.d.ts +155 -0
  134. package/types/results/wire.d.ts +122 -0
@@ -0,0 +1,1687 @@
1
+ import { ASSOCIATED_TOKEN_PROGRAM } from '../chain/pda.js';
2
+ import IDL from './idl/loot.js';
3
+ export { IDL, ASSOCIATED_TOKEN_PROGRAM };
4
+ /** Token Metadata: a legacy NFT's or a pNFT's metadata lives at an address of its (`METAPLEX_METADATA_PROGRAM`). */
5
+ export declare const TOKEN_METADATA_PROGRAM = "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";
6
+ /** 32 bytes a project names a call by (a match id, a payout's reason). Zeros when not given. */
7
+ export declare function reference(value: any): Uint8Array<ArrayBuffer>;
8
+ /**
9
+ * Any loot instruction. `accounts` names accounts by their IDL leaf name; `null` for an optional one passes "None".
10
+ * Options: `remaining` (metas after the instruction's own), `writable` and `signer` (leaf names whose flag is set
11
+ * on, beyond the IDL's), `readonly` (leaf names whose writable flag is set off).
12
+ */
13
+ export declare function lootIx(name: any, args?: {}, accounts?: {}, { remaining, writable, signer, readonly }?: {
14
+ readonly?: never[] | undefined;
15
+ remaining?: never[] | undefined;
16
+ signer?: never[] | undefined;
17
+ writable?: never[] | undefined;
18
+ }): {
19
+ programId: string;
20
+ keys: any[];
21
+ data: Uint8Array<any>;
22
+ };
23
+ /**
24
+ * The accounts one destination needs, in the order the program reads them: a pool, a named token account, a wallet
25
+ * and its associated token account of `mint` (the project's `treasury` wallet for `Treasury`), or whoever holds a
26
+ * collectible (its asset, then the holder and their associated token account). The program opens a wallet's account
27
+ * or a pool when it is not there, paid by whoever sends the instruction. `holders` maps an asset to its holder now;
28
+ * for one nobody holds, the default address fills the holder's two places. A buyer's choice (`Chosen`) is written as
29
+ * what was chosen first (`chosenShares`).
30
+ */
31
+ export declare function destinationAccounts(project: any, to: any, mint: any, { holders, programs, treasury }?: Readonly<Record<string, any>>): {
32
+ pubkey: any;
33
+ isSigner: any;
34
+ isWritable: any;
35
+ }[];
36
+ /** A split's destinations, in order. */
37
+ export declare const shareAccounts: (project: any, shares: any, mint: any, options: any) => any;
38
+ /**
39
+ * A split with the buyer's choice written in, as the program does at `open_box` and `buy_tickets`: a wallet, the
40
+ * holder of the collectible chosen (a share with an item, which needs one), or the treasury with no choice. A
41
+ * contest's decision names its wallet the same way (`decideIx`).
42
+ */
43
+ export declare const chosenShares: (shares: any, choice: any) => any;
44
+ /** Whether a split burns, so the mint is written: it has a burn share. */
45
+ export declare const sharesBurn: (shares: any) => any;
46
+ /**
47
+ * The account each prize of a box's entries comes with at the roll, in entry order and each entry's prizes in order:
48
+ * its item for an item, its pool for tokens from one, its stash for an NFT of one (a named one, or one at random). All
49
+ * written: the roll takes from them. Tokens minted and rolls take none here.
50
+ */
51
+ export declare function entryAccounts(project: any, entries: any): any;
52
+ /**
53
+ * For each mint a box's tokens are in, in the order their prizes first name them, the mint (written when the roll
54
+ * mints from it) and the project's vault for it, where tokens won wait. `poolMints` maps a pool index to its mint (a
55
+ * pool not opened yet has none and is left out).
56
+ */
57
+ export declare function prizeAccounts(project: any, entries: any, poolMints: {} | undefined, programs: any): {
58
+ pubkey: any;
59
+ isSigner: any;
60
+ isWritable: any;
61
+ }[];
62
+ /** Whether a box leaves its outcome to the oracle: more than one entry, or an entry gives a stash's NFT at random. */
63
+ export declare const boxRolls: (entries: any) => any;
64
+ /** What an order of `box` holds for the collectibles its roll may mint: a collectible's rent for each item the entry
65
+ * with the most of them gives. */
66
+ export declare const orderEscrow: (box: any) => bigint;
67
+ /**
68
+ * The nonce the `k`th roll an order won is named by when it settles: the first 8 bytes, little
69
+ * endian, of sha256("roll" | order | its requested slot (u64 LE) | k (u8)). Like every prize's roll, its order is at
70
+ * `prizeRollNonce` of it.
71
+ */
72
+ export declare function rollNonce(order: any, requestedSlot: any, k: any): bigint;
73
+ /**
74
+ * The nonce of a roll on an NFT whose box moves its numbers, burns it or gives it away: the first
75
+ * 8 bytes, little endian, of its address. Its player has one such roll open on it at a time: the order's address is
76
+ * taken until it settles or is refunded. `openBoxIx` makes a box's roll on one there; a mission's roll (`unstakeNftIx`)
77
+ * and a recipe's (`craftIx`) take it as their `nonce`.
78
+ */
79
+ export declare const nonceOn: (asset: any) => bigint;
80
+ /** Whether a box's roll holds the NFT it rolls on, or moves its numbers: an entry burns it, gives it
81
+ * away or moves its numbers. Its order is at the NFT's nonce (`nonceOn`). */
82
+ export declare const boxHolds: (box: any) => any;
83
+ /**
84
+ * The accounts of an NFT the player shows, for a gate or for odds: right after the instruction's other accounts.
85
+ * `shown` is a Core asset the project has authority over (its address), one it has no authority over (`{ asset }`: then
86
+ * its Sheet's address), a Token Metadata NFT (`{ mint, owner }`: its mint, its metadata, the owner's token account of
87
+ * it, its Sheet's address), or a compressed NFT (`{ compressed: assetId, tree }`: its asset id, its record, which a
88
+ * `proveLeafIx` earlier in the same transaction writes, its tree, and its Sheet's address).
89
+ */
90
+ export declare function shownAccounts(project: any, shown: any): {
91
+ pubkey: any;
92
+ isSigner: any;
93
+ isWritable: any;
94
+ }[];
95
+ /**
96
+ * What a player passes a gate with, right after an instruction's own accounts: a list's proof (`Gate::List`: its
97
+ * nodes as accounts, from `merkleProof` of `gateListLeaf`s), then an NFT shown (`shownAccounts`) for a gate that reads
98
+ * one, or for a box's odds.
99
+ */
100
+ export declare const gateAccounts: (project: any, { gate, wallet, shown, listProof }?: Readonly<Record<string, any>>) => any[];
101
+ /**
102
+ * A nonce a prize route names (its `nonce` argument), from what names the prize: a grant and its round, a lottery's
103
+ * contribution, a contest's entry, an auction and its last bid. Any nonce works (the sender picks it); the roll's order
104
+ * is then at `prizeRollNonce` of it (plus the place where the route says so), which no roll on an NFT is at.
105
+ */
106
+ export declare const prizeNonce: (...parts: any[]) => bigint;
107
+ /**
108
+ * The nonce a roll given as a prize is made at: the first 8 bytes, little endian, of
109
+ * sha256("prize" | n (u64 LE)), `n` the nonce the route names (its argument, plus the place or `k` where it says so).
110
+ * Every roll given as a prize (a grant's, a lottery place's, a contest's, an auction's roll lot, a mission's chest, a
111
+ * recipe's `Prize::Roll`, a box's prize roll) is at `["order", project, winner, prizeRollNonce(n)]`. A roll an order
112
+ * won is made at settle at `rollNonce(order, slot, k)` as it is (hashed under "roll", so no named nonce reaches it). A roll on an NFT (`nonceOn`, a recipe's `RollOn`, a mission's
113
+ * `roll`) and a box's own order are not. Not `prizeNonce`, which makes the `n` a route names from its parts.
114
+ */
115
+ export declare const prizeRollNonce: (n: any) => bigint;
116
+ /**
117
+ * The accounts a prize takes after a route's own, given to `winner`:
118
+ * Tokens the mint (written when minted), the pool when they come from one, the winner's account of the mint;
119
+ * Item the item; for a collectible, its collection (the Item's), its address at the item's next serial, Metaplex Core;
120
+ * Nft the stash, the NFT as `piece` takes it, then a compressed NFT's proof;
121
+ * Roll the box, then the order its roll is made in, at `prizeRollNonce(nonce)`; on a route the player pays or
122
+ * asks for (`strict`: a buy, a craft, a grant's claim), then the box's prize mints (`rollMints`);
123
+ * Held the lottery's own stash (`lottery`: the lottery's address), the NFT as `piece` takes it, then its proof.
124
+ * `poolMints` maps a pool's index to its mint (null for a pool never opened, which gives nothing: `projectMint` stands in
125
+ * for its mint); `items` an item's id to its decoded Item (for its next serial; `made`
126
+ * collectibles of the same item already made earlier in the instruction); `nft` the NFT's kind, as `piece` takes it
127
+ * ({ collection, tokenMetadata, compressed }). A strict roll's `boxes` maps the box's id to its decoded LootBox (null
128
+ * for one never written), and `rollPools` each pool its prizes name to its mint (null for one never opened;
129
+ * `poolMints` when not given).
130
+ */
131
+ export declare function prizeMetas({ project, collection, prize, winner, nonce, poolMints, items, nft, made, projectMint, programs, lottery, strict, boxes, rollPools }: {
132
+ boxes?: {} | undefined;
133
+ collection: any;
134
+ items?: {} | undefined;
135
+ lottery: any;
136
+ made?: number | undefined;
137
+ nft?: {} | undefined;
138
+ nonce?: bigint | undefined;
139
+ poolMints?: {} | undefined;
140
+ prize: any;
141
+ programs: any;
142
+ project: any;
143
+ projectMint: any;
144
+ rollPools?: any;
145
+ strict?: boolean | undefined;
146
+ winner: any;
147
+ }): any[];
148
+ /**
149
+ * The accounts the program reads after a roll's box and order, to check the roll can be asked for, on a route the
150
+ * player pays or asks for (a craft's `Prize::Roll` or `RollOn`, a buy's roll, a grant's claim of one): for each of the
151
+ * box's token prizes, in order, its pool and then, for a pool opened, the pool's mint; for tokens minted, their mint. The program refuses the whole
152
+ * transaction (PrizeHasHook) when any of those mints has a transfer hook, so the player keeps what the route takes.
153
+ * `box` is the decoded LootBox (null for one never written: no roll is made, and nothing follows); `pools` maps each
154
+ * pool its prizes name to its mint, or null for a pool never opened (its address alone).
155
+ */
156
+ export declare function rollMints(project: any, box: any, pools?: {}): any;
157
+ /** Bubblegum's signer for its calls to Core, `["mpl_core_cpi_signer"]`. */
158
+ export declare const BUBBLEGUM_CORE_SIGNER = "CbNY3JiXdXNE9tPNEk1aRZVEkWdj2v7kfJLNQwZZgpXk";
159
+ /**
160
+ * The project's owner or authority (`signer`) makes a Bubblegum v2 tree the project alone mints compressed prizes into
161
+ * (`Prize::Compressed`). `tree` is a new account of mpl-account-compression of `treeSize(maxDepth, maxBufferSize,
162
+ * canopy)` bytes, made empty first in the same transaction (a System `createAccount` owned by mpl-account-compression, the tree's keypair signing).
163
+ */
164
+ export declare const openTreeIx: ({ signer, project, tree, maxDepth, maxBufferSize }: {
165
+ maxBufferSize: any;
166
+ maxDepth: any;
167
+ project: any;
168
+ signer: any;
169
+ tree: any;
170
+ }) => {
171
+ programId: string;
172
+ keys: any[];
173
+ data: Uint8Array<any>;
174
+ };
175
+ /** The bytes an mpl-account-compression tree of this shape takes (its header, changelog, rightmost path and canopy). */
176
+ export declare function treeSize(maxDepth: any, maxBufferSize: any, canopy: any): number;
177
+ /** The ticket that names what an oracle request is for: sha256("ticket" | order or lottery | the slot of its first ask).
178
+ * Every request of one roll, or of one round's draw, names it. Nothing lives there. */
179
+ export declare const ticketOf: (requester: any, slot: any) => string;
180
+ /** Signed by the program's upgrade authority, once. `fees`: { player, project } lamports. */
181
+ export declare const initPlatformIx: ({ admin, fees }: {
182
+ admin: any;
183
+ fees: any;
184
+ }) => {
185
+ programId: string;
186
+ keys: any[];
187
+ data: Uint8Array<any>;
188
+ };
189
+ /** `nextAdmin` signs too when it is another key. */
190
+ export declare const setPlatformIx: ({ admin, fees, nextAdmin }: {
191
+ admin: any;
192
+ fees: any;
193
+ nextAdmin?: any;
194
+ }) => {
195
+ programId: string;
196
+ keys: any[];
197
+ data: Uint8Array<any>;
198
+ };
199
+ /** The platform collects the fees waiting in each project's fee box, into `to`. */
200
+ export declare const collectFeesIx: ({ admin, to, projects }: {
201
+ admin: any;
202
+ projects: any;
203
+ to: any;
204
+ }) => {
205
+ programId: string;
206
+ keys: any[];
207
+ data: Uint8Array<any>;
208
+ };
209
+ export declare const setSuspendedIx: ({ admin, project, suspended }: {
210
+ admin: any;
211
+ project: any;
212
+ suspended: any;
213
+ }) => {
214
+ programId: string;
215
+ keys: any[];
216
+ data: Uint8Array<any>;
217
+ };
218
+ /**
219
+ * Opens project `id` (any number of `owner`'s own) at `pda.project(owner, id)`. `authority` signs payouts and makes,
220
+ * `treasury` is the wallet the remainder of every split goes to (its associated token account of each mint, which the
221
+ * program opens when it is not there). `collections`: the Metaplex Core collections it has authority over (none at
222
+ * all is fine; at most 8), each one whose update authority is the owner or the project, passed after the
223
+ * instruction's own accounts. A project names no token: each mechanic names the mint it takes or pays. Only the owner
224
+ * signs; the authority's and the treasury's accounts are passed too, and the program refuses a key nobody can sign
225
+ * for that it can tell (an account of loot or of a token program, a program: `BadKey`).
226
+ */
227
+ export declare const createProjectIx: ({ owner, id, authority, treasury, collections }: {
228
+ authority: any;
229
+ collections?: never[] | undefined;
230
+ id?: number | undefined;
231
+ owner: any;
232
+ treasury: any;
233
+ }) => {
234
+ programId: string;
235
+ keys: any[];
236
+ data: Uint8Array<any>;
237
+ };
238
+ /**
239
+ * `update`: { authority?, treasury?, paused?, collections? }. `collections` replaces the project's list; every one in
240
+ * it is passed after the instruction's own accounts (the program reads the new ones). The owner pays for the project
241
+ * growing with its collections, and gets back what it shrinks by. A new owner (who signs too) is optional. A new
242
+ * authority or treasury comes with the account at its key (`new_authority`, `new_treasury`), which the program checks
243
+ * as `createProjectIx`'s.
244
+ */
245
+ export declare const updateProjectIx: ({ owner, project, authority, paused, treasury, collections, newOwner }: {
246
+ authority?: null | undefined;
247
+ collections?: null | undefined;
248
+ newOwner?: null | undefined;
249
+ owner: any;
250
+ paused?: null | undefined;
251
+ project: any;
252
+ treasury?: null | undefined;
253
+ }) => {
254
+ programId: string;
255
+ keys: any[];
256
+ data: Uint8Array<any>;
257
+ };
258
+ export declare const openPoolIx: ({ owner, project, index, mint }: {
259
+ index: any;
260
+ mint: any;
261
+ owner: any;
262
+ project: any;
263
+ }) => {
264
+ programId: string;
265
+ keys: any[];
266
+ data: Uint8Array<any>;
267
+ };
268
+ /** Where a record of the owner's lives: its kind's seed, the project and its id. */
269
+ export declare function recordAddress(project: any, def: any): any;
270
+ /**
271
+ * `def` with optional fields filled in (no window, no limit for each wallet, no key root, a fall on its own clock).
272
+ */
273
+ export declare function withDefaults(def: any): {
274
+ [x: string]: any;
275
+ };
276
+ /**
277
+ * The owner writes one record (`def`: { Item: { id, args } }, { Box: … }, …), at its own address. A lottery names
278
+ * its pot's mint, its pot (which its first write opens), its ticket mint, its
279
+ * funds and both token programs.
280
+ */
281
+ export declare function upsertIx({ owner, project, def: given, lottery }: {
282
+ def: any;
283
+ lottery?: null | undefined;
284
+ owner: any;
285
+ project: any;
286
+ }): {
287
+ programId: string;
288
+ keys: any[];
289
+ data: Uint8Array<any>;
290
+ };
291
+ /**
292
+ * The owner closes the record at `target`, and its rent comes back: a grant's with the funds it held. A lottery
293
+ * (`lottery`: its decoded record) sends what its pot holds to `to`, a token account of the pot's mint (the owner's own
294
+ * by default), and closes the pot.
295
+ */
296
+ export declare function closeRecordIx({ owner, project, target, lottery, schedule, programs, to, paymentTo, extra }: {
297
+ extra?: never[] | undefined;
298
+ lottery: any;
299
+ owner: any;
300
+ paymentTo: any;
301
+ programs: any;
302
+ project: any;
303
+ schedule: any;
304
+ target: any;
305
+ to: any;
306
+ }): {
307
+ programId: string;
308
+ keys: any[];
309
+ data: Uint8Array<any>;
310
+ };
311
+ /**
312
+ * `player` (or a sponsor, or the project's own keys funding a pool) pays `amount` of `mint`, split at once by `shares`.
313
+ * The rest goes to the project's `treasury` wallet. The player opens any account this pays into that is not there.
314
+ */
315
+ export declare function payIx({ player, project, mint, treasury, amount, shares, reference: ref, playerToken, holders, programs, extra }: {
316
+ amount: any;
317
+ extra?: never[] | undefined;
318
+ holders: any;
319
+ mint: any;
320
+ player: any;
321
+ playerToken: any;
322
+ programs: any;
323
+ project: any;
324
+ reference: any;
325
+ shares?: never[] | undefined;
326
+ treasury: any;
327
+ }): {
328
+ programId: string;
329
+ keys: any[];
330
+ data: Uint8Array<any>;
331
+ };
332
+ /**
333
+ * Opens a loot box (`box` the decoded LootBox at `boxAddress`), in an order at `nonce` (a box whose roll moves the
334
+ * numbers of the NFT it rolls on: at that NFT's, `nonceOn`, whatever `nonce` says). `poolMints` maps each pool its
335
+ * prizes take tokens from to its mint (a pool's tokens won wait in the project's vault for that mint); one not given
336
+ * is taken to be in the box's currency, one given as null is closed. `shown`: an NFT the player shows for the box's
337
+ * gate or odds; `listProof`: for a list gate, the proof's nodes. `chosenRecipient`: the wallet (or, for a share with an
338
+ * item, the collectible, `chosen`) the buyer names for a share the box lets them choose. A box of one entry with
339
+ * nothing random is rolled at once and takes no oracle accounts (a box that needs no roll at all sells with `buyIx`).
340
+ * The player opens the project's vault for the price's mint, and for each prize's, when it is not there. A box that
341
+ * limits each wallet counts the purchase in the player's receipt (its rent theirs).
342
+ */
343
+ export declare function openBoxIx({ player, project, box, boxAddress, nonce, maxPrice, shown, listProof, subject, chosenRecipient, chosen, poolMints, playerToken, programs, extra }: {
344
+ box: any;
345
+ boxAddress: any;
346
+ chosen?: null | undefined;
347
+ chosenRecipient?: null | undefined;
348
+ extra?: never[] | undefined;
349
+ listProof: any;
350
+ maxPrice: any;
351
+ nonce: any;
352
+ player: any;
353
+ playerToken: any;
354
+ poolMints: any;
355
+ programs: any;
356
+ project: any;
357
+ shown: any;
358
+ subject: any;
359
+ }): {
360
+ programId: string;
361
+ keys: any[];
362
+ data: Uint8Array<any>;
363
+ };
364
+ /**
365
+ * Buys a box that needs no roll (one entry, nothing random, no NFT to roll on: `boxRolls` false and no subject) in one
366
+ * instruction: the price is split at once (or burned, for an entry that burns) and the entry's prizes are given to
367
+ * the player (`prizeMetas`: `items` maps an item's id to its decoded Item, `poolMints` a pool's index to its mint,
368
+ * `nfts` an NFT a prize names to its kind; a roll's `boxes` and `rollPools`, for the rolled box's prize mints). No
369
+ * order. A prize that can't be given refuses the purchase. `treasury` is
370
+ * the project's treasury wallet; `holders` maps a collectible a share pays to its holder; a roll the entry gives is
371
+ * made at `nonce` (the next one for each roll after). `shown`/`listProof` pass the box's gate.
372
+ */
373
+ export declare function buyIx({ player, project, box, boxAddress, maxPrice, treasury, chosenRecipient, chosen, nonce, shown, listProof, items, poolMints, nfts, boxes, rollPools, holders, playerToken, programs, extra }: {
374
+ box: any;
375
+ boxAddress: any;
376
+ boxes?: {} | undefined;
377
+ chosen?: null | undefined;
378
+ chosenRecipient?: null | undefined;
379
+ extra?: never[] | undefined;
380
+ holders: any;
381
+ items?: {} | undefined;
382
+ listProof: any;
383
+ maxPrice: any;
384
+ nfts?: {} | undefined;
385
+ nonce?: bigint | undefined;
386
+ player: any;
387
+ playerToken: any;
388
+ poolMints?: {} | undefined;
389
+ programs: any;
390
+ project: any;
391
+ rollPools?: any;
392
+ shown: any;
393
+ treasury: any;
394
+ }): {
395
+ programId: string;
396
+ keys: any[];
397
+ data: Uint8Array<any>;
398
+ };
399
+ /**
400
+ * The oracle's answer to a box order (for a local simulation: on chain MagicBlock's oracle sends it). The accounts
401
+ * are the ones `open_box` handed the oracle: the order, the box, the roll's ticket (named by its first ask,
402
+ * `asked_first`, which a stale re-ask keeps), every prize's account (written); for a
403
+ * box with tokens the two token programs, the project, and each mint with its vault (a mint it mints from written);
404
+ * for a prize in a mint with a transfer hook, the hook's accounts (`extra`). The buyer's odds boosts were fixed at
405
+ * purchase.
406
+ */
407
+ export declare function callbackRollIx({ order, orderState, box, boxAddress, randomness, project, poolMints, programs, extra }: {
408
+ box: any;
409
+ boxAddress: any;
410
+ extra?: never[] | undefined;
411
+ order: any;
412
+ orderState: any;
413
+ poolMints: any;
414
+ programs: any;
415
+ project: any;
416
+ randomness: any;
417
+ }): {
418
+ programId: string;
419
+ keys: any[];
420
+ data: Uint8Array<any>;
421
+ };
422
+ /**
423
+ * The accounts of what an order won (`order.won`), in order, as `settle` hands each over:
424
+ * Item the item; for a collectible (`items[id]` its decoded Item), its collection, its address, Metaplex Core
425
+ * Tokens the mint, the project's vault for it, the player's account of it (`prizeTo`, when given)
426
+ * Nft the NFT as `piece` takes it (`nfts[nft]` its kind), going to the player, then a compressed NFT's proof
427
+ * Roll the box, then the order its roll is made in (`rollNonce`)
428
+ */
429
+ export declare function wonAccounts({ orderAddress, order, items, nfts, prizeTo, putBack, programs }: {
430
+ items?: {} | undefined;
431
+ nfts?: {} | undefined;
432
+ order: any;
433
+ orderAddress: any;
434
+ prizeTo: any;
435
+ programs: any;
436
+ putBack?: never[] | undefined;
437
+ }): any;
438
+ /** The heap a settle that moves three or more NFTs asks for (`settleHeapFrame`): all a transaction may have, 256 KiB. */
439
+ export declare const LARGE_SETTLE_HEAP: number;
440
+ /**
441
+ * The heap a settle of `order` asks for with Compute Budget's `RequestHeapFrame` (`requestHeapFrame`), in bytes; 0 for
442
+ * none (the 32 KiB every transaction has). A settle hands every account to each NFT's move, so one that moves three or
443
+ * more NFTs (the prizes and the NFT rolled on) can outgrow 32 KiB, for good once a payee turns on required memos
444
+ * (a known limit of the program).
445
+ *
446
+ * loot's own allocator uses the frame a transaction asks for, up to
447
+ * 256 KiB, so such a settle asks for all of it (`LARGE_SETTLE_HEAP`, about 1,000 compute units more). Every settle
448
+ * `js/play` sends for such an order asks for it, and so does the keeper's sweep: put `requestHeapFrame(heap)` before
449
+ * the settle when `settleHeapFrame(order)` is not 0. A prize step of a lottery gives one place a call and needs none.
450
+ */
451
+ export declare function settleHeapFrame(order: any): number;
452
+ /** All the compute units a transaction may have: what a settle that moves an NFT asks for (`settleComputeUnits`). */
453
+ export declare const MAX_COMPUTE_UNITS = 1400000;
454
+ /**
455
+ * The compute limit a settle of `order` asks for. A settle that moves an NFT asks for all a transaction may have
456
+ * (1,400,000 units): up to 986,000 were measured for three pNFTs of stashes, the NFT rolled on and
457
+ * four holders' shares. Any other asks for 800,000 (tokens to the player and up to four payees, accounts opened for
458
+ * them). A limit costs nothing more when no priority fee is set.
459
+ */
460
+ export declare function settleComputeUnits(order: any): 800000 | 1400000;
461
+ /**
462
+ * Carries out a rolled order: hands over what its roll set aside (`wonAccounts`: a collectible minted, the project's
463
+ * backend delivering a normal item from the receipt; tokens from the project's vault; an NFT taken out of its stash;
464
+ * a roll made for the player), then splits the payment, or burns it for an entry that burns. Anyone sends it, for the
465
+ * order at `orderAddress`; `signer` opens any account it pays into that is not there, and pays a roll's order. `order`
466
+ * is the decoded Order; `projectState` the decoded Project; `items` and `nfts` as `wonAccounts` takes them. `putBack`:
467
+ * NFTs won that the player, signing, puts back into their stash in place of taking them (one its collection won't let move).
468
+ * `handBack`: the wallet the box's fate gives the NFT rolled on to (`receiverOf`) is an account of the loot program
469
+ * (`handsBack` of it as read), so the program gives it back to the player, and a Token Metadata NFT's `token` is the
470
+ * player's. `extra`: a hook's or a memo's accounts.
471
+ */
472
+ export declare function settleIx({ signer, orderAddress, order, projectState, items, nfts, prizeTo, putBack, subject, handBack, holders, programs, extra }: {
473
+ extra?: never[] | undefined;
474
+ handBack?: boolean | undefined;
475
+ holders: any;
476
+ items: any;
477
+ nfts: any;
478
+ order: any;
479
+ orderAddress: any;
480
+ prizeTo: any;
481
+ programs: any;
482
+ projectState: any;
483
+ putBack: any;
484
+ signer: any;
485
+ subject: any;
486
+ }): {
487
+ programId: string;
488
+ keys: any[];
489
+ data: Uint8Array<any>;
490
+ };
491
+ /**
492
+ * Where a held NFT a roll was on goes, when not back to its player: the wallet its fate names, the stash it goes into,
493
+ * or the incinerator.
494
+ */
495
+ export declare function receiverOf(order: any): any;
496
+ /**
497
+ * Whether an NFT the project holds, given to the wallet whose account is `account` (as read: `{ owner }`, or null for
498
+ * none), goes back to its player instead: when that account is the loot program's (the project's
499
+ * own address, a record, a stash, a fee box), where nothing could move it again. A settle's fate and an NFT lottery
500
+ * ticket's price take it as `handBack`.
501
+ */
502
+ export declare const handsBack: (account: any) => boolean;
503
+ /** Where an NFT that is burned but can't be (any kind but Core) is sent: an address nobody holds the key to. */
504
+ export declare const INCINERATOR = "1nc1nerator11111111111111111111111111111111";
505
+ /**
506
+ * Gives an order's payment back to its player, into their account of the mint (`signer`, anyone, opens it when it is
507
+ * not there): an order whose roll failed or never came. A rolled order is settled, never refunded
508
+ * (`orderRefundSlot`). A purchase counted against a box's limit for each
509
+ * wallet is given back. `extra`: a hook's or a memo's accounts.
510
+ */
511
+ export declare function refundIx({ signer, orderAddress, order, subject, programs, extra }: {
512
+ extra?: never[] | undefined;
513
+ order: any;
514
+ orderAddress: any;
515
+ programs: any;
516
+ signer: any;
517
+ subject: any;
518
+ }): {
519
+ programId: string;
520
+ keys: any[];
521
+ data: Uint8Array<any>;
522
+ };
523
+ /**
524
+ * Anyone (`payer`, who pays the oracle) asks for the roll a mission's return, a recipe or a prize made (`order.status`
525
+ * Waiting): the box's prizes' accounts, as `openBoxIx` passes them. It lands in `callback_roll`. Returns a list of
526
+ * instructions: first `payer` opens the project's vault for each prize mint when it is not there (idempotent; the
527
+ * program refuses the ask without them, since tokens won wait there), then the ask.
528
+ */
529
+ export declare function askRollIx({ payer, orderAddress, order, box, poolMints, programs }: {
530
+ box: any;
531
+ order: any;
532
+ orderAddress: any;
533
+ payer: any;
534
+ poolMints: any;
535
+ programs: any;
536
+ }): {
537
+ programId: string;
538
+ keys: any[];
539
+ data: Uint8Array<any>;
540
+ }[];
541
+ /** The SOL a box order holds for each collectible its roll may mint (`orderEscrow`): its rent, given back unspent. The
542
+ * IDL's `ESCROW_LAMPORTS`. */
543
+ export declare const ESCROW_LAMPORTS: bigint;
544
+ /**
545
+ * The authority moves the project's tokens: `from` { Pool: [i] } or { Mint: [mint] } (newly minted), `to` a pool, a
546
+ * wallet, an account, the treasury (`treasury`, the project's wallet), a collectible's holder or 'Burn', `amount`
547
+ * { Fixed: [n] } or { Bps: [bps] } of a pool. The authority opens the account it pays into when it is not there; a
548
+ * collectible nobody holds gets nothing.
549
+ */
550
+ export declare function moveTokensIx({ authority, project, mint, from, to, amount, reference: ref, holders, programs, treasury, extra }: {
551
+ amount: any;
552
+ authority: any;
553
+ extra?: never[] | undefined;
554
+ from: any;
555
+ holders: any;
556
+ mint: any;
557
+ programs: any;
558
+ project: any;
559
+ reference: any;
560
+ to: any;
561
+ treasury: any;
562
+ }): {
563
+ programId: string;
564
+ keys: any[];
565
+ data: Uint8Array<any>;
566
+ };
567
+ /**
568
+ * The authority makes, rewrites or burns a collectible. `change`: { Make: { attributes } } (then `item` is the item id
569
+ * it makes one of, `asset` is a new key that signs, and `owner` receives it), { Set: [attributes] } or 'Burn'. `collection`: the project's for a Make
570
+ * or a Burn; for a Set, the asset's own (`MPL_CORE_PROGRAM` for one in none). `hasAuthority` false for a `Set` on an
571
+ * NFT the project has no authority over (a Core asset of another collection, or a Token Metadata NFT's mint): what it
572
+ * writes goes in the NFT's Sheet, or on the NFT itself when its Attributes plugin names the project.
573
+ */
574
+ export declare function collectibleIx({ authority, project, collection, asset, change, item, owner, hasAuthority, reference: ref }: {
575
+ asset: any;
576
+ authority: any;
577
+ change: any;
578
+ collection: any;
579
+ hasAuthority?: boolean | undefined;
580
+ item?: null | undefined;
581
+ owner?: null | undefined;
582
+ project: any;
583
+ reference: any;
584
+ }): {
585
+ programId: string;
586
+ keys: any[];
587
+ data: Uint8Array<any>;
588
+ };
589
+ /**
590
+ * A held NFT goes to `to`: the authority's choice while the hold runs, home to its player (anyone) after; a repaid
591
+ * loan's home (anyone, whenever), an unpaid one's to its lender once due. `hold` is the
592
+ * decoded Hold: its address names its end (`pda.hold(asset, free_at)`), so a release sent late never lands on a later
593
+ * hold. The NFT is any kind
594
+ * (`piece`): `asset` and `collection` for a Core asset, with `tokenMetadata` for a Token Metadata NFT, or `compressed`
595
+ * (after a `proveLeafIx`).
596
+ */
597
+ export declare function releaseIx({ signer, project, collection, asset, tokenMetadata: tm, compressed, hold, to, reference: ref }: {
598
+ asset: any;
599
+ collection: any;
600
+ compressed: any;
601
+ hold: any;
602
+ project: any;
603
+ reference: any;
604
+ signer: any;
605
+ to: any;
606
+ tokenMetadata: any;
607
+ }): {
608
+ programId: string;
609
+ keys: any[];
610
+ data: Uint8Array<any>;
611
+ };
612
+ /**
613
+ * The authority opens contest `id` in `mint`. `args`: { sides, closes_at, result_by, shares, gate, deciders,
614
+ * min_pot, stake, prize, nft, prize_split }: `prize`, what each winning entry gets when it is claimed (`prizeMetas`);
615
+ * `nft`, a rule an NFT each entry stakes passes, in place of tokens (no shares then, no stake: the NFTs are the pot).
616
+ * With `args.prize_split`, its token prize is set aside whole when it is
617
+ * decided, in the contest's own vault (`pda.prizeVault`, opened now at the authority's rent), and each winning entry
618
+ * takes its part by what it put in: `prizeMint` names the prize's mint when it comes from a pool.
619
+ */
620
+ export declare const openContestIx: ({ authority, project, id, mint, args, prizeMint }: {
621
+ args: any;
622
+ authority: any;
623
+ id: any;
624
+ mint: any;
625
+ prizeMint: any;
626
+ project: any;
627
+ }) => {
628
+ programId: string;
629
+ keys: any[];
630
+ data: Uint8Array<any>;
631
+ };
632
+ /** The prefix of a contest's verdict (`verdictBytes`). */
633
+ export declare const VERDICT_DOMAIN = "loot-verdict-v3";
634
+ /**
635
+ * The bytes a contest's decider key signs: "loot-verdict-v3" | program (32) | contest (32) | incarnation (u64 LE) |
636
+ * side (1; 255 calls it off) | expires (i64 LE), then | recipient (32) when the verdict names the wallet the
637
+ * contest's chosen share pays. `incarnation` is the contest's (the decoded Contest's), so a verdict decides only the
638
+ * contest it was signed for, never one opened later at the same id. `decide` rebuilds them from its own accounts and
639
+ * arguments.
640
+ */
641
+ export declare function verdictBytes({ program, contest, incarnation, side, expires, recipient }: {
642
+ contest: any;
643
+ expires: any;
644
+ incarnation: any;
645
+ program?: string | undefined;
646
+ recipient?: null | undefined;
647
+ side: any;
648
+ }): Uint8Array<any>;
649
+ /**
650
+ * Names the side that won (`side`), or calls the contest off (`side: null`). `signer` is the authority; or anyone
651
+ * sending a decider's verdict (`verdict: { expires }`, taken once entries have closed): then this instruction goes
652
+ * right after the Ed25519 check of the decider's signature over `verdictBytes` (`ed25519Ix` in grant.js), and
653
+ * `signer` pays the fee. Anyone writes down a contest that is off by itself. The contest's incarnation names it, so a
654
+ * decision sent late never decides a contest opened later at the same id. A call-off takes no share accounts. A
655
+ * contest with a chosen share is decided naming its `recipient`, a wallet (a bounty's worker); a decider's verdict
656
+ * signs it too (`verdictBytes`).
657
+ */
658
+ export declare function decideIx({ signer, project, projectState, contestAddress, contest, side, recipient, verdict, reference: ref, holders, prizeMint, programs, extra }: {
659
+ contest: any;
660
+ contestAddress: any;
661
+ extra?: never[] | undefined;
662
+ holders: any;
663
+ prizeMint: any;
664
+ programs: any;
665
+ project: any;
666
+ projectState: any;
667
+ recipient?: null | undefined;
668
+ reference: any;
669
+ side: any;
670
+ signer: any;
671
+ verdict: any;
672
+ }): {
673
+ programId: string;
674
+ keys: any[];
675
+ data: Uint8Array<any>;
676
+ };
677
+ /** The authority asks the oracle for a random number, for a rule of the project's own. */
678
+ export declare const rollIx: ({ authority, project, reference: ref }: {
679
+ authority: any;
680
+ project: any;
681
+ reference: any;
682
+ }) => {
683
+ programId: string;
684
+ keys: any[];
685
+ data: Uint8Array<any>;
686
+ };
687
+ /** The oracle's answer to a `roll` (for a local simulation). */
688
+ export declare const callbackRandomIx: ({ project, reference: ref, randomness }: {
689
+ project: any;
690
+ randomness: any;
691
+ reference: any;
692
+ }) => {
693
+ programId: string;
694
+ keys: {
695
+ pubkey: any;
696
+ isSigner: any;
697
+ isWritable: any;
698
+ }[];
699
+ data: Uint8Array<any>;
700
+ };
701
+ /**
702
+ * Anyone (`payer`) runs a schedule that is due, and opens the account it pays into when that is not there.
703
+ * `poolMint`: the mint of the pool it moves from (when it moves from one). `extra`: a hook's or a memo's accounts.
704
+ */
705
+ export declare function runScheduleIx({ payer, project, id, schedule, poolMint, holders, programs, treasury, extra }: {
706
+ extra?: never[] | undefined;
707
+ holders: any;
708
+ id: any;
709
+ payer: any;
710
+ poolMint: any;
711
+ programs: any;
712
+ project: any;
713
+ schedule: any;
714
+ treasury: any;
715
+ }): {
716
+ programId: string;
717
+ keys: any[];
718
+ data: Uint8Array<any>;
719
+ };
720
+ export declare const lotteryPaymentMint: (lottery: any) => any;
721
+ /**
722
+ * `player` buys `count` tickets: a contribution of their own at `nonce` (any number they have no contribution at in
723
+ * this lottery), whose rent they pay and get back once it is finished. The ticket money waits in the lottery's
724
+ * escrow until the draw. Whoever holds a collectible a fixed share pays is fixed now, from that collectible. It buys
725
+ * only at the `lottery`'s incarnation and revision (`TermsChanged` once the owner edits or recreates it). A lottery
726
+ * whose ticket costs an NFT (`lottery.nft_ticket`) sells one at a time, for `nft` ({ asset, collection, tokenMetadata,
727
+ * compressed }, as `piece` takes it), which the project holds until the round is drawn (then it goes where its `then`
728
+ * says, `spentTo`) or cancelled (then back to its buyer).
729
+ */
730
+ export declare function buyTicketsIx({ player, project, id, lottery, mint, count, nonce, shown, listProof, chosenRecipient, chosen, nft, playerToken, programs, extra }: {
731
+ chosen?: null | undefined;
732
+ chosenRecipient?: null | undefined;
733
+ count: any;
734
+ extra?: never[] | undefined;
735
+ id: any;
736
+ listProof: any;
737
+ lottery: any;
738
+ mint: any;
739
+ nft: any;
740
+ nonce: any;
741
+ player: any;
742
+ playerToken: any;
743
+ programs: any;
744
+ project: any;
745
+ shown: any;
746
+ }): {
747
+ programId: string;
748
+ keys: any[];
749
+ data: Uint8Array<any>;
750
+ };
751
+ /** Anyone asks for a lottery's draw once it is due. */
752
+ export declare const drawLotteryIx: ({ payer, project, id }: {
753
+ id: any;
754
+ payer: any;
755
+ project: any;
756
+ }) => {
757
+ programId: string;
758
+ keys: any[];
759
+ data: Uint8Array<any>;
760
+ };
761
+ /** The oracle's answer to a draw (for a local simulation). Every request of a round names the round's ticket, fixed
762
+ * at its first ask (`asked_first`): a re-ask keeps it, so the first answer to land draws the round. */
763
+ export declare function callbackLotteryIx({ project, id, lottery, askedFirst, randomness }: {
764
+ askedFirst?: any;
765
+ id: any;
766
+ lottery: any;
767
+ project: any;
768
+ randomness: any;
769
+ }): {
770
+ programId: string;
771
+ keys: {
772
+ pubkey: any;
773
+ isSigner: any;
774
+ isWritable: any;
775
+ }[];
776
+ data: Uint8Array<any>;
777
+ };
778
+ export declare const cancelLotteryIx: ({ project, id }: {
779
+ id: any;
780
+ project: any;
781
+ }) => {
782
+ programId: string;
783
+ keys: any[];
784
+ data: Uint8Array<any>;
785
+ };
786
+ /** Where a decoded contribution's shares go: as fixed when it was bought. */
787
+ export declare function lotteryContributionShares(lottery: any, contribution: any): any;
788
+ /**
789
+ * Anyone (`payer`) sends a contribution's next step (`lotteryStep`; `contributionAddress`, decoded `contribution`):
790
+ * - a drawn round gives every place's prize first: the step of a contribution that won a place with a prize gives
791
+ * the first such prize not given yet to its buyer, one place a call (`prizeMetas`: `collection`, `poolMints`, `items`, `nfts` as it takes them; a roll's
792
+ * order at `nonce` plus the place, `prizeNonce(contributionAddress)` by default), and nothing else moves;
793
+ * - once every prize is given, it is routed through its shares into the pot (or its tickets burned, or its NFT ticket
794
+ * spent); a cancelled round's, or a lottery's that returns its tickets, goes back to its buyer, never waiting;
795
+ * - one that holds a winning ticket stays (`done`): once every contribution is finished, it pays its buyer every
796
+ * place's share of the pot it won, into their account of the pot's mint.
797
+ * `payer` opens any account it pays into that is not there. `treasury`: the project's treasury wallet, for a share
798
+ * that names it. A ticket an NFT paid for passes that NFT (`ticket`: its kind, as `piece` takes it); `handBack` when the
799
+ * wallet its price gives it to is an account of the loot program (`handsBack`), where it goes back to its buyer (a
800
+ * Token Metadata NFT into the buyer's token account).
801
+ */
802
+ export declare function finishLotteryContributionIx({ payer, project, id, lottery, contributionAddress, contribution, treasury, nonce, collection, poolMints, items, nfts, ticket, handBack, programs, extra }: {
803
+ collection: any;
804
+ contribution: any;
805
+ contributionAddress: any;
806
+ extra?: never[] | undefined;
807
+ handBack?: boolean | undefined;
808
+ id: any;
809
+ items: any;
810
+ lottery: any;
811
+ nfts?: {} | undefined;
812
+ nonce: any;
813
+ payer: any;
814
+ poolMints: any;
815
+ programs: any;
816
+ project: any;
817
+ ticket?: {} | undefined;
818
+ treasury: any;
819
+ }): {
820
+ programId: string;
821
+ keys: any[];
822
+ data: Uint8Array<any>;
823
+ };
824
+ /**
825
+ * The owner opens farm `id`: of `stakedMint`'s tokens, or of collectibles when it is null. Its rewards come from pool
826
+ * `args.rewards_pool`, whose mint is `rewardsMint`: all it receives, shared, or with `args.rate` ({ per_day, mints })
827
+ * a fixed rate, minted or from that pool (a rate of 0 pays nothing: a farm that only grows or gives prizes).
828
+ * `args.gates`: the rules an NFT must all pass. `args.growth`: up to 4 of { key, per_day, level, steps, streak }, each
829
+ * writing points (and a level) on what is staked; tiers' `prize` is paid from `args.prize` ({ Mint: [mint] } or
830
+ * { Pool: [index] }), whose mint is `prizeMint`. `args.ends_at`: when it ends (0: never). For a farm of collectibles,
831
+ * `args.lock_key`: the attribute a staked NFT's lock is written under, as the time it ends, so recipes and rolls can
832
+ * move it; `args.upkeep_key`: the attribute that says until when it earns and grows (fuel). Empty: none.
833
+ */
834
+ export declare const openFarmIx: ({ owner, project, id, args, rewardsMint, stakedMint }: {
835
+ args: any;
836
+ id: any;
837
+ owner: any;
838
+ project: any;
839
+ rewardsMint: any;
840
+ stakedMint?: null | undefined;
841
+ }) => {
842
+ programId: string;
843
+ keys: any[];
844
+ data: Uint8Array<any>;
845
+ };
846
+ /**
847
+ * `player` stakes `amount` at lock tier `tier`. `farm` is decoded; `extra` carries token hook/memo accounts. A new tier
848
+ * on a seat with a booster, in a farm with growth, needs the booster's growth written first: put a `refreshSeatIx` of
849
+ * the seat before it, in the same transaction.
850
+ */
851
+ export declare const stakeTokensIx: ({ player, project, id, farm, amount, tier, programs, shown, extra }: {
852
+ amount: any;
853
+ extra?: never[] | undefined;
854
+ farm: any;
855
+ id: any;
856
+ player: any;
857
+ programs: any;
858
+ project: any;
859
+ shown: any;
860
+ tier?: number | undefined;
861
+ }) => {
862
+ programId: string;
863
+ keys: any[];
864
+ data: Uint8Array<any>;
865
+ };
866
+ /**
867
+ * `player` takes `amount` out (0: only collects what is owed, and takes out tokens whose unbonding wait is over);
868
+ * `forfeit` gives up rewards that can't move. Before the tier's lock has run, a tier with an early-exit fee
869
+ * (`exit_bps`) lets it leave, leaving that share of `amount` to the farm's `exit_to`. In a farm that unbonds
870
+ * (`unbond`), what is taken out waits that long first, earning nothing (`withdrawable`).
871
+ */
872
+ export declare const unstakeTokensIx: ({ player, project, id, farm, amount, forfeit, programs, extra }: {
873
+ amount: any;
874
+ extra?: never[] | undefined;
875
+ farm: any;
876
+ forfeit?: boolean | undefined;
877
+ id: any;
878
+ player: any;
879
+ programs: any;
880
+ project: any;
881
+ }) => {
882
+ programId: string;
883
+ keys: any[];
884
+ data: Uint8Array<any>;
885
+ };
886
+ /** What a token seat may take out now (Unix seconds `now`): its unbonded tokens once their wait is over, else 0. */
887
+ export declare const withdrawable: (seat: any, now: any) => bigint;
888
+ /**
889
+ * Whether a farm (decoded) takes a stake at lock tier `tier` at `now` (Unix seconds, the chain's clock), as the program
890
+ * judges it: a farm with an end (`ends_at`, 0 for never) takes none at its end or after it, nor one whose lock
891
+ * would run past it (`FarmOver`). A stake of tokens, a booster, a new tier and a watched NFT's takeover all ask it.
892
+ */
893
+ export declare function farmOpenFor(farm: any, tier: any, now: any): boolean;
894
+ export declare const AUTH_RULES_PROGRAM = "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg";
895
+ /**
896
+ * Any NFT's accounts on a route (a farm, a hold, an auction's lot): `{ accounts, proof, writable }`, the proof going
897
+ * first among the instruction's remaining accounts, `writable` the accounts to pass writable (`lootIx`'s option). The
898
+ * NFT is one of:
899
+ * a Core asset (`asset`; `collection` its collection now; `hasAuthority` false for one the project has no authority
900
+ * over, whose Sheet is passed);
901
+ * a Token Metadata NFT (`asset` its mint, `tokenMetadata` { programmable, ruleSet } from `decodeTokenMetadata`): the
902
+ * token account of `wallet` (its holder, or whoever the project sends it to) and the project's own;
903
+ * a compressed NFT (`compressed`, from `compressedFromDas`), proven by a `proveLeafIx` earlier in the transaction.
904
+ * A Token Metadata or compressed NFT passes its Sheet: the project writes nothing on it.
905
+ * What the route does with it, so only the accounts it takes are passed (each true when left out):
906
+ * `moves`: hands it to the project or sends it on; `locks`: locks or unlocks it in its wallet; `writes`: writes on it;
907
+ * `burns`: burns a Core asset (false when left out); `reads`: reads its Sheet; `held`: reads it in the project's token
908
+ * account (an escrow farm).
909
+ */
910
+ export declare function piece({ project, asset, wallet, collection, hasAuthority, tokenMetadata: tm, compressed: c, moves, locks, writes, burns, reads, held }: {
911
+ asset: any;
912
+ burns?: boolean | undefined;
913
+ collection: any;
914
+ compressed: any;
915
+ hasAuthority?: boolean | undefined;
916
+ held?: any;
917
+ locks?: boolean | undefined;
918
+ moves?: boolean | undefined;
919
+ project: any;
920
+ reads?: boolean | undefined;
921
+ tokenMetadata: any;
922
+ wallet: any;
923
+ writes?: boolean | undefined;
924
+ }): {
925
+ accounts: {
926
+ mpl_core_program: null;
927
+ metadata: null;
928
+ edition: null;
929
+ token: null;
930
+ token_record: null;
931
+ project_token: null;
932
+ project_record: null;
933
+ rule_set: null;
934
+ rules_program: null;
935
+ token_metadata_program: null;
936
+ instructions: null;
937
+ spl_token_program: null;
938
+ spl_ata_program: null;
939
+ collection: any;
940
+ tree_config: any;
941
+ leaf_delegate: any;
942
+ bubblegum_program: string;
943
+ compression_program: string;
944
+ log_wrapper: string;
945
+ asset: any;
946
+ sheet: any;
947
+ leaf: any;
948
+ tree: any;
949
+ } | {
950
+ collection: null;
951
+ mpl_core_program: null;
952
+ metadata: null;
953
+ edition: null;
954
+ token: null;
955
+ token_record: null;
956
+ project_token: null;
957
+ project_record: null;
958
+ rule_set: null;
959
+ rules_program: null;
960
+ token_metadata_program: null;
961
+ instructions: null;
962
+ spl_token_program: null;
963
+ spl_ata_program: null;
964
+ tree_config: null;
965
+ leaf_delegate: null;
966
+ bubblegum_program: null;
967
+ compression_program: null;
968
+ log_wrapper: null;
969
+ asset: any;
970
+ sheet: any;
971
+ leaf: any;
972
+ tree: any;
973
+ };
974
+ proof: any;
975
+ writable: string[];
976
+ } | {
977
+ accounts: {
978
+ collection: null;
979
+ mpl_core_program: null;
980
+ leaf: null;
981
+ tree: null;
982
+ tree_config: null;
983
+ leaf_delegate: null;
984
+ bubblegum_program: null;
985
+ compression_program: null;
986
+ log_wrapper: null;
987
+ asset: any;
988
+ sheet: any;
989
+ metadata: any;
990
+ token: any;
991
+ edition: any;
992
+ token_record: any;
993
+ project_token: any;
994
+ project_record: any;
995
+ rule_set: any;
996
+ rules_program: string | null;
997
+ token_metadata_program: string | null;
998
+ instructions: string | null;
999
+ spl_token_program: string | null;
1000
+ spl_ata_program: string | null;
1001
+ };
1002
+ proof: never[];
1003
+ writable: never[];
1004
+ } | {
1005
+ accounts: {
1006
+ metadata: null;
1007
+ edition: null;
1008
+ token: null;
1009
+ token_record: null;
1010
+ project_token: null;
1011
+ project_record: null;
1012
+ rule_set: null;
1013
+ rules_program: null;
1014
+ token_metadata_program: null;
1015
+ instructions: null;
1016
+ spl_token_program: null;
1017
+ spl_ata_program: null;
1018
+ leaf: null;
1019
+ tree: null;
1020
+ tree_config: null;
1021
+ leaf_delegate: null;
1022
+ bubblegum_program: null;
1023
+ compression_program: null;
1024
+ log_wrapper: null;
1025
+ asset: any;
1026
+ sheet: any;
1027
+ collection: any;
1028
+ mpl_core_program: string | null;
1029
+ };
1030
+ proof: never[];
1031
+ writable: string[];
1032
+ };
1033
+ /** The account an NFT paid goes to: the wallet it is given to, the stash it goes into, or the
1034
+ * incinerator for a burn (any account stands in for a Core asset, which Core burns). `then`: 'Burn', { Give: [wallet] }
1035
+ * or { Stash: [id] }. */
1036
+ export declare function spentTo(project: any, then: any): any;
1037
+ /**
1038
+ * The accounts of an NFT `owner` pays with, after a route's own: the NFT as `piece` takes it, its proof,
1039
+ * then where it goes (`spentTo`). Given on or burned it moves straight from its owner: a Token Metadata NFT's
1040
+ * receiver's token account (and a pNFT's record of it) take the project's places; stashed, it is handed to the
1041
+ * project first. A Core asset burned writes its collection.
1042
+ */
1043
+ export declare function nftPaid({ project, owner, then, asset, collection, hasAuthority, tokenMetadata: tm, compressed }: {
1044
+ asset: any;
1045
+ collection: any;
1046
+ compressed: any;
1047
+ hasAuthority: any;
1048
+ owner: any;
1049
+ project: any;
1050
+ then: any;
1051
+ tokenMetadata: any;
1052
+ }): any[];
1053
+ /**
1054
+ * `player` pays with an NFT, any kind (as `piece` takes it): burned (`to` null: the incinerator's address goes in its
1055
+ * place), or given to the wallet `to` (the treasury, a partner). The receipt (`PaidNft`) is the record: an app admits the player when the NFT, where it went (`to`: a payment to the player's own wallet pays nothing) and the reference
1056
+ * are the ones it asked for. `extra`: Core's transfer adapters.
1057
+ */
1058
+ export declare function payNftIx({ player, project, asset, to, collection, hasAuthority, tokenMetadata: tm, compressed, reference: ref, extra }: {
1059
+ asset: any;
1060
+ collection: any;
1061
+ compressed: any;
1062
+ extra?: never[] | undefined;
1063
+ hasAuthority: any;
1064
+ player: any;
1065
+ project: any;
1066
+ reference: any;
1067
+ to?: null | undefined;
1068
+ tokenMetadata: any;
1069
+ }): {
1070
+ programId: string;
1071
+ keys: any[];
1072
+ data: Uint8Array<any>;
1073
+ };
1074
+ /**
1075
+ * Whether a classic token account (its `{ owner, data }` as read) takes a Token Metadata NFT `mint` for `holder`: an
1076
+ * account of the Token program, of that mint, that `holder` owns, not frozen. Token Metadata refuses one another key
1077
+ * owns (a holder can hand their own associated account to another key) and a frozen one, so a route that hands the
1078
+ * NFT into it fails: then the NFT goes into a fresh account of the holder's (`freshNftAccount`).
1079
+ */
1080
+ export declare function takesNft(account: any, holder: any, mint: any): boolean;
1081
+ /**
1082
+ * A fresh token account of `mint` that `holder` holds, which `payer` opens (and pays the rent of, the fixed
1083
+ * `TOKEN_ACCOUNT_RENT`, never an RPC's figure) at an address of its key and a seed (`addressWithSeed`): no new key
1084
+ * signs. Pass it as the NFT's `tokenMetadata.into` when the holder's associated account can't take it (`takesNft`).
1085
+ *
1086
+ * The seed names the holder and the mint (a hash of both), so each holder has their own 8 addresses (`index` 0 to 7) of
1087
+ * a payer's. `there` is the account at the address now, as read (null: nothing there): nothing there is opened with
1088
+ * `CreateAccountWithSeed`; an address that holds only lamports someone sent it (System's, no data), which
1089
+ * `CreateAccountWithSeed` refuses, is topped up to the rent (never more than `TOKEN_ACCOUNT_RENT`, whatever the RPC says
1090
+ * it holds) and allocated as the payer's seed account instead; a token account there that takes the NFT
1091
+ * needs nothing (`instructions` []). Anything else at the address (an account of the holder's that no longer takes it,
1092
+ * or lamports no account can hold: negative, or not a whole number) answers null: try the next `index`.
1093
+ */
1094
+ export declare function freshNftAccount({ payer, holder, mint, index, there }: {
1095
+ holder: any;
1096
+ index?: number | undefined;
1097
+ mint: any;
1098
+ payer: any;
1099
+ there?: null | undefined;
1100
+ }): {
1101
+ address: string;
1102
+ instructions: {
1103
+ programId: string;
1104
+ keys: {
1105
+ pubkey: any;
1106
+ isSigner: any;
1107
+ isWritable: any;
1108
+ }[];
1109
+ data: Uint8Array<any>;
1110
+ }[];
1111
+ } | null;
1112
+ /** How many fresh accounts a payer may open for one holder and mint (`freshNftAccount`'s `index`). */
1113
+ export declare const FRESH_NFT_ACCOUNTS = 8;
1114
+ /** A token account's rent on every cluster (165 bytes). */
1115
+ export declare const TOKEN_ACCOUNT_RENT = 2039280n;
1116
+ /** Anyone closes a compressed NFT's record (`pda.leaf`) that no longer matches its tree; its rent goes to `payer`, who paid it. */
1117
+ export declare const closeLeafIx: ({ asset, tree, payer }: {
1118
+ asset: any;
1119
+ payer: any;
1120
+ tree: any;
1121
+ }) => {
1122
+ programId: string;
1123
+ keys: any[];
1124
+ data: Uint8Array<any>;
1125
+ };
1126
+ /**
1127
+ * Anyone proves a compressed NFT's leaf (`compressed` from `compressedFromDas`): put it before the instruction that
1128
+ * uses the NFT, in the same transaction. The proof must be against the tree's current root (`StaleProof` otherwise:
1129
+ * fetch it again). Its record is read only while the tree is as it was then. Bubblegum's config of the tree comes
1130
+ * with it: only a tree Bubblegum made has one.
1131
+ */
1132
+ export declare const proveLeafIx: ({ signer, compressed: c }: {
1133
+ compressed: any;
1134
+ signer: any;
1135
+ }) => {
1136
+ programId: string;
1137
+ keys: any[];
1138
+ data: Uint8Array<any>;
1139
+ };
1140
+ /** The project's owner or authority vouches for NFTs' off-chain traits: `root` of a `traitsTree`, under `key`. */
1141
+ export declare const setTraitsIx: ({ signer, project, key, root }: {
1142
+ key: any;
1143
+ project: any;
1144
+ root: any;
1145
+ signer: any;
1146
+ }) => {
1147
+ programId: string;
1148
+ keys: any[];
1149
+ data: Uint8Array<any>;
1150
+ };
1151
+ /** Anyone writes `nft`'s traits ([{ key, value }]) into its Sheet in `project`, by its `proof` in the tree under `key`. */
1152
+ export declare const proveTraitsIx: ({ signer, project, key, nft, attributes, proof }: {
1153
+ attributes: any;
1154
+ key: any;
1155
+ nft: any;
1156
+ project: any;
1157
+ proof: any;
1158
+ signer: any;
1159
+ }) => {
1160
+ programId: string;
1161
+ keys: any[];
1162
+ data: Uint8Array<any>;
1163
+ };
1164
+ /**
1165
+ * `player` stakes an NFT: on a seat of its own in a farm of collectibles, or as the booster of the player's token seat
1166
+ * in a farm of tokens. Any kind (`piece`): a Core asset, a Token Metadata NFT's mint with `tokenMetadata`, or
1167
+ * `compressed` (after a `proveLeafIx` in the same transaction). `previous`: in a farm that watches, the last staker of
1168
+ * an NFT that changed hands, whose seat this takes over. `extra` carries reward token hooks/memos and Core transfer
1169
+ * adapter accounts.
1170
+ */
1171
+ export declare const stakeNftIx: ({ player, project, id, farm, asset, collection, hasAuthority, tokenMetadata: tm, compressed, previous, tier, programs, extra }: {
1172
+ asset: any;
1173
+ collection: any;
1174
+ compressed: any;
1175
+ extra?: never[] | undefined;
1176
+ farm: any;
1177
+ hasAuthority?: boolean | undefined;
1178
+ id: any;
1179
+ player: any;
1180
+ previous?: null | undefined;
1181
+ programs: any;
1182
+ project: any;
1183
+ tier?: number | undefined;
1184
+ tokenMetadata: any;
1185
+ }) => {
1186
+ programId: string;
1187
+ keys: any[];
1188
+ data: Uint8Array<any>;
1189
+ };
1190
+ /**
1191
+ * `player` takes an NFT out once its lock has run: it grows on its way out (a farm with growth writes on it, or on its
1192
+ * Sheet), and from its own seat takes its tier's prize. `forfeit` gives up the rewards and the prize. Leaving a tier
1193
+ * that rolls (`roll`: its box id), the NFT is rolled on that box, in an order at `nonce` (anyone then asks the oracle,
1194
+ * `askRollIx`, and settles); a box that can burn it or give it away keeps it in the project's hands until then.
1195
+ */
1196
+ export declare const unstakeNftIx: ({ player, project, id, farm, asset, collection, hasAuthority, tokenMetadata: tm, compressed, forfeit, roll, nonce, tier, projectCollection, poolMints, items, nft, programs, extra }: {
1197
+ asset: any;
1198
+ collection: any;
1199
+ compressed: any;
1200
+ extra?: never[] | undefined;
1201
+ farm: any;
1202
+ forfeit?: boolean | undefined;
1203
+ hasAuthority?: boolean | undefined;
1204
+ id: any;
1205
+ items: any;
1206
+ nft: any;
1207
+ nonce?: bigint | undefined;
1208
+ player: any;
1209
+ poolMints: any;
1210
+ programs: any;
1211
+ project: any;
1212
+ projectCollection: any;
1213
+ roll?: null | undefined;
1214
+ tier: any;
1215
+ tokenMetadata: any;
1216
+ }) => {
1217
+ programId: string;
1218
+ keys: any[];
1219
+ data: Uint8Array<any>;
1220
+ };
1221
+ /**
1222
+ * `player` collects what the seat of `by` owes (their own address for tokens, a collectible's asset). `held`: in a farm
1223
+ * that watches, what shows the player still holds the seat's NFT (the Core asset, their token account of a Token
1224
+ * Metadata NFT, or a compressed NFT's record, `pda.leaf`, with its `tree`), which such a farm refuses to go without.
1225
+ */
1226
+ export declare const harvestIx: ({ player, project, id, farm, by, held, tree, compound, programs, extra }: {
1227
+ by?: any;
1228
+ compound?: boolean | undefined;
1229
+ extra?: never[] | undefined;
1230
+ farm: any;
1231
+ held?: null | undefined;
1232
+ id: any;
1233
+ player: any;
1234
+ programs: any;
1235
+ project: any;
1236
+ tree?: null | undefined;
1237
+ }) => {
1238
+ programId: string;
1239
+ keys: any[];
1240
+ data: Uint8Array<any>;
1241
+ };
1242
+ /**
1243
+ * Anyone (`signer`) writes what a seat's NFT grew (a farm with growth), then reads its boosts again. `seat` is the
1244
+ * decoded Seat of `by`. Its NFT is any kind (`piece`): a Core asset (`collection` its collection now, the project's when
1245
+ * left out; `hasAuthority` false for one the project has no authority over), a Token Metadata NFT (`tokenMetadata`), or
1246
+ * `compressed` (after a `proveLeafIx`). What shows where it is must come: a compressed NFT's proof, and a Token Metadata
1247
+ * NFT's token account that holds it, `holder`'s (its staker's, or a watched NFT's buyer's). `signer` pays for what the
1248
+ * write adds. `extra`: the reward mint's hook accounts.
1249
+ */
1250
+ export declare const refreshSeatIx: ({ signer, project, id, farm, by, seat, collection, hasAuthority, tokenMetadata: tm, compressed, holder, extra }: {
1251
+ by: any;
1252
+ collection: any;
1253
+ compressed: any;
1254
+ extra?: never[] | undefined;
1255
+ farm: any;
1256
+ hasAuthority?: boolean | undefined;
1257
+ holder?: any;
1258
+ id: any;
1259
+ project: any;
1260
+ seat: any;
1261
+ signer: any;
1262
+ tokenMetadata: any;
1263
+ }) => {
1264
+ programId: string;
1265
+ keys: any[];
1266
+ data: Uint8Array<any>;
1267
+ };
1268
+ /**
1269
+ * `player` crafts recipe `id` (`recipe` decoded, the version shown to them), `times` over. `assets`: the
1270
+ * collectibles handed in, in the recipe's order (the burned, the used, and for a `Show` line the NFT shown: its address
1271
+ * when it is the project's, `{ asset, collection }` for a Core NFT of another collection, `{ mint, owner }` for a Token
1272
+ * Metadata one; for a `Trade` line the NFT traded in, as `piece` takes it: `{ asset, collection, tokenMetadata,
1273
+ * compressed }`). A collectible used or renewed that is staked in a farm holding it for the player (escrow) is
1274
+ * `{ asset, farm }`, `farm` that farm's id: its seat and farm follow it. A `Staked` line names the farm its collectible
1275
+ * is staked in (`Input::Staked { item, farm }`, escrowed or frozen there): its address, or `{ asset, farm }` with that
1276
+ * farm, and its seat and that farm follow it. Each item line passes its item's collection
1277
+ * (`items[id].collection`, the decoded Items; `collection` when not given), written for a burn: Core writes it as it
1278
+ * burns a collectible. A recipe's `raises` write on the kept ones, in their Sheet when the project has no
1279
+ * authority over them. The player opens any account a line pays into that is not there. A roll it makes (a
1280
+ * `Prize::Roll` or a `RollOn`) passes its box's prize mints (`rollMints`): `boxes` maps the box's id to its decoded
1281
+ * LootBox, `rollPools` each pool its prizes name to its mint (null for one never opened; `poolMints` when not given).
1282
+ * A craft makes several Core calls: raise the compute limit. `extra`: a token's hook accounts.
1283
+ */
1284
+ export declare function craftIx({ player, project, collection, id, recipe, assets, times, nonce, holders, programs, treasury, poolMints, items, nfts, boxes, rollPools, extra }: {
1285
+ assets?: never[] | undefined;
1286
+ boxes?: {} | undefined;
1287
+ collection: any;
1288
+ extra?: never[] | undefined;
1289
+ holders: any;
1290
+ id: any;
1291
+ items?: {} | undefined;
1292
+ nfts?: {} | undefined;
1293
+ nonce?: bigint | undefined;
1294
+ player: any;
1295
+ poolMints: any;
1296
+ programs: any;
1297
+ project: any;
1298
+ recipe: any;
1299
+ rollPools?: any;
1300
+ times?: number | undefined;
1301
+ treasury: any;
1302
+ }): {
1303
+ programId: string;
1304
+ keys: any[];
1305
+ data: Uint8Array<any>;
1306
+ };
1307
+ /** The collectibles a craft of `recipe` makes: one per `Item` prize among its outputs. */
1308
+ export declare const craftNewAssets: (recipe: any) => any;
1309
+ /**
1310
+ * `player` hands an NFT to the project until `freeAt` (Unix seconds; the hold's address names it, `pda.hold`): a Core
1311
+ * asset (`collection` its own, Core's address for none), a Token Metadata NFT (`tokenMetadata`), or `compressed` (after
1312
+ * a `proveLeafIx`).
1313
+ */
1314
+ export declare function holdIx({ player, project, collection, asset, tokenMetadata: tm, compressed, freeAt, reference: ref }: {
1315
+ asset: any;
1316
+ collection: any;
1317
+ compressed: any;
1318
+ freeAt: any;
1319
+ player: any;
1320
+ project: any;
1321
+ reference: any;
1322
+ tokenMetadata: any;
1323
+ }): {
1324
+ programId: string;
1325
+ keys: any[];
1326
+ data: Uint8Array<any>;
1327
+ };
1328
+ /**
1329
+ * The project's owner or authority (`signer`) puts an NFT it holds into stash `id`, or (`out`: a wallet) takes one the
1330
+ * stash holds out to that wallet. The NFT is any kind, as `piece` takes it: `collection` a Core asset's own,
1331
+ * `tokenMetadata`, or `compressed` after a `proveLeafIx` in the same transaction. The signer pays what the stash grows
1332
+ * by, and gets back the rent it no longer needs. Taken out with `out` the project's own address, the entry is only dropped
1333
+ * from the stash and the NFT stays where it is. `out` is never another account of the program (`ToTheProject`).
1334
+ */
1335
+ export declare function stashIx({ signer, project, id, lottery, asset, out, collection, tokenMetadata: tm, compressed }: {
1336
+ asset: any;
1337
+ collection: any;
1338
+ compressed: any;
1339
+ id: any;
1340
+ lottery?: null | undefined;
1341
+ out?: null | undefined;
1342
+ project: any;
1343
+ signer: any;
1344
+ tokenMetadata: any;
1345
+ }): {
1346
+ programId: string;
1347
+ keys: any[];
1348
+ data: Uint8Array<any>;
1349
+ };
1350
+ /**
1351
+ * `player` backs `side` with `amount`, naming the contest's incarnation (which fixes its terms). `contest` is the
1352
+ * decoded Contest. A contest of NFTs (`contest.nft`) takes one NFT instead (`nft`: { asset, collection, tokenMetadata,
1353
+ * compressed }, as `piece` takes it), which the contest holds until it is claimed. `shown`/`listProof` pass its gate.
1354
+ * `extra`: a hook's accounts.
1355
+ */
1356
+ export declare function enterIx({ player, project, id, contest, side, amount, shown, listProof, nft, playerToken, programs, extra }: {
1357
+ amount: any;
1358
+ contest: any;
1359
+ extra?: never[] | undefined;
1360
+ id: any;
1361
+ listProof: any;
1362
+ nft: any;
1363
+ player: any;
1364
+ playerToken: any;
1365
+ programs: any;
1366
+ project: any;
1367
+ shown: any;
1368
+ side: any;
1369
+ }): {
1370
+ programId: string;
1371
+ keys: any[];
1372
+ data: Uint8Array<any>;
1373
+ };
1374
+ /**
1375
+ * Anyone (`payer`) claims `player`'s entry on `side`, into the player's account of the mint, which `payer` opens when
1376
+ * it is not there (the last entry's claim closes the pot and writes the mint). A winning entry of a contest with a
1377
+ * prize (`contest.prize`) also gets it (`prizeMetas`: `collection`, `poolMints`, `items`, `nft`; a roll's order at
1378
+ * `nonce`, `prizeNonce(entry)` by default), `payer` paying what it opens. For a contest of NFTs, `entry` is the decoded
1379
+ * Entry: its own NFT (`own`, its kind as `piece` takes it) goes back to its player, or to the opener for a loser's NFT
1380
+ * no winner took; a winner, while losers' NFTs are left, also takes one (`taking`: { player, side } of a losing entry
1381
+ * that still holds one, and `kind`, its NFT's kind). While losers' NFTs are left only the winner sends their claim, and
1382
+ * picks which (`payer` the player; `WinnerPicks` otherwise). `extra`: a hook's accounts.
1383
+ */
1384
+ export declare function claimIx({ payer, project, id, contest, player, side, entry, own, taking, nonce, collection, poolMints, items, nft, prizeMint, forgo, programs, extra }: {
1385
+ collection: any;
1386
+ contest: any;
1387
+ entry: any;
1388
+ extra?: never[] | undefined;
1389
+ forgo?: boolean | undefined;
1390
+ id: any;
1391
+ items: any;
1392
+ nft: any;
1393
+ nonce: any;
1394
+ own?: {} | undefined;
1395
+ payer: any;
1396
+ player: any;
1397
+ poolMints: any;
1398
+ prizeMint: any;
1399
+ programs: any;
1400
+ project: any;
1401
+ side: any;
1402
+ taking: any;
1403
+ }): {
1404
+ programId: string;
1405
+ keys: any[];
1406
+ data: Uint8Array<any>;
1407
+ };
1408
+ /** What a bid signs: sha256(mint | Borsh(AuctionArgs)). */
1409
+ export declare function auctionTerms(mint: any, args: any): Uint8Array<ArrayBuffer>;
1410
+ /** An auction's AuctionArgs from its decoded account (what `open_auction` fixed). */
1411
+ export declare const auctionArgsOf: (auction: any) => {
1412
+ lot: any;
1413
+ reserve: any;
1414
+ min_raise_bps: any;
1415
+ starts_at: any;
1416
+ ends_at: any;
1417
+ extend: any;
1418
+ shares: any;
1419
+ gate: any;
1420
+ nft_bids: any;
1421
+ };
1422
+ /** When bids close, as the program reckons it: `ends_at`, or `extend` seconds after the last bid when that is later. */
1423
+ export declare const auctionEnds: (auction: any) => bigint;
1424
+ /** The least next bid the program takes, or null when no u64 amount can top it. */
1425
+ export declare function leastBid(auction: any): bigint | null;
1426
+ /**
1427
+ * `seller` opens its auction `id` of `args.lot` ({ Item: [id] }, { Asset: [address] } or { Roll: [box id] }), alone,
1428
+ * and pays its rent: a player for an NFT of the project's own collection they hold; the project's owner or authority for an
1429
+ * NFT of any kind it holds (`piece`: `collection` a Core asset's own, `tokenMetadata`, or `compressed` after a
1430
+ * `proveLeafIx`), a new unit of its item, or a roll of one of its boxes (a mystery lot). Its address names the seller, so an
1431
+ * id is the seller's own.
1432
+ */
1433
+ export declare function openAuctionIx({ seller, project, collection, tokenMetadata: tm, compressed, id, mint, args }: {
1434
+ args: any;
1435
+ collection: any;
1436
+ compressed: any;
1437
+ id: any;
1438
+ mint: any;
1439
+ project: any;
1440
+ seller: any;
1441
+ tokenMetadata: any;
1442
+ }): {
1443
+ programId: string;
1444
+ keys: any[];
1445
+ data: Uint8Array<any>;
1446
+ };
1447
+ /**
1448
+ * `bidder` bids `amount` on auction `id`, signing its terms; the bid it tops goes back to the high bidder's account
1449
+ * of the mint, which `bidder` opens when it is not there. `auction` is the decoded Auction. `shown`/`listProof`: what
1450
+ * passes the auction's gate. An auction of NFT bids (`auction.nft_bids`) takes `nfts` instead ([{ asset, collection,
1451
+ * tokenMetadata }], as `piece` takes each; never a compressed NFT: `CompressedBid`), handed to the project, and gives the high bid's NFTs
1452
+ * (`held`, the kinds of `auction.held`, in order) back to its bidder. `extra`: a hook's accounts.
1453
+ */
1454
+ export declare function bidIx({ bidder, project, id, auction, amount, shown, listProof, nfts, held, bidderToken, programs, extra }: {
1455
+ amount: any;
1456
+ auction: any;
1457
+ bidder: any;
1458
+ bidderToken: any;
1459
+ extra?: never[] | undefined;
1460
+ held?: never[] | undefined;
1461
+ id: any;
1462
+ listProof: any;
1463
+ nfts?: never[] | undefined;
1464
+ programs: any;
1465
+ project: any;
1466
+ shown: any;
1467
+ }): {
1468
+ programId: string;
1469
+ keys: any[];
1470
+ data: Uint8Array<any>;
1471
+ };
1472
+ /**
1473
+ * Anyone ends auction `id` once it is over (its seller calls off one with no bid). Sold: the lot goes to the high
1474
+ * bidder (an item that is a collectible is minted to them at `pda.itemAsset(item, serial)`; a roll of a box is made
1475
+ * for them in an order at `prizeRollNonce(nonce)`, `nonce` being `prizeNonce(auction, last_bid_at)` by default, which `signer` pays for), the price
1476
+ * through the shares, the rest to whoever owned the lot (the seller of an NFT, the treasury for the project's item or
1477
+ * roll), however long after the end it is sent. With no bid, the lot goes home. `signer` opens any account the end pays into that is
1478
+ * not there. `item` is the decoded Item of an item lot; for an NFT lot, `collection` its Core collection now (the
1479
+ * project's when left out), `tokenMetadata` for a Token Metadata NFT, or `compressed` (after a `proveLeafIx`).
1480
+ */
1481
+ export declare function endAuctionIx({ signer, project, projectState, id, auction, item, collection, tokenMetadata: tm, compressed, held, reference: ref, nonce, holders, programs, extra }: {
1482
+ auction: any;
1483
+ collection: any;
1484
+ compressed: any;
1485
+ extra?: never[] | undefined;
1486
+ held?: never[] | undefined;
1487
+ holders: any;
1488
+ id: any;
1489
+ item?: null | undefined;
1490
+ nonce: any;
1491
+ programs: any;
1492
+ project: any;
1493
+ projectState: any;
1494
+ reference: any;
1495
+ signer: any;
1496
+ tokenMetadata: any;
1497
+ }): {
1498
+ programId: string;
1499
+ keys: any[];
1500
+ data: Uint8Array<any>;
1501
+ };
1502
+ /** The hash a taker signs, as the program rebuilds it: sha256(mint | rule | deal | shares), Borsh. `offer` is the decoded Offer. */
1503
+ export declare function offerTerms(offer: any): Uint8Array<ArrayBuffer>;
1504
+ /** What one take of a deal pays out of its offer's money: a bid's price, a loan's amount. */
1505
+ export declare const dealUnit: (deal: any) => bigint;
1506
+ /**
1507
+ * `maker` (any wallet, signing alone) opens offer `id` in `mint`, and puts all of its money (`left` times the deal's
1508
+ * price or amount) into the project's vault now. `args`: { rule, deal: { Buy: { price } } or { Lend: { amount, repay,
1509
+ * lasts } }, left, shares } (shares only on a price). Its address names the maker, so an id is the maker's own.
1510
+ */
1511
+ export declare function openOfferIx({ maker, project, id, mint, args, makerToken, programs, extra }: {
1512
+ args: any;
1513
+ extra?: never[] | undefined;
1514
+ id: any;
1515
+ maker: any;
1516
+ makerToken: any;
1517
+ mint: any;
1518
+ programs: any;
1519
+ project: any;
1520
+ }): {
1521
+ programId: string;
1522
+ keys: any[];
1523
+ data: Uint8Array<any>;
1524
+ };
1525
+ /** Its maker calls offer `id` off (`offer` the decoded Offer): what is left of its money goes back to them. Free. */
1526
+ export declare function closeOfferIx({ maker, project, id, offer, programs, extra }: {
1527
+ extra?: never[] | undefined;
1528
+ id: any;
1529
+ maker: any;
1530
+ offer: any;
1531
+ programs: any;
1532
+ project: any;
1533
+ }): {
1534
+ programId: string;
1535
+ keys: any[];
1536
+ data: Uint8Array<any>;
1537
+ };
1538
+ /**
1539
+ * `seller` sells an NFT that passes the bid's rule into offer `id` (`offer` the decoded Offer, its deal a `Buy`),
1540
+ * signing its terms: the NFT goes straight to the maker, the price through the shares, the rest to the seller. The NFT is
1541
+ * any kind, as `piece` takes it (`collection`, `hasAuthority` false for a Core asset of another collection,
1542
+ * `tokenMetadata`, or `compressed` after a `proveLeafIx`).
1543
+ */
1544
+ export declare function sellToOfferIx({ seller, project, projectState, id, offer, asset, collection, hasAuthority, tokenMetadata: tm, compressed, holders, programs, extra }: {
1545
+ asset: any;
1546
+ collection: any;
1547
+ compressed: any;
1548
+ extra?: never[] | undefined;
1549
+ hasAuthority: any;
1550
+ holders: any;
1551
+ id: any;
1552
+ offer: any;
1553
+ programs: any;
1554
+ project: any;
1555
+ projectState: any;
1556
+ seller: any;
1557
+ tokenMetadata: any;
1558
+ }): {
1559
+ programId: string;
1560
+ keys: any[];
1561
+ data: Uint8Array<any>;
1562
+ };
1563
+ /**
1564
+ * `borrower` borrows against an NFT that passes the offer's rule (`offer` the decoded Offer, its deal a `Lend`), due at
1565
+ * `due` (Unix seconds: after now, at most the deal's `lasts` from now), signing its terms. The NFT is held at
1566
+ * `pda.hold(asset, due)` until it is repaid (`repayIx`, then `releaseIx` sends it home) or, once due, sent to the
1567
+ * lender (`releaseIx` with `to` the lender); the loan goes to the borrower. The NFT is any kind, as `sellToOfferIx` takes it.
1568
+ */
1569
+ export declare function borrowIx({ borrower, project, id, offer, due, asset, collection, hasAuthority, tokenMetadata: tm, compressed, programs, extra }: {
1570
+ asset: any;
1571
+ borrower: any;
1572
+ collection: any;
1573
+ compressed: any;
1574
+ due: any;
1575
+ extra?: never[] | undefined;
1576
+ hasAuthority: any;
1577
+ id: any;
1578
+ offer: any;
1579
+ programs: any;
1580
+ project: any;
1581
+ tokenMetadata: any;
1582
+ }): {
1583
+ programId: string;
1584
+ keys: any[];
1585
+ data: Uint8Array<any>;
1586
+ };
1587
+ /**
1588
+ * Anyone (`payer`: the borrower, a friend) repays a loan before it is due (`hold` the decoded Hold, with its debt): the
1589
+ * debt's `repay` goes to the lender, and the NFT is the borrower's again. Only money moves: anyone then sends the NFT
1590
+ * home with `releaseIx` (in the same transaction, or later: a repaid loan's release has no deadline). Free. `extra`: a
1591
+ * transfer hook's accounts.
1592
+ */
1593
+ export declare function repayIx({ payer, project, hold, payerToken, programs, extra }: {
1594
+ extra?: never[] | undefined;
1595
+ hold: any;
1596
+ payer: any;
1597
+ payerToken: any;
1598
+ programs: any;
1599
+ project: any;
1600
+ }): {
1601
+ programId: string;
1602
+ keys: any[];
1603
+ data: Uint8Array<any>;
1604
+ };
1605
+ /** What a taker signs: sha256(maker | asset | mint | Borsh(ListingDeal) | Borsh(shares)). */
1606
+ export declare function listingTerms(listing: any): Uint8Array<ArrayBuffer>;
1607
+ /**
1608
+ * `maker` (any wallet, signing alone) lists an NFT they hold, of any kind (as `piece` takes it), for sale
1609
+ * (`deal: { Sell: { price } }`) or for rent (`{ Rent: { price, lasts, max_periods } }`: `price` a period of `lasts`
1610
+ * seconds, a renter taking 1 to `max_periods` at once), paid in `mint`, `shares` taken before the maker's part. The NFT
1611
+ * goes to the project until it is sold or the listing is closed. The listing's address names the NFT
1612
+ * (`pda.listing(project, asset)`), so a game finds it, and its renter, with one account read.
1613
+ */
1614
+ export declare function openListingIx({ maker, project, asset, mint, deal, shares, collection, hasAuthority, tokenMetadata: tm, compressed, extra }: {
1615
+ asset: any;
1616
+ collection: any;
1617
+ compressed: any;
1618
+ deal: any;
1619
+ extra?: never[] | undefined;
1620
+ hasAuthority: any;
1621
+ maker: any;
1622
+ mint: any;
1623
+ project: any;
1624
+ shares?: never[] | undefined;
1625
+ tokenMetadata: any;
1626
+ }): {
1627
+ programId: string;
1628
+ keys: any[];
1629
+ data: Uint8Array<any>;
1630
+ };
1631
+ /**
1632
+ * `taker` takes a listing (`listing`: the decoded Listing), signing its terms: a sale pays its price through the shares
1633
+ * to the maker and hands the NFT over; a rental of `periods` periods (1 to its `max_periods`) pays `price` each and
1634
+ * makes the taker its user until `periods × lasts` from now, refused while another runs. A rental moves no NFT, so it
1635
+ * takes none of the NFT's accounts but its address. `holders`, `programs`, `treasury` as for any split. After the
1636
+ * take's own accounts come a sale's compressed NFT's proof, then the shares' accounts, then (in `extra`) Core's
1637
+ * transfer adapters and any transfer hook's accounts, which the program finds by address after the shares'.
1638
+ */
1639
+ export declare function takeListingIx({ taker, project, projectState, listing, periods, collection, hasAuthority, tokenMetadata: tm, compressed, holders, programs, takerToken, extra }: {
1640
+ collection: any;
1641
+ compressed: any;
1642
+ extra?: never[] | undefined;
1643
+ hasAuthority: any;
1644
+ holders: any;
1645
+ listing: any;
1646
+ periods?: number | undefined;
1647
+ programs: any;
1648
+ project: any;
1649
+ projectState: any;
1650
+ taker: any;
1651
+ takerToken: any;
1652
+ tokenMetadata: any;
1653
+ }): {
1654
+ programId: string;
1655
+ keys: any[];
1656
+ data: Uint8Array<any>;
1657
+ };
1658
+ /**
1659
+ * Its maker closes a listing (`listing` the decoded Listing): the NFT goes home. While a rental runs it only stops (no
1660
+ * renter takes it again), and the same call once the rental is over takes it home. Free.
1661
+ */
1662
+ export declare function closeListingIx({ maker, project, listing, collection, hasAuthority, tokenMetadata: tm, compressed, extra }: {
1663
+ collection: any;
1664
+ compressed: any;
1665
+ extra?: never[] | undefined;
1666
+ hasAuthority: any;
1667
+ listing: any;
1668
+ maker: any;
1669
+ project: any;
1670
+ tokenMetadata: any;
1671
+ }): {
1672
+ programId: string;
1673
+ keys: any[];
1674
+ data: Uint8Array<any>;
1675
+ };
1676
+ /**
1677
+ * Whether a classic mint's account data (`data`, 82 bytes) is an NFT's, as the program takes one:
1678
+ * exactly one token, no decimals, initialized, and no mint authority or only its edition's. A semi-fungible item's
1679
+ * mint (several units, or one that can still mint) is refused when handed in (`NotAnNft`).
1680
+ */
1681
+ export declare function isNftMint(mint: any, data: any): boolean;
1682
+ /** A Token Metadata NFT's own addresses: its metadata, its edition, and a pNFT's record of a token account. */
1683
+ export declare const tokenMetadata: {
1684
+ metadata: (mint: any) => any;
1685
+ edition: (mint: any) => any;
1686
+ record: (mint: any, token: any) => any;
1687
+ };