rain-sdk-v2 1.0.8 → 1.0.10
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 +13 -0
- package/dist/Rain.d.ts +5 -0
- package/dist/Rain.js +4 -0
- package/dist/abi/CreateMarketAbi.d.ts +87 -1125
- package/dist/abi/CreateMarketAbi.js +1 -1
- package/dist/config/environments.js +1 -1
- package/dist/markets/getDynamicPayout.d.ts +6 -0
- package/dist/markets/getDynamicPayout.js +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -484,6 +484,19 @@ const yesShares = await rain.getUserOptionShares({
|
|
|
484
484
|
});
|
|
485
485
|
```
|
|
486
486
|
|
|
487
|
+
### `getDynamicPayout(params): Promise<bigint[]>`
|
|
488
|
+
|
|
489
|
+
Get the dynamic payout amounts for a user on a specific option. Returns an array of payout values per side.
|
|
490
|
+
|
|
491
|
+
```typescript
|
|
492
|
+
const payouts = await rain.getDynamicPayout({
|
|
493
|
+
marketContractAddress: '0x...',
|
|
494
|
+
userAddress: '0x...',
|
|
495
|
+
option: 1n, // 1-based option index
|
|
496
|
+
});
|
|
497
|
+
// payouts = [yesPayoutWei, noPayoutWei]
|
|
498
|
+
```
|
|
499
|
+
|
|
487
500
|
### `getUserActiveBuyOrders(params): Promise<bigint>`
|
|
488
501
|
|
|
489
502
|
Get count of user's active buy orders.
|
package/dist/Rain.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export declare class Rain {
|
|
|
34
34
|
optionSide: number;
|
|
35
35
|
userAddress: `0x${string}`;
|
|
36
36
|
}): Promise<bigint>;
|
|
37
|
+
getDynamicPayout(params: {
|
|
38
|
+
marketContractAddress: `0x${string}`;
|
|
39
|
+
userAddress: `0x${string}`;
|
|
40
|
+
option: bigint;
|
|
41
|
+
}): Promise<bigint[]>;
|
|
37
42
|
buildSplitTx(params: SplitTxParams & {
|
|
38
43
|
walletAddress: `0x${string}`;
|
|
39
44
|
}): Promise<RawTransaction[]>;
|
package/dist/Rain.js
CHANGED
|
@@ -16,6 +16,7 @@ import { ALLOWED_ENVIRONMENTS, ENV_CONFIG, getRandomRpc } from './config/environ
|
|
|
16
16
|
import { loginUser } from './auth/login.js';
|
|
17
17
|
import { getUserOptionLPShares } from './markets/getUserOptionLPShares.js';
|
|
18
18
|
import { getUserOptionShares } from './markets/getUserOptionShares.js';
|
|
19
|
+
import { getDynamicPayout } from './markets/getDynamicPayout.js';
|
|
19
20
|
import { createPublicClient, http, parseAbi } from 'viem';
|
|
20
21
|
import { arbitrum } from 'viem/chains';
|
|
21
22
|
import * as usersApi from './api/users.js';
|
|
@@ -89,6 +90,9 @@ export class Rain {
|
|
|
89
90
|
async getUserOptionShares(params) {
|
|
90
91
|
return getUserOptionShares({ ...params, rpcUrl: this.rpcUrl });
|
|
91
92
|
}
|
|
93
|
+
async getDynamicPayout(params) {
|
|
94
|
+
return getDynamicPayout({ ...params, rpcUrl: this.rpcUrl });
|
|
95
|
+
}
|
|
92
96
|
async buildSplitTx(params) {
|
|
93
97
|
return buildSplitRawTx({ ...params, rpcUrl: this.rpcUrl });
|
|
94
98
|
}
|