@7kprotocol/sdk-ts 1.3.3 → 2.0.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.
Files changed (104) hide show
  1. package/README.md +167 -1
  2. package/lib/cjs/buildTx.js +13 -5
  3. package/lib/cjs/estimateGasFee.js +3 -3
  4. package/lib/cjs/libs/getSplitCoinForTx.js +5 -14
  5. package/lib/cjs/libs/protocols/aftermath/index.js +1 -1
  6. package/lib/cjs/libs/protocols/base.js +1 -1
  7. package/lib/cjs/libs/protocols/cetus/index.js +4 -4
  8. package/lib/cjs/libs/protocols/deepbook/index.js +1 -1
  9. package/lib/cjs/libs/protocols/kriyaV3/index.js +4 -4
  10. package/lib/cjs/libs/protocols/suiswap/index.js +2 -2
  11. package/lib/cjs/libs/protocols/turbos/index.js +2 -2
  12. package/lib/cjs/suiClient.js +1 -1
  13. package/lib/cjs/types/buildTx.d.ts +2 -2
  14. package/lib/cjs/types/buildTx.d.ts.map +1 -1
  15. package/lib/cjs/types/estimateGasFee.d.ts +1 -1
  16. package/lib/cjs/types/estimateGasFee.d.ts.map +1 -1
  17. package/lib/cjs/types/index.d.ts +1 -1
  18. package/lib/cjs/types/libs/getCoinOjectIdsByAmount.d.ts +1 -1
  19. package/lib/cjs/types/libs/getCoinOjectIdsByAmount.d.ts.map +1 -1
  20. package/lib/cjs/types/libs/getSplitCoinForTx.d.ts +3 -3
  21. package/lib/cjs/types/libs/getSplitCoinForTx.d.ts.map +1 -1
  22. package/lib/cjs/types/libs/protocols/aftermath/index.d.ts +4 -5
  23. package/lib/cjs/types/libs/protocols/aftermath/index.d.ts.map +1 -1
  24. package/lib/cjs/types/libs/protocols/base.d.ts +3 -22
  25. package/lib/cjs/types/libs/protocols/base.d.ts.map +1 -1
  26. package/lib/cjs/types/libs/protocols/bluemove/index.d.ts +4 -5
  27. package/lib/cjs/types/libs/protocols/bluemove/index.d.ts.map +1 -1
  28. package/lib/cjs/types/libs/protocols/cetus/index.d.ts +4 -5
  29. package/lib/cjs/types/libs/protocols/cetus/index.d.ts.map +1 -1
  30. package/lib/cjs/types/libs/protocols/deepbook/index.d.ts +4 -5
  31. package/lib/cjs/types/libs/protocols/deepbook/index.d.ts.map +1 -1
  32. package/lib/cjs/types/libs/protocols/flowx/index.d.ts +4 -5
  33. package/lib/cjs/types/libs/protocols/flowx/index.d.ts.map +1 -1
  34. package/lib/cjs/types/libs/protocols/kriya/index.d.ts +4 -5
  35. package/lib/cjs/types/libs/protocols/kriya/index.d.ts.map +1 -1
  36. package/lib/cjs/types/libs/protocols/kriyaV3/index.d.ts +4 -5
  37. package/lib/cjs/types/libs/protocols/kriyaV3/index.d.ts.map +1 -1
  38. package/lib/cjs/types/libs/protocols/suiswap/index.d.ts +4 -5
  39. package/lib/cjs/types/libs/protocols/suiswap/index.d.ts.map +1 -1
  40. package/lib/cjs/types/libs/protocols/turbos/index.d.ts +4 -5
  41. package/lib/cjs/types/libs/protocols/turbos/index.d.ts.map +1 -1
  42. package/lib/cjs/types/libs/swapWithRoute.d.ts +2 -2
  43. package/lib/cjs/types/libs/swapWithRoute.d.ts.map +1 -1
  44. package/lib/cjs/types/suiClient.d.ts +1 -1
  45. package/lib/cjs/types/suiClient.d.ts.map +1 -1
  46. package/lib/cjs/types/types/sui.d.ts +1 -1
  47. package/lib/cjs/types/types/sui.d.ts.map +1 -1
  48. package/lib/cjs/types/types/tx.d.ts +5 -2
  49. package/lib/cjs/types/types/tx.d.ts.map +1 -1
  50. package/lib/cjs/types/utils/sui.d.ts +10 -11
  51. package/lib/cjs/types/utils/sui.d.ts.map +1 -1
  52. package/lib/cjs/utils/sui.js +8 -9
  53. package/lib/esm/buildTx.js +13 -5
  54. package/lib/esm/estimateGasFee.js +3 -3
  55. package/lib/esm/libs/getSplitCoinForTx.js +5 -14
  56. package/lib/esm/libs/protocols/aftermath/index.js +1 -1
  57. package/lib/esm/libs/protocols/base.js +1 -1
  58. package/lib/esm/libs/protocols/cetus/index.js +4 -4
  59. package/lib/esm/libs/protocols/deepbook/index.js +1 -1
  60. package/lib/esm/libs/protocols/kriyaV3/index.js +4 -4
  61. package/lib/esm/libs/protocols/suiswap/index.js +2 -2
  62. package/lib/esm/libs/protocols/turbos/index.js +2 -2
  63. package/lib/esm/suiClient.js +1 -1
  64. package/lib/esm/types/buildTx.d.ts +2 -2
  65. package/lib/esm/types/buildTx.d.ts.map +1 -1
  66. package/lib/esm/types/estimateGasFee.d.ts +1 -1
  67. package/lib/esm/types/estimateGasFee.d.ts.map +1 -1
  68. package/lib/esm/types/index.d.ts +1 -1
  69. package/lib/esm/types/libs/getCoinOjectIdsByAmount.d.ts +1 -1
  70. package/lib/esm/types/libs/getCoinOjectIdsByAmount.d.ts.map +1 -1
  71. package/lib/esm/types/libs/getSplitCoinForTx.d.ts +3 -3
  72. package/lib/esm/types/libs/getSplitCoinForTx.d.ts.map +1 -1
  73. package/lib/esm/types/libs/protocols/aftermath/index.d.ts +4 -5
  74. package/lib/esm/types/libs/protocols/aftermath/index.d.ts.map +1 -1
  75. package/lib/esm/types/libs/protocols/base.d.ts +3 -22
  76. package/lib/esm/types/libs/protocols/base.d.ts.map +1 -1
  77. package/lib/esm/types/libs/protocols/bluemove/index.d.ts +4 -5
  78. package/lib/esm/types/libs/protocols/bluemove/index.d.ts.map +1 -1
  79. package/lib/esm/types/libs/protocols/cetus/index.d.ts +4 -5
  80. package/lib/esm/types/libs/protocols/cetus/index.d.ts.map +1 -1
  81. package/lib/esm/types/libs/protocols/deepbook/index.d.ts +4 -5
  82. package/lib/esm/types/libs/protocols/deepbook/index.d.ts.map +1 -1
  83. package/lib/esm/types/libs/protocols/flowx/index.d.ts +4 -5
  84. package/lib/esm/types/libs/protocols/flowx/index.d.ts.map +1 -1
  85. package/lib/esm/types/libs/protocols/kriya/index.d.ts +4 -5
  86. package/lib/esm/types/libs/protocols/kriya/index.d.ts.map +1 -1
  87. package/lib/esm/types/libs/protocols/kriyaV3/index.d.ts +4 -5
  88. package/lib/esm/types/libs/protocols/kriyaV3/index.d.ts.map +1 -1
  89. package/lib/esm/types/libs/protocols/suiswap/index.d.ts +4 -5
  90. package/lib/esm/types/libs/protocols/suiswap/index.d.ts.map +1 -1
  91. package/lib/esm/types/libs/protocols/turbos/index.d.ts +4 -5
  92. package/lib/esm/types/libs/protocols/turbos/index.d.ts.map +1 -1
  93. package/lib/esm/types/libs/swapWithRoute.d.ts +2 -2
  94. package/lib/esm/types/libs/swapWithRoute.d.ts.map +1 -1
  95. package/lib/esm/types/suiClient.d.ts +1 -1
  96. package/lib/esm/types/suiClient.d.ts.map +1 -1
  97. package/lib/esm/types/types/sui.d.ts +1 -1
  98. package/lib/esm/types/types/sui.d.ts.map +1 -1
  99. package/lib/esm/types/types/tx.d.ts +5 -2
  100. package/lib/esm/types/types/tx.d.ts.map +1 -1
  101. package/lib/esm/types/utils/sui.d.ts +10 -11
  102. package/lib/esm/types/utils/sui.d.ts.map +1 -1
  103. package/lib/esm/utils/sui.js +8 -9
  104. package/package.json +2 -2
