@mysten/deepbook-v3 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/client.d.mts.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +0 -1
- package/dist/contracts/deepbook/account.d.mts.map +1 -1
- package/dist/contracts/deepbook/balances.d.mts +0 -1
- package/dist/contracts/deepbook/balances.d.mts.map +1 -1
- package/dist/contracts/deepbook/deep_price.d.mts +0 -1
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/deps/sui/vec_set.d.mts +0 -1
- package/dist/contracts/deepbook/deps/sui/vec_set.d.mts.map +1 -1
- package/dist/contracts/deepbook/order.d.mts +0 -1
- package/dist/contracts/deepbook/order.d.mts.map +1 -1
- package/dist/contracts/utils/index.d.mts.map +1 -1
- package/dist/contracts/utils/index.mjs.map +1 -1
- package/dist/pyth/PriceServiceConnection.d.mts.map +1 -1
- package/dist/pyth/pyth.d.mts.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 +42 -20
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbook.mjs +38 -0
- package/dist/transactions/deepbook.mjs.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts +2 -2
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/flashLoans.d.mts +0 -1
- package/dist/transactions/flashLoans.d.mts.map +1 -1
- package/dist/transactions/governance.d.mts +0 -1
- package/dist/transactions/governance.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +7 -8
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts.map +1 -1
- 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/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginPool.d.mts.map +1 -1
- package/dist/transactions/marginRegistry.d.mts.map +1 -1
- package/dist/transactions/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.mts.map +1 -1
- package/dist/utils/config.d.mts.map +1 -1
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +1 -1
- package/dist/utils/constants.mjs.map +1 -1
- package/dist/utils/errors.d.mts.map +1 -1
- package/dist/utils/validation.d.mts.map +1 -1
- package/package.json +6 -6
- package/src/contracts/utils/index.ts +4 -4
- package/src/transactions/deepbook.ts +64 -0
- package/src/utils/constants.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 993aa1f: Add `cancelLiveOrder` and `cancelLiveOrders` transaction builders that skip order ids not
|
|
8
|
+
currently in the balance manager's open orders (already filled, cancelled, expired-and-swept, or
|
|
9
|
+
not owned by this BM) instead of aborting. Also updates mainnet `DEEPBOOK_PACKAGE_ID` to
|
|
10
|
+
`0xf48222c4e057fa468baf136bff8e12504209d43850c5778f76159292a96f621e`.
|
|
11
|
+
|
|
12
|
+
## 1.2.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 6fd995d: Use type imports in generated code for verbatimModuleSyntax compatibility
|
|
17
|
+
|
|
3
18
|
## 1.2.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],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from "@mysten/sui/bcs";
|
|
|
3
3
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/account.d.ts
|
|
6
|
-
|
|
7
6
|
declare const Account: MoveStruct<{
|
|
8
7
|
epoch: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
9
8
|
open_orders: MoveStruct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"
|
|
1
|
+
{"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"mappings":";;;;;cAYa,OAAA,EAAO,UAAA;SAelB,gBAAA,CAAA,OAAA"}
|
|
@@ -2,7 +2,6 @@ import { MoveStruct } from "../utils/index.mjs";
|
|
|
2
2
|
import * as _mysten_sui_bcs16 from "@mysten/sui/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/contracts/deepbook/balances.d.ts
|
|
5
|
-
|
|
6
5
|
declare const Balances: MoveStruct<{
|
|
7
6
|
base: _mysten_sui_bcs16.BcsType<string, string | number | bigint, "u64">;
|
|
8
7
|
quote: _mysten_sui_bcs16.BcsType<string, string | number | bigint, "u64">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balances.d.mts","names":[],"sources":["../../../src/contracts/deepbook/balances.ts"],"
|
|
1
|
+
{"version":3,"file":"balances.d.mts","names":[],"sources":["../../../src/contracts/deepbook/balances.ts"],"mappings":";;;;cAYa,QAAA,EAAQ,UAAA;QAOnB,iBAAA,CAAA,OAAA"}
|
|
@@ -3,7 +3,6 @@ import * as _mysten_sui_bcs19 from "@mysten/sui/bcs";
|
|
|
3
3
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/deep_price.d.ts
|
|
6
|
-
|
|
7
6
|
declare const OrderDeepPrice: MoveStruct<{
|
|
8
7
|
asset_is_base: _mysten_sui_bcs19.BcsType<boolean, boolean, "bool">;
|
|
9
8
|
deep_per_asset: _mysten_sui_bcs19.BcsType<string, string | number | bigint, "u64">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep_price.d.mts","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"
|
|
1
|
+
{"version":3,"file":"deep_price.d.mts","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"mappings":";;;;;cAuCa,cAAA,EAAc,UAAA;iBAMzB,iBAAA,CAAA,OAAA"}
|
|
@@ -3,7 +3,6 @@ import { BcsType } from "@mysten/sui/bcs";
|
|
|
3
3
|
import * as _mysten_bcs0 from "@mysten/bcs";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/deps/sui/vec_set.d.ts
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
9
8
|
* duplicate keys. All operations are O(N) in the size of the set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vec_set.d.mts","names":[],"sources":["../../../../../src/contracts/deepbook/deps/sui/vec_set.ts"],"
|
|
1
|
+
{"version":3,"file":"vec_set.d.mts","names":[],"sources":["../../../../../src/contracts/deepbook/deps/sui/vec_set.ts"],"mappings":";;;;;AAcA;;;;;;;;AAAA,iBAAgB,MAAA,WAAiB,OAAA,MAAA,CAAA,GAAiB,cAAA,GAAiB,CAAA,IAAE,UAAA"}
|
|
@@ -3,7 +3,6 @@ import * as _mysten_sui_bcs32 from "@mysten/sui/bcs";
|
|
|
3
3
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/order.d.ts
|
|
6
|
-
|
|
7
6
|
declare const Order: MoveStruct<{
|
|
8
7
|
balance_manager_id: _mysten_sui_bcs32.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
9
8
|
order_id: _mysten_sui_bcs32.BcsType<string, string | number | bigint, "u128">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.d.mts","names":[],"sources":["../../../src/contracts/deepbook/order.ts"],"
|
|
1
|
+
{"version":3,"file":"order.d.mts","names":[],"sources":["../../../src/contracts/deepbook/order.ts"],"mappings":";;;;;cAca,KAAA,EAAK,UAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/contracts/utils/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/contracts/utils/index.ts"],"mappings":";;;;;UAkBiB,UAAA,iBACA,IAAA,CAAK,cAAA,CAAe,aAAA,2BAC3B,cAAA,CAAe,gBAAA,CAAiB,OAAA;EACzC,MAAA,EAAQ,iBAAA;AAAA;AAAA,UAGQ,cAAA,iBACA,IAAA,CAAK,cAAA,CAAe,aAAA,2BAC3B,cAAA,CAAe,iBAAA,CAAkB,OAAA;EAC1C,MAAA,EAAQ,iBAAA;AAAA;AAAA,cAwII,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;EAWZ,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\
|
|
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 interface GetOptions<\n\tInclude extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {},\n> extends SuiClientTypes.GetObjectOptions<Include> {\n\tclient: ClientWithCoreApi;\n}\n\nexport interface GetManyOptions<\n\tInclude extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {},\n> extends SuiClientTypes.GetObjectsOptions<Include> {\n\tclient: ClientWithCoreApi;\n}\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 type = getPureBcsSchema(structTag.typeParams[0]);\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 [i, argType] of argTypes.entries()) {\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 type = argTypes[i];\n\t\tconst bcsType = type === null ? null : getPureBcsSchema(type);\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} else if (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 ${type}`);\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\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;AAqJxD,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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PriceServiceConnection.d.mts","names":[],"sources":["../../src/pyth/PriceServiceConnection.ts"],"
|
|
1
|
+
{"version":3,"file":"PriceServiceConnection.d.mts","names":[],"sources":["../../src/pyth/PriceServiceConnection.ts"],"mappings":";KAMY,SAAA;AAAA,KAKA,4BAAA;EACX,OAAA;EACA,WAAA;AAAA;AAAA,cAEY,sBAAA;EAAA,QACJ,UAAA;EADI;;;;;;cAQA,QAAA,UAAkB,MAAA,GAAS,4BAAA;EAgBY;;;;;;EAA7C,aAAA,CAAc,QAAA,EAAU,SAAA,KAAc,OAAA;AAAA"}
|
package/dist/pyth/pyth.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pyth.d.mts","names":[],"sources":["../../src/pyth/pyth.ts"],"
|
|
1
|
+
{"version":3,"file":"pyth.d.mts","names":[],"sources":["../../src/pyth/pyth.ts"],"mappings":";;;;;KAgBY,QAAA;AAAA,cACC,yBAAA,SAAkC,sBAAA;EAD3B;;;;AACpB;;EAOO,uBAAA,CAAwB,QAAA,EAAU,SAAA,KAAc,OAAA,CAAQ,UAAA;AAAA;AAAA,cAKlD,aAAA;EAAA;EAMZ,QAAA,EAAU,iBAAA;EACV,WAAA,EAAa,QAAA;EACb,eAAA,EAAiB,QAAA;cAEL,QAAA,EAAU,iBAAA,EAAmB,WAAA,EAAa,QAAA,EAAU,eAAA,EAAiB,QAAA;EAf3E;;;;;;;EA2BA,UAAA,CAAW,IAAA,EAAM,UAAA,IAAc,EAAA,EAAI,WAAA,GAAW,OAAA;;;;EAfvC;;;;;;;EAkCP,gBAAA,CACL,EAAA,EAAI,WAAA,EACJ,OAAA,EAAS,UAAA,IACT,OAAA,EAAS,SAAA,KACP,OAAA,CAAQ,QAAA;EAHN;;;;EA2DL,oBAAA,CAAqB,MAAA,EAAQ,SAAA,GAAY,OAAA,CAAQ,QAAA;EAApB;;;;EAiD7B,iBAAA,CAAA,GAAqB,OAAA;IAAU,EAAA,EAAI,QAAA;IAAU,SAAA,EAAW,QAAA;EAAA;EA0E5B;;;EA3B5B,oBAAA,CAAA,GAAwB,OAAA,CAAQ,QAAA;EAyEL;;;EA9C3B,gBAAA,CAAA,GAAoB,OAAA,CAAQ,QAAA;EAzN5B;;;EAuQA,gBAAA,CAAA,GAAoB,OAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions0 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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balanceManager.d.mts","names":[],"sources":["../../src/transactions/balanceManager.ts"],"
|
|
1
|
+
{"version":3,"file":"balanceManager.d.mts","names":[],"sources":["../../src/transactions/balanceManager.ts"],"mappings":";;;;;;;;cAWa,sBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EAwBsD;;;;EAhB1E,4BAAA,SAAsC,EAAA,EAAI,WAAA;EA4FwB;;;;EA5ElE,6BAAA,GAAiC,YAAA,cAA0B,EAAA,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;EA2HZ;;;;;EA/G9D,mBAAA,GAAuB,OAAA,EAAS,mBAAA,MAAyB,EAAA,EAAI,WAAA;EAsJJ;;;;;;;EAvIzD,kBAAA,GACE,UAAA,UAAoB,OAAA,UAAiB,eAAA,cAA6B,EAAA,EAAI,WAAA;EA2OvB;;;;;;;;EAlNjD,mBAAA,GACE,UAAA,UAAoB,OAAA,UAAiB,gBAAA,UAA0B,SAAA,cAC/D,EAAA,EAAI,WAAA;EAyRsE;;;;;;;EArQ5E,sBAAA,GACE,UAAA,UAAoB,OAAA,UAAiB,SAAA,cAAuB,EAAA,EAAI,WAAA;EApGtD;;;;;;EAsHZ,mBAAA,GAAuB,UAAA,UAAoB,OAAA,cAAqB,EAAA,EAAI,WAAA;EA9FT;;;;;EA6G3D,aAAA,GAAiB,UAAA,cAAwB,EAAA,EAAI,WAAA,KAAW,yBAAA,CAA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A,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;EAtC9D;;;;;;EAmDT,2BAAA,GAA+B,UAAA,UAAoB,OAAA,cAAqB,EAAA,EAAI,WAAA,KAAW,yBAAA,CAAA,iBAAA;EAzBvF;;;;;;EAwCA,cAAA,GAAkB,UAAA,UAAoB,UAAA,cAAwB,EAAA,EAAI,WAAA;AAAA"}
|
|
@@ -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_transactions10 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/deepbook.d.ts
|
|
@@ -50,6 +50,28 @@ declare class DeepBookContract {
|
|
|
50
50
|
* @returns A function that takes a Transaction object
|
|
51
51
|
*/
|
|
52
52
|
cancelOrders: (poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => void;
|
|
53
|
+
/**
|
|
54
|
+
* @description Cancel an existing order, no-op if the order is not currently in the
|
|
55
|
+
* balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,
|
|
56
|
+
* or not owned by this balance manager). Unlike `cancelOrder`, this will not abort
|
|
57
|
+
* on unknown order ids.
|
|
58
|
+
* @param {string} poolKey The key to identify the pool
|
|
59
|
+
* @param {string} balanceManagerKey The key to identify the BalanceManager
|
|
60
|
+
* @param {string} orderId Order ID to cancel
|
|
61
|
+
* @returns A function that takes a Transaction object
|
|
62
|
+
*/
|
|
63
|
+
cancelLiveOrder: (poolKey: string, balanceManagerKey: string, orderId: string) => (tx: Transaction) => void;
|
|
64
|
+
/**
|
|
65
|
+
* @description Cancel multiple orders, skipping any order_id that is not currently in
|
|
66
|
+
* the balance manager's open orders (e.g. already filled, cancelled, expired-and-swept,
|
|
67
|
+
* or not owned by this balance manager). Duplicate ids in the input vector are handled
|
|
68
|
+
* gracefully. Unlike `cancelOrders`, this will not abort on unknown order ids.
|
|
69
|
+
* @param {string} poolKey The key to identify the pool
|
|
70
|
+
* @param {string} balanceManagerKey The key to identify the BalanceManager
|
|
71
|
+
* @param {string[]} orderIds Array of order IDs to cancel
|
|
72
|
+
* @returns A function that takes a Transaction object
|
|
73
|
+
*/
|
|
74
|
+
cancelLiveOrders: (poolKey: string, balanceManagerKey: string, orderIds: string[]) => (tx: Transaction) => void;
|
|
53
75
|
/**
|
|
54
76
|
* @description Cancel all open orders for a balance manager
|
|
55
77
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -358,40 +380,40 @@ declare class DeepBookContract {
|
|
|
358
380
|
* @param {string} referral The referral (DeepBookPoolReferral) to get the balances for
|
|
359
381
|
* @returns A function that takes a Transaction object
|
|
360
382
|
*/
|
|
361
|
-
getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) =>
|
|
383
|
+
getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
362
384
|
/**
|
|
363
385
|
* @description Get the multiplier for a referral (DeepBookPoolReferral)
|
|
364
386
|
* @param {string} poolKey The key to identify the pool
|
|
365
387
|
* @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for
|
|
366
388
|
* @returns A function that takes a Transaction object
|
|
367
389
|
*/
|
|
368
|
-
poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) =>
|
|
390
|
+
poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
369
391
|
/**
|
|
370
392
|
* @description Check if a pool is a stable pool
|
|
371
393
|
* @param {string} poolKey The key to identify the pool
|
|
372
394
|
* @returns A function that takes a Transaction object
|
|
373
395
|
*/
|
|
374
|
-
stablePool: (poolKey: string) => (tx: Transaction) =>
|
|
396
|
+
stablePool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
375
397
|
/**
|
|
376
398
|
* @description Check if a pool is registered
|
|
377
399
|
* @param {string} poolKey The key to identify the pool
|
|
378
400
|
* @returns A function that takes a Transaction object
|
|
379
401
|
*/
|
|
380
|
-
registeredPool: (poolKey: string) => (tx: Transaction) =>
|
|
402
|
+
registeredPool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
381
403
|
/**
|
|
382
404
|
* @description Get the quote quantity out for a given base quantity using input token as fee
|
|
383
405
|
* @param {string} poolKey The key to identify the pool
|
|
384
406
|
* @param {number} baseQuantity Base quantity to convert
|
|
385
407
|
* @returns A function that takes a Transaction object
|
|
386
408
|
*/
|
|
387
|
-
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint) => (tx: Transaction) =>
|
|
409
|
+
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
388
410
|
/**
|
|
389
411
|
* @description Get the base quantity out for a given quote quantity using input token as fee
|
|
390
412
|
* @param {string} poolKey The key to identify the pool
|
|
391
413
|
* @param {number} quoteQuantity Quote quantity to convert
|
|
392
414
|
* @returns A function that takes a Transaction object
|
|
393
415
|
*/
|
|
394
|
-
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number | bigint) => (tx: Transaction) =>
|
|
416
|
+
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
395
417
|
/**
|
|
396
418
|
* @description Get the quantity out for a given base or quote quantity using input token as fee
|
|
397
419
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -399,7 +421,7 @@ declare class DeepBookContract {
|
|
|
399
421
|
* @param {number} quoteQuantity Quote quantity to convert
|
|
400
422
|
* @returns A function that takes a Transaction object
|
|
401
423
|
*/
|
|
402
|
-
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_transactions10.TransactionResult;
|
|
403
425
|
/**
|
|
404
426
|
* @description Get the base quantity needed to receive a target quote quantity
|
|
405
427
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -407,7 +429,7 @@ declare class DeepBookContract {
|
|
|
407
429
|
* @param {boolean} payWithDeep Whether to pay fees with DEEP
|
|
408
430
|
* @returns A function that takes a Transaction object
|
|
409
431
|
*/
|
|
410
|
-
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) =>
|
|
432
|
+
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
411
433
|
/**
|
|
412
434
|
* @description Get the quote quantity needed to receive a target base quantity
|
|
413
435
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -415,14 +437,14 @@ declare class DeepBookContract {
|
|
|
415
437
|
* @param {boolean} payWithDeep Whether to pay fees with DEEP
|
|
416
438
|
* @returns A function that takes a Transaction object
|
|
417
439
|
*/
|
|
418
|
-
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) =>
|
|
440
|
+
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
419
441
|
/**
|
|
420
442
|
* @description Get account order details for a balance manager
|
|
421
443
|
* @param {string} poolKey The key to identify the pool
|
|
422
444
|
* @param {string} managerKey Key of the balance manager
|
|
423
445
|
* @returns A function that takes a Transaction object
|
|
424
446
|
*/
|
|
425
|
-
getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) =>
|
|
447
|
+
getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
426
448
|
/**
|
|
427
449
|
* @description Get the DEEP required for an order
|
|
428
450
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -430,51 +452,51 @@ declare class DeepBookContract {
|
|
|
430
452
|
* @param {number} price Price
|
|
431
453
|
* @returns A function that takes a Transaction object
|
|
432
454
|
*/
|
|
433
|
-
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_transactions10.TransactionResult;
|
|
434
456
|
/**
|
|
435
457
|
* @description Check if account exists for a balance manager
|
|
436
458
|
* @param {string} poolKey The key to identify the pool
|
|
437
459
|
* @param {string} managerKey Key of the balance manager
|
|
438
460
|
* @returns A function that takes a Transaction object
|
|
439
461
|
*/
|
|
440
|
-
accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) =>
|
|
462
|
+
accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
441
463
|
/**
|
|
442
464
|
* @description Get the next epoch trade parameters for a pool
|
|
443
465
|
* @param {string} poolKey The key to identify the pool
|
|
444
466
|
* @returns A function that takes a Transaction object
|
|
445
467
|
*/
|
|
446
|
-
poolTradeParamsNext: (poolKey: string) => (tx: Transaction) =>
|
|
468
|
+
poolTradeParamsNext: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
447
469
|
/**
|
|
448
470
|
* @description Get the quorum for a pool
|
|
449
471
|
* @param {string} poolKey The key to identify the pool
|
|
450
472
|
* @returns A function that takes a Transaction object
|
|
451
473
|
*/
|
|
452
|
-
quorum: (poolKey: string) => (tx: Transaction) =>
|
|
474
|
+
quorum: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
453
475
|
/**
|
|
454
476
|
* @description Get the pool ID
|
|
455
477
|
* @param {string} poolKey The key to identify the pool
|
|
456
478
|
* @returns A function that takes a Transaction object
|
|
457
479
|
*/
|
|
458
|
-
poolId: (poolKey: string) => (tx: Transaction) =>
|
|
480
|
+
poolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
459
481
|
/**
|
|
460
482
|
* @description Check if a limit order can be placed
|
|
461
483
|
* @param {CanPlaceLimitOrderParams} params Parameters for checking limit order validity
|
|
462
484
|
* @returns A function that takes a Transaction object
|
|
463
485
|
*/
|
|
464
|
-
canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) =>
|
|
486
|
+
canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
465
487
|
/**
|
|
466
488
|
* @description Check if a market order can be placed
|
|
467
489
|
* @param {CanPlaceMarketOrderParams} params Parameters for checking market order validity
|
|
468
490
|
* @returns A function that takes a Transaction object
|
|
469
491
|
*/
|
|
470
|
-
canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) =>
|
|
492
|
+
canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
471
493
|
/**
|
|
472
494
|
* @description Check if market order params are valid
|
|
473
495
|
* @param {string} poolKey The key to identify the pool
|
|
474
496
|
* @param {number} quantity Quantity
|
|
475
497
|
* @returns A function that takes a Transaction object
|
|
476
498
|
*/
|
|
477
|
-
checkMarketOrderParams: (poolKey: string, quantity: number | bigint) => (tx: Transaction) =>
|
|
499
|
+
checkMarketOrderParams: (poolKey: string, quantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
478
500
|
/**
|
|
479
501
|
* @description Check if limit order params are valid
|
|
480
502
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -483,7 +505,7 @@ declare class DeepBookContract {
|
|
|
483
505
|
* @param {number} expireTimestamp Expiration timestamp
|
|
484
506
|
* @returns A function that takes a Transaction object
|
|
485
507
|
*/
|
|
486
|
-
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_transactions10.TransactionResult;
|
|
487
509
|
}
|
|
488
510
|
//#endregion
|
|
489
511
|
export { DeepBookContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepbook.d.mts","names":[],"sources":["../../src/transactions/deepbook.ts"],"
|
|
1
|
+
{"version":3,"file":"deepbook.d.mts","names":[],"sources":["../../src/transactions/deepbook.ts"],"mappings":";;;;;;;;;cA4Ba,gBAAA;EAAA;;;;cAMA,MAAA,EAAQ,cAAA;EA0DQ;;;;;EAjD5B,eAAA,GAAmB,MAAA,EAAQ,qBAAA,MAA2B,EAAA,EAAI,WAAA;EA0NgB;;;;;EAzK1E,gBAAA,GAAoB,MAAA,EAAQ,sBAAA,MAA4B,EAAA,EAAI,WAAA;EAsTQ;;;;;;;;EA1QpE,WAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,OAAA,UAAiB,WAAA,cAC7D,EAAA,EAAI,WAAA;EA4akC;;;;;;;EA/YxC,WAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,OAAA,cAAqB,EAAA,EAAI,WAAA;EAyjBL;;;;;;;EA7hBlE,YAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,QAAA,gBAAwB,EAAA,EAAI,WAAA;EAisBC;;;;;;;;;;EAlqB3E,eAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,OAAA,cAAqB,EAAA,EAAI,WAAA;EAo7B1B;;;;;;;;;;EAr5B7C,gBAAA,GACE,OAAA,UAAiB,iBAAA,UAA2B,QAAA,gBAAwB,EAAA,EAAI,WAAA;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
|
@@ -125,6 +125,44 @@ var DeepBookContract = class {
|
|
|
125
125
|
typeArguments: [baseCoin.type, quoteCoin.type]
|
|
126
126
|
});
|
|
127
127
|
};
|
|
128
|
+
this.cancelLiveOrder = (poolKey, balanceManagerKey, orderId) => (tx) => {
|
|
129
|
+
tx.setGasBudgetIfNotSet(GAS_BUDGET);
|
|
130
|
+
const pool = this.#config.getPool(poolKey);
|
|
131
|
+
const balanceManager = this.#config.getBalanceManager(balanceManagerKey);
|
|
132
|
+
const baseCoin = this.#config.getCoin(pool.baseCoin);
|
|
133
|
+
const quoteCoin = this.#config.getCoin(pool.quoteCoin);
|
|
134
|
+
const tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));
|
|
135
|
+
tx.moveCall({
|
|
136
|
+
target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_live_order`,
|
|
137
|
+
arguments: [
|
|
138
|
+
tx.object(pool.address),
|
|
139
|
+
tx.object(balanceManager.address),
|
|
140
|
+
tradeProof,
|
|
141
|
+
tx.pure.u128(orderId),
|
|
142
|
+
tx.object.clock()
|
|
143
|
+
],
|
|
144
|
+
typeArguments: [baseCoin.type, quoteCoin.type]
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
this.cancelLiveOrders = (poolKey, balanceManagerKey, orderIds) => (tx) => {
|
|
148
|
+
tx.setGasBudgetIfNotSet(GAS_BUDGET);
|
|
149
|
+
const pool = this.#config.getPool(poolKey);
|
|
150
|
+
const balanceManager = this.#config.getBalanceManager(balanceManagerKey);
|
|
151
|
+
const baseCoin = this.#config.getCoin(pool.baseCoin);
|
|
152
|
+
const quoteCoin = this.#config.getCoin(pool.quoteCoin);
|
|
153
|
+
const tradeProof = tx.add(this.#config.balanceManager.generateProof(balanceManagerKey));
|
|
154
|
+
tx.moveCall({
|
|
155
|
+
target: `${this.#config.DEEPBOOK_PACKAGE_ID}::pool::cancel_live_orders`,
|
|
156
|
+
arguments: [
|
|
157
|
+
tx.object(pool.address),
|
|
158
|
+
tx.object(balanceManager.address),
|
|
159
|
+
tradeProof,
|
|
160
|
+
tx.pure.vector("u128", orderIds),
|
|
161
|
+
tx.object.clock()
|
|
162
|
+
],
|
|
163
|
+
typeArguments: [baseCoin.type, quoteCoin.type]
|
|
164
|
+
});
|
|
165
|
+
};
|
|
128
166
|
this.cancelAllOrders = (poolKey, balanceManagerKey) => (tx) => {
|
|
129
167
|
tx.setGasBudgetIfNotSet(GAS_BUDGET);
|
|
130
168
|
const pool = this.#config.getPool(poolKey);
|