@zofai/zo-sdk 0.2.9 → 0.2.11

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 (173) hide show
  1. package/dist/abstract/BaseAPI.cjs +7 -1
  2. package/dist/abstract/BaseAPI.cjs.map +1 -1
  3. package/dist/abstract/BaseAPI.d.cts +11 -10
  4. package/dist/abstract/BaseAPI.d.cts.map +1 -1
  5. package/dist/abstract/BaseAPI.d.mts +11 -10
  6. package/dist/abstract/BaseAPI.d.mts.map +1 -1
  7. package/dist/abstract/BaseAPI.mjs +7 -1
  8. package/dist/abstract/BaseAPI.mjs.map +1 -1
  9. package/dist/abstract/BaseDataAPI.d.cts +1 -1
  10. package/dist/abstract/BaseDataAPI.d.cts.map +1 -1
  11. package/dist/abstract/BaseDataAPI.d.mts +1 -1
  12. package/dist/abstract/BaseDataAPI.d.mts.map +1 -1
  13. package/dist/api.cjs +12 -12
  14. package/dist/api.cjs.map +1 -1
  15. package/dist/api.d.cts +1 -1
  16. package/dist/api.d.cts.map +1 -1
  17. package/dist/api.d.mts +1 -1
  18. package/dist/api.d.mts.map +1 -1
  19. package/dist/api.mjs +12 -12
  20. package/dist/api.mjs.map +1 -1
  21. package/dist/bcs.d.cts +41 -71
  22. package/dist/bcs.d.cts.map +1 -1
  23. package/dist/bcs.d.mts +41 -71
  24. package/dist/bcs.d.mts.map +1 -1
  25. package/dist/coins.cjs +74 -0
  26. package/dist/coins.cjs.map +1 -0
  27. package/dist/coins.d.cts +37 -0
  28. package/dist/coins.d.cts.map +1 -0
  29. package/dist/coins.d.mts +37 -0
  30. package/dist/coins.d.mts.map +1 -0
  31. package/dist/coins.mjs +67 -0
  32. package/dist/coins.mjs.map +1 -0
  33. package/dist/data.d.cts +6 -6
  34. package/dist/data.d.cts.map +1 -1
  35. package/dist/data.d.mts +6 -6
  36. package/dist/data.d.mts.map +1 -1
  37. package/dist/factory/SDKFactory.d.cts +1 -1
  38. package/dist/factory/SDKFactory.d.cts.map +1 -1
  39. package/dist/factory/SDKFactory.d.mts +1 -1
  40. package/dist/factory/SDKFactory.d.mts.map +1 -1
  41. package/dist/implementations/SLPAPI.cjs +192 -100
  42. package/dist/implementations/SLPAPI.cjs.map +1 -1
  43. package/dist/implementations/SLPAPI.d.cts +24 -24
  44. package/dist/implementations/SLPAPI.d.cts.map +1 -1
  45. package/dist/implementations/SLPAPI.d.mts +24 -24
  46. package/dist/implementations/SLPAPI.d.mts.map +1 -1
  47. package/dist/implementations/SLPAPI.mjs +192 -100
  48. package/dist/implementations/SLPAPI.mjs.map +1 -1
  49. package/dist/implementations/SLPDataAPI.cjs +2 -2
  50. package/dist/implementations/SLPDataAPI.cjs.map +1 -1
  51. package/dist/implementations/SLPDataAPI.d.cts +5 -5
  52. package/dist/implementations/SLPDataAPI.d.cts.map +1 -1
  53. package/dist/implementations/SLPDataAPI.d.mts +5 -5
  54. package/dist/implementations/SLPDataAPI.d.mts.map +1 -1
  55. package/dist/implementations/SLPDataAPI.mjs +2 -2
  56. package/dist/implementations/SLPDataAPI.mjs.map +1 -1
  57. package/dist/implementations/USDZAPI.cjs +176 -92
  58. package/dist/implementations/USDZAPI.cjs.map +1 -1
  59. package/dist/implementations/USDZAPI.d.cts +22 -22
  60. package/dist/implementations/USDZAPI.d.cts.map +1 -1
  61. package/dist/implementations/USDZAPI.d.mts +22 -22
  62. package/dist/implementations/USDZAPI.d.mts.map +1 -1
  63. package/dist/implementations/USDZAPI.mjs +176 -92
  64. package/dist/implementations/USDZAPI.mjs.map +1 -1
  65. package/dist/implementations/USDZDataAPI.d.cts +5 -5
  66. package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
  67. package/dist/implementations/USDZDataAPI.d.mts +5 -5
  68. package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
  69. package/dist/implementations/ZBTCVCAPI.cjs +84 -46
  70. package/dist/implementations/ZBTCVCAPI.cjs.map +1 -1
  71. package/dist/implementations/ZBTCVCAPI.d.cts +12 -12
  72. package/dist/implementations/ZBTCVCAPI.d.cts.map +1 -1
  73. package/dist/implementations/ZBTCVCAPI.d.mts +12 -12
  74. package/dist/implementations/ZBTCVCAPI.d.mts.map +1 -1
  75. package/dist/implementations/ZBTCVCAPI.mjs +84 -46
  76. package/dist/implementations/ZBTCVCAPI.mjs.map +1 -1
  77. package/dist/implementations/ZBTCVCDataAPI.cjs.map +1 -1
  78. package/dist/implementations/ZBTCVCDataAPI.d.cts +5 -5
  79. package/dist/implementations/ZBTCVCDataAPI.d.cts.map +1 -1
  80. package/dist/implementations/ZBTCVCDataAPI.d.mts +5 -5
  81. package/dist/implementations/ZBTCVCDataAPI.d.mts.map +1 -1
  82. package/dist/implementations/ZBTCVCDataAPI.mjs.map +1 -1
  83. package/dist/implementations/ZLPAPI.cjs +192 -100
  84. package/dist/implementations/ZLPAPI.cjs.map +1 -1
  85. package/dist/implementations/ZLPAPI.d.cts +24 -24
  86. package/dist/implementations/ZLPAPI.d.cts.map +1 -1
  87. package/dist/implementations/ZLPAPI.d.mts +24 -24
  88. package/dist/implementations/ZLPAPI.d.mts.map +1 -1
  89. package/dist/implementations/ZLPAPI.mjs +192 -100
  90. package/dist/implementations/ZLPAPI.mjs.map +1 -1
  91. package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
  92. package/dist/implementations/ZLPDataAPI.d.cts +5 -5
  93. package/dist/implementations/ZLPDataAPI.d.cts.map +1 -1
  94. package/dist/implementations/ZLPDataAPI.d.mts +5 -5
  95. package/dist/implementations/ZLPDataAPI.d.mts.map +1 -1
  96. package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
  97. package/dist/index.cjs +2 -0
  98. package/dist/index.cjs.map +1 -1
  99. package/dist/index.d.cts +3 -1
  100. package/dist/index.d.cts.map +1 -1
  101. package/dist/index.d.mts +3 -1
  102. package/dist/index.d.mts.map +1 -1
  103. package/dist/index.mjs +2 -0
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interfaces/base.d.cts +26 -22
  106. package/dist/interfaces/base.d.cts.map +1 -1
  107. package/dist/interfaces/base.d.mts +26 -22
  108. package/dist/interfaces/base.d.mts.map +1 -1
  109. package/dist/interfaces/slp.d.cts +1 -1
  110. package/dist/interfaces/slp.d.cts.map +1 -1
  111. package/dist/interfaces/slp.d.mts +1 -1
  112. package/dist/interfaces/slp.d.mts.map +1 -1
  113. package/dist/interfaces/usdz.d.cts +1 -1
  114. package/dist/interfaces/usdz.d.cts.map +1 -1
  115. package/dist/interfaces/usdz.d.mts +1 -1
  116. package/dist/interfaces/usdz.d.mts.map +1 -1
  117. package/dist/interfaces/zbtcvc.d.cts +1 -1
  118. package/dist/interfaces/zbtcvc.d.cts.map +1 -1
  119. package/dist/interfaces/zbtcvc.d.mts +1 -1
  120. package/dist/interfaces/zbtcvc.d.mts.map +1 -1
  121. package/dist/interfaces/zlp.d.cts +1 -1
  122. package/dist/interfaces/zlp.d.cts.map +1 -1
  123. package/dist/interfaces/zlp.d.mts +1 -1
  124. package/dist/interfaces/zlp.d.mts.map +1 -1
  125. package/dist/oracle.cjs +27 -22
  126. package/dist/oracle.cjs.map +1 -1
  127. package/dist/oracle.d.cts +14 -2
  128. package/dist/oracle.d.cts.map +1 -1
  129. package/dist/oracle.d.mts +14 -2
  130. package/dist/oracle.d.mts.map +1 -1
  131. package/dist/oracle.mjs +27 -22
  132. package/dist/oracle.mjs.map +1 -1
  133. package/dist/suiClient.cjs +8 -0
  134. package/dist/suiClient.cjs.map +1 -0
  135. package/dist/suiClient.d.cts +8 -0
  136. package/dist/suiClient.d.cts.map +1 -0
  137. package/dist/suiClient.d.mts +8 -0
  138. package/dist/suiClient.d.mts.map +1 -0
  139. package/dist/suiClient.mjs +2 -0
  140. package/dist/suiClient.mjs.map +1 -0
  141. package/dist/utils.cjs +7 -3
  142. package/dist/utils.cjs.map +1 -1
  143. package/dist/utils.d.cts +2 -2
  144. package/dist/utils.d.cts.map +1 -1
  145. package/dist/utils.d.mts +2 -2
  146. package/dist/utils.d.mts.map +1 -1
  147. package/dist/utils.mjs +7 -3
  148. package/dist/utils.mjs.map +1 -1
  149. package/package.json +4 -4
  150. package/src/abstract/BaseAPI.ts +11 -9
  151. package/src/abstract/BaseDataAPI.ts +1 -1
  152. package/src/api.ts +13 -17
  153. package/src/coins.ts +116 -0
  154. package/src/data.ts +1 -1
  155. package/src/factory/SDKFactory.ts +1 -1
  156. package/src/implementations/SLPAPI.ts +200 -116
  157. package/src/implementations/SLPDataAPI.ts +3 -3
  158. package/src/implementations/USDZAPI.ts +185 -95
  159. package/src/implementations/USDZDataAPI.ts +1 -1
  160. package/src/implementations/ZBTCVCAPI.ts +99 -53
  161. package/src/implementations/ZBTCVCDataAPI.ts +1 -1
  162. package/src/implementations/ZLPAPI.ts +200 -111
  163. package/src/implementations/ZLPDataAPI.ts +1 -1
  164. package/src/index.ts +3 -1
  165. package/src/interfaces/base.ts +14 -22
  166. package/src/interfaces/slp.ts +0 -1
  167. package/src/interfaces/usdz.ts +0 -1
  168. package/src/interfaces/zbtcvc.ts +0 -1
  169. package/src/interfaces/zlp.ts +0 -1
  170. package/src/oracle.ts +70 -30
  171. package/src/suiClient.ts +11 -0
  172. package/src/utils.ts +9 -3
  173. package/tsconfig.json +8 -1
