@mysten/deepbook-v3 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/PREDICT.md +149 -55
- package/README.md +18 -13
- package/dist/contracts/account/account.d.mts +23 -23
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_registry.d.mts +19 -19
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/account.d.mts.map +1 -1
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/balances.d.mts.map +1 -1
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +27 -0
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/admin.mjs +38 -0
- package/dist/contracts/deepbook_predict/admin.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts +81 -0
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs +103 -0
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +25 -0
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/builder_code_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/builder_code_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.d.mts +104 -0
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/config_events.mjs +155 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/ewma_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +859 -0
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/expiry_market.mjs +647 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts +159 -0
- package/dist/contracts/deepbook_predict/market_manager.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/market_manager.mjs +88 -2
- package/dist/contracts/deepbook_predict/market_manager.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.d.mts +101 -0
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/order_events.mjs +7 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pause_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs +51 -0
- package/dist/contracts/deepbook_predict/pause_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/plp.d.mts +801 -0
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/plp.mjs +458 -1
- package/dist/contracts/deepbook_predict/plp.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +39 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs +52 -0
- package/dist/contracts/deepbook_predict/pool_valuation_cap.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts +90 -0
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/predict_account.mjs +24 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +127 -0
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/pricing.mjs +25 -1
- package/dist/contracts/deepbook_predict/pricing.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing_config.mjs +28 -0
- package/dist/contracts/deepbook_predict/pricing_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +665 -0
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs +841 -0
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts +30 -0
- package/dist/contracts/deepbook_predict/range_codec.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/range_codec.mjs +6 -1
- package/dist/contracts/deepbook_predict/range_codec.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/registry.d.mts +382 -0
- package/dist/contracts/deepbook_predict/registry.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/registry.mjs +456 -1
- package/dist/contracts/deepbook_predict/registry.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/vault_events.d.mts +199 -0
- package/dist/contracts/deepbook_predict/vault_events.d.mts.map +1 -0
- package/dist/contracts/deepbook_predict/vault_events.mjs +19 -1
- package/dist/contracts/deepbook_predict/vault_events.mjs.map +1 -1
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/sessions.d.mts +22 -22
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/predict/client.d.mts +3 -2
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +3 -2
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/index.d.mts +18 -1
- package/dist/predict/index.mjs +18 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/dist/transactions/marginTPSL.d.mts +10 -10
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/package.json +1 -1
- package/src/predict/client.ts +3 -2
- package/src/predict/index.ts +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b07659a: Predict: export the generated move-call bindings from `@mysten/deepbook-v3/predict`, the
|
|
8
|
+
way `/account` already exports `accountMoveCalls`. Each `client.predict.tx.*` builder returns a
|
|
9
|
+
finished `Transaction`, so a Predict call could not join a PTB the caller was building — creating
|
|
10
|
+
an account, funding it and queueing a PLP supply in one transaction meant hand-writing
|
|
11
|
+
`plp::request_supply` as a raw `moveCall`. Every Predict module with a callable function is now
|
|
12
|
+
reachable as a namespace of transaction thunks (`plpMoveCalls`, `expiryMarketMoveCalls`,
|
|
13
|
+
`predictAccountMoveCalls`, `protocolConfigMoveCalls`, `registryMoveCalls`, `builderCodeMoveCalls`,
|
|
14
|
+
`marketManagerMoveCalls`, `pricingMoveCalls`, `rangeCodecMoveCalls`, and the cap modules),
|
|
15
|
+
alongside the event layouts (`vaultEvents`, `orderEvents`, `configEvents`, `builderCodeEvents`).
|
|
16
|
+
Pass `config: toGeneratedConfig(cfg)` and the shared objects fill themselves in; owner-authorized
|
|
17
|
+
calls take an `Auth` from `generateAuth(cfg)`. Additive only: no existing export changes.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- ee8df5d: Predict docs: document both recorded deployments. `PREDICT.md` and the README now
|
|
22
|
+
describe the `deepbook-predict-mainnet` and `deepbook-predict-testnet` records that `getConfig`,
|
|
23
|
+
`getDeployment`, `getUnits`, `getAccountConfig`, and `getSessionsConfig` resolve, the quote coin
|
|
24
|
+
per network (Circle native USDC on mainnet, a mintable test coin that displays as DUSDC on
|
|
25
|
+
testnet, read from `quoteCoinType`), the `side: 'range'` descriptor arm, which decoders have
|
|
26
|
+
plural forms, what is exported for PTB composition, that `read.markets()` returns
|
|
27
|
+
live-and-not-yet-settled markets, and the `supplyPlp` / `withdrawPlp` floor options as shipped.
|
|
28
|
+
Documentation only; no runtime change.
|
|
29
|
+
|
|
3
30
|
## 2.3.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
package/PREDICT.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# DeepBook Predict (`@mysten/deepbook-v3/predict`)
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for DeepBook Predict — binary markets on Sui. Builds ready-to-sign
|
|
4
|
-
reads on-chain state through your Sui client. The SDK never signs and never touches
|
|
5
|
-
`tx.*` method returns a `Transaction` for your wallet (dapp-kit) or signer to execute.
|
|
3
|
+
TypeScript SDK for DeepBook Predict — binary and range markets on Sui. Builds ready-to-sign
|
|
4
|
+
transactions and reads on-chain state through your Sui client. The SDK never signs and never touches
|
|
5
|
+
keys: every `tx.*` method returns a `Transaction` for your wallet (dapp-kit) or signer to execute.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -12,8 +12,10 @@ npm i @mysten/deepbook-v3 @mysten/sui
|
|
|
12
12
|
|
|
13
13
|
`@mysten/sui` is a peer dependency.
|
|
14
14
|
|
|
15
|
-
>
|
|
16
|
-
>
|
|
15
|
+
> Two deployments are recorded, **testnet** and **mainnet**: `predict({ network })` and
|
|
16
|
+
> `getConfig(network)` resolve either, and any other network throws. They settle in different coins
|
|
17
|
+
> that share one Move module path — read `quoteCoinType` from the config rather than assuming a
|
|
18
|
+
> symbol or a type. See [Networks & deployments](#networks--deployments).
|
|
17
19
|
|
|
18
20
|
## Quickstart
|
|
19
21
|
|
|
@@ -32,16 +34,22 @@ const client = new SuiGrpcClient({
|
|
|
32
34
|
// One-time: create your Predict account (a shared AccountWrapper).
|
|
33
35
|
const createTx = client.predict.tx.createManager();
|
|
34
36
|
|
|
35
|
-
// Fund it: pulls
|
|
37
|
+
// Fund it: pulls the deployment's quote coin (`client.predict.cfg.quoteCoinType`) from your
|
|
38
|
+
// address (coin objects and/or address balance).
|
|
36
39
|
const depositTx = client.predict.tx.deposit(myAddress, 250); // $250
|
|
37
40
|
|
|
38
|
-
// Cash out: lands in your
|
|
41
|
+
// Cash out: lands in your quote-coin address balance by default (no coin-object churn).
|
|
39
42
|
// Pass { toCoinObject: true } if you need a discrete Coin<T> instead.
|
|
40
43
|
const withdrawTx = client.predict.tx.withdraw(myAddress, 100); // $100
|
|
41
44
|
|
|
42
|
-
// Pick a
|
|
45
|
+
// Pick a market. `read.markets()` lists ACTIVE markets — live and not yet settled — which
|
|
46
|
+
// includes a market past its expiry that nobody has settled yet; quoting against one aborts.
|
|
47
|
+
// Expiries are absolute timestamps, so never hardcode one: filter on `expiryMs`, leaving
|
|
48
|
+
// room to quote, sign and land (and clear the pre-expiry no-trade window).
|
|
43
49
|
const markets = await client.predict.read.markets();
|
|
44
|
-
|
|
50
|
+
// -> [{ id, expiryMs, tickSize, admissionTickSize, mintPaused, referencePrice }, ...]
|
|
51
|
+
const tradeable = markets.filter((m) => Number(m.expiryMs) > Date.now() + 30_000 && !m.mintPaused);
|
|
52
|
+
const expiryMs = tradeable[0].expiryMs;
|
|
45
53
|
|
|
46
54
|
// Describe the position once and reuse it — quoting and minting take the same descriptor.
|
|
47
55
|
const desc = { underlying: 'BTC', expiryMs, strike: 'reference', side: 'up' } as const;
|
|
@@ -73,14 +81,10 @@ receipt.entryProbability; // your fill price (0..1 per $1 payout)
|
|
|
73
81
|
receipt.premium; // exact cost breakdown
|
|
74
82
|
receipt.fees;
|
|
75
83
|
|
|
76
|
-
// Read:
|
|
77
|
-
const
|
|
78
|
-
// -> [{ id, expiryMs, tickSize, admissionTickSize, mintPaused, referencePrice }, ...]
|
|
79
|
-
const market = await client.predict.read.market({
|
|
80
|
-
underlying: 'BTC',
|
|
81
|
-
expiryMs: markets[0].expiryMs,
|
|
82
|
-
});
|
|
84
|
+
// Read: one market's live state (+ NAV) and the pool.
|
|
85
|
+
const market = await client.predict.read.market({ underlying: 'BTC', expiryMs });
|
|
83
86
|
console.log(market?.nav, market?.tickSize, market?.mintPaused);
|
|
87
|
+
const pool = await client.predict.read.pool();
|
|
84
88
|
```
|
|
85
89
|
|
|
86
90
|
## ⚠ Slippage defaults are UNCAPPED
|
|
@@ -89,30 +93,41 @@ console.log(market?.nav, market?.tickSize, market?.mintPaused);
|
|
|
89
93
|
**uncapped** — if the price moves between your quote and execution, the position can cost up to your
|
|
90
94
|
full account balance. **Call `read.quoteMint` and pass its `cost` (plus your buffer) as `maxCost`.**
|
|
91
95
|
The same applies to `redeem`: the deployed `redeem_live` DOES take `min_probability` /
|
|
92
|
-
`min_proceeds` floors, but the facade does not surface them
|
|
93
|
-
`read.quoteRedeem` first, close fast
|
|
96
|
+
`min_proceeds` floors, but the facade's `tx.redeem` does not surface them and always sends `0`
|
|
97
|
+
(uncapped). `read.quoteRedeem` first, close fast. The floors are reachable through `/sessions`:
|
|
98
|
+
`SessionsContract.redeemLive` takes `minProbability` / `minProceeds` (raw units —
|
|
99
|
+
`probabilityToRaw`, `usdcToRaw`) plus a `pricer` from `loadLivePricer`, and is signed by a session
|
|
100
|
+
key the owner has authorized (see the README's `/sessions` section).
|
|
94
101
|
|
|
95
102
|
## Units
|
|
96
103
|
|
|
97
104
|
Everything human-facing is decimal; everything on-chain is scaled integers. The facade converts
|
|
98
105
|
**inputs** exactly (string/bigint math — no floats on the money path in). Read outputs typed
|
|
99
|
-
`number` are display values: above 2^53 raw they lose low-digit precision —
|
|
100
|
-
|
|
106
|
+
`number` are display values: above 2^53 raw they lose low-digit precision — quotes and receipts
|
|
107
|
+
carry a `raw` block of `bigint`s alongside, and `plpBalance` / `pool().plpTotalSupply` are raw
|
|
108
|
+
`bigint` already.
|
|
109
|
+
|
|
110
|
+
Amounts are in the deployment's quote coin — `getConfig(network).quoteCoinType`: Circle native USDC
|
|
111
|
+
on mainnet, a mintable 6-decimal test coin on testnet. Both are `…::usdc::USDC`, so only the package
|
|
112
|
+
address tells them apart; read the type, never assume a symbol.
|
|
101
113
|
|
|
102
114
|
| Concept | You pass / receive | On-chain raw |
|
|
103
115
|
| ------------------------------------------- | -------------------------------------------------------------- | ------------------------------------- |
|
|
104
|
-
| Amounts (deposit, spend, maxCost, balances) | USD decimal number or string (`12.5`, `"12.5"`) | ×1e6 (
|
|
116
|
+
| Amounts (deposit, spend, maxCost, balances) | USD decimal number or string (`12.5`, `"12.5"`) | ×1e6 (quote coin) |
|
|
105
117
|
| `quantity` | **max payout** in USD; positions pay $1 per contract at expiry | ×1e6, in $0.01 lots |
|
|
106
118
|
| `strike` | USD (`105_000`) | ×1e9, must land on the admission grid |
|
|
107
119
|
| `maxProbability` | 0..1 (`0.35` = 35¢ per $1 contract) | ×1e9 |
|
|
108
120
|
| PLP shares (`withdrawPlp`, `plpBalance`) | raw `bigint` shares | 6-decimal coin |
|
|
109
121
|
|
|
110
|
-
`side: "up"` wins if the settlement price is above the strike; `"down"` below
|
|
122
|
+
`side: "up"` wins if the settlement price is above the strike; `"down"` below; `"range"` (see
|
|
123
|
+
[Range positions](#range-positions)) if it lands inside `(lower, upper]`.
|
|
111
124
|
|
|
112
125
|
Trading closes slightly before expiry: the protocol enforces a short pre-expiry no-trade window
|
|
113
|
-
(`no_trade_window_ms` on the live `ProtocolConfig`,
|
|
114
|
-
|
|
115
|
-
|
|
126
|
+
(`no_trade_window_ms` on the live `ProtocolConfig`, 2 s on both recorded deployments), so a mint or
|
|
127
|
+
redeem submitted inside it aborts `ETradeWindowClosed` rather than filling. Treat the last seconds
|
|
128
|
+
of a window as untradeable rather than retrying, and when choosing a market from `read.markets()`
|
|
129
|
+
leave enough of the window to quote, sign and land — a quote taken seconds before expiry executes
|
|
130
|
+
inside the window.
|
|
116
131
|
|
|
117
132
|
## Reference-price markets (Polymarket-style windows)
|
|
118
133
|
|
|
@@ -139,11 +154,11 @@ strikes away from the reference remain fully supported.
|
|
|
139
154
|
### Numeric strikes must sit on the admission grid
|
|
140
155
|
|
|
141
156
|
New mint strikes must be a whole multiple of the market's **`admissionTickSize`** — a step
|
|
142
|
-
deliberately coarser than `tickSize`, and it
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
deliberately coarser than `tickSize`, and it is configured per cadence (both recorded deployments
|
|
158
|
+
run `$1` against a `$0.01` tick on their enabled cadences, 1m and 5m). Always read it off the market
|
|
159
|
+
rather than assuming a value. The market's `referencePrice` is the one finite strike the chain
|
|
160
|
+
admits off-grid. `read.markets()` and `read.market()` both report `admissionTickSize`, so a board
|
|
161
|
+
can be built from it directly:
|
|
147
162
|
|
|
148
163
|
```ts
|
|
149
164
|
const m = (await client.predict.read.markets())[0];
|
|
@@ -153,6 +168,23 @@ const strike = Math.round(target / m.admissionTickSize) * m.admissionTickSize;
|
|
|
153
168
|
An off-grid numeric strike throws `PredictInputError` at build time rather than aborting on chain
|
|
154
169
|
with `EInvalidAdmissionTick`.
|
|
155
170
|
|
|
171
|
+
### Range positions
|
|
172
|
+
|
|
173
|
+
`MarketDescriptor` has a third arm: `{ underlying, expiryMs, side: 'range', lower, upper }`. It pays
|
|
174
|
+
$1 per contract when the settlement price lands inside `(lower, upper]` — left-open, right-closed,
|
|
175
|
+
the same convention as the on-chain range key. Both bounds are USD strikes that must be finite, on
|
|
176
|
+
the tick grid, with `lower < upper`, and **each is admission-grid checked** exactly like a binary
|
|
177
|
+
numeric strike. `strike: 'reference'` is binary-only — a range has no single reference strike — and
|
|
178
|
+
`read.price` is binary-only too; price a range locally with `pricer.range(lower, upper)`.
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
const tx = await client.predict.tx.mint(
|
|
182
|
+
myAddress,
|
|
183
|
+
{ underlying: 'BTC', expiryMs, side: 'range', lower: 104_000, upper: 106_000 },
|
|
184
|
+
{ quantity: 25, maxCost: 10 },
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
156
188
|
## What's in the box
|
|
157
189
|
|
|
158
190
|
- **`client.predict.tx`** — `createManager`, `deposit`, `withdraw`, `mint`, `mintAmount`, `redeem`,
|
|
@@ -160,23 +192,59 @@ with `EInvalidAdmissionTick`.
|
|
|
160
192
|
`setBuilderCode`, `unsetBuilderCode`. Market-resolving builders
|
|
161
193
|
(`mint`/`mintAmount`/`redeem`/`claimSettled`) are async: they resolve the market object from
|
|
162
194
|
`{ underlying, expiryMs, strike, side }` via the on-chain registry (cached per client).
|
|
163
|
-
- **`client.predict.read`** — `markets()` (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
195
|
+
- **`client.predict.read`** — `markets()` (summaries of the pool's **active** markets — live and not
|
|
196
|
+
yet settled, so a market past expiry that nobody has settled is still listed and quoting against
|
|
197
|
+
it aborts; filter on `expiryMs` and `mintPaused` before trading: id, expiry, tick size, admission
|
|
198
|
+
tick size, mint-paused, reference price), `market(desc)` (state + live NAV), `price(m)` (anonymous
|
|
199
|
+
both-sides pricing for any strike, one chain call per strike), `pricer(m)` (a **client-side board
|
|
200
|
+
pricer** — one chain read of the resolved pricer, then price every strike locally; see below),
|
|
167
201
|
`quoteMint(owner, m, opts)` / `quoteRedeem(owner, m, opts)` (exact dry-run quotes: real fees from
|
|
168
202
|
the real code path — and they throw the same typed errors the real trade would, so a quote doubles
|
|
169
203
|
as preflight), `balance(owner)`, `plpBalance(owner)`, `pool()`, `positions(owner)` (chain-only
|
|
170
204
|
enumeration of open positions), `hasPosition(owner, marketId, orderId)`. All reads run over the
|
|
171
205
|
client's `simulateTransaction`; no indexer required.
|
|
172
206
|
- **`client.predict.decode`** — pure execution-result decoders (no network): `mint`, `redeem`,
|
|
173
|
-
`claim`, `createManager`, `deposit`, `withdraw`, `plpRequest`, `plpCancel`, `builderCode
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
207
|
+
`claim`, `createManager`, `deposit`, `withdraw`, `plpRequest`, `plpCancel`, `builderCode`. Each
|
|
208
|
+
singular form throws unless exactly one matching event is present; `mints`, `redeems` and `claims`
|
|
209
|
+
are the plural forms for batched PTBs and return every receipt (the other decoders have no
|
|
210
|
+
plural). Execute transactions with events included and pass the result; receipts come back in SDK
|
|
211
|
+
units with raw bigints alongside. Decoding uses the events' canonical BCS bytes, so it is
|
|
212
|
+
transport-independent.
|
|
213
|
+
- **PTB composition** — each `client.predict.tx.*` builder returns a finished `Transaction`, so to
|
|
214
|
+
put a Predict call into a PTB you are building, use the generated move-call bindings `/predict`
|
|
215
|
+
exports: one namespace of transaction thunks per Predict module (`plpMoveCalls`,
|
|
216
|
+
`expiryMarketMoveCalls`, `predictAccountMoveCalls`, `protocolConfigMoveCalls`,
|
|
217
|
+
`registryMoveCalls`, `builderCodeMoveCalls`, `marketManagerMoveCalls`, `pricingMoveCalls`,
|
|
218
|
+
`rangeCodecMoveCalls`, `adminMoveCalls` and the cap modules) plus the event layouts
|
|
219
|
+
(`vaultEvents`, `orderEvents`, `configEvents`, `builderCodeEvents`). Pass
|
|
220
|
+
`config: toGeneratedConfig(cfg)` — the flat config slice the bindings resolve the shared objects
|
|
221
|
+
against — and give owner-authorized calls `auth: tx.add(generateAuth(cfg))`, the hot-potato `Auth`
|
|
222
|
+
the account calls consume. The account itself (create, deposit, share) is
|
|
223
|
+
`@mysten/deepbook-v3/account`'s `accountRegistryMoveCalls` / `accountMoveCalls`. Also exported:
|
|
224
|
+
`loadLivePricer(toGeneratedConfig(cfg), { expiryMarketId, ...cfg.underlyings[sym] })` — the
|
|
225
|
+
`pricer` every live trade call borrows, which the `/sessions` Predict wrappers take as a PTB
|
|
226
|
+
result — and `deriveAccountWrapperId(cfg, owner)`.
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
// Create an account, fund it, and queue a PLP supply — one PTB, one signature.
|
|
230
|
+
const config = toGeneratedConfig(cfg);
|
|
231
|
+
const wrapper = tx.add(accountRegistryMoveCalls._new({ config }));
|
|
232
|
+
tx.add(
|
|
233
|
+
accountMoveCalls.depositFunds({
|
|
234
|
+
config,
|
|
235
|
+
arguments: { wrapper, auth: tx.add(generateAuth(cfg)), coin },
|
|
236
|
+
typeArguments: [cfg.quoteCoinType],
|
|
237
|
+
}),
|
|
238
|
+
);
|
|
239
|
+
tx.add(
|
|
240
|
+
plpMoveCalls.requestSupply({
|
|
241
|
+
config,
|
|
242
|
+
arguments: { wrapper, auth: tx.add(generateAuth(cfg)), amount, minPlpOut },
|
|
243
|
+
}),
|
|
244
|
+
);
|
|
245
|
+
tx.add(accountMoveCalls.share({ config, arguments: { self: wrapper } }));
|
|
246
|
+
```
|
|
247
|
+
|
|
180
248
|
- **Typed errors** — invalid inputs throw `PredictInputError` before the chain sees them; failed
|
|
181
249
|
simulations throw `PredictMoveError` with the decoded Move abort (`module`, `code`, `abortName`).
|
|
182
250
|
|
|
@@ -203,9 +271,9 @@ on-chain; the client only evaluates the digital. It throws the same typed stale-
|
|
|
203
271
|
The math is a faithful float port of the deployed `pricing::compute_nd2` (SVI with the skew
|
|
204
272
|
correction, signed params, and the remaining-time roll-down). It agrees with the chain closely —
|
|
205
273
|
within ~1e-4 in probability, up to ~1e-4 near ATM where the chain's fixed-point truncation dominates
|
|
206
|
-
(`
|
|
207
|
-
namespace for callers who already hold their own oracle inputs (e.g. a live feed) and want
|
|
208
|
-
chain calls:
|
|
274
|
+
(`test/predict/testnet/pricing.test.ts` bounds it live). The pure functions are exported under a
|
|
275
|
+
`pricing` namespace for callers who already hold their own oracle inputs (e.g. a live feed) and want
|
|
276
|
+
zero chain calls:
|
|
209
277
|
|
|
210
278
|
```ts
|
|
211
279
|
import { pricing } from '@mysten/deepbook-v3/predict';
|
|
@@ -223,11 +291,29 @@ const rolled = pricing.rollDown(rawSvi, remainingMs, anchorTteMs); // decay a, b
|
|
|
223
291
|
|
|
224
292
|
## Networks & deployments
|
|
225
293
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
294
|
+
Two deployments are recorded. `getDeployment(network)` names each one and the deepbookv3 commit its
|
|
295
|
+
ids were generated at:
|
|
296
|
+
|
|
297
|
+
| Network | Deployment | Chain id | Source commit | `quoteCoinType` |
|
|
298
|
+
| --------- | -------------------------- | ---------- | ------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
299
|
+
| `mainnet` | `deepbook-predict-mainnet` | `35834a8a` | `14a7e8f8` | Circle native USDC — `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC` |
|
|
300
|
+
| `testnet` | `deepbook-predict-testnet` | `4c78adac` | `a928bd2d` | mintable test coin, displays as `DUSDC` — `0xc028557a1ed49e42ed091e115aedefd70a442b184c18fbec5c48d5b6c0b8c184::usdc::USDC` |
|
|
301
|
+
|
|
302
|
+
Object ids for both are baked into the SDK — `MAINNET_CONFIG` / `TESTNET_CONFIG`, with
|
|
303
|
+
`MAINNET_DEPLOYMENT` / `TESTNET_DEPLOYMENT` and `MAINNET_UNITS` / `TESTNET_UNITS` alongside — and
|
|
304
|
+
are regenerated, with a release, whenever a deployment moves. `getConfig`, `getDeployment` and
|
|
305
|
+
`getUnits` resolve both networks and throw on any other; `getAccountConfig` (`/account`) and
|
|
306
|
+
`getSessionsConfig` (`/sessions`) read slices of the same generated record, so the three subpaths
|
|
307
|
+
cannot address different deployments. Units are identical on both (`$0.01` lots, 6 quote decimals,
|
|
308
|
+
1e9 fixed-point scale).
|
|
309
|
+
|
|
310
|
+
Move-call targets resolve from the config's package ids, so a deployment of your own is addressed by
|
|
311
|
+
passing `config` — `predict({ network, config })` or
|
|
312
|
+
`new PredictClient({ client, network, config })` — and `network` is then not consulted.
|
|
313
|
+
|
|
314
|
+
An expired market stays in `read.markets()` until someone settles it — the list is the pool's
|
|
315
|
+
live-and-not-yet-settled set, not a tradeable set. On either network, check `expiryMs` against the
|
|
316
|
+
clock (and `mintPaused`) before quoting rather than assuming the list is tradeable.
|
|
231
317
|
|
|
232
318
|
## Notes
|
|
233
319
|
|
|
@@ -239,12 +325,20 @@ stop requiring an SDK release for target resolution.
|
|
|
239
325
|
- PLP supply/withdraw are queued and fill at the next pool flush; cancels take the queue `index` —
|
|
240
326
|
get it from `decode.plpRequest(result).index`.
|
|
241
327
|
- **Both take an optional price floor**, and default to none:
|
|
242
|
-
`supplyPlp(owner,
|
|
243
|
-
`withdrawPlp(owner, shares, { minUsdcOut })` (USD decimals
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
328
|
+
`supplyPlp(owner, amountUsdc, { minPlpOut })` (`PlpSupplyOptions`, raw `bigint` shares; omitted →
|
|
329
|
+
`0n`) and `withdrawPlp(owner, shares, { minUsdcOut })` (`PlpWithdrawOptions`, USD decimals as
|
|
330
|
+
`number | string`, measured after the protocol's withdraw fee; omitted → no floor). Each floors
|
|
331
|
+
the flush's MARK for the whole request rather than naming a quantity — a flush quoting less
|
|
332
|
+
declines instead of filling smaller. What a miss costs is the deployment's
|
|
333
|
+
`lp_request_limit_flush_attempts`: the deployed value is one on both recorded deployments, so the
|
|
334
|
+
first flush below the floor cancels the request and refunds it, and re-queueing is a fresh
|
|
335
|
+
transaction (three is the configurable maximum, not the default). Leave the floor off and the
|
|
336
|
+
request takes whatever mark the flush quotes.
|
|
337
|
+
- **First-time funding in one PTB**: `deposit(owner, amount, { create: true })` creates the wrapper,
|
|
338
|
+
deposits through the fresh handle and shares it last. `owner` must be the transaction signer (the
|
|
339
|
+
wrapper is derived from the sender), and it aborts if the account already exists — the builder
|
|
340
|
+
does no chain read, so gate on `wrapperIdFor(owner)` + a `getObject`, or fall back to `deposit`
|
|
341
|
+
without the flag on that abort.
|
|
248
342
|
- `claimSettled` closes the order in full — the deployed entrypoint takes no quantity.
|
|
249
343
|
- **`withdraw` lands in your address balance by default** (`0x2::coin::send_funds`), not a coin
|
|
250
344
|
object — it merges into the versionless accumulator `deposit` already draws from, so the round
|
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Entry points
|
|
4
4
|
|
|
5
|
-
| Import | Contents
|
|
6
|
-
| ------------------------------ |
|
|
7
|
-
| `@mysten/deepbook-v3` | DeepBook spot and margin — pools, orders, balance managers, flash loans, governance, margin managers/pools, TPSL.
|
|
8
|
-
| `@mysten/deepbook-v3/account` | The shared on-chain **account primitive** (`AccountContract`): the canonical `AccountWrapper`, `Auth`, and custody balances that DeepBook's core account wrapper and DeepBook Predict both build on.
|
|
9
|
-
| `@mysten/deepbook-v3/sessions` | **Time-limited trading sessions** over a canonical Account (`SessionsContract`): grant an ephemeral address bounded authority until a fixed expiry. Covers the session lifecycle and the DeepBook Predict wrappers.
|
|
10
|
-
| `@mysten/deepbook-v3/predict` | **DeepBook Predict** — binary markets: market discovery, quotes, mint/redeem/claim, PLP, typed receipts and a client-side board pricer. See [PREDICT.md](./PREDICT.md).
|
|
5
|
+
| Import | Contents |
|
|
6
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7
|
+
| `@mysten/deepbook-v3` | DeepBook spot and margin — pools, orders, balance managers, flash loans, governance, margin managers/pools, TPSL. |
|
|
8
|
+
| `@mysten/deepbook-v3/account` | The shared on-chain **account primitive** (`AccountContract`): the canonical `AccountWrapper`, `Auth`, and custody balances that DeepBook's core account wrapper and DeepBook Predict both build on. |
|
|
9
|
+
| `@mysten/deepbook-v3/sessions` | **Time-limited trading sessions** over a canonical Account (`SessionsContract`): grant an ephemeral address bounded authority until a fixed expiry. Covers the session lifecycle and the DeepBook Predict wrappers. |
|
|
10
|
+
| `@mysten/deepbook-v3/predict` | **DeepBook Predict** — binary and range markets: market discovery, quotes, mint/redeem/claim, PLP, typed receipts and a client-side board pricer, with deployed ids for testnet and mainnet. See [PREDICT.md](./PREDICT.md). |
|
|
11
11
|
|
|
12
12
|
Subpaths are separate module graphs — importing `@mysten/deepbook-v3/account` does not load any spot
|
|
13
13
|
or margin code.
|
|
@@ -15,10 +15,13 @@ or margin code.
|
|
|
15
15
|
Each subpath also exports the **deployed ids** for its own surface, so a caller never transcribes
|
|
16
16
|
them: `getAccountConfig(network)` on `/account`, `getSessionsConfig(network)` on `/sessions`,
|
|
17
17
|
`getConfig(network)` on `/predict`. All three read one generated record (`src/deployments/`), so a
|
|
18
|
-
redeploy updates every subpath at once and they cannot end up addressing different deployments.
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
rather than returning placeholder ids.
|
|
18
|
+
redeploy updates every subpath at once and they cannot end up addressing different deployments. Two
|
|
19
|
+
networks are recorded, `testnet` (`deepbook-predict-testnet`) and `mainnet`
|
|
20
|
+
(`deepbook-predict-mainnet`); `getDeployment(network)` names the deployment and the deepbookv3
|
|
21
|
+
commit those ids came from, and an unrecorded network throws rather than returning placeholder ids.
|
|
22
|
+
The two deployments settle in different coins that share one Move module path — Circle native USDC
|
|
23
|
+
on mainnet, a mintable test coin (displayed as `DUSDC`) on testnet — so take the coin type from
|
|
24
|
+
`getConfig(network).quoteCoinType` on `/predict` rather than assuming either.
|
|
22
25
|
|
|
23
26
|
### `@mysten/deepbook-v3/account`
|
|
24
27
|
|
|
@@ -30,7 +33,7 @@ is computable off-chain with no chain read. `AccountContract` takes only the dep
|
|
|
30
33
|
import { Transaction } from '@mysten/sui/transactions';
|
|
31
34
|
import { AccountContract, getAccountConfig } from '@mysten/deepbook-v3/account';
|
|
32
35
|
|
|
33
|
-
// Deployed ids ship with the package — no transcription.
|
|
36
|
+
// Deployed ids ship with the package — no transcription. 'testnet' | 'mainnet'.
|
|
34
37
|
const account = new AccountContract(getAccountConfig('testnet'));
|
|
35
38
|
|
|
36
39
|
// …or drive a deployment of your own:
|
|
@@ -38,8 +41,10 @@ const custom = new AccountContract({ accountPackageId: '0x…', accountRegistry:
|
|
|
38
41
|
|
|
39
42
|
const wrapperId = account.deriveAccountWrapperId(owner);
|
|
40
43
|
|
|
44
|
+
// `quoteCoinType` is the deployment's settlement coin — `getConfig(network).quoteCoinType`
|
|
45
|
+
// from `/predict` — not a symbol you assume.
|
|
41
46
|
const tx = new Transaction();
|
|
42
|
-
tx.add(account.depositFunds({ wrapperId, coin, coinType:
|
|
47
|
+
tx.add(account.depositFunds({ wrapperId, coin, coinType: quoteCoinType }));
|
|
43
48
|
```
|
|
44
49
|
|
|
45
50
|
> `Account` exported from the package root is `@deepbook/core::account::Account` (the per-pool
|
|
@@ -61,7 +66,7 @@ withdrawal or arbitrary-mutation entrypoint.
|
|
|
61
66
|
```ts
|
|
62
67
|
import { SessionsContract, getSessionsConfig } from '@mysten/deepbook-v3/sessions';
|
|
63
68
|
|
|
64
|
-
// Deployed ids ship with the package — no transcription.
|
|
69
|
+
// Deployed ids ship with the package — no transcription. 'testnet' | 'mainnet'.
|
|
65
70
|
const sessions = new SessionsContract(getSessionsConfig('testnet'));
|
|
66
71
|
|
|
67
72
|
const wrapperId = sessions.deriveAccountWrapperId(owner);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MoveStruct, MoveTuple, RawTransactionArgument } from "../utils/index.mjs";
|
|
2
2
|
import { BcsType } from "@mysten/sui/bcs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions0 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/contracts/account/account.d.ts
|
|
@@ -57,7 +57,7 @@ interface IdOptions {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
/** Returns the wrapper object ID. */
|
|
60
|
-
declare function id(options: IdOptions): (tx: Transaction) =>
|
|
60
|
+
declare function id(options: IdOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
61
61
|
interface LoadAccountArguments {
|
|
62
62
|
self: RawTransactionArgument<string>;
|
|
63
63
|
}
|
|
@@ -69,7 +69,7 @@ interface LoadAccountOptions {
|
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
/** Borrows the wrapped account for read-only composition. */
|
|
72
|
-
declare function loadAccount(options: LoadAccountOptions): (tx: Transaction) =>
|
|
72
|
+
declare function loadAccount(options: LoadAccountOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
73
73
|
interface BalanceArguments {
|
|
74
74
|
self: TransactionArgument;
|
|
75
75
|
}
|
|
@@ -85,7 +85,7 @@ interface BalanceOptions {
|
|
|
85
85
|
* Returns the total balance of `T` available to the account, including funds
|
|
86
86
|
* delivered through the ambient accumulator but not yet settled into the account.
|
|
87
87
|
*/
|
|
88
|
-
declare function balance(options: BalanceOptions): (tx: Transaction) =>
|
|
88
|
+
declare function balance(options: BalanceOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
89
89
|
interface OwnerArguments {
|
|
90
90
|
self: TransactionArgument;
|
|
91
91
|
}
|
|
@@ -100,7 +100,7 @@ interface OwnerOptions {
|
|
|
100
100
|
* Returns the account owner address. This may be an EOA address or an
|
|
101
101
|
* object-ID-as-address.
|
|
102
102
|
*/
|
|
103
|
-
declare function owner(options: OwnerOptions): (tx: Transaction) =>
|
|
103
|
+
declare function owner(options: OwnerOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
104
104
|
interface AccountIdArguments {
|
|
105
105
|
self: TransactionArgument;
|
|
106
106
|
}
|
|
@@ -112,7 +112,7 @@ interface AccountIdOptions {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
/** Returns the canonical account ID. */
|
|
115
|
-
declare function accountId(options: AccountIdOptions): (tx: Transaction) =>
|
|
115
|
+
declare function accountId(options: AccountIdOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
116
116
|
interface ReferrerAccountIdArguments {
|
|
117
117
|
self: TransactionArgument;
|
|
118
118
|
}
|
|
@@ -127,7 +127,7 @@ interface ReferrerAccountIdOptions {
|
|
|
127
127
|
* Returns the canonical referrer account ID recorded at creation for external Move
|
|
128
128
|
* composition.
|
|
129
129
|
*/
|
|
130
|
-
declare function referrerAccountId(options: ReferrerAccountIdOptions): (tx: Transaction) =>
|
|
130
|
+
declare function referrerAccountId(options: ReferrerAccountIdOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
131
131
|
interface ReferrerReceiveAddressArguments {
|
|
132
132
|
self: TransactionArgument;
|
|
133
133
|
}
|
|
@@ -142,7 +142,7 @@ interface ReferrerReceiveAddressOptions {
|
|
|
142
142
|
* Returns the referrer's accumulator receive address for external Move
|
|
143
143
|
* composition.
|
|
144
144
|
*/
|
|
145
|
-
declare function referrerReceiveAddress(options: ReferrerReceiveAddressOptions): (tx: Transaction) =>
|
|
145
|
+
declare function referrerReceiveAddress(options: ReferrerReceiveAddressOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
146
146
|
interface ReceiveAddressArguments {
|
|
147
147
|
self: TransactionArgument;
|
|
148
148
|
}
|
|
@@ -154,7 +154,7 @@ interface ReceiveAddressOptions {
|
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
156
|
/** Returns the accumulator receive address for this account (the wrapper address). */
|
|
157
|
-
declare function receiveAddress(options: ReceiveAddressOptions): (tx: Transaction) =>
|
|
157
|
+
declare function receiveAddress(options: ReceiveAddressOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
158
158
|
interface GenerateAuthOptions {
|
|
159
159
|
package?: string;
|
|
160
160
|
arguments?: [];
|
|
@@ -163,7 +163,7 @@ interface GenerateAuthOptions {
|
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
/** Creates owner authority bound to the transaction sender. */
|
|
166
|
-
declare function generateAuth(options?: GenerateAuthOptions): (tx: Transaction) =>
|
|
166
|
+
declare function generateAuth(options?: GenerateAuthOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
167
167
|
interface GenerateAuthAsObjectArguments {
|
|
168
168
|
uid: RawTransactionArgument<string>;
|
|
169
169
|
}
|
|
@@ -175,7 +175,7 @@ interface GenerateAuthAsObjectOptions {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
/** Creates owner authority bound to an owning object's address. */
|
|
178
|
-
declare function generateAuthAsObject(options: GenerateAuthAsObjectOptions): (tx: Transaction) =>
|
|
178
|
+
declare function generateAuthAsObject(options: GenerateAuthAsObjectOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
179
179
|
interface ShareArguments {
|
|
180
180
|
self: RawTransactionArgument<string>;
|
|
181
181
|
}
|
|
@@ -187,7 +187,7 @@ interface ShareOptions {
|
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
/** Shares a newly created account wrapper. */
|
|
190
|
-
declare function share(options: ShareOptions): (tx: Transaction) =>
|
|
190
|
+
declare function share(options: ShareOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
191
191
|
interface LoadAccountMutArguments {
|
|
192
192
|
self: RawTransactionArgument<string>;
|
|
193
193
|
auth: TransactionArgument;
|
|
@@ -204,7 +204,7 @@ interface LoadAccountMutOptions {
|
|
|
204
204
|
* Owner authority must match the stored owner; app authority is package-issued
|
|
205
205
|
* after registry authorization and carries no owner or operation restriction.
|
|
206
206
|
*/
|
|
207
|
-
declare function loadAccountMut(options: LoadAccountMutOptions): (tx: Transaction) =>
|
|
207
|
+
declare function loadAccountMut(options: LoadAccountMutOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
208
208
|
interface SettleArguments {
|
|
209
209
|
wrapper: RawTransactionArgument<string>;
|
|
210
210
|
}
|
|
@@ -224,7 +224,7 @@ interface SettleOptions {
|
|
|
224
224
|
* address-balance withdrawal; value leaving the account still requires a mutable
|
|
225
225
|
* borrow through `Auth`.
|
|
226
226
|
*/
|
|
227
|
-
declare function settle(options: SettleOptions): (tx: Transaction) =>
|
|
227
|
+
declare function settle(options: SettleOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
228
228
|
interface DepositArguments {
|
|
229
229
|
self: TransactionArgument;
|
|
230
230
|
coin: RawTransactionArgument<string>;
|
|
@@ -241,7 +241,7 @@ interface DepositOptions {
|
|
|
241
241
|
* Deposits into stored balance only; callers that include accumulator funds must
|
|
242
242
|
* settle through the wrapper first.
|
|
243
243
|
*/
|
|
244
|
-
declare function deposit(options: DepositOptions): (tx: Transaction) =>
|
|
244
|
+
declare function deposit(options: DepositOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
245
245
|
interface WithdrawArguments {
|
|
246
246
|
self: TransactionArgument;
|
|
247
247
|
amount: RawTransactionArgument<number | bigint>;
|
|
@@ -258,7 +258,7 @@ interface WithdrawOptions {
|
|
|
258
258
|
* Withdraws from stored balance only; callers that include accumulator funds must
|
|
259
259
|
* settle through the wrapper first.
|
|
260
260
|
*/
|
|
261
|
-
declare function withdraw(options: WithdrawOptions): (tx: Transaction) =>
|
|
261
|
+
declare function withdraw(options: WithdrawOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
262
262
|
interface DepositFundsArguments {
|
|
263
263
|
wrapper: RawTransactionArgument<string>;
|
|
264
264
|
auth: TransactionArgument;
|
|
@@ -276,7 +276,7 @@ interface DepositFundsOptions {
|
|
|
276
276
|
* PTB entrypoint that settles accumulator funds, consumes authority, and deposits
|
|
277
277
|
* into stored balance in one call.
|
|
278
278
|
*/
|
|
279
|
-
declare function depositFunds(options: DepositFundsOptions): (tx: Transaction) =>
|
|
279
|
+
declare function depositFunds(options: DepositFundsOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
280
280
|
interface WithdrawFundsArguments {
|
|
281
281
|
wrapper: RawTransactionArgument<string>;
|
|
282
282
|
auth: TransactionArgument;
|
|
@@ -294,7 +294,7 @@ interface WithdrawFundsOptions {
|
|
|
294
294
|
* PTB entrypoint that settles accumulator funds, consumes authority, and withdraws
|
|
295
295
|
* from stored balance in one call.
|
|
296
296
|
*/
|
|
297
|
-
declare function withdrawFunds(options: WithdrawFundsOptions): (tx: Transaction) =>
|
|
297
|
+
declare function withdrawFunds(options: WithdrawFundsOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
298
298
|
interface AttachArguments<Data extends BcsType<any>> {
|
|
299
299
|
self: TransactionArgument;
|
|
300
300
|
Permit: TransactionArgument;
|
|
@@ -312,7 +312,7 @@ interface AttachOptions<Data extends BcsType<any>> {
|
|
|
312
312
|
* Attach an app's `Data` under its witness namespace. Requires `Permit<App>`.
|
|
313
313
|
* Aborts if `App` already has data attached.
|
|
314
314
|
*/
|
|
315
|
-
declare function attach<Data extends BcsType<any>>(options: AttachOptions<Data>): (tx: Transaction) =>
|
|
315
|
+
declare function attach<Data extends BcsType<any>>(options: AttachOptions<Data>): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
316
316
|
interface HasDataArguments {
|
|
317
317
|
self: TransactionArgument;
|
|
318
318
|
}
|
|
@@ -325,7 +325,7 @@ interface HasDataOptions {
|
|
|
325
325
|
typeArguments: [string];
|
|
326
326
|
}
|
|
327
327
|
/** Whether `App` has data attached to this account. */
|
|
328
|
-
declare function hasData(options: HasDataOptions): (tx: Transaction) =>
|
|
328
|
+
declare function hasData(options: HasDataOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
329
329
|
interface BorrowDataArguments {
|
|
330
330
|
self: TransactionArgument;
|
|
331
331
|
}
|
|
@@ -342,7 +342,7 @@ interface BorrowDataOptions {
|
|
|
342
342
|
* `App` and on-chain state is public, so composing apps can read it. Aborts if
|
|
343
343
|
* nothing is attached.
|
|
344
344
|
*/
|
|
345
|
-
declare function borrowData(options: BorrowDataOptions): (tx: Transaction) =>
|
|
345
|
+
declare function borrowData(options: BorrowDataOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
346
346
|
interface BorrowDataMutArguments {
|
|
347
347
|
self: TransactionArgument;
|
|
348
348
|
Permit: TransactionArgument;
|
|
@@ -359,7 +359,7 @@ interface BorrowDataMutOptions {
|
|
|
359
359
|
* Mutably borrow an app's attached `Data`. Requires `Permit<App>`. Aborts if
|
|
360
360
|
* nothing is attached.
|
|
361
361
|
*/
|
|
362
|
-
declare function borrowDataMut(options: BorrowDataMutOptions): (tx: Transaction) =>
|
|
362
|
+
declare function borrowDataMut(options: BorrowDataMutOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
363
363
|
interface DetachArguments {
|
|
364
364
|
self: TransactionArgument;
|
|
365
365
|
Permit: TransactionArgument;
|
|
@@ -376,7 +376,7 @@ interface DetachOptions {
|
|
|
376
376
|
* Detach and return an app's `Data`. Requires `Permit<App>`. Aborts if nothing is
|
|
377
377
|
* attached.
|
|
378
378
|
*/
|
|
379
|
-
declare function detach(options: DetachOptions): (tx: Transaction) =>
|
|
379
|
+
declare function detach(options: DetachOptions): (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
380
380
|
//#endregion
|
|
381
381
|
export { Account, AccountWrapper, account_d_exports };
|
|
382
382
|
//# sourceMappingURL=account.d.mts.map
|