@@ -1,10 +1,9 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BaseContract } from "../base";
3
3
  export declare class FlowXContract extends BaseContract {
4
- swap(tx: TransactionBlock): Promise<{
5
- index: number;
6
- resultIndex: number;
7
- kind: "NestedResult";
4
+ swap(tx: Transaction): Promise<{
5
+ $kind: "NestedResult";
6
+ NestedResult: [number, number];
8
7
  }>;
9
8
  }
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/flowx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CAYhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/flowx/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAY3B"}
@@ -1,10 +1,9 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BaseContract } from "../base";
3
3
  export declare class KriyaContract extends BaseContract {
4
- swap(tx: TransactionBlock): Promise<{
5
- index: number;
6
- resultIndex: number;
7
- kind: "NestedResult";
4
+ swap(tx: Transaction): Promise<{
5
+ $kind: "NestedResult";
6
+ NestedResult: [number, number];
8
7
  }>;
9
8
  }
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/kriya/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAOvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CAyBhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/kriya/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAOvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAyB3B"}
@@ -1,10 +1,9 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BaseContract } from "../base";
3
3
  export declare class KriyaV3Contract extends BaseContract {
4
- swap(tx: TransactionBlock): Promise<{
5
- index: number;
6
- resultIndex: number;
7
- kind: "NestedResult";
4
+ swap(tx: Transaction): Promise<{
5
+ $kind: "NestedResult";
6
+ NestedResult: [number, number];
8
7
  }>;
9
8
  }
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/kriyaV3/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AASvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CA+DhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/kriyaV3/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AASvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA+D3B"}
@@ -1,10 +1,9 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BaseContract } from "../base";
3
3
  export declare class SuiswapContract extends BaseContract {
4
- swap(tx: TransactionBlock): Promise<{
5
- index: number;
6
- resultIndex: number;
7
- kind: "NestedResult";
4
+ swap(tx: Transaction): Promise<{
5
+ $kind: "NestedResult";
6
+ NestedResult: [number, number];
8
7
  }>;
9
8
  }
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/suiswap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CA2BhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/suiswap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA2B3B"}
@@ -1,10 +1,9 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BaseContract } from "../base";
3
3
  export declare class TurbosContract extends BaseContract {
4
- swap(tx: TransactionBlock): Promise<{
5
- index: number;
6
- resultIndex: number;
7
- kind: "NestedResult";
4
+ swap(tx: Transaction): Promise<{
5
+ $kind: "NestedResult";
6
+ NestedResult: [number, number];
8
7
  }>;
9
8
  }
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/turbos/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC,qBAAa,cAAe,SAAQ,YAAY;IACxC,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CAqChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/turbos/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC,qBAAa,cAAe,SAAQ,YAAY;IACxC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAqC3B"}
@@ -1,10 +1,10 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { TxSorSwap } from "../types/aggregator";
3
3
  import { TransactionResultItem } from "../types/sui";
4
4
  export declare function swapWithRoute({ route, inputCoinObject, currentAccount, tx, }: {
5
5
  route: TxSorSwap[];
6
6
  inputCoinObject: TransactionResultItem;
7
7
  currentAccount: string;
8
- tx: TransactionBlock;
8
+ tx: Transaction;
9
9
  }): Promise<TransactionResultItem | undefined>;
10
10
  //# sourceMappingURL=swapWithRoute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"swapWithRoute.d.ts","sourceRoot":"","sources":["../../../../src/libs/swapWithRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,wBAAsB,aAAa,CAAC,EAClC,KAAK,EACL,eAAe,EACf,cAAc,EACd,EAAE,GACH,EAAE;IACD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,eAAe,EAAE,qBAAqB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,gBAAgB,CAAC;CACtB,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAiB7C"}
1
+ {"version":3,"file":"swapWithRoute.d.ts","sourceRoot":"","sources":["../../../../src/libs/swapWithRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD,wBAAsB,aAAa,CAAC,EAClC,KAAK,EACL,eAAe,EACf,cAAc,EACd,EAAE,GACH,EAAE;IACD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,eAAe,EAAE,qBAAqB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,WAAW,CAAC;CACjB,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAiB7C"}
@@ -1,4 +1,4 @@
1
- import { SuiClient } from "@mysten/sui.js/client";
1
+ import { SuiClient } from "@mysten/sui/client";
2
2
  export declare function getSuiClient(): SuiClient;
3
3
  export declare function setSuiClient(client: SuiClient): void;
4
4
  //# sourceMappingURL=suiClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suiClient.d.ts","sourceRoot":"","sources":["../../../src/suiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,uBAAuB,CAAC;AAMlE,wBAAgB,YAAY,cAE3B;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAE7C"}
1
+ {"version":3,"file":"suiClient.d.ts","sourceRoot":"","sources":["../../../src/suiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAM/D,wBAAgB,YAAY,cAE3B;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAE7C"}
@@ -1,4 +1,4 @@
1
- import { TransactionResult } from "@mysten/sui.js/transactions";
1
+ import { TransactionResult } from "@mysten/sui/transactions";
2
2
  import { Unarray } from "./utilities";
3
3
  export type TransactionResultItem = Unarray<TransactionResult>;
4
4
  //# sourceMappingURL=sui.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/types/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/types/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
@@ -1,12 +1,15 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
2
2
  import { Commission, QuoteResponse } from "./aggregator";
3
3
  import BigNumber from "bignumber.js";
4
4
  export interface CommonParams {
5
- tx?: TransactionBlock;
6
5
  quoteResponse: QuoteResponse;
7
6
  accountAddress: string;
8
7
  slippage: BigNumber.Value;
9
8
  commission: Commission;
9
+ extendTx?: {
10
+ tx: Transaction;
11
+ coinIn?: TransactionObjectArgument;
12
+ };
10
13
  }
11
14
  export interface BuildTxParams extends CommonParams {
12
15
  isGasEstimate?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../../../src/types/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,WAAW,CAAC;QAChB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;CACH;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1,5 +1,5 @@
1
- import { TransactionArgument, TransactionBlock } from "@mysten/sui.js/transactions";
2
- import { CoinStruct, SuiObjectResponseQuery } from "@mysten/sui.js/client";
1
+ import { TransactionArgument, Transaction } from "@mysten/sui/transactions";
2
+ import { CoinStruct, SuiObjectResponseQuery } from "@mysten/sui/client";
3
3
  type DataPage<T> = {
4
4
  data: T[];
5
5
  nextCursor?: any;
@@ -11,19 +11,18 @@ type PageQuery = {
11
11
  };
12
12
  type PaginationArgs = "all" | PageQuery;
13
13
  export declare const SuiUtils: {
14
- getSuiCoin(amount: bigint | TransactionArgument, txb: TransactionBlock): TransactionArgument;
15
- mergeCoins(coinObjects: Array<string | TransactionArgument>, txb: TransactionBlock): TransactionArgument | undefined;
16
- getCoinValue(coinType: string, coinObject: string | TransactionArgument, txb: TransactionBlock): TransactionArgument;
14
+ getSuiCoin(amount: bigint | TransactionArgument, txb: Transaction): TransactionArgument;
15
+ mergeCoins(coinObjects: Array<string | TransactionArgument>, txb: Transaction): TransactionArgument | undefined;
16
+ getCoinValue(coinType: string, coinObject: string | TransactionArgument, txb: Transaction): TransactionArgument;
17
17
  getExactCoinByAmount(coinType: string, coins: {
18
18
  objectId: string;
19
19
  balance: bigint;
20
- }[], amount: bigint, txb: TransactionBlock): {
21
- index: number;
22
- resultIndex: number;
23
- kind: "NestedResult";
20
+ }[], amount: bigint, txb: Transaction): {
21
+ $kind: "NestedResult";
22
+ NestedResult: [number, number];
24
23
  };
25
- mergeAllUserCoins(coinType: string, signerAddress: string): Promise<TransactionBlock | undefined>;
26
- mergeAllCoinsWithoutFetch(coins: CoinStruct[], coinType: string, txb: TransactionBlock): void;
24
+ mergeAllUserCoins(coinType: string, signerAddress: string): Promise<Transaction | undefined>;
25
+ mergeAllCoinsWithoutFetch(coins: CoinStruct[], coinType: string, txb: Transaction): void;
27
26
  getAllUserCoins({ address, type }: {
28
27
  type: string;
29
28
  address: string;
@@ -1 +1 @@
1
- {"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/utils/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,UAAU,EAEV,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAK/B,KAAK,QAAQ,CAAC,CAAC,IAAI;IACjB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC;AAExC,eAAO,MAAM,QAAQ;uBAET,MAAM,GAAG,mBAAmB,OAC/B,gBAAgB,GACpB,mBAAmB;4BAQP,KAAK,CAAC,MAAM,GAAG,mBAAmB,CAAC,OAC3C,gBAAgB,GACpB,mBAAmB,GAAG,SAAS;2BAsBtB,MAAM,cACJ,MAAM,GAAG,mBAAmB,OACnC,gBAAgB,GACpB,mBAAmB;mCAYV,MAAM,SACT;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,UACtC,MAAM,OACT,gBAAgB;;;;;gCAoBW,MAAM,iBAAiB,MAAM;qCAoCtD,UAAU,EAAE,YACT,MAAM,OACX,gBAAgB;uCAsBkB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;sCA8BhE,MAAM,SACP;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;iCA6BvC,MAAM,SACN,sBAAsB,mBACb,cAAc,GAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;4BAyBD,MAAM;CAO/B,CAAC"}
1
+ {"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/utils/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EACL,UAAU,EAEV,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAK5B,KAAK,QAAQ,CAAC,CAAC,IAAI;IACjB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,KAAK,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC;AAExC,eAAO,MAAM,QAAQ;uBAET,MAAM,GAAG,mBAAmB,OAC/B,WAAW,GACf,mBAAmB;4BAMP,KAAK,CAAC,MAAM,GAAG,mBAAmB,CAAC,OAC3C,WAAW,GACf,mBAAmB,GAAG,SAAS;2BAsBtB,MAAM,cACJ,MAAM,GAAG,mBAAmB,OACnC,WAAW,GACf,mBAAmB;mCAYV,MAAM,SACT;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,UACtC,MAAM,OACT,WAAW;;;;gCAoBgB,MAAM,iBAAiB,MAAM;qCAoCtD,UAAU,EAAE,YACT,MAAM,OACX,WAAW;uCAsBuB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;sCA8BhE,MAAM,SACP;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;iCA6BvC,MAAM,SACN,sBAAsB,mBACb,cAAc,GAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;4BAyBD,MAAM;CAO/B,CAAC"}
@@ -10,14 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SuiUtils = void 0;
13
- const transactions_1 = require("@mysten/sui.js/transactions");
14
- const utils_1 = require("@mysten/sui.js/utils");
13
+ const transactions_1 = require("@mysten/sui/transactions");
14
+ const utils_1 = require("@mysten/sui/utils");
15
15
  const token_1 = require("./token");
16
16
  const suiClient_1 = require("../suiClient");
17
17
  exports.SuiUtils = {
18
18
  getSuiCoin(amount, txb) {
19
- const inputCoinAmount = typeof amount === "bigint" ? txb.pure(amount) : amount;
20
- const [coin] = txb.splitCoins(txb.gas, [inputCoinAmount]);
19
+ const [coin] = txb.splitCoins(txb.gas, [amount]);
21
20
  return coin;
22
21
  },
23
22
  mergeCoins(coinObjects, txb) {
@@ -48,7 +47,7 @@ exports.SuiUtils = {
48
47
  },
49
48
  getExactCoinByAmount(coinType, coins, amount, txb) {
50
49
  if ((0, token_1.checkIsSui)(coinType)) {
51
- const [coinA] = txb.splitCoins(txb.gas, [txb.pure(amount)]);
50
+ const [coinA] = txb.splitCoins(txb.gas, [amount]);
52
51
  return coinA;
53
52
  }
54
53
  else {
@@ -56,7 +55,7 @@ exports.SuiUtils = {
56
55
  if (coinsX.length > 1) {
57
56
  txb.mergeCoins(txb.object(coinsX[0]), coinsX.slice(1).map((coin) => txb.object(coin)));
58
57
  }
59
- const [coinA] = txb.splitCoins(txb.object(coinsX[0]), [txb.pure(amount)]);
58
+ const [coinA] = txb.splitCoins(txb.object(coinsX[0]), [amount]);
60
59
  return coinA;
61
60
  }
62
61
  },
@@ -71,10 +70,10 @@ exports.SuiUtils = {
71
70
  coins.forEach((coin) => {
72
71
  totalBalance += BigInt(coin.balance);
73
72
  });
74
- const txb = new transactions_1.TransactionBlock();
73
+ const txb = new transactions_1.Transaction();
75
74
  if ((0, token_1.checkIsSui)(coinType)) {
76
75
  totalBalance = totalBalance - BigInt("1000");
77
- txb.splitCoins(txb.gas, [txb.pure(totalBalance.toString())]);
76
+ txb.splitCoins(txb.gas, [totalBalance]);
78
77
  }
79
78
  const coinObjectsIds = coins.map((coin) => coin.coinObjectId);
80
79
  if (coins.length > 1) {
@@ -94,7 +93,7 @@ exports.SuiUtils = {
94
93
  });
95
94
  if ((0, token_1.checkIsSui)(coinType)) {
96
95
  totalBalance = totalBalance - BigInt("1000");
97
- txb.splitCoins(txb.gas, [txb.pure(totalBalance.toString())]);
96
+ txb.splitCoins(txb.gas, [totalBalance]);
98
97
  }
99
98
  const coinObjectsIds = coins.map((coin) => coin.coinObjectId);
100
99
  if (coins.length > 1) {
@@ -1,4 +1,4 @@
1
- import { TransactionBlock, } from "@mysten/sui.js/transactions";
1
+ import { Transaction, } from "@mysten/sui/transactions";
2
2
  import BigNumber from "bignumber.js";
3
3
  import { getSplitCoinForTx } from "./libs/getSplitCoinForTx";
4
4
  import { groupSwapRoutes } from "./libs/groupSwapRoutes";
@@ -6,8 +6,9 @@ import { swapWithRoute } from "./libs/swapWithRoute";
6
6
  import { denormalizeTokenType } from "./utils/token";
7
7
  import { SuiUtils } from "./utils/sui";
8
8
  import { _7K_CONFIG, _7K_PACKAGE_ID } from "./constants/_7k";
9
- import { isValidSuiAddress } from "@mysten/sui.js/utils";
10
- export const buildTx = async ({ quoteResponse, accountAddress, slippage, tx: _tx, commission: _commission, isGasEstimate, }) => {
9
+ import { isValidSuiAddress } from "@mysten/sui/utils";
10
+ export const buildTx = async ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }) => {
11
+ const { tx: _tx, coinIn } = extendTx || {};
11
12
  if (!accountAddress) {
12
13
  throw new Error("Sender address is required");
13
14
  }
@@ -17,10 +18,17 @@ export const buildTx = async ({ quoteResponse, accountAddress, slippage, tx: _tx
17
18
  if (!isValidSuiAddress(_commission.partner)) {
18
19
  throw new Error("Invalid commission partner address");
19
20
  }
20
- const tx = _tx || new TransactionBlock();
21
+ const tx = _tx || new Transaction();
21
22
  const routes = groupSwapRoutes(quoteResponse);
22
23
  const splits = routes.map((group) => group[0]?.amount ?? "0");
23
- const { coinData } = await getSplitCoinForTx(accountAddress, quoteResponse.swapAmountWithDecimal, splits, denormalizeTokenType(quoteResponse.tokenIn), tx, isGasEstimate);
24
+ let coinData;
25
+ if (coinIn) {
26
+ coinData = tx.splitCoins(coinIn, splits);
27
+ }
28
+ else {
29
+ const { coinData: _data } = await getSplitCoinForTx(accountAddress, quoteResponse.swapAmountWithDecimal, splits, denormalizeTokenType(quoteResponse.tokenIn), tx, isGasEstimate);
30
+ coinData = _data;
31
+ }
24
32
  const coinObjects = [];
25
33
  await Promise.all(routes.map(async (route, index) => {
26
34
  const inputCoinObject = coinData[index];
@@ -1,14 +1,14 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { SUI_DECIMALS } from "@mysten/sui.js/utils";
2
+ import { SUI_DECIMALS } from "@mysten/sui/utils";
3
3
  import { buildTx } from "./buildTx";
4
4
  import { formatBalance } from "./utils/number";
5
5
  import { getSuiClient } from "./suiClient";
6
6
  import { getSuiPrice } from "./getSuiPrice";
7
- export async function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, tx: _tx, commission, }) {
7
+ export async function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }) {
8
8
  if (!accountAddress)
9
9
  return 0;
10
10
  const tx = await buildTx({
11
- tx: _tx,
11
+ extendTx,
12
12
  quoteResponse,
13
13
  accountAddress,
14
14
  slippage,
@@ -1,36 +1,27 @@
1
- import { TransactionBlock, } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { getCoinOjectIdsByAmount } from "./getCoinOjectIdsByAmount";
3
3
  import { SUI_TYPE } from "../constants/tokens";
4
4
  export const getSplitCoinForTx = async (account, amount, splits, coinType, inheritTx, inspecTransaction) => {
5
- const tx = inheritTx ?? new TransactionBlock();
5
+ const tx = inheritTx ?? new Transaction();
6
6
  const { objectIds } = await getCoinOjectIdsByAmount(account, amount, coinType);
7
7
  const coinObjectId = objectIds[0];
8
8
  if (coinType === SUI_TYPE) {
9
- const pureAmount = [];
10
- for (const split of splits) {
11
- pureAmount.push(tx.pure(split));
12
- }
13
9
  let coin;
14
10
  if (inspecTransaction) {
15
11
  if (objectIds.length > 1) {
16
12
  tx.mergeCoins(tx.object(coinObjectId), objectIds.slice(1).map((item) => tx.object(item)));
17
13
  }
18
- coin = tx.splitCoins(tx.object(coinObjectId), pureAmount);
14
+ coin = tx.splitCoins(tx.object(coinObjectId), splits);
19
15
  }
20
16
  else {
21
- coin = tx.splitCoins(tx.gas, pureAmount);
17
+ coin = tx.splitCoins(tx.gas, splits);
22
18
  }
23
19
  return { tx, coinData: coin };
24
20
  }
25
21
  if (objectIds.length > 1) {
26
22
  tx.mergeCoins(tx.object(coinObjectId), objectIds.slice(1).map((item) => tx.object(item)));
27
23
  }
28
- //handle split coin
29
- const pureAmount = [];
30
- for (const split of splits) {
31
- pureAmount.push(tx.pure(split));
32
- }
33
24
  // split correct amount to swap
34
- const coinData = tx.splitCoins(tx.object(coinObjectId), pureAmount);
25
+ const coinData = tx.splitCoins(tx.object(coinObjectId), splits);
35
26
  return { tx, coinData };
36
27
  };
@@ -28,7 +28,7 @@ export class AfterMathContract extends BaseContract {
28
28
  tx.object(INSURANCE_FUND),
29
29
  tx.object(REFERRAL_VAULT),
30
30
  inputCoinObject,
31
- tx.pure(returnAmount),
31
+ tx.pure.u64(returnAmount),
32
32
  tx.pure.u64("1000000000000000000"), // slippage
33
33
  ],
34
34
  });
@@ -1,4 +1,4 @@
1
- import { normalizeStructTag, parseStructTag } from "@mysten/sui.js/utils";
1
+ import { normalizeStructTag, parseStructTag } from "@mysten/sui/utils";
2
2
  import { SuiUtils } from "../../utils/sui";
3
3
  export class BaseContract {
4
4
  swapInfo;
@@ -1,5 +1,5 @@
1
1
  import { BaseContract } from "../base";
2
- import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils";
2
+ import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
3
3
  import { getDefaultSqrtPriceLimit } from "../utils";
4
4
  import { SuiUtils } from "../../../utils/sui";
5
5
  const GLOBAL_CONFIG_ID = "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f";
@@ -27,11 +27,11 @@ export class CetusContract extends BaseContract {
27
27
  tx.object(this.swapInfo.poolId),
28
28
  this.swapInfo.swapXtoY ? this.inputCoinObject : zeroOut, // coin A
29
29
  this.swapInfo.swapXtoY ? zeroOut : this.inputCoinObject, // coin B
30
- tx.pure(this.swapInfo.swapXtoY), // a to b or b to a
31
- tx.pure(true), // exact in or out
30
+ tx.pure.bool(this.swapInfo.swapXtoY), // a to b or b to a
31
+ tx.pure.bool(true), // exact in or out
32
32
  amountIn, // swap amount
33
33
  tx.pure.u128(sqrtPriceLimit.toString()), // sqrt price limit
34
- tx.pure(false),
34
+ tx.pure.bool(false),
35
35
  tx.object(SUI_CLOCK_OBJECT_ID),
36
36
  ],
37
37
  });
@@ -1,4 +1,4 @@
1
- import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils";
1
+ import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
2
2
  import { BaseContract } from "../base";
3
3
  import { _7K_PACKAGE_ID } from "../../../constants/_7k";
4
4
  const PACKAGE_ID = "0xdee9";
@@ -1,5 +1,5 @@
1
1
  import { BaseContract } from "../base";
2
- import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils";
2
+ import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
3
3
  import { normalizeTokenType } from "../../../utils/token";
4
4
  const PACKAGE_ID = "0xbd8d4489782042c6fafad4de4bc6a5e0b84a43c6c00647ffd7062d1e2bb7549e";
5
5
  const VERSION_ID = "0xf5145a7ac345ca8736cf8c76047d00d6d378f30e81be6f6eb557184d9de93c78";
@@ -16,10 +16,10 @@ export class KriyaV3Contract extends BaseContract {
16
16
  typeArguments: this.getTypeParams(),
17
17
  arguments: [
18
18
  tx.object(poolId),
19
- tx.pure(swapXtoY),
20
- tx.pure(true),
19
+ tx.pure.bool(swapXtoY),
20
+ tx.pure.bool(true),
21
21
  this.getInputCoinValue(tx),
22
- tx.pure(swapXtoY ? LowLimitPrice : limitPrice),
22
+ tx.pure.u128(swapXtoY ? LowLimitPrice : limitPrice),
23
23
  tx.object(SUI_CLOCK_OBJECT_ID),
24
24
  tx.object(VERSION_ID),
25
25
  ],
@@ -1,4 +1,4 @@
1
- import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils";
1
+ import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
2
2
  import { BaseContract } from "../base";
3
3
  const PACKAGE_ID = "0xd075d51486df71e750872b4edf82ea3409fda397ceecc0b6aedf573d923c54a0";
4
4
  const MODULE_NAME = "pool";
@@ -18,7 +18,7 @@ export class SuiswapContract extends BaseContract {
18
18
  arguments: [
19
19
  tx.object(poolId),
20
20
  tx.makeMoveVec({
21
- objects: [inputCoin],
21
+ elements: [inputCoin],
22
22
  }),
23
23
  inputAmount,
24
24
  tx.object(SUI_CLOCK_OBJECT_ID),
@@ -1,4 +1,4 @@
1
- import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui.js/utils";
1
+ import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
2
2
  import { BaseContract } from "../base";
3
3
  import { getDefaultSqrtPriceLimit } from "../utils";
4
4
  import { ONE_MINUTE } from "./constants";
@@ -20,7 +20,7 @@ export class TurbosContract extends BaseContract {
20
20
  arguments: [
21
21
  tx.object(poolId),
22
22
  tx.makeMoveVec({
23
- objects: [this.inputCoinObject],
23
+ elements: [this.inputCoinObject],
24
24
  }),
25
25
  inputAmount,
26
26
  tx.pure.u64(0),
@@ -1,4 +1,4 @@
1
- import { SuiClient, getFullnodeUrl } from "@mysten/sui.js/client";
1
+ import { SuiClient, getFullnodeUrl } from "@mysten/sui/client";
2
2
  let suiClient = new SuiClient({
3
3
  url: getFullnodeUrl("mainnet"),
4
4
  });
@@ -1,4 +1,4 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BuildTxParams } from "./types/tx";
3
- export declare const buildTx: ({ quoteResponse, accountAddress, slippage, tx: _tx, commission: _commission, isGasEstimate, }: BuildTxParams) => Promise<TransactionBlock>;
3
+ export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }: BuildTxParams) => Promise<Transaction>;
4
4
  //# sourceMappingURL=buildTx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../src/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,eAAO,MAAM,OAAO,kGAOjB,aAAa,8BAsEf,CAAC"}
1
+ {"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../src/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,eAAO,MAAM,OAAO,mGAOjB,aAAa,yBA8Ef,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { EstimateGasFeeParams } from "./types/tx";
2
- export declare function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, tx: _tx, commission, }: EstimateGasFeeParams): Promise<number>;
2
+ export declare function estimateGasFee({ quoteResponse, accountAddress, slippage, suiPrice: _suiPrice, extendTx, commission, }: EstimateGasFeeParams): Promise<number>;
3
3
  //# sourceMappingURL=estimateGasFee.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../src/estimateGasFee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,EAAE,EAAE,GAAG,EACP,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCxC"}
1
+ {"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../src/estimateGasFee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCxC"}
@@ -11,7 +11,7 @@ declare const _default: {
11
11
  getQuote: typeof getQuote;
12
12
  getSuiPrice: typeof getSuiPrice;
13
13
  estimateGasFee: typeof estimateGasFee;
14
- buildTx: ({ quoteResponse, accountAddress, slippage, tx: _tx, commission: _commission, isGasEstimate, }: import("./types/tx").BuildTxParams) => Promise<import("@mysten/sui.js/dist/cjs/transactions").TransactionBlock>;
14
+ buildTx: ({ quoteResponse, accountAddress, slippage, commission: _commission, isGasEstimate, extendTx, }: import("./types/tx").BuildTxParams) => Promise<import("@mysten/sui/dist/cjs/transactions").Transaction>;
15
15
  };
16
16
  export default _default;
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { CoinStruct } from "@mysten/sui.js/client";
1
+ import { CoinStruct } from "@mysten/sui/client";
2
2
  export declare const getCoinOjectIdsByAmount: (address: string, amount: string, coinType: string) => Promise<{
3
3
  objectIds: string[];
4
4
  objectCoins: CoinStruct[];
@@ -1 +1 @@
1
- {"version":3,"file":"getCoinOjectIdsByAmount.d.ts","sourceRoot":"","sources":["../../../../src/libs/getCoinOjectIdsByAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,uBAAuB,CAAC;AA2BnE,eAAO,MAAM,uBAAuB,YACzB,MAAM,UACP,MAAM,YACJ,MAAM,KACf,OAAO,CAAC;IACT,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB,CA0CA,CAAC"}
1
+ {"version":3,"file":"getCoinOjectIdsByAmount.d.ts","sourceRoot":"","sources":["../../../../src/libs/getCoinOjectIdsByAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AA2BhE,eAAO,MAAM,uBAAuB,YACzB,MAAM,UACP,MAAM,YACJ,MAAM,KACf,OAAO,CAAC;IACT,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB,CA0CA,CAAC"}
@@ -1,6 +1,6 @@
1
- import { TransactionBlock, TransactionResult } from "@mysten/sui.js/transactions";
2
- export declare const getSplitCoinForTx: (account: string, amount: string, splits: string[], coinType: string, inheritTx?: TransactionBlock, inspecTransaction?: boolean) => Promise<{
3
- tx: TransactionBlock;
1
+ import { Transaction, TransactionResult } from "@mysten/sui/transactions";
2
+ export declare const getSplitCoinForTx: (account: string, amount: string, splits: string[], coinType: string, inheritTx?: Transaction, inspecTransaction?: boolean) => Promise<{
3
+ tx: Transaction;
4
4
  coinData: TransactionResult;
5
5
  }>;
6
6
  //# sourceMappingURL=getSplitCoinForTx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAIrC,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,gBAAgB,sBACR,OAAO,KAC1B,OAAO,CAAC;IACT,EAAE,EAAE,gBAAgB,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CA4CA,CAAC"}
1
+ {"version":3,"file":"getSplitCoinForTx.d.ts","sourceRoot":"","sources":["../../../../src/libs/getSplitCoinForTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAI1E,eAAO,MAAM,iBAAiB,YACnB,MAAM,UACP,MAAM,UACN,MAAM,EAAE,YACN,MAAM,cACJ,WAAW,sBACH,OAAO,KAC1B,OAAO,CAAC;IACT,EAAE,EAAE,WAAW,CAAC;IAChB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAkCA,CAAC"}
@@ -1,10 +1,9 @@
1
- import { TransactionBlock } from "@mysten/sui.js/transactions";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
2
  import { BaseContract } from "../base";
3
3
  export declare class AfterMathContract extends BaseContract {
4
- swap(tx: TransactionBlock): Promise<{
5
- index: number;
6
- resultIndex: number;
7
- kind: "NestedResult";
4
+ swap(tx: Transaction): Promise<{
5
+ $kind: "NestedResult";
6
+ NestedResult: [number, number];
8
7
  }>;
9
8
  }
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/aftermath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAkBvC,qBAAa,iBAAkB,SAAQ,YAAY;IAC3C,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CA2BhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/aftermath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAkBvC,qBAAa,iBAAkB,SAAQ,YAAY;IAC3C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA2B3B"}