@mysten/deepbook-v3 1.3.2 → 1.3.5
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 +40 -0
- package/dist/contracts/utils/index.d.mts.map +1 -1
- package/dist/contracts/utils/index.mjs +1 -0
- package/dist/contracts/utils/index.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbookAdmin.d.mts +2 -2
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +23 -23
- package/package.json +5 -7
- package/src/contracts/utils/index.ts +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 1.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9e067cf: Validate the new per-package release flow end-to-end across every public @mysten package.
|
|
8
|
+
No functional changes — empty patch bump to force the orchestrator to dispatch every
|
|
9
|
+
release-<pkg>.yml workflow with `dry_run=false` so each package publishes via OIDC trusted
|
|
10
|
+
publishing.
|
|
11
|
+
- Updated dependencies [9e067cf]
|
|
12
|
+
- @mysten/bcs@2.0.4
|
|
13
|
+
- @mysten/sui@2.16.1
|
|
14
|
+
|
|
15
|
+
## 1.3.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 75a32c1: Bump `axios` to `^1.16.0` to address security advisories (CVE-2025-62718 and related
|
|
20
|
+
prototype pollution issues).
|
|
21
|
+
|
|
22
|
+
## 1.3.3
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- bb8d26a: Fix three latent type errors in the generated `utils/index.ts` that surfaced for
|
|
27
|
+
consumers with `noUncheckedIndexedAccess: true`:
|
|
28
|
+
- `getPureBcsSchema(structTag.typeParams[0])` passed `TypeTag | undefined` to a parameter typed
|
|
29
|
+
`string | TypeTag`. Now null-checks the inner tag before passing it.
|
|
30
|
+
- `argTypes[i]` was redundantly re-indexed inside a `for…of entries()` loop, returning
|
|
31
|
+
`string | null | undefined` and being passed back to `getPureBcsSchema`. Switched to the loop
|
|
32
|
+
variable, which is `string | null`.
|
|
33
|
+
- `MoveStruct.get()` returned the destructured `[res]` from `getMany([objectId])` without
|
|
34
|
+
asserting it was defined. Now throws if no object was returned.
|
|
35
|
+
|
|
36
|
+
The codegen test suite gained a `tsc`-based check that compiles the generated `utils/index.ts`
|
|
37
|
+
under strict + `noUncheckedIndexedAccess`, so embedded-template type bugs are caught before
|
|
38
|
+
release rather than by downstream consumers.
|
|
39
|
+
|
|
40
|
+
All consumer packages (`payment-kit`, `pas`, `walrus`, `suins`, `deepbook-v3`, `kiosk`) have been
|
|
41
|
+
regenerated with the fix.
|
|
42
|
+
|
|
3
43
|
## 1.3.2
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/contracts/utils/index.ts"],"mappings":";;;;;KAkBY,UAAA,iBAA2B,IAAA,CAAK,cAAA,CAAe,aAAA,qBAC1D,cAAA,CAAe,gBAAA,CAAiB,OAAA;EAAa,MAAA,EAAQ,iBAAA;AAAA;AAAA,KAE1C,cAAA,iBAA+B,IAAA,CAAK,cAAA,CAAe,aAAA,qBAC9D,cAAA,CAAe,iBAAA,CAAkB,OAAA;EAAa,MAAA,EAAQ,iBAAA;AAAA;AAAA,cAyI1C,UAAA,WACF,MAAA,SAAe,OAAA,oDAEhB,SAAA,CAAU,CAAA,EAAG,IAAA;EAChB,GAAA,iBAAoB,IAAA,CAAK,cAAA,CAAe,aAAA,2BAAA,CAAA;IAC7C,QAAA;IAAA,GACG;EAAA,GACD,UAAA,CAAW,OAAA,IAAW,OAAA,CACxB,cAAA,CAAe,MAAA,CAAO,OAAA;IAAY,OAAA;IAAe,IAAA;EAAA;IAChD,IAAA,EAAM,SAAA,CAAU,CAAA;EAAA;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/contracts/utils/index.ts"],"mappings":";;;;;KAkBY,UAAA,iBAA2B,IAAA,CAAK,cAAA,CAAe,aAAA,qBAC1D,cAAA,CAAe,gBAAA,CAAiB,OAAA;EAAa,MAAA,EAAQ,iBAAA;AAAA;AAAA,KAE1C,cAAA,iBAA+B,IAAA,CAAK,cAAA,CAAe,aAAA,qBAC9D,cAAA,CAAe,iBAAA,CAAkB,OAAA;EAAa,MAAA,EAAQ,iBAAA;AAAA;AAAA,cAyI1C,UAAA,WACF,MAAA,SAAe,OAAA,oDAEhB,SAAA,CAAU,CAAA,EAAG,IAAA;EAChB,GAAA,iBAAoB,IAAA,CAAK,cAAA,CAAe,aAAA,2BAAA,CAAA;IAC7C,QAAA;IAAA,GACG;EAAA,GACD,UAAA,CAAW,OAAA,IAAW,OAAA,CACxB,cAAA,CAAe,MAAA,CAAO,OAAA;IAAY,OAAA;IAAe,IAAA;EAAA;IAChD,IAAA,EAAM,SAAA,CAAU,CAAA;EAAA;EAeZ,OAAA,iBAAwB,IAAA,CAAK,cAAA,CAAe,aAAA,2BAAA,CAAA;IACjD,MAAA;IAAA,GACG;EAAA,GACD,cAAA,CAAe,OAAA,IAAW,OAAA,CAC5B,KAAA,CACC,cAAA,CAAe,MAAA,CAAO,OAAA;IAAY,OAAA;IAAe,IAAA;EAAA;IAChD,IAAA,EAAM,SAAA,CAAU,CAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/contracts/utils/index.ts"],"sourcesContent":["import {\n\tbcs,\n\ttype BcsType,\n\ttype TypeTag,\n\tTypeTagSerializer,\n\tBcsStruct,\n\tBcsEnum,\n\tBcsTuple,\n} from '@mysten/sui/bcs';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\nimport { type TransactionArgument, isArgument } from '@mysten/sui/transactions';\nimport { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';\n\nconst MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');\nconst SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');\n\nexport type RawTransactionArgument<T> = T | TransactionArgument;\n\nexport type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =\n\tSuiClientTypes.GetObjectOptions<Include> & { client: ClientWithCoreApi };\n\nexport type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =\n\tSuiClientTypes.GetObjectsOptions<Include> & { client: ClientWithCoreApi };\n\nexport function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null {\n\tconst parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;\n\n\tif ('u8' in parsedTag) {\n\t\treturn bcs.U8;\n\t} else if ('u16' in parsedTag) {\n\t\treturn bcs.U16;\n\t} else if ('u32' in parsedTag) {\n\t\treturn bcs.U32;\n\t} else if ('u64' in parsedTag) {\n\t\treturn bcs.U64;\n\t} else if ('u128' in parsedTag) {\n\t\treturn bcs.U128;\n\t} else if ('u256' in parsedTag) {\n\t\treturn bcs.U256;\n\t} else if ('address' in parsedTag) {\n\t\treturn bcs.Address;\n\t} else if ('bool' in parsedTag) {\n\t\treturn bcs.Bool;\n\t} else if ('vector' in parsedTag) {\n\t\tconst type = getPureBcsSchema(parsedTag.vector);\n\t\treturn type ? bcs.vector(type) : null;\n\t} else if ('struct' in parsedTag) {\n\t\tconst structTag = parsedTag.struct;\n\t\tconst pkg = normalizeSuiAddress(structTag.address);\n\n\t\tif (pkg === MOVE_STDLIB_ADDRESS) {\n\t\t\tif (\n\t\t\t\t(structTag.module === 'ascii' || structTag.module === 'string') &&\n\t\t\t\tstructTag.name === 'String'\n\t\t\t) {\n\t\t\t\treturn bcs.String;\n\t\t\t}\n\n\t\t\tif (structTag.module === 'option' && structTag.name === 'Option') {\n\t\t\t\tconst
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/contracts/utils/index.ts"],"sourcesContent":["import {\n\tbcs,\n\ttype BcsType,\n\ttype TypeTag,\n\tTypeTagSerializer,\n\tBcsStruct,\n\tBcsEnum,\n\tBcsTuple,\n} from '@mysten/sui/bcs';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\nimport { type TransactionArgument, isArgument } from '@mysten/sui/transactions';\nimport { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';\n\nconst MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');\nconst SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');\n\nexport type RawTransactionArgument<T> = T | TransactionArgument;\n\nexport type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =\n\tSuiClientTypes.GetObjectOptions<Include> & { client: ClientWithCoreApi };\n\nexport type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> =\n\tSuiClientTypes.GetObjectsOptions<Include> & { client: ClientWithCoreApi };\n\nexport function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null {\n\tconst parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;\n\n\tif ('u8' in parsedTag) {\n\t\treturn bcs.U8;\n\t} else if ('u16' in parsedTag) {\n\t\treturn bcs.U16;\n\t} else if ('u32' in parsedTag) {\n\t\treturn bcs.U32;\n\t} else if ('u64' in parsedTag) {\n\t\treturn bcs.U64;\n\t} else if ('u128' in parsedTag) {\n\t\treturn bcs.U128;\n\t} else if ('u256' in parsedTag) {\n\t\treturn bcs.U256;\n\t} else if ('address' in parsedTag) {\n\t\treturn bcs.Address;\n\t} else if ('bool' in parsedTag) {\n\t\treturn bcs.Bool;\n\t} else if ('vector' in parsedTag) {\n\t\tconst type = getPureBcsSchema(parsedTag.vector);\n\t\treturn type ? bcs.vector(type) : null;\n\t} else if ('struct' in parsedTag) {\n\t\tconst structTag = parsedTag.struct;\n\t\tconst pkg = normalizeSuiAddress(structTag.address);\n\n\t\tif (pkg === MOVE_STDLIB_ADDRESS) {\n\t\t\tif (\n\t\t\t\t(structTag.module === 'ascii' || structTag.module === 'string') &&\n\t\t\t\tstructTag.name === 'String'\n\t\t\t) {\n\t\t\t\treturn bcs.String;\n\t\t\t}\n\n\t\t\tif (structTag.module === 'option' && structTag.name === 'Option') {\n\t\t\t\tconst inner = structTag.typeParams[0];\n\t\t\t\tconst type = inner ? getPureBcsSchema(inner) : null;\n\t\t\t\treturn type ? bcs.option(type) : null;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tpkg === SUI_FRAMEWORK_ADDRESS &&\n\t\t\tstructTag.module === 'object' &&\n\t\t\t(structTag.name === 'ID' || structTag.name === 'UID')\n\t\t) {\n\t\t\treturn bcs.Address;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport function normalizeMoveArguments(\n\targs: unknown[] | object,\n\targTypes: readonly (string | null)[],\n\tparameterNames?: string[],\n) {\n\tconst argLen = Array.isArray(args) ? args.length : Object.keys(args).length;\n\tif (parameterNames && argLen !== parameterNames.length) {\n\t\tthrow new Error(\n\t\t\t`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`,\n\t\t);\n\t}\n\n\tconst normalizedArgs: TransactionArgument[] = [];\n\n\tlet index = 0;\n\tfor (const argType of argTypes) {\n\t\tif (argType === '0x2::clock::Clock') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.clock());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x2::random::Random') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.random());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x2::deny_list::DenyList') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.denyList());\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (argType === '0x3::sui_system::SuiSystemState') {\n\t\t\tnormalizedArgs.push((tx) => tx.object.system());\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet arg;\n\t\tif (Array.isArray(args)) {\n\t\t\tif (index >= args.length) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`,\n\t\t\t\t);\n\t\t\t}\n\t\t\targ = args[index];\n\t\t} else {\n\t\t\tif (!parameterNames) {\n\t\t\t\tthrow new Error(`Expected arguments to be passed as an array`);\n\t\t\t}\n\t\t\tconst name = parameterNames[index];\n\t\t\targ = args[name as keyof typeof args];\n\n\t\t\tif (arg === undefined) {\n\t\t\t\tthrow new Error(`Parameter ${name} is required`);\n\t\t\t}\n\t\t}\n\n\t\tindex += 1;\n\n\t\tif (typeof arg === 'function' || isArgument(arg)) {\n\t\t\tnormalizedArgs.push(arg as TransactionArgument);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst bcsType = argType === null ? null : getPureBcsSchema(argType);\n\n\t\tif (bcsType) {\n\t\t\tconst bytes = bcsType.serialize(arg as never);\n\t\t\tnormalizedArgs.push((tx) => tx.pure(bytes));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof arg === 'string') {\n\t\t\tnormalizedArgs.push((tx) => tx.object(arg));\n\t\t\tcontinue;\n\t\t}\n\n\t\tthrow new Error(`Invalid argument ${stringify(arg)} for type ${argType}`);\n\t}\n\n\treturn normalizedArgs;\n}\n\nexport class MoveStruct<\n\tT extends Record<string, BcsType<any>>,\n\tconst Name extends string = string,\n> extends BcsStruct<T, Name> {\n\tasync get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({\n\t\tobjectId,\n\t\t...options\n\t}: GetOptions<Include>): Promise<\n\t\tSuiClientTypes.Object<Include & { content: true; json: true }> & {\n\t\t\tjson: BcsStruct<T>['$inferType'];\n\t\t}\n\t> {\n\t\tconst [res] = await this.getMany<Include>({\n\t\t\t...options,\n\t\t\tobjectIds: [objectId],\n\t\t});\n\n\t\tif (!res) {\n\t\t\tthrow new Error(`No object found for id ${objectId}`);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tasync getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({\n\t\tclient,\n\t\t...options\n\t}: GetManyOptions<Include>): Promise<\n\t\tArray<\n\t\t\tSuiClientTypes.Object<Include & { content: true; json: true }> & {\n\t\t\t\tjson: BcsStruct<T>['$inferType'];\n\t\t\t}\n\t\t>\n\t> {\n\t\tconst response = (await client.core.getObjects({\n\t\t\t...options,\n\t\t\tinclude: {\n\t\t\t\t...options.include,\n\t\t\t\tcontent: true,\n\t\t\t},\n\t\t})) as SuiClientTypes.GetObjectsResponse<Include & { content: true }>;\n\n\t\treturn response.objects.map((obj) => {\n\t\t\tif (obj instanceof Error) {\n\t\t\t\tthrow obj;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...obj,\n\t\t\t\tjson: this.parse(obj.content),\n\t\t\t};\n\t\t});\n\t}\n}\n\nexport class MoveEnum<\n\tT extends Record<string, BcsType<any> | null>,\n\tconst Name extends string,\n> extends BcsEnum<T, Name> {}\n\nexport class MoveTuple<\n\tconst T extends readonly BcsType<any>[],\n\tconst Name extends string,\n> extends BcsTuple<T, Name> {}\n\nfunction stringify(val: unknown) {\n\tif (typeof val === 'object') {\n\t\treturn JSON.stringify(val, (val: unknown) => val);\n\t}\n\tif (typeof val === 'bigint') {\n\t\treturn val.toString();\n\t}\n\n\treturn val;\n}\n"],"mappings":";;;;;AAaA,MAAM,sBAAsB,oBAAoB,MAAM;AACtD,MAAM,wBAAwB,oBAAoB,MAAM;AAiJxD,IAAa,aAAb,cAGU,UAAmB;CAC5B,MAAM,IAAiF,EACtF,UACA,GAAG,WAKF;EACD,MAAM,CAAC,OAAO,MAAM,KAAK,QAAiB;GACzC,GAAG;GACH,WAAW,CAAC,SAAS;GACrB,CAAC;AAEF,MAAI,CAAC,IACJ,OAAM,IAAI,MAAM,0BAA0B,WAAW;AAGtD,SAAO;;CAGR,MAAM,QAAqF,EAC1F,QACA,GAAG,WAOF;AASD,UARkB,MAAM,OAAO,KAAK,WAAW;GAC9C,GAAG;GACH,SAAS;IACR,GAAG,QAAQ;IACX,SAAS;IACT;GACD,CAAC,EAEc,QAAQ,KAAK,QAAQ;AACpC,OAAI,eAAe,MAClB,OAAM;AAGP,UAAO;IACN,GAAG;IACH,MAAM,KAAK,MAAM,IAAI,QAAQ;IAC7B;IACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions3 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/balanceManager.d.ts
|
|
@@ -21,7 +21,7 @@ declare class BalanceManagerContract {
|
|
|
21
21
|
* @description Create a new BalanceManager, manually set the owner. Returns the manager.
|
|
22
22
|
* @returns A function that takes a Transaction object
|
|
23
23
|
*/
|
|
24
|
-
createBalanceManagerWithOwner: (ownerAddress: string) => (tx: Transaction) =>
|
|
24
|
+
createBalanceManagerWithOwner: (ownerAddress: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
25
25
|
/**
|
|
26
26
|
* @description Share the BalanceManager
|
|
27
27
|
* @param {TransactionArgument} manager The BalanceManager to share
|
|
@@ -65,38 +65,38 @@ declare class BalanceManagerContract {
|
|
|
65
65
|
* @param {string} managerKey The key of the BalanceManager
|
|
66
66
|
* @returns A function that takes a Transaction object
|
|
67
67
|
*/
|
|
68
|
-
generateProof: (managerKey: string) => (tx: Transaction) =>
|
|
68
|
+
generateProof: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
69
69
|
/**
|
|
70
70
|
* @description Generate a trade proof as the owner
|
|
71
71
|
* @param {string} managerId The ID of the BalanceManager
|
|
72
72
|
* @returns A function that takes a Transaction object
|
|
73
73
|
*/
|
|
74
|
-
generateProofAsOwner: (managerId: string) => (tx: Transaction) =>
|
|
74
|
+
generateProofAsOwner: (managerId: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
75
75
|
/**
|
|
76
76
|
* @description Generate a trade proof as a trader
|
|
77
77
|
* @param {string} managerId The ID of the BalanceManager
|
|
78
78
|
* @param {string} tradeCapId The ID of the tradeCap
|
|
79
79
|
* @returns A function that takes a Transaction object
|
|
80
80
|
*/
|
|
81
|
-
generateProofAsTrader: (managerId: string, tradeCapId: string) => (tx: Transaction) =>
|
|
81
|
+
generateProofAsTrader: (managerId: string, tradeCapId: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
82
82
|
/**
|
|
83
83
|
* @description Mint a TradeCap
|
|
84
84
|
* @param {string} managerKey The name of the BalanceManager
|
|
85
85
|
* @returns A function that takes a Transaction object
|
|
86
86
|
*/
|
|
87
|
-
mintTradeCap: (managerKey: string) => (tx: Transaction) =>
|
|
87
|
+
mintTradeCap: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
88
88
|
/**
|
|
89
89
|
* @description Mint a DepositCap
|
|
90
90
|
* @param {string} managerKey The name of the BalanceManager
|
|
91
91
|
* @returns A function that takes a Transaction object
|
|
92
92
|
*/
|
|
93
|
-
mintDepositCap: (managerKey: string) => (tx: Transaction) =>
|
|
93
|
+
mintDepositCap: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
94
94
|
/**
|
|
95
95
|
* @description Mint a WithdrawalCap
|
|
96
96
|
* @param {string} managerKey The name of the BalanceManager
|
|
97
97
|
* @returns A function that takes a Transaction object
|
|
98
98
|
*/
|
|
99
|
-
mintWithdrawalCap: (managerKey: string) => (tx: Transaction) =>
|
|
99
|
+
mintWithdrawalCap: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
100
100
|
/**
|
|
101
101
|
* @description Deposit using the DepositCap
|
|
102
102
|
* @param {string} managerKey The name of the BalanceManager
|
|
@@ -112,7 +112,7 @@ declare class BalanceManagerContract {
|
|
|
112
112
|
* @param {number} amountToWithdraw The amount to withdraw
|
|
113
113
|
* @returns A function that takes a Transaction object
|
|
114
114
|
*/
|
|
115
|
-
withdrawWithCap: (managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) =>
|
|
115
|
+
withdrawWithCap: (managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
116
116
|
/**
|
|
117
117
|
* @description Set the referral for the BalanceManager for a specific pool
|
|
118
118
|
* @param {string} managerKey The name of the BalanceManager
|
|
@@ -147,20 +147,20 @@ declare class BalanceManagerContract {
|
|
|
147
147
|
* @param {string} referralId The ID of the referral to get the owner of
|
|
148
148
|
* @returns A function that takes a Transaction object
|
|
149
149
|
*/
|
|
150
|
-
balanceManagerReferralOwner: (referralId: string) => (tx: Transaction) =>
|
|
150
|
+
balanceManagerReferralOwner: (referralId: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
151
151
|
/**
|
|
152
152
|
* @description Get the pool ID associated with a referral (DeepBookPoolReferral)
|
|
153
153
|
* @param {string} referralId The ID of the referral to get the pool ID of
|
|
154
154
|
* @returns A function that takes a Transaction object
|
|
155
155
|
*/
|
|
156
|
-
balanceManagerReferralPoolId: (referralId: string) => (tx: Transaction) =>
|
|
156
|
+
balanceManagerReferralPoolId: (referralId: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
157
157
|
/**
|
|
158
158
|
* @description Get the referral ID from the balance manager for a specific pool
|
|
159
159
|
* @param {string} managerKey The name of the BalanceManager
|
|
160
160
|
* @param {string} poolKey Key of the pool to get the referral for
|
|
161
161
|
* @returns A function that takes a Transaction object
|
|
162
162
|
*/
|
|
163
|
-
getBalanceManagerReferralId: (managerKey: string, poolKey: string) => (tx: Transaction) =>
|
|
163
|
+
getBalanceManagerReferralId: (managerKey: string, poolKey: string) => (tx: Transaction) => _mysten_sui_transactions3.TransactionResult;
|
|
164
164
|
/**
|
|
165
165
|
* @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.
|
|
166
166
|
* @param {string} managerKey The name of the BalanceManager
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CanPlaceLimitOrderParams, CanPlaceMarketOrderParams, CreatePermissionlessPoolParams, PlaceLimitOrderParams, PlaceMarketOrderParams, SwapParams, SwapWithManagerParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions14 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/deepbook.d.ts
|
|
@@ -380,40 +380,40 @@ declare class DeepBookContract {
|
|
|
380
380
|
* @param {string} referral The referral (DeepBookPoolReferral) to get the balances for
|
|
381
381
|
* @returns A function that takes a Transaction object
|
|
382
382
|
*/
|
|
383
|
-
getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) =>
|
|
383
|
+
getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
384
384
|
/**
|
|
385
385
|
* @description Get the multiplier for a referral (DeepBookPoolReferral)
|
|
386
386
|
* @param {string} poolKey The key to identify the pool
|
|
387
387
|
* @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for
|
|
388
388
|
* @returns A function that takes a Transaction object
|
|
389
389
|
*/
|
|
390
|
-
poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) =>
|
|
390
|
+
poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
391
391
|
/**
|
|
392
392
|
* @description Check if a pool is a stable pool
|
|
393
393
|
* @param {string} poolKey The key to identify the pool
|
|
394
394
|
* @returns A function that takes a Transaction object
|
|
395
395
|
*/
|
|
396
|
-
stablePool: (poolKey: string) => (tx: Transaction) =>
|
|
396
|
+
stablePool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
397
397
|
/**
|
|
398
398
|
* @description Check if a pool is registered
|
|
399
399
|
* @param {string} poolKey The key to identify the pool
|
|
400
400
|
* @returns A function that takes a Transaction object
|
|
401
401
|
*/
|
|
402
|
-
registeredPool: (poolKey: string) => (tx: Transaction) =>
|
|
402
|
+
registeredPool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
403
403
|
/**
|
|
404
404
|
* @description Get the quote quantity out for a given base quantity using input token as fee
|
|
405
405
|
* @param {string} poolKey The key to identify the pool
|
|
406
406
|
* @param {number} baseQuantity Base quantity to convert
|
|
407
407
|
* @returns A function that takes a Transaction object
|
|
408
408
|
*/
|
|
409
|
-
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint) => (tx: Transaction) =>
|
|
409
|
+
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
410
410
|
/**
|
|
411
411
|
* @description Get the base quantity out for a given quote quantity using input token as fee
|
|
412
412
|
* @param {string} poolKey The key to identify the pool
|
|
413
413
|
* @param {number} quoteQuantity Quote quantity to convert
|
|
414
414
|
* @returns A function that takes a Transaction object
|
|
415
415
|
*/
|
|
416
|
-
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number | bigint) => (tx: Transaction) =>
|
|
416
|
+
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
417
417
|
/**
|
|
418
418
|
* @description Get the quantity out for a given base or quote quantity using input token as fee
|
|
419
419
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -421,7 +421,7 @@ declare class DeepBookContract {
|
|
|
421
421
|
* @param {number} quoteQuantity Quote quantity to convert
|
|
422
422
|
* @returns A function that takes a Transaction object
|
|
423
423
|
*/
|
|
424
|
-
getQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint, quoteQuantity: number | bigint) => (tx: Transaction) =>
|
|
424
|
+
getQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
425
425
|
/**
|
|
426
426
|
* @description Get the base quantity needed to receive a target quote quantity
|
|
427
427
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -429,7 +429,7 @@ declare class DeepBookContract {
|
|
|
429
429
|
* @param {boolean} payWithDeep Whether to pay fees with DEEP
|
|
430
430
|
* @returns A function that takes a Transaction object
|
|
431
431
|
*/
|
|
432
|
-
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) =>
|
|
432
|
+
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
433
433
|
/**
|
|
434
434
|
* @description Get the quote quantity needed to receive a target base quantity
|
|
435
435
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -437,14 +437,14 @@ declare class DeepBookContract {
|
|
|
437
437
|
* @param {boolean} payWithDeep Whether to pay fees with DEEP
|
|
438
438
|
* @returns A function that takes a Transaction object
|
|
439
439
|
*/
|
|
440
|
-
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) =>
|
|
440
|
+
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
441
441
|
/**
|
|
442
442
|
* @description Get account order details for a balance manager
|
|
443
443
|
* @param {string} poolKey The key to identify the pool
|
|
444
444
|
* @param {string} managerKey Key of the balance manager
|
|
445
445
|
* @returns A function that takes a Transaction object
|
|
446
446
|
*/
|
|
447
|
-
getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) =>
|
|
447
|
+
getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
448
448
|
/**
|
|
449
449
|
* @description Get the DEEP required for an order
|
|
450
450
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -452,51 +452,51 @@ declare class DeepBookContract {
|
|
|
452
452
|
* @param {number} price Price
|
|
453
453
|
* @returns A function that takes a Transaction object
|
|
454
454
|
*/
|
|
455
|
-
getOrderDeepRequired: (poolKey: string, baseQuantity: number | bigint, price: number | bigint) => (tx: Transaction) =>
|
|
455
|
+
getOrderDeepRequired: (poolKey: string, baseQuantity: number | bigint, price: number | bigint) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
456
456
|
/**
|
|
457
457
|
* @description Check if account exists for a balance manager
|
|
458
458
|
* @param {string} poolKey The key to identify the pool
|
|
459
459
|
* @param {string} managerKey Key of the balance manager
|
|
460
460
|
* @returns A function that takes a Transaction object
|
|
461
461
|
*/
|
|
462
|
-
accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) =>
|
|
462
|
+
accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
463
463
|
/**
|
|
464
464
|
* @description Get the next epoch trade parameters for a pool
|
|
465
465
|
* @param {string} poolKey The key to identify the pool
|
|
466
466
|
* @returns A function that takes a Transaction object
|
|
467
467
|
*/
|
|
468
|
-
poolTradeParamsNext: (poolKey: string) => (tx: Transaction) =>
|
|
468
|
+
poolTradeParamsNext: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
469
469
|
/**
|
|
470
470
|
* @description Get the quorum for a pool
|
|
471
471
|
* @param {string} poolKey The key to identify the pool
|
|
472
472
|
* @returns A function that takes a Transaction object
|
|
473
473
|
*/
|
|
474
|
-
quorum: (poolKey: string) => (tx: Transaction) =>
|
|
474
|
+
quorum: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
475
475
|
/**
|
|
476
476
|
* @description Get the pool ID
|
|
477
477
|
* @param {string} poolKey The key to identify the pool
|
|
478
478
|
* @returns A function that takes a Transaction object
|
|
479
479
|
*/
|
|
480
|
-
poolId: (poolKey: string) => (tx: Transaction) =>
|
|
480
|
+
poolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
481
481
|
/**
|
|
482
482
|
* @description Check if a limit order can be placed
|
|
483
483
|
* @param {CanPlaceLimitOrderParams} params Parameters for checking limit order validity
|
|
484
484
|
* @returns A function that takes a Transaction object
|
|
485
485
|
*/
|
|
486
|
-
canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) =>
|
|
486
|
+
canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
487
487
|
/**
|
|
488
488
|
* @description Check if a market order can be placed
|
|
489
489
|
* @param {CanPlaceMarketOrderParams} params Parameters for checking market order validity
|
|
490
490
|
* @returns A function that takes a Transaction object
|
|
491
491
|
*/
|
|
492
|
-
canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) =>
|
|
492
|
+
canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
493
493
|
/**
|
|
494
494
|
* @description Check if market order params are valid
|
|
495
495
|
* @param {string} poolKey The key to identify the pool
|
|
496
496
|
* @param {number} quantity Quantity
|
|
497
497
|
* @returns A function that takes a Transaction object
|
|
498
498
|
*/
|
|
499
|
-
checkMarketOrderParams: (poolKey: string, quantity: number | bigint) => (tx: Transaction) =>
|
|
499
|
+
checkMarketOrderParams: (poolKey: string, quantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
500
500
|
/**
|
|
501
501
|
* @description Check if limit order params are valid
|
|
502
502
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -505,7 +505,7 @@ declare class DeepBookContract {
|
|
|
505
505
|
* @param {number} expireTimestamp Expiration timestamp
|
|
506
506
|
* @returns A function that takes a Transaction object
|
|
507
507
|
*/
|
|
508
|
-
checkLimitOrderParams: (poolKey: string, price: number | bigint, quantity: number | bigint, expireTimestamp: number) => (tx: Transaction) =>
|
|
508
|
+
checkLimitOrderParams: (poolKey: string, price: number | bigint, quantity: number | bigint, expireTimestamp: number) => (tx: Transaction) => _mysten_sui_transactions14.TransactionResult;
|
|
509
509
|
}
|
|
510
510
|
//#endregion
|
|
511
511
|
export { DeepBookContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreatePoolAdminParams, SetEwmaParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions33 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/deepbookAdmin.d.ts
|
|
@@ -104,7 +104,7 @@ declare class DeepBookAdminContract {
|
|
|
104
104
|
* @description Deauthorize the MarginApp by removing its authorization key
|
|
105
105
|
* @returns A function that takes a Transaction object and returns a bool
|
|
106
106
|
*/
|
|
107
|
-
deauthorizeMarginApp: () => (tx: Transaction) =>
|
|
107
|
+
deauthorizeMarginApp: () => (tx: Transaction) => _mysten_sui_transactions33.TransactionResult;
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
110
|
export { DeepBookAdminContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoolConfigParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions34 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginAdmin.d.ts
|
|
@@ -17,7 +17,7 @@ declare class MarginAdminContract {
|
|
|
17
17
|
* @description Mint a maintainer cap
|
|
18
18
|
* @returns A function that takes a Transaction object
|
|
19
19
|
*/
|
|
20
|
-
mintMaintainerCap: () => (tx: Transaction) =>
|
|
20
|
+
mintMaintainerCap: () => (tx: Transaction) => _mysten_sui_transactions34.TransactionResult;
|
|
21
21
|
/**
|
|
22
22
|
* @description Revoke a maintainer cap
|
|
23
23
|
* @returns A function that takes a Transaction object
|
|
@@ -80,7 +80,7 @@ declare class MarginAdminContract {
|
|
|
80
80
|
* @param {PoolConfigParams} poolConfigParams The parameters for the pool config
|
|
81
81
|
* @returns A function that takes a Transaction object
|
|
82
82
|
*/
|
|
83
|
-
newPoolConfig: (poolKey: string, poolConfigParams: PoolConfigParams) => (tx: Transaction) =>
|
|
83
|
+
newPoolConfig: (poolKey: string, poolConfigParams: PoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions34.TransactionResult;
|
|
84
84
|
/**
|
|
85
85
|
* @description Create a new pool config with leverage
|
|
86
86
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -95,7 +95,7 @@ declare class MarginAdminContract {
|
|
|
95
95
|
* @param {number} maxEwmaDifferenceBps The maximum EWMA difference in basis points
|
|
96
96
|
* @returns A function that takes a Transaction object
|
|
97
97
|
*/
|
|
98
|
-
newCoinTypeData: (coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number) => (tx: Transaction) =>
|
|
98
|
+
newCoinTypeData: (coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number) => (tx: Transaction) => _mysten_sui_transactions34.TransactionResult;
|
|
99
99
|
/**
|
|
100
100
|
* @description Create a new Pyth config
|
|
101
101
|
* @param {Array<{coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number}>} coinSetups The coins with their oracle config to be added to the Pyth config
|
|
@@ -106,12 +106,12 @@ declare class MarginAdminContract {
|
|
|
106
106
|
coinKey: string;
|
|
107
107
|
maxConfBps: number;
|
|
108
108
|
maxEwmaDifferenceBps: number;
|
|
109
|
-
}>, maxAgeSeconds: number) => (tx: Transaction) =>
|
|
109
|
+
}>, maxAgeSeconds: number) => (tx: Transaction) => _mysten_sui_transactions34.TransactionResult;
|
|
110
110
|
/**
|
|
111
111
|
* @description Mint a pause cap
|
|
112
112
|
* @returns A function that takes a Transaction object
|
|
113
113
|
*/
|
|
114
|
-
mintPauseCap: () => (tx: Transaction) =>
|
|
114
|
+
mintPauseCap: () => (tx: Transaction) => _mysten_sui_transactions34.TransactionResult;
|
|
115
115
|
/**
|
|
116
116
|
* @description Revoke a pause cap
|
|
117
117
|
* @param {string} pauseCapId The ID of the pause cap to revoke
|
|
@@ -131,7 +131,7 @@ declare class MarginAdminContract {
|
|
|
131
131
|
* @param {string} coinKey The key to identify the margin pool
|
|
132
132
|
* @returns A function that takes a Transaction object and returns a Coin<Asset>
|
|
133
133
|
*/
|
|
134
|
-
adminWithdrawDefaultReferralFees: (coinKey: string) => (tx: Transaction) =>
|
|
134
|
+
adminWithdrawDefaultReferralFees: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions34.TransactionResult;
|
|
135
135
|
}
|
|
136
136
|
//#endregion
|
|
137
137
|
export { MarginAdminContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InterestConfigParams, MarginPoolConfigParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions0 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginMaintainer.d.ts
|
|
@@ -27,27 +27,27 @@ declare class MarginMaintainerContract {
|
|
|
27
27
|
* @param {InterestConfigParams} interestConfig The configuration for the interest
|
|
28
28
|
* @returns A function that takes a Transaction object
|
|
29
29
|
*/
|
|
30
|
-
newProtocolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams, interestConfig: InterestConfigParams) => (tx: Transaction) =>
|
|
30
|
+
newProtocolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams, interestConfig: InterestConfigParams) => (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
31
31
|
/**
|
|
32
32
|
* @description Create a new margin pool config
|
|
33
33
|
* @param {string} coinKey The key to identify the coin
|
|
34
34
|
* @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool
|
|
35
35
|
* @returns A function that takes a Transaction object
|
|
36
36
|
*/
|
|
37
|
-
newMarginPoolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams) => (tx: Transaction) =>
|
|
37
|
+
newMarginPoolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
38
38
|
/**
|
|
39
39
|
* @description Create a new margin pool config with rate limit
|
|
40
40
|
* @param {string} coinKey The key to identify the coin
|
|
41
41
|
* @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool with rate limit
|
|
42
42
|
* @returns A function that takes a Transaction object
|
|
43
43
|
*/
|
|
44
|
-
newMarginPoolConfigWithRateLimit: (coinKey: string, marginPoolConfig: Required<Pick<MarginPoolConfigParams, "rateLimitCapacity" | "rateLimitRefillRatePerMs" | "rateLimitEnabled">> & MarginPoolConfigParams) => (tx: Transaction) =>
|
|
44
|
+
newMarginPoolConfigWithRateLimit: (coinKey: string, marginPoolConfig: Required<Pick<MarginPoolConfigParams, "rateLimitCapacity" | "rateLimitRefillRatePerMs" | "rateLimitEnabled">> & MarginPoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
45
45
|
/**
|
|
46
46
|
* @description Create a new interest config
|
|
47
47
|
* @param {InterestConfigParams} interestConfig The configuration for the interest
|
|
48
48
|
* @returns A function that takes a Transaction object
|
|
49
49
|
*/
|
|
50
|
-
newInterestConfig: (interestConfig: InterestConfigParams) => (tx: Transaction) =>
|
|
50
|
+
newInterestConfig: (interestConfig: InterestConfigParams) => (tx: Transaction) => _mysten_sui_transactions0.TransactionResult;
|
|
51
51
|
/**
|
|
52
52
|
* @description Enable a deepbook pool for loan
|
|
53
53
|
* @param {string} deepbookPoolKey The key to identify the deepbook pool
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginMaintainer.d.mts","names":[],"sources":["../../src/transactions/marginMaintainer.ts"],"mappings":";;;;;;;;;cAiBa,wBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EA8CA;;;;;;EAxBpB,gBAAA,GAAoB,OAAA,UAAiB,UAAA,EAAY,mBAAA,MAAyB,EAAA,EAAI,WAAA;EA+E1E;;;;;;;EA1DJ,iBAAA,GAEE,OAAA,UACA,gBAAA,EAAkB,sBAAA,EAClB,cAAA,EAAgB,oBAAA,MAEhB,EAAA,EAAI,WAAA,KAAW,
|
|
1
|
+
{"version":3,"file":"marginMaintainer.d.mts","names":[],"sources":["../../src/transactions/marginMaintainer.ts"],"mappings":";;;;;;;;;cAiBa,wBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EA8CA;;;;;;EAxBpB,gBAAA,GAAoB,OAAA,UAAiB,UAAA,EAAY,mBAAA,MAAyB,EAAA,EAAI,WAAA;EA+E1E;;;;;;;EA1DJ,iBAAA,GAEE,OAAA,UACA,gBAAA,EAAkB,sBAAA,EAClB,cAAA,EAAgB,oBAAA,MAEhB,EAAA,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;EAwF6D;;;;;;EA9D9E,mBAAA,GACE,OAAA,UAAiB,gBAAA,EAAkB,sBAAA,MAA4B,EAAA,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;EAyI1E;;;;;;EArHN,gCAAA,GAEE,OAAA,UACA,gBAAA,EAAkB,QAAA,CACjB,IAAA,CACC,sBAAA,4EAID,sBAAA,MAED,EAAA,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;;;;;;EA8BjB,iBAAA,GAAqB,cAAA,EAAgB,oBAAA,MAA0B,EAAA,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;EAnHzC;;;;;;;EAuIrC,yBAAA,GACE,eAAA,UAAyB,OAAA,UAAiB,aAAA,EAAe,yBAAA,MACzD,EAAA,EAAI,WAAA;EAhHJ;;;;;;;EAuIF,0BAAA,GACE,eAAA,UAAyB,OAAA,UAAiB,aAAA,EAAe,yBAAA,MACzD,EAAA,EAAI,WAAA;EA5G+D;;;;;;;EAmIrE,oBAAA,GAEE,OAAA,UACA,aAAA,EAAe,yBAAA,EACf,cAAA,EAAgB,oBAAA,MAEhB,EAAA,EAAI,WAAA;EA5GH;;;;;;;EAmIH,sBAAA,GAEE,OAAA,UACA,aAAA,EAAe,yBAAA,EACf,gBAAA,EAAkB,sBAAA,MAElB,EAAA,EAAI,WAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DepositDuringInitParams, DepositParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions40 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginManager.d.ts
|
|
@@ -73,49 +73,49 @@ declare class MarginManagerContract {
|
|
|
73
73
|
* @param {number} amount The amount to withdraw
|
|
74
74
|
* @returns A function that takes a Transaction object
|
|
75
75
|
*/
|
|
76
|
-
withdrawBase: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
76
|
+
withdrawBase: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
77
77
|
/**
|
|
78
78
|
* @description Withdraw quote from a margin manager
|
|
79
79
|
* @param {string} managerKey The key to identify the manager
|
|
80
80
|
* @param {number} amount The amount to withdraw
|
|
81
81
|
* @returns A function that takes a Transaction object
|
|
82
82
|
*/
|
|
83
|
-
withdrawQuote: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
83
|
+
withdrawQuote: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
84
84
|
/**
|
|
85
85
|
* @description Withdraw deep from a margin manager
|
|
86
86
|
* @param {string} managerKey The key to identify the manager
|
|
87
87
|
* @param {number} amount The amount to withdraw
|
|
88
88
|
* @returns A function that takes a Transaction object
|
|
89
89
|
*/
|
|
90
|
-
withdrawDeep: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
90
|
+
withdrawDeep: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
91
91
|
/**
|
|
92
92
|
* @description Borrow base from a margin manager
|
|
93
93
|
* @param {string} managerKey The key to identify the manager
|
|
94
94
|
* @param {number} amount The amount to borrow
|
|
95
95
|
* @returns A function that takes a Transaction object
|
|
96
96
|
*/
|
|
97
|
-
borrowBase: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
97
|
+
borrowBase: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
98
98
|
/**
|
|
99
99
|
* @description Borrow quote from a margin manager
|
|
100
100
|
* @param {string} managerKey The key to identify the manager
|
|
101
101
|
* @param {number} amount The amount to borrow
|
|
102
102
|
* @returns A function that takes a Transaction object
|
|
103
103
|
*/
|
|
104
|
-
borrowQuote: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
104
|
+
borrowQuote: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
105
105
|
/**
|
|
106
106
|
* @description Repay base from a margin manager
|
|
107
107
|
* @param {string} managerKey The key to identify the manager
|
|
108
108
|
* @param {number} amount The amount to repay
|
|
109
109
|
* @returns A function that takes a Transaction object
|
|
110
110
|
*/
|
|
111
|
-
repayBase: (managerKey: string, amount?: number) => (tx: Transaction) =>
|
|
111
|
+
repayBase: (managerKey: string, amount?: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
112
112
|
/**
|
|
113
113
|
* @description Repay quote from a margin manager
|
|
114
114
|
* @param {string} managerKey The key to identify the manager
|
|
115
115
|
* @param {number} amount The amount to repay
|
|
116
116
|
* @returns A function that takes a Transaction object
|
|
117
117
|
*/
|
|
118
|
-
repayQuote: (managerKey: string, amount?: number) => (tx: Transaction) =>
|
|
118
|
+
repayQuote: (managerKey: string, amount?: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
119
119
|
/**
|
|
120
120
|
* @description Liquidate a margin manager
|
|
121
121
|
* @param {string} managerAddress The address of the manager to liquidate
|
|
@@ -124,7 +124,7 @@ declare class MarginManagerContract {
|
|
|
124
124
|
* @param {TransactionArgument} repayCoin The coin to repay
|
|
125
125
|
* @returns A function that takes a Transaction object
|
|
126
126
|
*/
|
|
127
|
-
liquidate: (managerAddress: string, poolKey: string, debtIsBase: boolean, repayCoin: TransactionArgument) => (tx: Transaction) =>
|
|
127
|
+
liquidate: (managerAddress: string, poolKey: string, debtIsBase: boolean, repayCoin: TransactionArgument) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
128
128
|
/**
|
|
129
129
|
* @description Set the referral for a margin manager (DeepBookPoolReferral)
|
|
130
130
|
* @param {string} managerKey The key to identify the margin manager
|
|
@@ -145,63 +145,63 @@ declare class MarginManagerContract {
|
|
|
145
145
|
* @param {string} marginManagerId The ID of the margin manager
|
|
146
146
|
* @returns A function that takes a Transaction object
|
|
147
147
|
*/
|
|
148
|
-
ownerByPoolKey: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
148
|
+
ownerByPoolKey: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
149
149
|
/**
|
|
150
150
|
* @description Get the DeepBook pool ID associated with a margin manager
|
|
151
151
|
* @param {string} poolKey The key to identify the pool
|
|
152
152
|
* @param {string} marginManagerId The ID of the margin manager
|
|
153
153
|
* @returns A function that takes a Transaction object
|
|
154
154
|
*/
|
|
155
|
-
deepbookPool: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
155
|
+
deepbookPool: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
156
156
|
/**
|
|
157
157
|
* @description Get the margin pool ID (if any) associated with a margin manager
|
|
158
158
|
* @param {string} poolKey The key to identify the pool
|
|
159
159
|
* @param {string} marginManagerId The ID of the margin manager
|
|
160
160
|
* @returns A function that takes a Transaction object
|
|
161
161
|
*/
|
|
162
|
-
marginPoolId: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
162
|
+
marginPoolId: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
163
163
|
/**
|
|
164
164
|
* @description Get borrowed shares for both base and quote assets
|
|
165
165
|
* @param {string} poolKey The key to identify the pool
|
|
166
166
|
* @param {string} marginManagerId The ID of the margin manager
|
|
167
167
|
* @returns A function that takes a Transaction object
|
|
168
168
|
*/
|
|
169
|
-
borrowedShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
169
|
+
borrowedShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
170
170
|
/**
|
|
171
171
|
* @description Get borrowed base shares
|
|
172
172
|
* @param {string} poolKey The key to identify the pool
|
|
173
173
|
* @param {string} marginManagerId The ID of the margin manager
|
|
174
174
|
* @returns A function that takes a Transaction object
|
|
175
175
|
*/
|
|
176
|
-
borrowedBaseShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
176
|
+
borrowedBaseShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
177
177
|
/**
|
|
178
178
|
* @description Get borrowed quote shares
|
|
179
179
|
* @param {string} poolKey The key to identify the pool
|
|
180
180
|
* @param {string} marginManagerId The ID of the margin manager
|
|
181
181
|
* @returns A function that takes a Transaction object
|
|
182
182
|
*/
|
|
183
|
-
borrowedQuoteShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
183
|
+
borrowedQuoteShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
184
184
|
/**
|
|
185
185
|
* @description Check if margin manager has base asset debt
|
|
186
186
|
* @param {string} poolKey The key to identify the pool
|
|
187
187
|
* @param {string} marginManagerId The ID of the margin manager
|
|
188
188
|
* @returns A function that takes a Transaction object
|
|
189
189
|
*/
|
|
190
|
-
hasBaseDebt: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
190
|
+
hasBaseDebt: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
191
191
|
/**
|
|
192
192
|
* @description Get the balance manager ID for a margin manager
|
|
193
193
|
* @param {string} poolKey The key to identify the pool
|
|
194
194
|
* @param {string} marginManagerId The ID of the margin manager
|
|
195
195
|
* @returns A function that takes a Transaction object
|
|
196
196
|
*/
|
|
197
|
-
balanceManager: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
197
|
+
balanceManager: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
198
198
|
/**
|
|
199
199
|
* @description Calculate assets (base and quote) for a margin manager
|
|
200
200
|
* @param {string} poolKey The key to identify the pool
|
|
201
201
|
* @param {string} marginManagerId The ID of the margin manager
|
|
202
202
|
* @returns A function that takes a Transaction object
|
|
203
203
|
*/
|
|
204
|
-
calculateAssets: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
204
|
+
calculateAssets: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
205
205
|
/**
|
|
206
206
|
* @description Calculate debts (base and quote) for a margin manager
|
|
207
207
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -209,7 +209,7 @@ declare class MarginManagerContract {
|
|
|
209
209
|
* @param {string} marginManagerId The ID of the margin manager
|
|
210
210
|
* @returns A function that takes a Transaction object
|
|
211
211
|
*/
|
|
212
|
-
calculateDebts: (poolKey: string, coinKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
212
|
+
calculateDebts: (poolKey: string, coinKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
213
213
|
/**
|
|
214
214
|
* @description Get comprehensive state information for a margin manager
|
|
215
215
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -219,28 +219,28 @@ declare class MarginManagerContract {
|
|
|
219
219
|
* base_debt, quote_debt, base_pyth_price, base_pyth_decimals,
|
|
220
220
|
* quote_pyth_price, quote_pyth_decimals)
|
|
221
221
|
*/
|
|
222
|
-
managerState: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
222
|
+
managerState: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
223
223
|
/**
|
|
224
224
|
* @description Get the base asset balance of a margin manager
|
|
225
225
|
* @param {string} poolKey The key to identify the pool
|
|
226
226
|
* @param {string} marginManagerId The ID of the margin manager
|
|
227
227
|
* @returns A function that takes a Transaction object
|
|
228
228
|
*/
|
|
229
|
-
baseBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
229
|
+
baseBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
230
230
|
/**
|
|
231
231
|
* @description Get the quote asset balance of a margin manager
|
|
232
232
|
* @param {string} poolKey The key to identify the pool
|
|
233
233
|
* @param {string} marginManagerId The ID of the margin manager
|
|
234
234
|
* @returns A function that takes a Transaction object
|
|
235
235
|
*/
|
|
236
|
-
quoteBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
236
|
+
quoteBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
237
237
|
/**
|
|
238
238
|
* @description Get the DEEP token balance of a margin manager
|
|
239
239
|
* @param {string} poolKey The key to identify the pool
|
|
240
240
|
* @param {string} marginManagerId The ID of the margin manager
|
|
241
241
|
* @returns A function that takes a Transaction object
|
|
242
242
|
*/
|
|
243
|
-
deepBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
243
|
+
deepBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
244
244
|
}
|
|
245
245
|
//#endregion
|
|
246
246
|
export { MarginManagerContract };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@mysten/deepbook-v3",
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "Sui Deepbook SDK",
|
|
5
|
-
"version": "1.3.
|
|
5
|
+
"version": "1.3.5",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.mjs",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@noble/hashes": "^2.0.1",
|
|
34
|
-
"axios": "^1.
|
|
34
|
+
"axios": "^1.16.0",
|
|
35
35
|
"axios-retry": "^4.5.0",
|
|
36
|
-
"@mysten/bcs": "^2.0.
|
|
36
|
+
"@mysten/bcs": "^2.0.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@iarna/toml": "^2.2.5",
|
|
@@ -45,12 +45,10 @@
|
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vite": "^8.0.5",
|
|
47
47
|
"vitest": "^4.0.17",
|
|
48
|
-
"wait-on": "^9.0.3"
|
|
49
|
-
"@mysten/codegen": "^0.10.0",
|
|
50
|
-
"@mysten/sui": "^2.16.0"
|
|
48
|
+
"wait-on": "^9.0.3"
|
|
51
49
|
},
|
|
52
50
|
"peerDependencies": {
|
|
53
|
-
"@mysten/sui": "^2.16.
|
|
51
|
+
"@mysten/sui": "^2.16.1"
|
|
54
52
|
},
|
|
55
53
|
"scripts": {
|
|
56
54
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
@@ -57,7 +57,8 @@ export function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (structTag.module === 'option' && structTag.name === 'Option') {
|
|
60
|
-
const
|
|
60
|
+
const inner = structTag.typeParams[0];
|
|
61
|
+
const type = inner ? getPureBcsSchema(inner) : null;
|
|
61
62
|
return type ? bcs.option(type) : null;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -89,7 +90,7 @@ export function normalizeMoveArguments(
|
|
|
89
90
|
const normalizedArgs: TransactionArgument[] = [];
|
|
90
91
|
|
|
91
92
|
let index = 0;
|
|
92
|
-
for (const
|
|
93
|
+
for (const argType of argTypes) {
|
|
93
94
|
if (argType === '0x2::clock::Clock') {
|
|
94
95
|
normalizedArgs.push((tx) => tx.object.clock());
|
|
95
96
|
continue;
|
|
@@ -137,8 +138,7 @@ export function normalizeMoveArguments(
|
|
|
137
138
|
continue;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
const
|
|
141
|
-
const bcsType = type === null ? null : getPureBcsSchema(type);
|
|
141
|
+
const bcsType = argType === null ? null : getPureBcsSchema(argType);
|
|
142
142
|
|
|
143
143
|
if (bcsType) {
|
|
144
144
|
const bytes = bcsType.serialize(arg as never);
|
|
@@ -151,7 +151,7 @@ export function normalizeMoveArguments(
|
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
throw new Error(`Invalid argument ${stringify(arg)} for type ${
|
|
154
|
+
throw new Error(`Invalid argument ${stringify(arg)} for type ${argType}`);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
return normalizedArgs;
|
|
@@ -174,6 +174,10 @@ export class MoveStruct<
|
|
|
174
174
|
objectIds: [objectId],
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
+
if (!res) {
|
|
178
|
+
throw new Error(`No object found for id ${objectId}`);
|
|
179
|
+
}
|
|
180
|
+
|
|
177
181
|
return res;
|
|
178
182
|
}
|
|
179
183
|
|