@slvr-labs/sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/index.d.mts +2117 -0
- package/dist/index.d.ts +1903 -34
- package/dist/index.js +3091 -427
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3035 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -11
- package/skills/slvr-bot/SKILL.md +9 -8
- package/skills/slvr-bot/references/api.md +8 -0
- package/dist/connect.d.ts +0 -47
- package/dist/connect.d.ts.map +0 -1
- package/dist/connect.js +0 -56
- package/dist/connect.js.map +0 -1
- package/dist/contracts/autoCommit.d.ts +0 -151
- package/dist/contracts/autoCommit.d.ts.map +0 -1
- package/dist/contracts/autoCommit.js +0 -426
- package/dist/contracts/autoCommit.js.map +0 -1
- package/dist/contracts/hub.d.ts +0 -50
- package/dist/contracts/hub.d.ts.map +0 -1
- package/dist/contracts/hub.js +0 -118
- package/dist/contracts/hub.js.map +0 -1
- package/dist/contracts/index.d.ts +0 -8
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js +0 -18
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/jackpot.d.ts +0 -21
- package/dist/contracts/jackpot.d.ts.map +0 -1
- package/dist/contracts/jackpot.js +0 -44
- package/dist/contracts/jackpot.js.map +0 -1
- package/dist/contracts/lottery.d.ts +0 -256
- package/dist/contracts/lottery.d.ts.map +0 -1
- package/dist/contracts/lottery.js +0 -767
- package/dist/contracts/lottery.js.map +0 -1
- package/dist/contracts/registry.d.ts +0 -53
- package/dist/contracts/registry.d.ts.map +0 -1
- package/dist/contracts/registry.js +0 -143
- package/dist/contracts/registry.js.map +0 -1
- package/dist/contracts/staking.d.ts +0 -101
- package/dist/contracts/staking.d.ts.map +0 -1
- package/dist/contracts/staking.js +0 -306
- package/dist/contracts/staking.js.map +0 -1
- package/dist/contracts/token.d.ts +0 -95
- package/dist/contracts/token.d.ts.map +0 -1
- package/dist/contracts/token.js +0 -273
- package/dist/contracts/token.js.map +0 -1
- package/dist/deployments.d.ts +0 -117
- package/dist/deployments.d.ts.map +0 -1
- package/dist/deployments.js +0 -74
- package/dist/deployments.js.map +0 -1
- package/dist/errors.d.ts +0 -39
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -67
- package/dist/errors.js.map +0 -1
- package/dist/ev.d.ts +0 -123
- package/dist/ev.d.ts.map +0 -1
- package/dist/ev.js +0 -111
- package/dist/ev.js.map +0 -1
- package/dist/events.d.ts +0 -418
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js +0 -87
- package/dist/events.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/oracle.d.ts +0 -48
- package/dist/oracle.d.ts.map +0 -1
- package/dist/oracle.js +0 -77
- package/dist/oracle.js.map +0 -1
- package/dist/price.d.ts +0 -52
- package/dist/price.d.ts.map +0 -1
- package/dist/price.js +0 -78
- package/dist/price.js.map +0 -1
- package/dist/transaction.d.ts +0 -54
- package/dist/transaction.d.ts.map +0 -1
- package/dist/transaction.js +0 -105
- package/dist/transaction.js.map +0 -1
- package/dist/types.d.ts +0 -162
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -23
- package/dist/types.js.map +0 -1
- package/dist/utils.d.ts +0 -58
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -110
- package/dist/utils.js.map +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
/**
|
|
3
|
-
* SlvrJackpot contract interface (read-only pool surface).
|
|
4
|
-
*/
|
|
5
|
-
export declare class SlvrJackpot {
|
|
6
|
-
private publicClient;
|
|
7
|
-
private address;
|
|
8
|
-
private static readonly ABI;
|
|
9
|
-
constructor(publicClient: PublicClient, _walletClient: WalletClient | undefined, address: Address);
|
|
10
|
-
/** Read-only contract: no wallet client needed. Kept for a consistent SDK surface. */
|
|
11
|
-
setWalletClient(_walletClient: WalletClient | undefined): void;
|
|
12
|
-
/**
|
|
13
|
-
* Native (ETH) jackpot pool balance
|
|
14
|
-
*/
|
|
15
|
-
jackpotPool(): Promise<bigint>;
|
|
16
|
-
/**
|
|
17
|
-
* SLVR jackpot pool balance
|
|
18
|
-
*/
|
|
19
|
-
jackpotSlvrPool(): Promise<bigint>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=jackpot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jackpot.d.ts","sourceRoot":"","sources":["../../src/contracts/jackpot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAErE;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,OAAO,CAAU;IAEzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAGxB;gBAGS,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO;IAKjG,sFAAsF;IACtF,eAAe,CAAC,aAAa,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;IAI9D;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQpC;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;CAOzC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SlvrJackpot = void 0;
|
|
4
|
-
const viem_1 = require("viem");
|
|
5
|
-
/**
|
|
6
|
-
* SlvrJackpot contract interface (read-only pool surface).
|
|
7
|
-
*/
|
|
8
|
-
class SlvrJackpot {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
|
-
constructor(publicClient, _walletClient, address) {
|
|
11
|
-
this.publicClient = publicClient;
|
|
12
|
-
this.address = address;
|
|
13
|
-
}
|
|
14
|
-
/** Read-only contract: no wallet client needed. Kept for a consistent SDK surface. */
|
|
15
|
-
setWalletClient(_walletClient) {
|
|
16
|
-
// no-op
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Native (ETH) jackpot pool balance
|
|
20
|
-
*/
|
|
21
|
-
async jackpotPool() {
|
|
22
|
-
return await this.publicClient.readContract({
|
|
23
|
-
address: this.address,
|
|
24
|
-
abi: SlvrJackpot.ABI,
|
|
25
|
-
functionName: 'jackpotPool',
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* SLVR jackpot pool balance
|
|
30
|
-
*/
|
|
31
|
-
async jackpotSlvrPool() {
|
|
32
|
-
return await this.publicClient.readContract({
|
|
33
|
-
address: this.address,
|
|
34
|
-
abi: SlvrJackpot.ABI,
|
|
35
|
-
functionName: 'jackpotSlvrPool',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.SlvrJackpot = SlvrJackpot;
|
|
40
|
-
SlvrJackpot.ABI = (0, viem_1.parseAbi)([
|
|
41
|
-
'function jackpotPool() view returns (uint256)',
|
|
42
|
-
'function jackpotSlvrPool() view returns (uint256)',
|
|
43
|
-
]);
|
|
44
|
-
//# sourceMappingURL=jackpot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jackpot.js","sourceRoot":"","sources":["../../src/contracts/jackpot.ts"],"names":[],"mappings":";;;AAAA,+BAAqE;AAErE;;GAEG;AACH,MAAa,WAAW;IAStB,6DAA6D;IAC7D,YAAY,YAA0B,EAAE,aAAuC,EAAE,OAAgB;QAC/F,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,sFAAsF;IACtF,eAAe,CAAC,aAAuC;QACrD,QAAQ;IACV,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW;QACf,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;YAC1C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,WAAW,CAAC,GAAG;YACpB,YAAY,EAAE,aAAa;SAC5B,CAAW,CAAC;IACf,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe;QACnB,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;YAC1C,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,WAAW,CAAC,GAAG;YACpB,YAAY,EAAE,iBAAiB;SAChC,CAAW,CAAC;IACf,CAAC;;AAxCH,kCAyCC;AArCyB,eAAG,GAAG,IAAA,eAAQ,EAAC;IACrC,+CAA+C;IAC/C,mDAAmD;CACpD,CAAC,CAAC"}
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
import { RoundInfo, MinerState, BetParams, ClaimParams, ClaimParamsAdvanced } from '../types';
|
|
3
|
-
import { BetPlacedEvent, RoundResolvedEvent } from '../events';
|
|
4
|
-
/**
|
|
5
|
-
* SlvrGridLottery contract interface
|
|
6
|
-
*/
|
|
7
|
-
export declare class SlvrGridLottery {
|
|
8
|
-
private publicClient;
|
|
9
|
-
private walletClient?;
|
|
10
|
-
private address;
|
|
11
|
-
private static readonly ABI;
|
|
12
|
-
constructor(publicClient: PublicClient, walletClient: WalletClient | undefined, address: Address);
|
|
13
|
-
/**
|
|
14
|
-
* Update the wallet client
|
|
15
|
-
* @param walletClient New wallet client
|
|
16
|
-
*/
|
|
17
|
-
setWalletClient(walletClient: WalletClient | undefined): void;
|
|
18
|
-
/**
|
|
19
|
-
* Get the current round ID
|
|
20
|
-
*/
|
|
21
|
-
currentRoundId(): Promise<bigint>;
|
|
22
|
-
/**
|
|
23
|
-
* Get round start time
|
|
24
|
-
*/
|
|
25
|
-
roundStart(roundId: bigint): Promise<bigint>;
|
|
26
|
-
/**
|
|
27
|
-
* Get round end time
|
|
28
|
-
*/
|
|
29
|
-
roundEnd(roundId: bigint): Promise<bigint>;
|
|
30
|
-
/**
|
|
31
|
-
* Check if round is open for betting
|
|
32
|
-
*/
|
|
33
|
-
roundOpen(roundId: bigint): Promise<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Get the betting cutoff timestamp (unix seconds) for a round.
|
|
36
|
-
*
|
|
37
|
-
* Bets are only accepted until this time, which can be earlier than
|
|
38
|
-
* {@link roundEnd}. Bots deciding whether they can still bet should gate on
|
|
39
|
-
* this rather than on `roundEnd`.
|
|
40
|
-
*/
|
|
41
|
-
bettingEnd(roundId: bigint): Promise<bigint>;
|
|
42
|
-
/**
|
|
43
|
-
* Estimate the reward an account would receive for a round, in wei.
|
|
44
|
-
*
|
|
45
|
-
* Thin pass-through to the contract's `getExpectedReward`. Useful for sizing
|
|
46
|
-
* bets or deciding whether a claim is worth the gas.
|
|
47
|
-
*/
|
|
48
|
-
getExpectedReward(account: Address, roundId: bigint): Promise<bigint>;
|
|
49
|
-
/**
|
|
50
|
-
* Get the latest resolved round ID (type(uint256).max sentinel when none resolved yet)
|
|
51
|
-
*/
|
|
52
|
-
latestResolvedRoundId(): Promise<bigint>;
|
|
53
|
-
/**
|
|
54
|
-
* Get full round information
|
|
55
|
-
*/
|
|
56
|
-
getRound(roundId: bigint): Promise<RoundInfo>;
|
|
57
|
-
/**
|
|
58
|
-
* Get total amount bet on a square for a round
|
|
59
|
-
*/
|
|
60
|
-
getTotalOnSquare(roundId: bigint, square: number): Promise<bigint>;
|
|
61
|
-
/**
|
|
62
|
-
* Get number of bettors on a square for a round
|
|
63
|
-
*/
|
|
64
|
-
getBettorsOnSquare(roundId: bigint, square: number): Promise<bigint>;
|
|
65
|
-
/**
|
|
66
|
-
* Get a user's bet amount on a square for a round
|
|
67
|
-
*/
|
|
68
|
-
getUserBet(roundId: bigint, square: number, bettor: Address): Promise<bigint>;
|
|
69
|
-
/**
|
|
70
|
-
* Check if a user has claimed rewards for a round
|
|
71
|
-
*/
|
|
72
|
-
getHasClaimed(roundId: bigint, user: Address): Promise<boolean>;
|
|
73
|
-
/**
|
|
74
|
-
* Get miner state for an account
|
|
75
|
-
*/
|
|
76
|
-
getMinerState(account: Address): Promise<MinerState>;
|
|
77
|
-
/**
|
|
78
|
-
* Check if an account exists
|
|
79
|
-
*/
|
|
80
|
-
hasAccount(account: Address): Promise<boolean>;
|
|
81
|
-
/**
|
|
82
|
-
* Get carry-over winner native pool (when no winners)
|
|
83
|
-
*/
|
|
84
|
-
carryWinnerNativePool(): Promise<bigint>;
|
|
85
|
-
/**
|
|
86
|
-
* Get staker rewards that failed to distribute (owed)
|
|
87
|
-
*/
|
|
88
|
-
carryStakerNativeOwed(): Promise<bigint>;
|
|
89
|
-
/**
|
|
90
|
-
* Get jackpot funds that failed to add (owed)
|
|
91
|
-
*/
|
|
92
|
-
carryJackpotNativeOwed(): Promise<bigint>;
|
|
93
|
-
/**
|
|
94
|
-
* Get carry-over SLVR pool
|
|
95
|
-
*/
|
|
96
|
-
carrySlvrPool(): Promise<bigint>;
|
|
97
|
-
/**
|
|
98
|
-
* Get the configured SLVR-per-round value.
|
|
99
|
-
*
|
|
100
|
-
* NOTE: This is no longer the authoritative emission number. Emission is hub-gated: the amount
|
|
101
|
-
* actually minted each round is bounded by the game's streamed emission budget on SlvrHub
|
|
102
|
-
* (see SlvrHub.pendingEmission / mintReward). Treat this only as the requested/target value.
|
|
103
|
-
*/
|
|
104
|
-
slvrPerRound(): Promise<bigint>;
|
|
105
|
-
/**
|
|
106
|
-
* Get protocol fee in basis points
|
|
107
|
-
*/
|
|
108
|
-
protocolFeeBps(): Promise<number>;
|
|
109
|
-
/**
|
|
110
|
-
* Get grid size (should be 25)
|
|
111
|
-
*/
|
|
112
|
-
grid(): Promise<number>;
|
|
113
|
-
/**
|
|
114
|
-
* Get account deposit amount
|
|
115
|
-
*/
|
|
116
|
-
accountDeposit(): Promise<bigint>;
|
|
117
|
-
/**
|
|
118
|
-
* Place a bet on the current round
|
|
119
|
-
* Note: The contract will automatically handle account deposit for new accounts.
|
|
120
|
-
* If the beneficiary is a new account, ensure msg.value >= ACCOUNT_DEPOSIT + total bet amount.
|
|
121
|
-
* @param params Bet parameters
|
|
122
|
-
* @returns Transaction hash
|
|
123
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
124
|
-
* @throws ValidationError if inputs are invalid
|
|
125
|
-
* @throws ContractCallError if contract call fails
|
|
126
|
-
*/
|
|
127
|
-
bet(params: BetParams): Promise<`0x${string}`>;
|
|
128
|
-
/**
|
|
129
|
-
* Claim rewards for a round
|
|
130
|
-
* @param params Claim parameters
|
|
131
|
-
* @returns Transaction hash
|
|
132
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
133
|
-
* @throws ValidationError if inputs are invalid
|
|
134
|
-
* @throws ContractCallError if contract call fails
|
|
135
|
-
*/
|
|
136
|
-
claim(params: ClaimParams): Promise<`0x${string}`>;
|
|
137
|
-
/**
|
|
138
|
-
* Advanced claim function covering all claim variants
|
|
139
|
-
* Handles: user vs delegate, native/SLVR recipients, bypassFee, ethOnly
|
|
140
|
-
* @param params Advanced claim parameters
|
|
141
|
-
* @returns Transaction hash
|
|
142
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
143
|
-
* @throws ValidationError if inputs are invalid
|
|
144
|
-
* @throws ContractCallError if contract call fails
|
|
145
|
-
*/
|
|
146
|
-
claimAdvanced(params: ClaimParamsAdvanced): Promise<`0x${string}`>;
|
|
147
|
-
/**
|
|
148
|
-
* Batch claim rewards for multiple rounds
|
|
149
|
-
* Note: This sends multiple transactions sequentially. For better UX, consider
|
|
150
|
-
* using a multicall contract or batching in your application layer.
|
|
151
|
-
* @param roundIds Array of round IDs to claim
|
|
152
|
-
* @param user User address to claim for (defaults to wallet client account)
|
|
153
|
-
* @param options Optional configuration
|
|
154
|
-
* @param options.waitForReceipt Whether to wait for each transaction receipt (default: false)
|
|
155
|
-
* @returns Array of transaction hashes
|
|
156
|
-
* @throws WalletClientRequiredError if wallet client is not available
|
|
157
|
-
* @throws ValidationError if inputs are invalid
|
|
158
|
-
* @throws ContractCallError if contract call fails
|
|
159
|
-
*/
|
|
160
|
-
batchClaim(roundIds: bigint[], user?: Address, options?: {
|
|
161
|
-
waitForReceipt?: boolean;
|
|
162
|
-
}): Promise<`0x${string}`[]>;
|
|
163
|
-
/**
|
|
164
|
-
* Approve a delegate to claim rewards on your behalf
|
|
165
|
-
*/
|
|
166
|
-
approveDelegate(delegate: Address): Promise<`0x${string}`>;
|
|
167
|
-
/**
|
|
168
|
-
* Revoke a delegate's approval to claim on your behalf
|
|
169
|
-
*/
|
|
170
|
-
revokeDelegate(delegate: Address): Promise<`0x${string}`>;
|
|
171
|
-
/**
|
|
172
|
-
* Check if a delegate is approved for a user
|
|
173
|
-
*/
|
|
174
|
-
getDelegate(user: Address, delegate: Address): Promise<boolean>;
|
|
175
|
-
/**
|
|
176
|
-
* Donate SLVR tokens directly to the jackpot pool.
|
|
177
|
-
* Note: caller must have approved the lottery to spend `amount` of SLVR beforehand.
|
|
178
|
-
*/
|
|
179
|
-
donateSlvrToJackpot(amount: bigint): Promise<`0x${string}`>;
|
|
180
|
-
/**
|
|
181
|
-
* Add ETH (native) tokens to the jackpot pool
|
|
182
|
-
* @param value Amount of native ETH to deposit
|
|
183
|
-
*/
|
|
184
|
-
addEthToJackpot(value: bigint): Promise<`0x${string}`>;
|
|
185
|
-
/**
|
|
186
|
-
* Withdraw your accumulated mined SLVR (the "refine and cash out" path).
|
|
187
|
-
*
|
|
188
|
-
* Settles your miner accrual (auto-checkpoints) and transfers your SLVR out,
|
|
189
|
-
* net of the refining fee. This is the function a mining bot wants to realize
|
|
190
|
-
* SLVR rewards outside of a specific round claim. Reverts if you have nothing to
|
|
191
|
-
* withdraw. The exact `(totalPayout, refiningFee)` are in the emitted `Claimed`
|
|
192
|
-
* event; this returns the transaction hash.
|
|
193
|
-
*/
|
|
194
|
-
withdrawUnrefinedSlvr(): Promise<`0x${string}`>;
|
|
195
|
-
/**
|
|
196
|
-
* Force on-chain settlement of a miner's refined-reward accrual (lazy
|
|
197
|
-
* "checkpoint"). Permissionless — you can checkpoint any account.
|
|
198
|
-
*
|
|
199
|
-
* This only updates accounting (rolls index growth into `refinedAccrued`); it
|
|
200
|
-
* moves no tokens. You rarely need it: `claim` and {@link withdrawUnrefinedSlvr}
|
|
201
|
-
* both checkpoint internally, and the up-to-date figure can be derived off-chain
|
|
202
|
-
* from {@link getMinerState}. Use it when you want state settled without a
|
|
203
|
-
* claim/withdraw — e.g. to make a subsequent `getMinerState` read exact.
|
|
204
|
-
*/
|
|
205
|
-
checkpoint(account: Address): Promise<`0x${string}`>;
|
|
206
|
-
/**
|
|
207
|
-
* Get all square data for a round
|
|
208
|
-
*/
|
|
209
|
-
getRoundSquares(roundId: bigint): Promise<Array<{
|
|
210
|
-
square: number;
|
|
211
|
-
total: bigint;
|
|
212
|
-
bettors: bigint;
|
|
213
|
-
}>>;
|
|
214
|
-
/**
|
|
215
|
-
* Get user's bets for a round
|
|
216
|
-
*/
|
|
217
|
-
getUserBets(roundId: bigint, user: Address): Promise<Array<{
|
|
218
|
-
square: number;
|
|
219
|
-
amount: bigint;
|
|
220
|
-
}>>;
|
|
221
|
-
/**
|
|
222
|
-
* Wait until a round is resolved, resolving with its final {@link RoundInfo}.
|
|
223
|
-
* Polls `getRound` on an interval — handy for "bet, then claim once it settles".
|
|
224
|
-
*
|
|
225
|
-
* @param opts.pollIntervalMs how often to check (default 4000)
|
|
226
|
-
* @param opts.timeoutMs give up after this long (default: wait indefinitely)
|
|
227
|
-
* @throws {Error} if `timeoutMs` elapses before resolution
|
|
228
|
-
*/
|
|
229
|
-
waitForResolution(roundId: bigint, opts?: {
|
|
230
|
-
pollIntervalMs?: number;
|
|
231
|
-
timeoutMs?: number;
|
|
232
|
-
}): Promise<RoundInfo>;
|
|
233
|
-
/**
|
|
234
|
-
* Subscribe to `RoundResolved` events. Returns an unsubscribe function.
|
|
235
|
-
*
|
|
236
|
-
* @example
|
|
237
|
-
* ```typescript
|
|
238
|
-
* const stop = sdk.lottery.watchRoundResolved((e) => {
|
|
239
|
-
* console.log(`round ${e.roundId} won by square ${e.winningSquare}`);
|
|
240
|
-
* });
|
|
241
|
-
* // later: stop();
|
|
242
|
-
* ```
|
|
243
|
-
*/
|
|
244
|
-
watchRoundResolved(onResolved: (event: RoundResolvedEvent['args']) => void, opts?: {
|
|
245
|
-
onError?: (error: Error) => void;
|
|
246
|
-
}): () => void;
|
|
247
|
-
/**
|
|
248
|
-
* Subscribe to `BetPlaced` events (optionally for one round). Returns an
|
|
249
|
-
* unsubscribe function. Useful for reacting to pot changes in real time.
|
|
250
|
-
*/
|
|
251
|
-
watchBets(onBet: (event: BetPlacedEvent['args']) => void, opts?: {
|
|
252
|
-
roundId?: bigint;
|
|
253
|
-
onError?: (error: Error) => void;
|
|
254
|
-
}): () => void;
|
|
255
|
-
}
|
|
256
|
-
//# sourceMappingURL=lottery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lottery.d.ts","sourceRoot":"","sources":["../../src/contracts/lottery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG9F,OAAO,EAAyB,cAAc,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEtF;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,YAAY,CAAC,CAAe;IACpC,OAAO,CAAC,OAAO,CAAU;IAGzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CA2CxB;gBAES,YAAY,EAAE,YAAY,EAAE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