@mysten/deepbook-v3 2.9.2 → 2.10.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.
- package/CHANGELOG.md +58 -0
- package/README.md +21 -0
- package/dist/account-bindings/account-registry.d.mts +109 -0
- package/dist/account-bindings/account-registry.d.mts.map +1 -0
- package/dist/account-bindings/account-registry.mjs +56 -0
- package/dist/account-bindings/account-registry.mjs.map +1 -0
- package/dist/account-bindings/account.d.mts +176 -0
- package/dist/account-bindings/account.d.mts.map +1 -0
- package/dist/account-bindings/account.mjs +94 -0
- package/dist/account-bindings/account.mjs.map +1 -0
- package/dist/account-bindings/latest.d.mts +12 -0
- package/dist/account-bindings/latest.d.mts.map +1 -0
- package/dist/account-bindings/latest.mjs +19 -0
- package/dist/account-bindings/latest.mjs.map +1 -0
- package/dist/account.d.mts +46 -3
- package/dist/account.d.mts.map +1 -1
- package/dist/account.mjs +51 -2
- package/dist/account.mjs.map +1 -1
- package/dist/contracts/account/account.d.mts +25 -97
- package/dist/contracts/account/account.d.mts.map +1 -1
- package/dist/contracts/account/account.mjs +43 -35
- package/dist/contracts/account/account.mjs.map +1 -1
- package/dist/contracts/account/account_events.d.mts +20 -20
- package/dist/contracts/account/account_events.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.d.mts +7 -54
- package/dist/contracts/account/account_registry.d.mts.map +1 -1
- package/dist/contracts/account/account_registry.mjs +2 -22
- package/dist/contracts/account/account_registry.mjs.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/balances.d.mts +4 -4
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook_predict/admin.d.mts +4 -4
- package/dist/contracts/deepbook_predict/admin.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code.d.mts +60 -13
- package/dist/contracts/deepbook_predict/builder_code.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code.mjs +55 -1
- package/dist/contracts/deepbook_predict/builder_code.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/builder_code_events.d.mts +10 -10
- package/dist/contracts/deepbook_predict/config_events.d.mts +88 -84
- package/dist/contracts/deepbook_predict/config_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/config_events.mjs +8 -0
- package/dist/contracts/deepbook_predict/config_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.d.mts +262 -101
- package/dist/contracts/deepbook_predict/expiry_market.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/expiry_market.mjs +320 -41
- package/dist/contracts/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/market_lifecycle_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/market_manager.d.mts +27 -27
- package/dist/contracts/deepbook_predict/order_events.d.mts +56 -54
- package/dist/contracts/deepbook_predict/order_events.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/order_events.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pause_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/plp.d.mts +74 -74
- package/dist/contracts/deepbook_predict/plp.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/pool_valuation_cap.d.mts +5 -5
- package/dist/contracts/deepbook_predict/predict_account.d.mts +22 -17
- package/dist/contracts/deepbook_predict/predict_account.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/predict_account.mjs +12 -6
- package/dist/contracts/deepbook_predict/predict_account.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/pricing.d.mts +67 -67
- package/dist/contracts/deepbook_predict/pricing.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.d.mts +127 -83
- package/dist/contracts/deepbook_predict/protocol_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs +59 -1
- package/dist/contracts/deepbook_predict/protocol_config.mjs.map +1 -1
- package/dist/contracts/deepbook_predict/range_codec.d.mts +2 -2
- package/dist/contracts/deepbook_predict/registry.d.mts +32 -32
- package/dist/contracts/deepbook_predict/vault_events.d.mts +131 -131
- package/dist/contracts/deepbook_predict_math/lazer_price.d.mts +13 -13
- package/dist/contracts/deepbook_predict_math/math.d.mts +14 -14
- package/dist/contracts/deepbook_predict_orders/delayed_execution_config.d.mts +30 -30
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs +6 -0
- package/dist/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_orders/desk.d.mts +28 -28
- package/dist/contracts/deepbook_predict_orders/order_queue.d.mts +187 -187
- package/dist/contracts/deepbook_predict_orders/queue.d.mts +240 -62
- package/dist/contracts/deepbook_predict_orders/queue.d.mts.map +1 -1
- package/dist/contracts/deepbook_predict_orders/queue.mjs +306 -41
- package/dist/contracts/deepbook_predict_orders/queue.mjs.map +1 -1
- package/dist/contracts/deepbook_predict_orders/queue_events.d.mts +140 -140
- package/dist/contracts/deepbook_sessions/session_config.d.mts +8 -8
- package/dist/contracts/deepbook_sessions/session_config.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.d.mts +271 -31
- package/dist/contracts/deepbook_sessions/sessions.d.mts.map +1 -1
- package/dist/contracts/deepbook_sessions/sessions.mjs +363 -3
- package/dist/contracts/deepbook_sessions/sessions.mjs.map +1 -1
- package/dist/deployments/mainnet.mjs.map +1 -1
- package/dist/deployments/testnet.d.mts.map +1 -1
- package/dist/deployments/testnet.mjs +7 -4
- package/dist/deployments/testnet.mjs.map +1 -1
- package/dist/predict/bindings/expiry-market.d.mts +57 -7
- package/dist/predict/bindings/expiry-market.d.mts.map +1 -1
- package/dist/predict/bindings/expiry-market.mjs +48 -2
- package/dist/predict/bindings/expiry-market.mjs.map +1 -1
- package/dist/predict/bindings/protocol-config.d.mts +5 -5
- package/dist/predict/bindings/protocol-config.mjs +4 -1
- package/dist/predict/bindings/protocol-config.mjs.map +1 -1
- package/dist/predict/bindings/queue.d.mts +30 -0
- package/dist/predict/bindings/queue.d.mts.map +1 -0
- package/dist/predict/bindings/queue.mjs +59 -0
- package/dist/predict/bindings/queue.mjs.map +1 -0
- package/dist/predict/bindings/rename.mjs +5 -1
- package/dist/predict/bindings/rename.mjs.map +1 -1
- package/dist/predict/client.d.mts.map +1 -1
- package/dist/predict/client.mjs +11 -5
- package/dist/predict/client.mjs.map +1 -1
- package/dist/predict/config/generated.d.mts +1 -1
- package/dist/predict/config/generated.d.mts.map +1 -1
- package/dist/predict/config/generated.mjs +1 -0
- package/dist/predict/config/generated.mjs.map +1 -1
- package/dist/predict/config/mainnet.mjs +3 -1
- package/dist/predict/config/mainnet.mjs.map +1 -1
- package/dist/predict/config/testnet.mjs +3 -1
- package/dist/predict/config/testnet.mjs.map +1 -1
- package/dist/predict/config/types.d.mts +23 -0
- package/dist/predict/config/types.d.mts.map +1 -1
- package/dist/predict/cost.d.mts +9 -1
- package/dist/predict/cost.d.mts.map +1 -1
- package/dist/predict/cost.mjs.map +1 -1
- package/dist/predict/errors.d.mts.map +1 -1
- package/dist/predict/errors.mjs +6 -2
- package/dist/predict/errors.mjs.map +1 -1
- package/dist/predict/index.d.mts +1 -1
- package/dist/predict/index.mjs +2 -2
- package/dist/predict/queue.d.mts +8 -4
- package/dist/predict/queue.d.mts.map +1 -1
- package/dist/predict/queue.mjs +8 -4
- package/dist/predict/queue.mjs.map +1 -1
- package/dist/predict/reads/balances.mjs +1 -1
- package/dist/predict/reads/queue.d.mts +3 -2
- package/dist/predict/reads/queue.d.mts.map +1 -1
- package/dist/predict/reads/queue.mjs +5 -4
- package/dist/predict/reads/queue.mjs.map +1 -1
- package/dist/predict/tx/authed.mjs +1 -1
- package/dist/predict/tx/common.d.mts.map +1 -1
- package/dist/predict/tx/common.mjs +3 -2
- package/dist/predict/tx/common.mjs.map +1 -1
- package/dist/predict/tx/trade.d.mts.map +1 -1
- package/dist/predict/tx/trade.mjs +3 -2
- package/dist/predict/tx/trade.mjs.map +1 -1
- package/dist/sessions.d.mts +10 -1
- package/dist/sessions.d.mts.map +1 -1
- package/dist/sessions.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts +4 -4
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginPool.d.mts.map +1 -1
- package/dist/transactions/marginRegistry.d.mts +16 -16
- package/dist/transactions/marginTPSL.d.mts +10 -10
- package/dist/transactions/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/poolProxy.d.mts +8 -8
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +2 -2
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +1 -1
- package/src/account-bindings/account-registry.ts +39 -0
- package/src/account-bindings/account.ts +73 -0
- package/src/account-bindings/latest.ts +41 -0
- package/src/account.ts +89 -5
- package/src/contracts/account/account.ts +73 -4
- package/src/contracts/account/account_registry.ts +1 -1
- package/src/contracts/deepbook_predict/builder_code.ts +94 -2
- package/src/contracts/deepbook_predict/config_events.ts +7 -0
- package/src/contracts/deepbook_predict/expiry_market.ts +490 -44
- package/src/contracts/deepbook_predict/order_events.ts +6 -4
- package/src/contracts/deepbook_predict/predict_account.ts +12 -6
- package/src/contracts/deepbook_predict/protocol_config.ts +85 -0
- package/src/contracts/deepbook_predict_orders/deps/deepbook_predict/expiry_market.ts +14 -0
- package/src/contracts/deepbook_predict_orders/order_flow.ts +4 -0
- package/src/contracts/deepbook_predict_orders/queue.ts +495 -9
- package/src/contracts/deepbook_sessions/sessions.ts +538 -3
- package/src/deployments/mainnet.ts +4 -4
- package/src/deployments/testnet.ts +18 -7
- package/src/deployments/types.ts +14 -0
- package/src/predict/bindings/expiry-market.ts +87 -0
- package/src/predict/bindings/queue.ts +42 -0
- package/src/predict/bindings/rename.ts +5 -1
- package/src/predict/client.ts +25 -3
- package/src/predict/config/generated.ts +3 -0
- package/src/predict/config/mainnet.ts +4 -0
- package/src/predict/config/testnet.ts +4 -0
- package/src/predict/config/types.ts +23 -0
- package/src/predict/cost.ts +9 -1
- package/src/predict/errors.ts +11 -1
- package/src/predict/index.ts +1 -1
- package/src/predict/queue.ts +8 -4
- package/src/predict/reads/queue.ts +7 -4
- package/src/predict/tx/common.ts +2 -0
- package/src/predict/tx/trade.ts +3 -1
- package/src/sessions.ts +10 -1
- package/src/utils/constants.ts +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 2.10.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c2766b4: Bump the testnet `LIQUIDATION_PACKAGE_ID` to `margin_liquidation` v5: `0x29bccec5…` →
|
|
8
|
+
`0x4f4916fc38892fe335a8aab45e3f42700060eb2d20f854607489ad88a88393a9`. v5 links testnet core v21
|
|
9
|
+
and margin v17, the packages `DEEPBOOK_PACKAGE_ID` and `MARGIN_PACKAGE_ID` already point at. It is
|
|
10
|
+
built from the same source as mainnet v6. It keeps every public signature and retires the
|
|
11
|
+
legacy-Pyth `liquidate_base` and `liquidate_quote`, which no builder here calls. Mainnet is
|
|
12
|
+
unchanged.
|
|
13
|
+
|
|
14
|
+
## 2.10.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 3acf620: Point Testnet at the Predict Version 5 rehearsal packages and add account v2's coin
|
|
19
|
+
receive.
|
|
20
|
+
|
|
21
|
+
- Testnet ids: Predict v8 `0x7fc9677d…`, `deepbook_predict_orders` v3 `0xc5869f5b…`, Sessions v5
|
|
22
|
+
`0x13108df3…` and account v2 `0x4401eae9…`. Mainnet ids are unchanged.
|
|
23
|
+
- The retirement guard follows the configured call targets. The new
|
|
24
|
+
`packages.predictCurrentVersion` and `packages.predictOrdersCurrentVersion` pin the version
|
|
25
|
+
constants each network's call targets compile: Testnet 5 and 2 (Version 5), Mainnet 4 and 1
|
|
26
|
+
until its upgrade. So the SDK keeps trading on Testnet when the Predict and order-desk
|
|
27
|
+
watermarks move to 5 and 2, and still reports Mainnet's v4 code as `'retired'` if Mainnet's move
|
|
28
|
+
first. `PREDICT_PACKAGE_VERSION` (5) and `ORDER_FLOW_PACKAGE_VERSION` (2) are the versions these
|
|
29
|
+
bindings were generated from, and the default for a custom config. They follow the Mainnet
|
|
30
|
+
package numbers, never Testnet's.
|
|
31
|
+
- Account calls go to the latest account package, through the new optional
|
|
32
|
+
`accountPackageIdLatest` (`/account` and `/sessions` ids) and `packages.accountLatest`
|
|
33
|
+
(Predict). A transaction can't call a package at an older version than another package in it
|
|
34
|
+
links, so an account call at v1 next to Predict v8 aborts `InvalidLinkage`. `AccountContract`,
|
|
35
|
+
the Predict builders and the exported `accountMoveCalls` / `accountRegistryMoveCalls` all
|
|
36
|
+
resolve it from the config (an explicit `package` still wins). `accountPackageId` and
|
|
37
|
+
`packages.account` stay the original id, which every derived address and type tag uses.
|
|
38
|
+
- `AccountContract.receiveCoin` and `receiveCoinAtAccountId` move a `Coin<T>` sent to an account's
|
|
39
|
+
wrapper address (or its canonical id) into its balance. They are permissionless and need account
|
|
40
|
+
v2.
|
|
41
|
+
- The Predict, `deepbook_predict_orders`, Sessions and account bindings are regenerated from the
|
|
42
|
+
Version 5 sources, so they include the builder-fee calls. `expiryMarketMoveCalls.redeemSettled`,
|
|
43
|
+
`redeemSettledPermissionless` and `quoteClose`, and `queueMoveCalls.quoteRedeemOpen`, keep their
|
|
44
|
+
shipped argument keys, because Version 5 underscore-prefixed those parameters. `redeemSettled`
|
|
45
|
+
and `redeemSettledPermissionless` always abort from Predict v5.
|
|
46
|
+
- Abort names for the builder-fee codes: `protocol_config` 16 `EBuilderFeeCutoverNotReached`, and
|
|
47
|
+
`sessions` 3–5 `EBuilderNotApproved`, `EBuilderFeeAboveApproved` and
|
|
48
|
+
`EBuilderApprovalsNotEnabled`.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 3acf620: Bump the mainnet `LIQUIDATION_PACKAGE_ID` to `margin_liquidation` v6: `0xba2b39c0…` →
|
|
53
|
+
`0xd61f264aaf707285a712347fccfb8e905e99d7dc72a6bd1053829ddebf420c2b`. v6 links core v9 and margin
|
|
54
|
+
v8, the packages `DEEPBOOK_PACKAGE_ID` and `MARGIN_PACKAGE_ID` already point at. v5 links margin
|
|
55
|
+
v7, so its liquidations stop working once margin version 7 is disabled. v6 keeps every public
|
|
56
|
+
signature. It retires the legacy-Pyth `liquidate_base` and `liquidate_quote`, which now abort. No
|
|
57
|
+
builder in this package calls them, because `liquidateBase` and `liquidateQuote` already target
|
|
58
|
+
`liquidate_base_upgraded` and `liquidate_quote_upgraded`. The deployed vault and its
|
|
59
|
+
`LIQUIDATION_VAULT` type are unchanged. Testnet is unchanged.
|
|
60
|
+
|
|
3
61
|
## 2.9.2
|
|
4
62
|
|
|
5
63
|
## 2.9.1
|
package/README.md
CHANGED
|
@@ -47,6 +47,27 @@ const tx = new Transaction();
|
|
|
47
47
|
tx.add(account.depositFunds({ wrapperId, coin, coinType: quoteCoinType }));
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
**Upgraded account packages.** `accountPackageId` is always the ORIGINAL package id: the wrapper
|
|
51
|
+
address and every type tag are derived from it, and Move types keep their defining package across
|
|
52
|
+
upgrades. Once a network upgrades `account`, its config also carries `accountPackageIdLatest`, and
|
|
53
|
+
every builder, and the exported `accountMoveCalls` / `accountRegistryMoveCalls` given that config,
|
|
54
|
+
call that package. A transaction can't call a package at an older version than another package in it
|
|
55
|
+
links, so a hand-written `tx.moveCall` into account next to an upgraded Predict must name the latest
|
|
56
|
+
id too, or it aborts `InvalidLinkage`.
|
|
57
|
+
|
|
58
|
+
**Receiving a coin (account v2).** A coin transferred to `deriveAccountWrapperId(owner)`, for
|
|
59
|
+
example by a bridge that can only send to an address, sits there until anyone moves it into the
|
|
60
|
+
account's balance. It can arrive before the account exists. The call is permissionless and only
|
|
61
|
+
credits that account:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
tx.add(account.receiveCoin({ wrapperId, coin: coinObjectId, coinType: quoteCoinType }));
|
|
65
|
+
// A coin sent to the account's canonical id instead of its wrapper address:
|
|
66
|
+
tx.add(account.receiveCoinAtAccountId({ wrapperId, coin: coinObjectId, coinType: quoteCoinType }));
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Both throw on a network whose config has no `accountPackageIdLatest` (still on account v1).
|
|
70
|
+
|
|
50
71
|
> `Account` exported from the package root is `@deepbook/core::account::Account` (the per-pool
|
|
51
72
|
> trading account). The account primitive's `Account` is a different type with an unrelated layout
|
|
52
73
|
> and is exported only from the `/account` subpath.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ConfigValue } from "../contracts/utils/index.mjs";
|
|
2
|
+
import { AccountAdminCap, AccountKey, AccountRegistry, AccountWrapperKey, AppKey, AssertAppIsAuthorizedArguments, AssertAppIsAuthorizedOptions, AuthorizeAppArguments, AuthorizeAppOptions, DeauthorizeAppArguments, DeauthorizeAppOptions, DerivedAddressArguments, DerivedAddressOptions, DerivedExistsArguments, DerivedExistsOptions, DerivedWrapperAddressArguments, DerivedWrapperAddressOptions, DerivedWrapperExistsArguments, DerivedWrapperExistsOptions, GenerateAuthAsAppArguments, GenerateAuthAsAppOptions, IsAppAuthorizedArguments, IsAppAuthorizedOptions, NewArguments, NewOptions, NewSelfOwnedArguments, NewSelfOwnedOptions, NewWithReferrerArguments, NewWithReferrerOptions } from "../contracts/account/account_registry.mjs";
|
|
3
|
+
import * as _mysten_sui_transactions71 from "@mysten/sui/transactions";
|
|
4
|
+
|
|
5
|
+
//#region src/account-bindings/account-registry.d.ts
|
|
6
|
+
declare namespace account_registry_d_exports {
|
|
7
|
+
export { AccountAdminCap, AccountKey, AccountRegistry, AccountWrapperKey, AppKey, AssertAppIsAuthorizedArguments, AssertAppIsAuthorizedOptions, AuthorizeAppArguments, AuthorizeAppOptions, DeauthorizeAppArguments, DeauthorizeAppOptions, DerivedAddressArguments, DerivedAddressOptions, DerivedExistsArguments, DerivedExistsOptions, DerivedWrapperAddressArguments, DerivedWrapperAddressOptions, DerivedWrapperExistsArguments, DerivedWrapperExistsOptions, GenerateAuthAsAppArguments, GenerateAuthAsAppOptions, IsAppAuthorizedArguments, IsAppAuthorizedOptions, NewArguments, NewOptions, NewSelfOwnedArguments, NewSelfOwnedOptions, NewWithReferrerArguments, NewWithReferrerOptions, WRAPPED, _new, assertAppIsAuthorized, authorizeApp, deauthorizeApp, derivedAddress, derivedExists, derivedWrapperAddress, derivedWrapperExists, generateAuthAsApp, isAppAuthorized, newSelfOwned, newWithReferrer };
|
|
8
|
+
}
|
|
9
|
+
declare const derivedAddress: (options: Omit<DerivedAddressOptions, "config"> & {
|
|
10
|
+
config?: ({
|
|
11
|
+
accountRegistry: ConfigValue;
|
|
12
|
+
accountPackageId?: string;
|
|
13
|
+
} & {
|
|
14
|
+
accountPackageIdLatest?: string;
|
|
15
|
+
}) | undefined;
|
|
16
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
17
|
+
declare const derivedWrapperAddress: (options: Omit<DerivedWrapperAddressOptions, "config"> & {
|
|
18
|
+
config?: ({
|
|
19
|
+
accountRegistry: ConfigValue;
|
|
20
|
+
accountPackageId?: string;
|
|
21
|
+
} & {
|
|
22
|
+
accountPackageIdLatest?: string;
|
|
23
|
+
}) | undefined;
|
|
24
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
25
|
+
declare const derivedExists: (options: Omit<DerivedExistsOptions, "config"> & {
|
|
26
|
+
config?: ({
|
|
27
|
+
accountRegistry: ConfigValue;
|
|
28
|
+
accountPackageId?: string;
|
|
29
|
+
} & {
|
|
30
|
+
accountPackageIdLatest?: string;
|
|
31
|
+
}) | undefined;
|
|
32
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
33
|
+
declare const derivedWrapperExists: (options: Omit<DerivedWrapperExistsOptions, "config"> & {
|
|
34
|
+
config?: ({
|
|
35
|
+
accountRegistry: ConfigValue;
|
|
36
|
+
accountPackageId?: string;
|
|
37
|
+
} & {
|
|
38
|
+
accountPackageIdLatest?: string;
|
|
39
|
+
}) | undefined;
|
|
40
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
41
|
+
declare const _new: (options: Omit<NewOptions, "config"> & {
|
|
42
|
+
config?: ({
|
|
43
|
+
accountRegistry: ConfigValue;
|
|
44
|
+
accountPackageId?: string;
|
|
45
|
+
} & {
|
|
46
|
+
accountPackageIdLatest?: string;
|
|
47
|
+
}) | undefined;
|
|
48
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
49
|
+
declare const newWithReferrer: (options: Omit<NewWithReferrerOptions, "config"> & {
|
|
50
|
+
config?: ({
|
|
51
|
+
accountRegistry: ConfigValue;
|
|
52
|
+
accountPackageId?: string;
|
|
53
|
+
} & {
|
|
54
|
+
accountPackageIdLatest?: string;
|
|
55
|
+
}) | undefined;
|
|
56
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
57
|
+
declare const newSelfOwned: (options: Omit<NewSelfOwnedOptions, "config"> & {
|
|
58
|
+
config?: ({
|
|
59
|
+
accountRegistry: ConfigValue;
|
|
60
|
+
accountPackageId?: string;
|
|
61
|
+
} & {
|
|
62
|
+
accountPackageIdLatest?: string;
|
|
63
|
+
}) | undefined;
|
|
64
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
65
|
+
declare const isAppAuthorized: (options: Omit<IsAppAuthorizedOptions, "config"> & {
|
|
66
|
+
config?: ({
|
|
67
|
+
accountRegistry: ConfigValue;
|
|
68
|
+
accountPackageId?: string;
|
|
69
|
+
} & {
|
|
70
|
+
accountPackageIdLatest?: string;
|
|
71
|
+
}) | undefined;
|
|
72
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
73
|
+
declare const authorizeApp: (options: Omit<AuthorizeAppOptions, "config"> & {
|
|
74
|
+
config?: ({
|
|
75
|
+
accountRegistry: ConfigValue;
|
|
76
|
+
accountPackageId?: string;
|
|
77
|
+
} & {
|
|
78
|
+
accountPackageIdLatest?: string;
|
|
79
|
+
}) | undefined;
|
|
80
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
81
|
+
declare const deauthorizeApp: (options: Omit<DeauthorizeAppOptions, "config"> & {
|
|
82
|
+
config?: ({
|
|
83
|
+
accountRegistry: ConfigValue;
|
|
84
|
+
accountPackageId?: string;
|
|
85
|
+
} & {
|
|
86
|
+
accountPackageIdLatest?: string;
|
|
87
|
+
}) | undefined;
|
|
88
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
89
|
+
declare const assertAppIsAuthorized: (options: Omit<AssertAppIsAuthorizedOptions, "config"> & {
|
|
90
|
+
config?: ({
|
|
91
|
+
accountRegistry: ConfigValue;
|
|
92
|
+
accountPackageId?: string;
|
|
93
|
+
} & {
|
|
94
|
+
accountPackageIdLatest?: string;
|
|
95
|
+
}) | undefined;
|
|
96
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
97
|
+
declare const generateAuthAsApp: (options: Omit<GenerateAuthAsAppOptions, "config"> & {
|
|
98
|
+
config?: ({
|
|
99
|
+
accountRegistry: ConfigValue;
|
|
100
|
+
accountPackageId?: string;
|
|
101
|
+
} & {
|
|
102
|
+
accountPackageIdLatest?: string;
|
|
103
|
+
}) | undefined;
|
|
104
|
+
}) => (tx: _mysten_sui_transactions71.Transaction) => _mysten_sui_transactions71.TransactionResult;
|
|
105
|
+
/** Every generated function wrapped above, for the completeness test. */
|
|
106
|
+
declare const WRAPPED: readonly ["derivedAddress", "derivedWrapperAddress", "derivedExists", "derivedWrapperExists", "_new", "newWithReferrer", "newSelfOwned", "isAppAuthorized", "authorizeApp", "deauthorizeApp", "assertAppIsAuthorized", "generateAuthAsApp"];
|
|
107
|
+
//#endregion
|
|
108
|
+
export { account_registry_d_exports };
|
|
109
|
+
//# sourceMappingURL=account-registry.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-registry.d.mts","names":[],"sources":["../../src/account-bindings/account-registry.ts"],"mappings":";;;;;;;;cAWa,cAAA,GAAc,OAAA,EAAA,IAAA,CAAA,qBAAA;;qBAAA,WAAA;;;;;;cACd,qBAAA,GAAqB,OAAA,EAAA,IAAA,CAAA,4BAAA;;qBAAA,WAAA;;;;;;cACrB,aAAA,GAAa,OAAA,EAAA,IAAA,CAAA,oBAAA;;qBAAA,WAAA;;;;;;cACb,oBAAA,GAAoB,OAAA,EAAA,IAAA,CAAA,2BAAA;;qBAAA,WAAA;;;;;;cACpB,IAAA,GAAI,OAAA,EAAA,IAAA,CAAA,UAAA;;qBAAA,WAAA;;;;;;cACJ,eAAA,GAAe,OAAA,EAAA,IAAA,CAAA,sBAAA;;qBAAA,WAAA;;;;;;cACf,YAAA,GAAY,OAAA,EAAA,IAAA,CAAA,mBAAA;;qBAAA,WAAA;;;;;;cACZ,eAAA,GAAe,OAAA,EAAA,IAAA,CAAA,sBAAA;;qBAAA,WAAA;;;;;;cACf,YAAA,GAAY,OAAA,EAAA,IAAA,CAAA,mBAAA;;qBAAA,WAAA;;;;;;cACZ,cAAA,GAAc,OAAA,EAAA,IAAA,CAAA,qBAAA;;qBAAA,WAAA;;;;;;cACd,qBAAA,GAAqB,OAAA,EAAA,IAAA,CAAA,4BAAA;;qBAAA,WAAA;;;;;;cACrB,iBAAA,GAAiB,OAAA,EAAA,IAAA,CAAA,wBAAA;;qBAAA,WAAA;;;;;;AAT9B;AAAA,cAYa,OAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { latestAccountPackage } from "./latest.mjs";
|
|
3
|
+
import { AccountAdminCap, AccountKey, AccountRegistry, AccountWrapperKey, AppKey, _new as _new$1, assertAppIsAuthorized as assertAppIsAuthorized$1, authorizeApp as authorizeApp$1, deauthorizeApp as deauthorizeApp$1, derivedAddress as derivedAddress$1, derivedExists as derivedExists$1, derivedWrapperAddress as derivedWrapperAddress$1, derivedWrapperExists as derivedWrapperExists$1, generateAuthAsApp as generateAuthAsApp$1, isAppAuthorized as isAppAuthorized$1, newSelfOwned as newSelfOwned$1, newWithReferrer as newWithReferrer$1 } from "../contracts/account/account_registry.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/account-bindings/account-registry.ts
|
|
6
|
+
var account_registry_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
AccountAdminCap: () => AccountAdminCap,
|
|
8
|
+
AccountKey: () => AccountKey,
|
|
9
|
+
AccountRegistry: () => AccountRegistry,
|
|
10
|
+
AccountWrapperKey: () => AccountWrapperKey,
|
|
11
|
+
AppKey: () => AppKey,
|
|
12
|
+
WRAPPED: () => WRAPPED,
|
|
13
|
+
_new: () => _new,
|
|
14
|
+
assertAppIsAuthorized: () => assertAppIsAuthorized,
|
|
15
|
+
authorizeApp: () => authorizeApp,
|
|
16
|
+
deauthorizeApp: () => deauthorizeApp,
|
|
17
|
+
derivedAddress: () => derivedAddress,
|
|
18
|
+
derivedExists: () => derivedExists,
|
|
19
|
+
derivedWrapperAddress: () => derivedWrapperAddress,
|
|
20
|
+
derivedWrapperExists: () => derivedWrapperExists,
|
|
21
|
+
generateAuthAsApp: () => generateAuthAsApp,
|
|
22
|
+
isAppAuthorized: () => isAppAuthorized,
|
|
23
|
+
newSelfOwned: () => newSelfOwned,
|
|
24
|
+
newWithReferrer: () => newWithReferrer
|
|
25
|
+
});
|
|
26
|
+
const derivedAddress = latestAccountPackage(derivedAddress$1);
|
|
27
|
+
const derivedWrapperAddress = latestAccountPackage(derivedWrapperAddress$1);
|
|
28
|
+
const derivedExists = latestAccountPackage(derivedExists$1);
|
|
29
|
+
const derivedWrapperExists = latestAccountPackage(derivedWrapperExists$1);
|
|
30
|
+
const _new = latestAccountPackage(_new$1);
|
|
31
|
+
const newWithReferrer = latestAccountPackage(newWithReferrer$1);
|
|
32
|
+
const newSelfOwned = latestAccountPackage(newSelfOwned$1);
|
|
33
|
+
const isAppAuthorized = latestAccountPackage(isAppAuthorized$1);
|
|
34
|
+
const authorizeApp = latestAccountPackage(authorizeApp$1);
|
|
35
|
+
const deauthorizeApp = latestAccountPackage(deauthorizeApp$1);
|
|
36
|
+
const assertAppIsAuthorized = latestAccountPackage(assertAppIsAuthorized$1);
|
|
37
|
+
const generateAuthAsApp = latestAccountPackage(generateAuthAsApp$1);
|
|
38
|
+
/** Every generated function wrapped above, for the completeness test. */
|
|
39
|
+
const WRAPPED = Object.freeze([
|
|
40
|
+
"derivedAddress",
|
|
41
|
+
"derivedWrapperAddress",
|
|
42
|
+
"derivedExists",
|
|
43
|
+
"derivedWrapperExists",
|
|
44
|
+
"_new",
|
|
45
|
+
"newWithReferrer",
|
|
46
|
+
"newSelfOwned",
|
|
47
|
+
"isAppAuthorized",
|
|
48
|
+
"authorizeApp",
|
|
49
|
+
"deauthorizeApp",
|
|
50
|
+
"assertAppIsAuthorized",
|
|
51
|
+
"generateAuthAsApp"
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { _new, account_registry_exports };
|
|
56
|
+
//# sourceMappingURL=account-registry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-registry.mjs","names":["generated.derivedAddress","generated.derivedWrapperAddress","generated.derivedExists","generated.derivedWrapperExists","generated._new","generated.newWithReferrer","generated.newSelfOwned","generated.isAppAuthorized","generated.authorizeApp","generated.deauthorizeApp","generated.assertAppIsAuthorized","generated.generateAuthAsApp"],"sources":["../../src/account-bindings/account-registry.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// The public `account_registry` bindings: the generated ones, each calling the latest account package\n// (see `latest.ts`). Types and BCS layouts are re-exported unchanged.\n\nimport * as generated from '../contracts/account/account_registry.js';\nimport { latestAccountPackage } from './latest.js';\n\nexport * from '../contracts/account/account_registry.js';\n\nexport const derivedAddress = latestAccountPackage(generated.derivedAddress);\nexport const derivedWrapperAddress = latestAccountPackage(generated.derivedWrapperAddress);\nexport const derivedExists = latestAccountPackage(generated.derivedExists);\nexport const derivedWrapperExists = latestAccountPackage(generated.derivedWrapperExists);\nexport const _new = latestAccountPackage(generated._new);\nexport const newWithReferrer = latestAccountPackage(generated.newWithReferrer);\nexport const newSelfOwned = latestAccountPackage(generated.newSelfOwned);\nexport const isAppAuthorized = latestAccountPackage(generated.isAppAuthorized);\nexport const authorizeApp = latestAccountPackage(generated.authorizeApp);\nexport const deauthorizeApp = latestAccountPackage(generated.deauthorizeApp);\nexport const assertAppIsAuthorized = latestAccountPackage(generated.assertAppIsAuthorized);\nexport const generateAuthAsApp = latestAccountPackage(generated.generateAuthAsApp);\n\n/** Every generated function wrapped above, for the completeness test. */\nexport const WRAPPED = Object.freeze([\n\t'derivedAddress',\n\t'derivedWrapperAddress',\n\t'derivedExists',\n\t'derivedWrapperExists',\n\t'_new',\n\t'newWithReferrer',\n\t'newSelfOwned',\n\t'isAppAuthorized',\n\t'authorizeApp',\n\t'deauthorizeApp',\n\t'assertAppIsAuthorized',\n\t'generateAuthAsApp',\n] as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAa,iBAAiB,qBAAqBA,iBAAyB;AAC5E,MAAa,wBAAwB,qBAAqBC,wBAAgC;AAC1F,MAAa,gBAAgB,qBAAqBC,gBAAwB;AAC1E,MAAa,uBAAuB,qBAAqBC,uBAA+B;AACxF,MAAa,OAAO,qBAAqBC,OAAe;AACxD,MAAa,kBAAkB,qBAAqBC,kBAA0B;AAC9E,MAAa,eAAe,qBAAqBC,eAAuB;AACxE,MAAa,kBAAkB,qBAAqBC,kBAA0B;AAC9E,MAAa,eAAe,qBAAqBC,eAAuB;AACxE,MAAa,iBAAiB,qBAAqBC,iBAAyB;AAC5E,MAAa,wBAAwB,qBAAqBC,wBAAgC;AAC1F,MAAa,oBAAoB,qBAAqBC,oBAA4B;;AAGlF,MAAa,UAAU,OAAO,OAAO;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAU"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Account, AccountIdArguments, AccountIdOptions, AccountWrapper, AttachArguments, AttachOptions, Auth, BalanceArguments, BalanceOptions, BorrowDataArguments, BorrowDataMutArguments, BorrowDataMutOptions, BorrowDataOptions, CoinKey, DataKey, DepositArguments, DepositFundsArguments, DepositFundsOptions, DepositOptions, DetachArguments, DetachOptions, GenerateAuthAsObjectArguments, GenerateAuthAsObjectOptions, GenerateAuthOptions, HasDataArguments, HasDataOptions, IdArguments, IdOptions, LoadAccountArguments, LoadAccountMutArguments, LoadAccountMutOptions, LoadAccountOptions, OwnerArguments, OwnerOptions, ReceiveAddressArguments, ReceiveAddressOptions, ReceiveCoinArguments, ReceiveCoinAtAccountIdArguments, ReceiveCoinAtAccountIdOptions, ReceiveCoinOptions, ReferrerAccountIdArguments, ReferrerAccountIdOptions, ReferrerReceiveAddressArguments, ReferrerReceiveAddressOptions, SettleArguments, SettleOptions, ShareArguments, ShareOptions, WithdrawArguments, WithdrawFundsArguments, WithdrawFundsOptions, WithdrawOptions } from "../contracts/account/account.mjs";
|
|
2
|
+
import { WithLatestConfig } from "./latest.mjs";
|
|
3
|
+
import { BcsType } from "@mysten/sui/bcs";
|
|
4
|
+
import * as _mysten_sui_transactions23 from "@mysten/sui/transactions";
|
|
5
|
+
|
|
6
|
+
//#region src/account-bindings/account.d.ts
|
|
7
|
+
declare namespace account_d_exports {
|
|
8
|
+
export { Account, AccountIdArguments, AccountIdOptions, AccountWrapper, AttachArguments, AttachOptions, Auth, BalanceArguments, BalanceOptions, BorrowDataArguments, BorrowDataMutArguments, BorrowDataMutOptions, BorrowDataOptions, CoinKey, DataKey, DepositArguments, DepositFundsArguments, DepositFundsOptions, DepositOptions, DetachArguments, DetachOptions, GenerateAuthAsObjectArguments, GenerateAuthAsObjectOptions, GenerateAuthOptions, HasDataArguments, HasDataOptions, IdArguments, IdOptions, LoadAccountArguments, LoadAccountMutArguments, LoadAccountMutOptions, LoadAccountOptions, OwnerArguments, OwnerOptions, ReceiveAddressArguments, ReceiveAddressOptions, ReceiveCoinArguments, ReceiveCoinAtAccountIdArguments, ReceiveCoinAtAccountIdOptions, ReceiveCoinOptions, ReferrerAccountIdArguments, ReferrerAccountIdOptions, ReferrerReceiveAddressArguments, ReferrerReceiveAddressOptions, SettleArguments, SettleOptions, ShareArguments, ShareOptions, WRAPPED, WithdrawArguments, WithdrawFundsArguments, WithdrawFundsOptions, WithdrawOptions, accountId, attach, balance, borrowData, borrowDataMut, deposit, depositFunds, detach, generateAuth, generateAuthAsObject, hasData, id, loadAccount, loadAccountMut, owner, receiveAddress, receiveCoin, receiveCoinAtAccountId, referrerAccountId, referrerReceiveAddress, settle, share, withdraw, withdrawFunds };
|
|
9
|
+
}
|
|
10
|
+
declare const id: (options: Omit<IdOptions, "config"> & {
|
|
11
|
+
config?: ({
|
|
12
|
+
accountPackageId?: string;
|
|
13
|
+
} & {
|
|
14
|
+
accountPackageIdLatest?: string;
|
|
15
|
+
}) | undefined;
|
|
16
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
17
|
+
declare const loadAccount: (options: Omit<LoadAccountOptions, "config"> & {
|
|
18
|
+
config?: ({
|
|
19
|
+
accountPackageId?: string;
|
|
20
|
+
} & {
|
|
21
|
+
accountPackageIdLatest?: string;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
24
|
+
declare const balance: (options: Omit<BalanceOptions, "config"> & {
|
|
25
|
+
config?: ({
|
|
26
|
+
accountPackageId?: string;
|
|
27
|
+
} & {
|
|
28
|
+
accountPackageIdLatest?: string;
|
|
29
|
+
}) | undefined;
|
|
30
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
31
|
+
declare const owner: (options: Omit<OwnerOptions, "config"> & {
|
|
32
|
+
config?: ({
|
|
33
|
+
accountPackageId?: string;
|
|
34
|
+
} & {
|
|
35
|
+
accountPackageIdLatest?: string;
|
|
36
|
+
}) | undefined;
|
|
37
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
38
|
+
declare const accountId: (options: Omit<AccountIdOptions, "config"> & {
|
|
39
|
+
config?: ({
|
|
40
|
+
accountPackageId?: string;
|
|
41
|
+
} & {
|
|
42
|
+
accountPackageIdLatest?: string;
|
|
43
|
+
}) | undefined;
|
|
44
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
45
|
+
declare const referrerAccountId: (options: Omit<ReferrerAccountIdOptions, "config"> & {
|
|
46
|
+
config?: ({
|
|
47
|
+
accountPackageId?: string;
|
|
48
|
+
} & {
|
|
49
|
+
accountPackageIdLatest?: string;
|
|
50
|
+
}) | undefined;
|
|
51
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
52
|
+
declare const referrerReceiveAddress: (options: Omit<ReferrerReceiveAddressOptions, "config"> & {
|
|
53
|
+
config?: ({
|
|
54
|
+
accountPackageId?: string;
|
|
55
|
+
} & {
|
|
56
|
+
accountPackageIdLatest?: string;
|
|
57
|
+
}) | undefined;
|
|
58
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
59
|
+
declare const receiveAddress: (options: Omit<ReceiveAddressOptions, "config"> & {
|
|
60
|
+
config?: ({
|
|
61
|
+
accountPackageId?: string;
|
|
62
|
+
} & {
|
|
63
|
+
accountPackageIdLatest?: string;
|
|
64
|
+
}) | undefined;
|
|
65
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
66
|
+
declare const generateAuth: (options?: (Omit<GenerateAuthOptions, "config"> & {
|
|
67
|
+
config?: ({
|
|
68
|
+
accountPackageId?: string;
|
|
69
|
+
} & {
|
|
70
|
+
accountPackageIdLatest?: string;
|
|
71
|
+
}) | undefined;
|
|
72
|
+
}) | undefined) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
73
|
+
declare const generateAuthAsObject: (options: Omit<GenerateAuthAsObjectOptions, "config"> & {
|
|
74
|
+
config?: ({
|
|
75
|
+
accountPackageId?: string;
|
|
76
|
+
} & {
|
|
77
|
+
accountPackageIdLatest?: string;
|
|
78
|
+
}) | undefined;
|
|
79
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
80
|
+
declare const share: (options: Omit<ShareOptions, "config"> & {
|
|
81
|
+
config?: ({
|
|
82
|
+
accountPackageId?: string;
|
|
83
|
+
} & {
|
|
84
|
+
accountPackageIdLatest?: string;
|
|
85
|
+
}) | undefined;
|
|
86
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
87
|
+
declare const loadAccountMut: (options: Omit<LoadAccountMutOptions, "config"> & {
|
|
88
|
+
config?: ({
|
|
89
|
+
accountPackageId?: string;
|
|
90
|
+
} & {
|
|
91
|
+
accountPackageIdLatest?: string;
|
|
92
|
+
}) | undefined;
|
|
93
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
94
|
+
declare const settle: (options: Omit<SettleOptions, "config"> & {
|
|
95
|
+
config?: ({
|
|
96
|
+
accountPackageId?: string;
|
|
97
|
+
} & {
|
|
98
|
+
accountPackageIdLatest?: string;
|
|
99
|
+
}) | undefined;
|
|
100
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
101
|
+
declare const receiveCoin: (options: Omit<ReceiveCoinOptions, "config"> & {
|
|
102
|
+
config?: ({
|
|
103
|
+
accountPackageId?: string;
|
|
104
|
+
} & {
|
|
105
|
+
accountPackageIdLatest?: string;
|
|
106
|
+
}) | undefined;
|
|
107
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
108
|
+
declare const receiveCoinAtAccountId: (options: Omit<ReceiveCoinAtAccountIdOptions, "config"> & {
|
|
109
|
+
config?: ({
|
|
110
|
+
accountPackageId?: string;
|
|
111
|
+
} & {
|
|
112
|
+
accountPackageIdLatest?: string;
|
|
113
|
+
}) | undefined;
|
|
114
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
115
|
+
declare const deposit: (options: Omit<DepositOptions, "config"> & {
|
|
116
|
+
config?: ({
|
|
117
|
+
accountPackageId?: string;
|
|
118
|
+
} & {
|
|
119
|
+
accountPackageIdLatest?: string;
|
|
120
|
+
}) | undefined;
|
|
121
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
122
|
+
declare const withdraw: (options: Omit<WithdrawOptions, "config"> & {
|
|
123
|
+
config?: ({
|
|
124
|
+
accountPackageId?: string;
|
|
125
|
+
} & {
|
|
126
|
+
accountPackageIdLatest?: string;
|
|
127
|
+
}) | undefined;
|
|
128
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
129
|
+
declare const depositFunds: (options: Omit<DepositFundsOptions, "config"> & {
|
|
130
|
+
config?: ({
|
|
131
|
+
accountPackageId?: string;
|
|
132
|
+
} & {
|
|
133
|
+
accountPackageIdLatest?: string;
|
|
134
|
+
}) | undefined;
|
|
135
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
136
|
+
declare const withdrawFunds: (options: Omit<WithdrawFundsOptions, "config"> & {
|
|
137
|
+
config?: ({
|
|
138
|
+
accountPackageId?: string;
|
|
139
|
+
} & {
|
|
140
|
+
accountPackageIdLatest?: string;
|
|
141
|
+
}) | undefined;
|
|
142
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
143
|
+
declare function attach<Data extends BcsType<any>>(options: WithLatestConfig<AttachOptions<Data>>): (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
144
|
+
declare const hasData: (options: Omit<HasDataOptions, "config"> & {
|
|
145
|
+
config?: ({
|
|
146
|
+
accountPackageId?: string;
|
|
147
|
+
} & {
|
|
148
|
+
accountPackageIdLatest?: string;
|
|
149
|
+
}) | undefined;
|
|
150
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
151
|
+
declare const borrowData: (options: Omit<BorrowDataOptions, "config"> & {
|
|
152
|
+
config?: ({
|
|
153
|
+
accountPackageId?: string;
|
|
154
|
+
} & {
|
|
155
|
+
accountPackageIdLatest?: string;
|
|
156
|
+
}) | undefined;
|
|
157
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
158
|
+
declare const borrowDataMut: (options: Omit<BorrowDataMutOptions, "config"> & {
|
|
159
|
+
config?: ({
|
|
160
|
+
accountPackageId?: string;
|
|
161
|
+
} & {
|
|
162
|
+
accountPackageIdLatest?: string;
|
|
163
|
+
}) | undefined;
|
|
164
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
165
|
+
declare const detach: (options: Omit<DetachOptions, "config"> & {
|
|
166
|
+
config?: ({
|
|
167
|
+
accountPackageId?: string;
|
|
168
|
+
} & {
|
|
169
|
+
accountPackageIdLatest?: string;
|
|
170
|
+
}) | undefined;
|
|
171
|
+
}) => (tx: _mysten_sui_transactions23.Transaction) => _mysten_sui_transactions23.TransactionResult;
|
|
172
|
+
/** Every generated function wrapped above, for the completeness test. */
|
|
173
|
+
declare const WRAPPED: readonly ["id", "loadAccount", "balance", "owner", "accountId", "referrerAccountId", "referrerReceiveAddress", "receiveAddress", "generateAuth", "generateAuthAsObject", "share", "loadAccountMut", "settle", "receiveCoin", "receiveCoinAtAccountId", "deposit", "withdraw", "depositFunds", "withdrawFunds", "attach", "hasData", "borrowData", "borrowDataMut", "detach"];
|
|
174
|
+
//#endregion
|
|
175
|
+
export { account_d_exports };
|
|
176
|
+
//# sourceMappingURL=account.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.mts","names":[],"sources":["../../src/account-bindings/account.ts"],"mappings":";;;;;;;;;cAYa,EAAA,GAAE,OAAA,EAAA,IAAA,CAAA,SAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACF,WAAA,GAAW,OAAA,EAAA,IAAA,CAAA,kBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACX,OAAA,GAAO,OAAA,EAAA,IAAA,CAAA,cAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACP,KAAA,GAAK,OAAA,EAAA,IAAA,CAAA,YAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACL,SAAA,GAAS,OAAA,EAAA,IAAA,CAAA,gBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACT,iBAAA,GAAiB,OAAA,EAAA,IAAA,CAAA,wBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACjB,sBAAA,GAAsB,OAAA,EAAA,IAAA,CAAA,6BAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACtB,cAAA,GAAc,OAAA,EAAA,IAAA,CAAA,qBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACd,YAAA,GAAY,OAAA,IAAA,IAAA,CAAA,mBAAA;;;;;;wBAAA,0BAAA,CAAA,WAAA;cACZ,oBAAA,GAAoB,OAAA,EAAA,IAAA,CAAA,2BAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACpB,KAAA,GAAK,OAAA,EAAA,IAAA,CAAA,YAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACL,cAAA,GAAc,OAAA,EAAA,IAAA,CAAA,qBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACd,MAAA,GAAM,OAAA,EAAA,IAAA,CAAA,aAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACN,WAAA,GAAW,OAAA,EAAA,IAAA,CAAA,kBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACX,sBAAA,GAAsB,OAAA,EAAA,IAAA,CAAA,6BAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACtB,OAAA,GAAO,OAAA,EAAA,IAAA,CAAA,cAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACP,QAAA,GAAQ,OAAA,EAAA,IAAA,CAAA,eAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACR,YAAA,GAAY,OAAA,EAAA,IAAA,CAAA,mBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACZ,aAAA,GAAa,OAAA,EAAA,IAAA,CAAA,oBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;iBAEV,MAAA,cAAoB,OAAA,MAAA,CACnC,OAAA,EAAS,gBAAA,CAAiB,aAAA,CAAwB,IAAA,MAAM,EAAA,EAA/B,0BAAA,CAA+B,WAAA,KAAA,0BAAA,CAAA,iBAAA;AAAA,cAQ5C,OAAA,GAAO,OAAA,EAAA,IAAA,CAAA,cAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACP,UAAA,GAAU,OAAA,EAAA,IAAA,CAAA,iBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACV,aAAA,GAAa,OAAA,EAAA,IAAA,CAAA,oBAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;cACb,MAAA,GAAM,OAAA,EAAA,IAAA,CAAA,aAAA;;;;;;WAAA,0BAAA,CAAA,WAAA;;cAGN,OAAA"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { Account, AccountWrapper, Auth, CoinKey, DataKey, accountId as accountId$1, attach as attach$1, balance as balance$1, borrowData as borrowData$1, borrowDataMut as borrowDataMut$1, deposit as deposit$1, depositFunds as depositFunds$1, detach as detach$1, generateAuth as generateAuth$1, generateAuthAsObject as generateAuthAsObject$1, hasData as hasData$1, id as id$1, loadAccount as loadAccount$1, loadAccountMut as loadAccountMut$1, owner as owner$1, receiveAddress as receiveAddress$1, receiveCoin as receiveCoin$1, receiveCoinAtAccountId as receiveCoinAtAccountId$1, referrerAccountId as referrerAccountId$1, referrerReceiveAddress as referrerReceiveAddress$1, settle as settle$1, share as share$1, withdraw as withdraw$1, withdrawFunds as withdrawFunds$1 } from "../contracts/account/account.mjs";
|
|
3
|
+
import { latestAccountPackage } from "./latest.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/account-bindings/account.ts
|
|
6
|
+
var account_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
Account: () => Account,
|
|
8
|
+
AccountWrapper: () => AccountWrapper,
|
|
9
|
+
Auth: () => Auth,
|
|
10
|
+
CoinKey: () => CoinKey,
|
|
11
|
+
DataKey: () => DataKey,
|
|
12
|
+
WRAPPED: () => WRAPPED,
|
|
13
|
+
accountId: () => accountId,
|
|
14
|
+
attach: () => attach,
|
|
15
|
+
balance: () => balance,
|
|
16
|
+
borrowData: () => borrowData,
|
|
17
|
+
borrowDataMut: () => borrowDataMut,
|
|
18
|
+
deposit: () => deposit,
|
|
19
|
+
depositFunds: () => depositFunds,
|
|
20
|
+
detach: () => detach,
|
|
21
|
+
generateAuth: () => generateAuth,
|
|
22
|
+
generateAuthAsObject: () => generateAuthAsObject,
|
|
23
|
+
hasData: () => hasData,
|
|
24
|
+
id: () => id,
|
|
25
|
+
loadAccount: () => loadAccount,
|
|
26
|
+
loadAccountMut: () => loadAccountMut,
|
|
27
|
+
owner: () => owner,
|
|
28
|
+
receiveAddress: () => receiveAddress,
|
|
29
|
+
receiveCoin: () => receiveCoin,
|
|
30
|
+
receiveCoinAtAccountId: () => receiveCoinAtAccountId,
|
|
31
|
+
referrerAccountId: () => referrerAccountId,
|
|
32
|
+
referrerReceiveAddress: () => referrerReceiveAddress,
|
|
33
|
+
settle: () => settle,
|
|
34
|
+
share: () => share,
|
|
35
|
+
withdraw: () => withdraw,
|
|
36
|
+
withdrawFunds: () => withdrawFunds
|
|
37
|
+
});
|
|
38
|
+
const id = latestAccountPackage(id$1);
|
|
39
|
+
const loadAccount = latestAccountPackage(loadAccount$1);
|
|
40
|
+
const balance = latestAccountPackage(balance$1);
|
|
41
|
+
const owner = latestAccountPackage(owner$1);
|
|
42
|
+
const accountId = latestAccountPackage(accountId$1);
|
|
43
|
+
const referrerAccountId = latestAccountPackage(referrerAccountId$1);
|
|
44
|
+
const referrerReceiveAddress = latestAccountPackage(referrerReceiveAddress$1);
|
|
45
|
+
const receiveAddress = latestAccountPackage(receiveAddress$1);
|
|
46
|
+
const generateAuth = latestAccountPackage(generateAuth$1);
|
|
47
|
+
const generateAuthAsObject = latestAccountPackage(generateAuthAsObject$1);
|
|
48
|
+
const share = latestAccountPackage(share$1);
|
|
49
|
+
const loadAccountMut = latestAccountPackage(loadAccountMut$1);
|
|
50
|
+
const settle = latestAccountPackage(settle$1);
|
|
51
|
+
const receiveCoin = latestAccountPackage(receiveCoin$1);
|
|
52
|
+
const receiveCoinAtAccountId = latestAccountPackage(receiveCoinAtAccountId$1);
|
|
53
|
+
const deposit = latestAccountPackage(deposit$1);
|
|
54
|
+
const withdraw = latestAccountPackage(withdraw$1);
|
|
55
|
+
const depositFunds = latestAccountPackage(depositFunds$1);
|
|
56
|
+
const withdrawFunds = latestAccountPackage(withdrawFunds$1);
|
|
57
|
+
function attach(options) {
|
|
58
|
+
return latestAccountPackage(attach$1)(options);
|
|
59
|
+
}
|
|
60
|
+
const hasData = latestAccountPackage(hasData$1);
|
|
61
|
+
const borrowData = latestAccountPackage(borrowData$1);
|
|
62
|
+
const borrowDataMut = latestAccountPackage(borrowDataMut$1);
|
|
63
|
+
const detach = latestAccountPackage(detach$1);
|
|
64
|
+
/** Every generated function wrapped above, for the completeness test. */
|
|
65
|
+
const WRAPPED = Object.freeze([
|
|
66
|
+
"id",
|
|
67
|
+
"loadAccount",
|
|
68
|
+
"balance",
|
|
69
|
+
"owner",
|
|
70
|
+
"accountId",
|
|
71
|
+
"referrerAccountId",
|
|
72
|
+
"referrerReceiveAddress",
|
|
73
|
+
"receiveAddress",
|
|
74
|
+
"generateAuth",
|
|
75
|
+
"generateAuthAsObject",
|
|
76
|
+
"share",
|
|
77
|
+
"loadAccountMut",
|
|
78
|
+
"settle",
|
|
79
|
+
"receiveCoin",
|
|
80
|
+
"receiveCoinAtAccountId",
|
|
81
|
+
"deposit",
|
|
82
|
+
"withdraw",
|
|
83
|
+
"depositFunds",
|
|
84
|
+
"withdrawFunds",
|
|
85
|
+
"attach",
|
|
86
|
+
"hasData",
|
|
87
|
+
"borrowData",
|
|
88
|
+
"borrowDataMut",
|
|
89
|
+
"detach"
|
|
90
|
+
]);
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { account_exports, balance, depositFunds, generateAuth, loadAccount, receiveCoin, receiveCoinAtAccountId, share, withdrawFunds };
|
|
94
|
+
//# sourceMappingURL=account.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.mjs","names":["generated.id","generated.loadAccount","generated.balance","generated.owner","generated.accountId","generated.referrerAccountId","generated.referrerReceiveAddress","generated.receiveAddress","generated.generateAuth","generated.generateAuthAsObject","generated.share","generated.loadAccountMut","generated.settle","generated.receiveCoin","generated.receiveCoinAtAccountId","generated.deposit","generated.withdraw","generated.depositFunds","generated.withdrawFunds","generated.attach","generated.hasData","generated.borrowData","generated.borrowDataMut","generated.detach"],"sources":["../../src/account-bindings/account.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// The public `account` bindings: the generated ones, each calling the latest account package\n// (see `latest.ts`). Types and BCS layouts are re-exported unchanged.\n\nimport * as generated from '../contracts/account/account.js';\nimport type { BcsType } from '@mysten/sui/bcs';\nimport { latestAccountPackage, type WithLatestConfig } from './latest.js';\n\nexport * from '../contracts/account/account.js';\n\nexport const id = latestAccountPackage(generated.id);\nexport const loadAccount = latestAccountPackage(generated.loadAccount);\nexport const balance = latestAccountPackage(generated.balance);\nexport const owner = latestAccountPackage(generated.owner);\nexport const accountId = latestAccountPackage(generated.accountId);\nexport const referrerAccountId = latestAccountPackage(generated.referrerAccountId);\nexport const referrerReceiveAddress = latestAccountPackage(generated.referrerReceiveAddress);\nexport const receiveAddress = latestAccountPackage(generated.receiveAddress);\nexport const generateAuth = latestAccountPackage(generated.generateAuth);\nexport const generateAuthAsObject = latestAccountPackage(generated.generateAuthAsObject);\nexport const share = latestAccountPackage(generated.share);\nexport const loadAccountMut = latestAccountPackage(generated.loadAccountMut);\nexport const settle = latestAccountPackage(generated.settle);\nexport const receiveCoin = latestAccountPackage(generated.receiveCoin);\nexport const receiveCoinAtAccountId = latestAccountPackage(generated.receiveCoinAtAccountId);\nexport const deposit = latestAccountPackage(generated.deposit);\nexport const withdraw = latestAccountPackage(generated.withdraw);\nexport const depositFunds = latestAccountPackage(generated.depositFunds);\nexport const withdrawFunds = latestAccountPackage(generated.withdrawFunds);\n// Generic, so written out to keep `Data`.\nexport function attach<Data extends BcsType<any>>(\n\toptions: WithLatestConfig<generated.AttachOptions<Data>>,\n) {\n\treturn (\n\t\tlatestAccountPackage(generated.attach) as (\n\t\t\toptions: WithLatestConfig<generated.AttachOptions<Data>>,\n\t\t) => ReturnType<typeof generated.attach<Data>>\n\t)(options);\n}\nexport const hasData = latestAccountPackage(generated.hasData);\nexport const borrowData = latestAccountPackage(generated.borrowData);\nexport const borrowDataMut = latestAccountPackage(generated.borrowDataMut);\nexport const detach = latestAccountPackage(generated.detach);\n\n/** Every generated function wrapped above, for the completeness test. */\nexport const WRAPPED = Object.freeze([\n\t'id',\n\t'loadAccount',\n\t'balance',\n\t'owner',\n\t'accountId',\n\t'referrerAccountId',\n\t'referrerReceiveAddress',\n\t'receiveAddress',\n\t'generateAuth',\n\t'generateAuthAsObject',\n\t'share',\n\t'loadAccountMut',\n\t'settle',\n\t'receiveCoin',\n\t'receiveCoinAtAccountId',\n\t'deposit',\n\t'withdraw',\n\t'depositFunds',\n\t'withdrawFunds',\n\t'attach',\n\t'hasData',\n\t'borrowData',\n\t'borrowDataMut',\n\t'detach',\n] as const);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAa,KAAK,qBAAqBA,KAAa;AACpD,MAAa,cAAc,qBAAqBC,cAAsB;AACtE,MAAa,UAAU,qBAAqBC,UAAkB;AAC9D,MAAa,QAAQ,qBAAqBC,QAAgB;AAC1D,MAAa,YAAY,qBAAqBC,YAAoB;AAClE,MAAa,oBAAoB,qBAAqBC,oBAA4B;AAClF,MAAa,yBAAyB,qBAAqBC,yBAAiC;AAC5F,MAAa,iBAAiB,qBAAqBC,iBAAyB;AAC5E,MAAa,eAAe,qBAAqBC,eAAuB;AACxE,MAAa,uBAAuB,qBAAqBC,uBAA+B;AACxF,MAAa,QAAQ,qBAAqBC,QAAgB;AAC1D,MAAa,iBAAiB,qBAAqBC,iBAAyB;AAC5E,MAAa,SAAS,qBAAqBC,SAAiB;AAC5D,MAAa,cAAc,qBAAqBC,cAAsB;AACtE,MAAa,yBAAyB,qBAAqBC,yBAAiC;AAC5F,MAAa,UAAU,qBAAqBC,UAAkB;AAC9D,MAAa,WAAW,qBAAqBC,WAAmB;AAChE,MAAa,eAAe,qBAAqBC,eAAuB;AACxE,MAAa,gBAAgB,qBAAqBC,gBAAwB;AAE1E,SAAgB,OACf,SACC;AACD,QACC,qBAAqBC,SAAiB,CAGrC,QAAQ;;AAEX,MAAa,UAAU,qBAAqBC,UAAkB;AAC9D,MAAa,aAAa,qBAAqBC,aAAqB;AACpE,MAAa,gBAAgB,qBAAqBC,gBAAwB;AAC1E,MAAa,SAAS,qBAAqBC,SAAiB;;AAG5D,MAAa,UAAU,OAAO,OAAO;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,CAAU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/account-bindings/latest.d.ts
|
|
2
|
+
/** An options type whose `config` also accepts the latest account package. */
|
|
3
|
+
type WithLatestConfig<Options> = Options extends {
|
|
4
|
+
config?: infer Config;
|
|
5
|
+
} ? Omit<Options, 'config'> & {
|
|
6
|
+
config?: Config & {
|
|
7
|
+
accountPackageIdLatest?: string;
|
|
8
|
+
};
|
|
9
|
+
} : Options;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { WithLatestConfig };
|
|
12
|
+
//# sourceMappingURL=latest.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latest.d.mts","names":[],"sources":["../../src/account-bindings/latest.ts"],"mappings":";;KAiBY,gBAAA,YAA4B,OAAA;EAAkB,MAAA;AAAA,IACvD,IAAA,CAAK,OAAA;EAAuB,MAAA,GAAS,MAAA;IAAW,sBAAA;EAAA;AAAA,IAChD,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/account-bindings/latest.ts
|
|
2
|
+
/**
|
|
3
|
+
* The generated call with its package resolved to the latest account package. Options stay
|
|
4
|
+
* optional where the generated call's are; `config` also accepts `accountPackageIdLatest`.
|
|
5
|
+
*/
|
|
6
|
+
function latestAccountPackage(call) {
|
|
7
|
+
const wrapped = (options) => {
|
|
8
|
+
const target = options?.package ?? options?.config?.accountPackageIdLatest;
|
|
9
|
+
return call(target ? {
|
|
10
|
+
...options,
|
|
11
|
+
package: target
|
|
12
|
+
} : options);
|
|
13
|
+
};
|
|
14
|
+
return wrapped;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { latestAccountPackage };
|
|
19
|
+
//# sourceMappingURL=latest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latest.mjs","names":[],"sources":["../../src/account-bindings/latest.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// Account calls target the latest `account` package, while `accountPackageId` stays the\n// original id everywhere: the derived wrapper and account addresses and every type tag are\n// built from it, because Move types keep their defining package across upgrades. A PTB can't\n// call a package at an older version than another package in it links, and Predict's Version 5\n// links account v2, so an account call at the original id beside it aborts `InvalidLinkage`.\n// The generated bindings resolve their package from `config.accountPackageId`, so every one is\n// wrapped here to resolve `package`, then `config.accountPackageIdLatest`, then that.\n\nexport interface AccountCallOptions {\n\tpackage?: string;\n\tconfig?: { accountPackageId?: string; accountPackageIdLatest?: string };\n}\n\n/** An options type whose `config` also accepts the latest account package. */\nexport type WithLatestConfig<Options> = Options extends { config?: infer Config }\n\t? Omit<Options, 'config'> & { config?: Config & { accountPackageIdLatest?: string } }\n\t: Options;\n\n/** A generated call whose options' `config` also accepts `accountPackageIdLatest`. */\nexport type LatestAccountCall<Call> = Call extends (...args: infer Args) => infer Result\n\t? (...args: { [K in keyof Args]: WithLatestConfig<Args[K]> }) => Result\n\t: never;\n\n/**\n * The generated call with its package resolved to the latest account package. Options stay\n * optional where the generated call's are; `config` also accepts `accountPackageIdLatest`.\n */\nexport function latestAccountPackage<Call extends (options: never) => unknown>(\n\tcall: Call,\n): LatestAccountCall<Call> {\n\tconst wrapped = (options?: AccountCallOptions) => {\n\t\tconst target = options?.package ?? options?.config?.accountPackageIdLatest;\n\t\treturn (call as unknown as (options?: AccountCallOptions) => unknown)(\n\t\t\ttarget ? { ...options, package: target } : options,\n\t\t);\n\t};\n\treturn wrapped as unknown as LatestAccountCall<Call>;\n}\n"],"mappings":";;;;;AA8BA,SAAgB,qBACf,MAC0B;CAC1B,MAAM,WAAW,YAAiC;EACjD,MAAM,SAAS,SAAS,WAAW,SAAS,QAAQ;AACpD,SAAQ,KACP,SAAS;GAAE,GAAG;GAAS,SAAS;GAAQ,GAAG,QAC3C;;AAEF,QAAO"}
|