package/src/api.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  /* eslint-disable class-methods-use-this */
3
3
  import type { KioskClient, KioskOwnerCap } from '@mysten/kiosk'
4
4
  import { KioskTransaction } from '@mysten/kiosk'
5
- import type { SuiClient } from '@mysten/sui/client'
6
5
  import { Transaction } from '@mysten/sui/transactions'
7
6
  import { SUI_CLOCK_OBJECT_ID } from '@mysten/sui/utils'
8
7
 
@@ -10,6 +9,7 @@ import type { Network } from './consts'
10
9
  import { ALLOW_TRADE_CAN_TRADE, ALLOW_TRADE_MUST_TRADE, ALLOW_TRADE_NO_TRADE } from './consts'
11
10
  import type { ICredential } from './data'
12
11
  import { DataAPI } from './data'
12
+ import type { SuiClient } from './suiClient'
13
13
  import { joinSymbol } from './utils'
14
14
 
15
15
  export class API extends DataAPI {
@@ -64,7 +64,7 @@ export class API extends DataAPI {
64
64
  sender = '',
65
65
  ) => {
66
66
  let tx = new Transaction()
67
- tx = await this.initOracleTxb(Object.keys(this.consts.pythFeeder.feeder), tx)
67
+ tx = (await this.initOracleTxb(Object.keys(this.consts.pythFeeder.feeder), tx)).tx
68
68
  if (referralAddress && !(await this.hasReferral(sender || ''))) {
69
69
  tx = await this.addReferral(referralAddress, tx)
70
70
  }
@@ -90,7 +90,7 @@ export class API extends DataAPI {
90
90
  }
91
91
 
92
92
  withdraw = async (coin: string, zlpCoinObjects: string[], amount: number, minAmountOut = 0) => {
93
- const tx = await this.initOracleTxb(Object.keys(this.consts.pythFeeder.feeder))
93
+ const { tx } = await this.initOracleTxb(Object.keys(this.consts.pythFeeder.feeder))
94
94
  const zlpCoinObject = this.#processCoins(tx, 'zlp', zlpCoinObjects)
95
95
  const [withdrawObject] = tx.splitCoins(zlpCoinObject, [tx.pure.u64(amount)])
96
96
 
@@ -133,7 +133,7 @@ export class API extends DataAPI {
133
133
  if (referralAddress && !(await this.hasReferral(sender || ''))) {
134
134
  tx = await this.addReferral(referralAddress, tx)
135
135
  }
136
- tx = await this.initOracleTxb([collateralToken, indexToken], tx)
136
+ tx = (await this.initOracleTxb([collateralToken, indexToken], tx)).tx
137
137
  const coinObject = this.#processCoins(tx, collateralToken, coinObjects)
138
138
  const [depositObject, feeObject] = tx.splitCoins(coinObject, [
139
139
  tx.pure.u64(collateralAmount),
@@ -203,7 +203,7 @@ export class API extends DataAPI {
203
203
  if (referralAddress && !(await this.hasReferral(sender || ''))) {
204
204
  tx = await this.addReferral(referralAddress, tx)
205
205
  }
206
- tx = await this.initOracleTxb([collateralToken, indexToken], tx)
206
+ tx = (await this.initOracleTxb([collateralToken, indexToken], tx)).tx
207
207
  const coinObject = this.#processCoins(tx, collateralToken, coinObjects)
208
208
  const [depositObject, feeObject] = tx.splitCoins(coinObject, [
209
209
  tx.pure.u64(collateralAmount),
@@ -276,7 +276,7 @@ export class API extends DataAPI {
276
276
  coinObjects: string[],
277
277
  long: boolean,
278
278
  ) => {
279
- const tx = await this.initOracleTxb([collateralToken, indexToken])
279
+ const { tx } = await this.initOracleTxb([collateralToken, indexToken])
280
280
  const coinObject = this.#processCoins(tx, collateralToken, coinObjects)
281
281
  const [depositObject] = tx.splitCoins(coinObject, [tx.pure.u64(amount)])
282
282
 
@@ -300,7 +300,7 @@ export class API extends DataAPI {
300
300
  amount: number,
301
301
  long: boolean,
302
302
  ) => {
303
- const tx = await this.initOracleTxb([collateralToken, indexToken])
303
+ const { tx } = await this.initOracleTxb([collateralToken, indexToken])
304
304
  const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
305
305
 
306
306
  tx.moveCall({
@@ -342,7 +342,7 @@ export class API extends DataAPI {
342
342
  collateralSlippage = 0.5,
343
343
  relayerFee = BigInt(0.5),
344
344
  ) => {
345
- const tx = await this.initOracleTxb([collateralToken, indexToken])
345
+ const { tx } = await this.initOracleTxb([collateralToken, indexToken])
346
346
  const symbol = joinSymbol(long ? 'long' : 'short', indexToken)
347
347
  const coinObject = this.#processCoins(tx, collateralToken, coinObjects)
348
348
  const feeObject = tx.splitCoins(coinObject, [tx.pure.u64(relayerFee)])
@@ -358,7 +358,6 @@ export class API extends DataAPI {
358
358
  isTakeProfitOrder = true
359
359
  }
360
360
 
361
-
362
361
  tx.moveCall({
363
362
  target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position`,
364
363
  typeArguments: [
@@ -407,7 +406,7 @@ export class API extends DataAPI {
407
406
  collateralSlippage = 0.5,
408
407
  relayerFee = BigInt(0.5),
409
408
  ) => {
410
- const tx = await this.initOracleTxb([collateralToken, indexToken])
409
+ const { tx } = await this.initOracleTxb([collateralToken, indexToken])
411
410
 
412
411
  const kioskTx = new KioskTransaction({
413
412
  transaction: tx,
@@ -435,7 +434,6 @@ export class API extends DataAPI {
435
434
  isTakeProfitOrder = true
436
435
  }
437
436
 
438
-
439
437
  tx.moveCall({
440
438
  target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position_with_scard`,
441
439
  typeArguments: [
@@ -491,7 +489,7 @@ export class API extends DataAPI {
491
489
  if (!tx) {
492
490
  tx = new Transaction()
493
491
  }
494
- tx = await this.initOracleTxb(positions.flatMap(position => [position.collateralToken, position.indexToken]), tx)
492
+ tx = (await this.initOracleTxb(positions.flatMap(position => [position.collateralToken, position.indexToken]), tx)).tx
495
493
 
496
494
  for (const position of positions) {
497
495
  const {
@@ -525,7 +523,6 @@ export class API extends DataAPI {
525
523
  innerIsTakeProfitOrder = true
526
524
  }
527
525
 
528
-
529
526
  tx.moveCall({
530
527
  target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position`,
531
528
  typeArguments: [
@@ -573,7 +570,7 @@ export class API extends DataAPI {
573
570
  if (!tx) {
574
571
  tx = new Transaction()
575
572
  }
576
- tx = await this.initOracleTxb(positions.flatMap(position => [position.collateralToken, position.indexToken]), tx)
573
+ tx = (await this.initOracleTxb(positions.flatMap(position => [position.collateralToken, position.indexToken]), tx)).tx
577
574
 
578
575
  const kioskTx = new KioskTransaction({
579
576
  transaction: tx,
@@ -618,7 +615,6 @@ export class API extends DataAPI {
618
615
  innerIsTakeProfitOrder = true
619
616
  }
620
617
 
621
-
622
618
  tx.moveCall({
623
619
  target: `${this.consts.zoCore.upgradedPackage}::market::decrease_position_with_scard`,
624
620
  typeArguments: [
@@ -748,7 +744,7 @@ export class API extends DataAPI {
748
744
  fromAmount: bigint,
749
745
  fromCoinObjects: string[],
750
746
  ) => {
751
- const tx = await this.initOracleTxb(Object.keys(this.consts.zoCore.vaults))
747
+ const { tx } = await this.initOracleTxb(Object.keys(this.consts.zoCore.vaults))
752
748
  const fromCoinObject = this.#processCoins(tx, fromToken, fromCoinObjects)
753
749
  const [fromDepositObject] = tx.splitCoins(fromCoinObject, [tx.pure.u64(fromAmount)])
754
750
  const vaultsValuation = this.valuateVaults(tx)
@@ -901,7 +897,7 @@ export class API extends DataAPI {
901
897
 
902
898
  // admin methods
903
899
  adminUpdatePriceFeed = async (collateralToken: string, indexToken: string) => {
904
- const tx = await this.initOracleTxb([collateralToken, indexToken])
900
+ const { tx } = await this.initOracleTxb([collateralToken, indexToken])
905
901
  return tx
906
902
  }
907
903
 
package/src/coins.ts ADDED
@@ -0,0 +1,116 @@
1
+ import type { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions'
2
+ import { coinWithBalance } from '@mysten/sui/transactions'
3
+ import { SUI_TYPE_ARG } from '@mysten/sui/utils'
4
+
5
+ import type { SuiClient } from './suiClient'
6
+
7
+ /**
8
+ * Sui wallets can hold funds in two places for the same coin type:
9
+ * - coin objects (what getCoins returns)
10
+ * - address balance (funds held at the address until redeemed in a tx)
11
+ */
12
+ export interface ICoinBalanceBreakdown {
13
+ coinType: string
14
+ totalBalance: bigint
15
+ coinObjectBalance: bigint
16
+ addressBalance: bigint
17
+ }
18
+
19
+ export interface ICoinFundingOptions {
20
+ /** bigint values matching each split in processCoinSplitting (sum = total spend). */
21
+ splitAmounts?: bigint[]
22
+ /** Use coinWithBalance (redeems address balance and/or merges coin objects). */
23
+ useAddressBalance?: boolean
24
+ }
25
+
26
+ export function sumSplitAmounts(amounts: bigint[]): bigint {
27
+ return amounts.reduce((total, amount) => total + amount, 0n)
28
+ }
29
+
30
+ export async function getCoinBalanceBreakdown(
31
+ provider: SuiClient,
32
+ owner: string,
33
+ coinType: string,
34
+ ): Promise<ICoinBalanceBreakdown> {
35
+ const balance = await provider.getBalance({ owner, coinType })
36
+ const totalBalance = BigInt(balance.totalBalance)
37
+
38
+ const extended = balance as { coinBalance?: string, addressBalance?: string }
39
+ if (extended.coinBalance !== undefined && extended.addressBalance !== undefined) {
40
+ return {
41
+ coinType: balance.coinType,
42
+ totalBalance,
43
+ coinObjectBalance: BigInt(extended.coinBalance),
44
+ addressBalance: BigInt(extended.addressBalance),
45
+ }
46
+ }
47
+
48
+ let coinObjectBalance = 0n
49
+ let cursor: string | null | undefined = null
50
+ do {
51
+ const page = await provider.getCoins({ owner, coinType, cursor })
52
+ for (const coin of page.data) {
53
+ coinObjectBalance += BigInt(coin.balance)
54
+ }
55
+ cursor = page.hasNextPage ? page.nextCursor : null
56
+ } while (cursor)
57
+
58
+ const addressBalance = totalBalance > coinObjectBalance ? totalBalance - coinObjectBalance : 0n
59
+
60
+ return {
61
+ coinType: balance.coinType,
62
+ totalBalance,
63
+ coinObjectBalance,
64
+ addressBalance,
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Prefer coinWithBalance when the wallet has address balance and/or coin objects alone
70
+ * cannot cover `amount`. processCoins / processCoinSplitting only spend explicit object IDs otherwise.
71
+ */
72
+ export function needsCoinWithBalanceFunding(
73
+ breakdown: ICoinBalanceBreakdown,
74
+ amount: bigint,
75
+ ): boolean {
76
+ if (breakdown.totalBalance < amount) {
77
+ return false
78
+ }
79
+ if (breakdown.addressBalance > 0n) {
80
+ return true
81
+ }
82
+ return breakdown.coinObjectBalance < amount
83
+ }
84
+
85
+ /**
86
+ * Creates a spendable Coin<T> inside an open transaction.
87
+ * At build time Mysten resolves this via coin::redeem_funds (address balance) and/or merging coin objects.
88
+ */
89
+ export function createSpendableCoin(
90
+ tx: Transaction,
91
+ coinType: string,
92
+ amount: bigint,
93
+ useGasCoin = false,
94
+ ): TransactionObjectArgument {
95
+ return coinWithBalance({ balance: amount, type: coinType, useGasCoin })(tx)
96
+ }
97
+
98
+ /**
99
+ * Resolves a spendable SUI coin for sponsored transactions.
100
+ * Uses coinWithBalance so address balance and coin objects are both supported.
101
+ */
102
+ export async function resolveSpendableSuiCoin(
103
+ tx: Transaction,
104
+ provider: SuiClient,
105
+ sender: string,
106
+ amount: bigint,
107
+ ): Promise<TransactionObjectArgument> {
108
+ const breakdown = await getCoinBalanceBreakdown(provider, sender, SUI_TYPE_ARG)
109
+ if (breakdown.totalBalance < amount) {
110
+ throw new Error(
111
+ `Insufficient SUI balance: need ${amount} MIST, have ${breakdown.totalBalance} MIST `
112
+ + `(coin objects: ${breakdown.coinObjectBalance}, address balance: ${breakdown.addressBalance})`,
113
+ )
114
+ }
115
+ return createSpendableCoin(tx, SUI_TYPE_ARG, amount, false)
116
+ }
package/src/data.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable class-methods-use-this */
2
2
 
3
- import type { DynamicFieldInfo, SuiClient } from '@mysten/sui/client'
3
+ import type { DynamicFieldInfo, SuiClient } from './suiClient'
4
4
  import type { Transaction } from '@mysten/sui/transactions'
5
5
  import { SUI_CLOCK_OBJECT_ID } from '@mysten/sui/utils'
6
6
 
@@ -4,7 +4,7 @@
4
4
  * This is the main entry point for the re-architected SDK system
5
5
  */
6
6
 
7
- import type { SuiClient } from '@mysten/sui/client'
7
+ import type { SuiClient } from '../suiClient'
8
8
 
9
9
  import type { LPToken, Network } from '../consts'
10
10
  import { LPToken as LPTokenEnum } from '../consts'