@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,4 +1,4 @@
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 interface BaseContractParams {
@@ -11,27 +11,8 @@ export declare abstract class BaseContract {
11
11
  protected inputCoinObject: TransactionResultItem;
12
12
  protected currentAccount: string;
13
13
  constructor({ swapInfo, inputCoinObject, currentAccount, }: BaseContractParams);
14
- abstract swap(tx: TransactionBlock): Promise<TransactionResultItem>;
15
- protected getInputCoinValue(tx: TransactionBlock): {
16
- index: number;
17
- kind: "Input";
18
- value?: any;
19
- type?: "object" | undefined;
20
- } | {
21
- index: number;
22
- kind: "Input";
23
- type: "pure";
24
- value?: any;
25
- } | {
26
- kind: "GasCoin";
27
- } | {
28
- index: number;
29
- kind: "Result";
30
- } | {
31
- index: number;
32
- resultIndex: number;
33
- kind: "NestedResult";
34
- };
14
+ abstract swap(tx: Transaction): Promise<TransactionResultItem>;
15
+ protected getInputCoinValue(tx: Transaction): import("@mysten/sui/transactions").TransactionArgument;
35
16
  protected getTypeParams(): string[];
36
17
  }
37
18
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,qBAAqB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,8BAAsB,YAAY;IAChC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC9B,SAAS,CAAC,eAAe,EAAE,qBAAqB,CAAC;IACjD,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;gBAErB,EACV,QAAQ,EACR,eAAe,EACf,cAAc,GACf,EAAE,kBAAkB;IAMrB,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAEnE,SAAS,CAAC,iBAAiB,CAAC,EAAE,EAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;IAQhD,SAAS,CAAC,aAAa;CAKxB"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,qBAAqB,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,8BAAsB,YAAY;IAChC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC9B,SAAS,CAAC,eAAe,EAAE,qBAAqB,CAAC;IACjD,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;gBAErB,EACV,QAAQ,EACR,eAAe,EACf,cAAc,GACf,EAAE,kBAAkB;IAMrB,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAE9D,SAAS,CAAC,iBAAiB,CAAC,EAAE,EAAE,WAAW;IAQ3C,SAAS,CAAC,aAAa;CAKxB"}
@@ -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 BluemoveContract 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/bluemove/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,qBAAa,gBAAiB,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CAoBhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluemove/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAQvC,qBAAa,gBAAiB,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAoB3B"}
@@ -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 CetusContract 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/cetus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAWvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;CAyChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/cetus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAWvC,qBAAa,aAAc,SAAQ,YAAY;IACvC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAyC3B"}
@@ -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 DeepBookContract 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
  private createAccountCap;
10
9
  private deleteAccountCap;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/deepbook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,gBAAiB,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,EAAE,gBAAgB;;;;;IA+D/B,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,gBAAgB;CAMzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/deepbook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,gBAAiB,SAAQ,YAAY;IAC1C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;IA+D1B,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,gBAAgB;CAMzB"}
@@ -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"}
@@ -1,11 +1,10 @@
1
- import { TransactionBlock, } from "@mysten/sui.js/transactions";
2
- import { parseStructTag } from "@mysten/sui.js/utils";
1
+ import { Transaction } from "@mysten/sui/transactions";
2
+ import { parseStructTag } from "@mysten/sui/utils";
3
3
  import { checkIsSui } from "./token";
4
4
  import { getSuiClient } from "../suiClient";
5
5
  export const SuiUtils = {
6
6
  getSuiCoin(amount, txb) {
7
- const inputCoinAmount = typeof amount === "bigint" ? txb.pure(amount) : amount;
8
- const [coin] = txb.splitCoins(txb.gas, [inputCoinAmount]);
7
+ const [coin] = txb.splitCoins(txb.gas, [amount]);
9
8
  return coin;
10
9
  },
11
10
  mergeCoins(coinObjects, txb) {
@@ -36,7 +35,7 @@ export const SuiUtils = {
36
35
  },
37
36
  getExactCoinByAmount(coinType, coins, amount, txb) {
38
37
  if (checkIsSui(coinType)) {
39
- const [coinA] = txb.splitCoins(txb.gas, [txb.pure(amount)]);
38
+ const [coinA] = txb.splitCoins(txb.gas, [amount]);
40
39
  return coinA;
41
40
  }
42
41
  else {
@@ -44,7 +43,7 @@ export const SuiUtils = {
44
43
  if (coinsX.length > 1) {
45
44
  txb.mergeCoins(txb.object(coinsX[0]), coinsX.slice(1).map((coin) => txb.object(coin)));
46
45
  }
47
- const [coinA] = txb.splitCoins(txb.object(coinsX[0]), [txb.pure(amount)]);
46
+ const [coinA] = txb.splitCoins(txb.object(coinsX[0]), [amount]);
48
47
  return coinA;
49
48
  }
50
49
  },
@@ -58,10 +57,10 @@ export const SuiUtils = {
58
57
  coins.forEach((coin) => {
59
58
  totalBalance += BigInt(coin.balance);
60
59
  });
61
- const txb = new TransactionBlock();
60
+ const txb = new Transaction();
62
61
  if (checkIsSui(coinType)) {
63
62
  totalBalance = totalBalance - BigInt("1000");
64
- txb.splitCoins(txb.gas, [txb.pure(totalBalance.toString())]);
63
+ txb.splitCoins(txb.gas, [totalBalance]);
65
64
  }
66
65
  const coinObjectsIds = coins.map((coin) => coin.coinObjectId);
67
66
  if (coins.length > 1) {
@@ -80,7 +79,7 @@ export const SuiUtils = {
80
79
  });
81
80
  if (checkIsSui(coinType)) {
82
81
  totalBalance = totalBalance - BigInt("1000");
83
- txb.splitCoins(txb.gas, [txb.pure(totalBalance.toString())]);
82
+ txb.splitCoins(txb.gas, [totalBalance]);
84
83
  }
85
84
  const coinObjectsIds = coins.map((coin) => coin.coinObjectId);
86
85
  if (coins.length > 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7kprotocol/sdk-ts",
3
- "version": "1.3.3",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -63,7 +63,7 @@
63
63
  "typescript-eslint": "^7.15.0"
64
64
  },
65
65
  "peerDependencies": {
66
- "@mysten/sui.js": "^0.54.1",
66
+ "@mysten/sui": "^1.5.0",
67
67
  "bignumber.js": "^9.1.2",
68
68
  "bn.js": "^5.2.1"
69
69
  }