@zofai/zo-sdk 0.2.10 → 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 (135) hide show
  1. package/dist/abstract/BaseAPI.d.cts +3 -3
  2. package/dist/abstract/BaseAPI.d.cts.map +1 -1
  3. package/dist/abstract/BaseAPI.d.mts +3 -3
  4. package/dist/abstract/BaseAPI.d.mts.map +1 -1
  5. package/dist/abstract/BaseDataAPI.d.cts +1 -1
  6. package/dist/abstract/BaseDataAPI.d.cts.map +1 -1
  7. package/dist/abstract/BaseDataAPI.d.mts +1 -1
  8. package/dist/abstract/BaseDataAPI.d.mts.map +1 -1
  9. package/dist/api.cjs +7 -7
  10. package/dist/api.cjs.map +1 -1
  11. package/dist/api.d.cts +1 -1
  12. package/dist/api.d.cts.map +1 -1
  13. package/dist/api.d.mts +1 -1
  14. package/dist/api.d.mts.map +1 -1
  15. package/dist/api.mjs +7 -7
  16. package/dist/api.mjs.map +1 -1
  17. package/dist/bcs.d.cts +41 -71
  18. package/dist/bcs.d.cts.map +1 -1
  19. package/dist/bcs.d.mts +41 -71
  20. package/dist/bcs.d.mts.map +1 -1
  21. package/dist/coins.cjs.map +1 -1
  22. package/dist/coins.d.cts +1 -1
  23. package/dist/coins.d.cts.map +1 -1
  24. package/dist/coins.d.mts +1 -1
  25. package/dist/coins.d.mts.map +1 -1
  26. package/dist/coins.mjs.map +1 -1
  27. package/dist/data.d.cts +6 -6
  28. package/dist/data.d.cts.map +1 -1
  29. package/dist/data.d.mts +6 -6
  30. package/dist/data.d.mts.map +1 -1
  31. package/dist/factory/SDKFactory.d.cts +1 -1
  32. package/dist/factory/SDKFactory.d.cts.map +1 -1
  33. package/dist/factory/SDKFactory.d.mts +1 -1
  34. package/dist/factory/SDKFactory.d.mts.map +1 -1
  35. package/dist/implementations/SLPAPI.cjs.map +1 -1
  36. package/dist/implementations/SLPAPI.d.cts +1 -1
  37. package/dist/implementations/SLPAPI.d.cts.map +1 -1
  38. package/dist/implementations/SLPAPI.d.mts +1 -1
  39. package/dist/implementations/SLPAPI.d.mts.map +1 -1
  40. package/dist/implementations/SLPAPI.mjs.map +1 -1
  41. package/dist/implementations/SLPDataAPI.cjs.map +1 -1
  42. package/dist/implementations/SLPDataAPI.d.cts +5 -5
  43. package/dist/implementations/SLPDataAPI.d.cts.map +1 -1
  44. package/dist/implementations/SLPDataAPI.d.mts +5 -5
  45. package/dist/implementations/SLPDataAPI.d.mts.map +1 -1
  46. package/dist/implementations/SLPDataAPI.mjs.map +1 -1
  47. package/dist/implementations/USDZAPI.cjs.map +1 -1
  48. package/dist/implementations/USDZAPI.d.cts +1 -1
  49. package/dist/implementations/USDZAPI.d.cts.map +1 -1
  50. package/dist/implementations/USDZAPI.d.mts +1 -1
  51. package/dist/implementations/USDZAPI.d.mts.map +1 -1
  52. package/dist/implementations/USDZAPI.mjs.map +1 -1
  53. package/dist/implementations/USDZDataAPI.d.cts +5 -5
  54. package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
  55. package/dist/implementations/USDZDataAPI.d.mts +5 -5
  56. package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
  57. package/dist/implementations/ZBTCVCAPI.cjs.map +1 -1
  58. package/dist/implementations/ZBTCVCAPI.d.cts +1 -1
  59. package/dist/implementations/ZBTCVCAPI.d.cts.map +1 -1
  60. package/dist/implementations/ZBTCVCAPI.d.mts +1 -1
  61. package/dist/implementations/ZBTCVCAPI.d.mts.map +1 -1
  62. package/dist/implementations/ZBTCVCAPI.mjs.map +1 -1
  63. package/dist/implementations/ZBTCVCDataAPI.cjs.map +1 -1
  64. package/dist/implementations/ZBTCVCDataAPI.d.cts +5 -5
  65. package/dist/implementations/ZBTCVCDataAPI.d.cts.map +1 -1
  66. package/dist/implementations/ZBTCVCDataAPI.d.mts +5 -5
  67. package/dist/implementations/ZBTCVCDataAPI.d.mts.map +1 -1
  68. package/dist/implementations/ZBTCVCDataAPI.mjs.map +1 -1
  69. package/dist/implementations/ZLPAPI.cjs.map +1 -1
  70. package/dist/implementations/ZLPAPI.d.cts +1 -1
  71. package/dist/implementations/ZLPAPI.d.cts.map +1 -1
  72. package/dist/implementations/ZLPAPI.d.mts +1 -1
  73. package/dist/implementations/ZLPAPI.d.mts.map +1 -1
  74. package/dist/implementations/ZLPAPI.mjs.map +1 -1
  75. package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
  76. package/dist/implementations/ZLPDataAPI.d.cts +5 -5
  77. package/dist/implementations/ZLPDataAPI.d.cts.map +1 -1
  78. package/dist/implementations/ZLPDataAPI.d.mts +5 -5
  79. package/dist/implementations/ZLPDataAPI.d.mts.map +1 -1
  80. package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
  81. package/dist/index.cjs +1 -0
  82. package/dist/index.cjs.map +1 -1
  83. package/dist/index.d.cts +2 -1
  84. package/dist/index.d.cts.map +1 -1
  85. package/dist/index.d.mts +2 -1
  86. package/dist/index.d.mts.map +1 -1
  87. package/dist/index.mjs +1 -0
  88. package/dist/index.mjs.map +1 -1
  89. package/dist/interfaces/base.d.cts +1 -1
  90. package/dist/interfaces/base.d.cts.map +1 -1
  91. package/dist/interfaces/base.d.mts +1 -1
  92. package/dist/interfaces/base.d.mts.map +1 -1
  93. package/dist/oracle.cjs.map +1 -1
  94. package/dist/oracle.d.cts +1 -1
  95. package/dist/oracle.d.cts.map +1 -1
  96. package/dist/oracle.d.mts +1 -1
  97. package/dist/oracle.d.mts.map +1 -1
  98. package/dist/oracle.mjs.map +1 -1
  99. package/dist/suiClient.cjs +8 -0
  100. package/dist/suiClient.cjs.map +1 -0
  101. package/dist/suiClient.d.cts +8 -0
  102. package/dist/suiClient.d.cts.map +1 -0
  103. package/dist/suiClient.d.mts +8 -0
  104. package/dist/suiClient.d.mts.map +1 -0
  105. package/dist/suiClient.mjs +2 -0
  106. package/dist/suiClient.mjs.map +1 -0
  107. package/dist/utils.cjs +7 -3
  108. package/dist/utils.cjs.map +1 -1
  109. package/dist/utils.d.cts +2 -2
  110. package/dist/utils.d.cts.map +1 -1
  111. package/dist/utils.d.mts +2 -2
  112. package/dist/utils.d.mts.map +1 -1
  113. package/dist/utils.mjs +7 -3
  114. package/dist/utils.mjs.map +1 -1
  115. package/package.json +4 -4
  116. package/src/abstract/BaseAPI.ts +1 -1
  117. package/src/abstract/BaseDataAPI.ts +1 -1
  118. package/src/api.ts +8 -12
  119. package/src/coins.ts +2 -1
  120. package/src/data.ts +1 -1
  121. package/src/factory/SDKFactory.ts +1 -1
  122. package/src/implementations/SLPAPI.ts +1 -1
  123. package/src/implementations/SLPDataAPI.ts +1 -1
  124. package/src/implementations/USDZAPI.ts +1 -1
  125. package/src/implementations/USDZDataAPI.ts +1 -1
  126. package/src/implementations/ZBTCVCAPI.ts +1 -1
  127. package/src/implementations/ZBTCVCDataAPI.ts +1 -1
  128. package/src/implementations/ZLPAPI.ts +1 -1
  129. package/src/implementations/ZLPDataAPI.ts +1 -1
  130. package/src/index.ts +2 -1
  131. package/src/interfaces/base.ts +1 -1
  132. package/src/oracle.ts +6 -2
  133. package/src/suiClient.ts +11 -0
  134. package/src/utils.ts +9 -3
  135. package/tsconfig.json +8 -1
package/src/oracle.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { SuiClient } from '@mysten/sui/client'
2
1
  import type { TransactionObjectArgument } from '@mysten/sui/transactions'
3
2
  import { Transaction } from '@mysten/sui/transactions'
4
3
  import type { PriceFeed } from '@pythnetwork/pyth-sui-js'
@@ -7,6 +6,7 @@ import { SuiPriceServiceConnection, SuiPythClient } from '@pythnetwork/pyth-sui-
7
6
  import { resolveSpendableSuiCoin } from './coins'
8
7
  import type { IConsts, Network } from './consts'
9
8
  import { getConsts, getPriceIdToPythFeeder, getPythFeederToId, getPythFeederToPriceId, getSharedConfig, LPToken } from './consts'
9
+ import type { SuiClient } from './suiClient'
10
10
  import { createJsonRpcProvider } from './utils'
11
11
 
12
12
  export interface IInitOracleSponsorOptions {
@@ -47,7 +47,11 @@ export class OracleAPI {
47
47
  this.PythFeederToPriceId = getPythFeederToPriceId(network)
48
48
  this.PythFeederToId = getPythFeederToId(network)
49
49
  this.provider = provider || createJsonRpcProvider(network)
50
- this.client = new SuiPythClient(this.provider, this.consts.pythFeeder.state, this.consts.pythFeeder.wormhole.state)
50
+ this.client = new SuiPythClient(
51
+ this.provider as ConstructorParameters<typeof SuiPythClient>[0],
52
+ this.consts.pythFeeder.state,
53
+ this.consts.pythFeeder.wormhole.state,
54
+ )
51
55
  }
52
56
 
53
57
  validateCache() {
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Sui v2 client re-exports.
3
+ * SuiJsonRpcClient is the JSON-RPC replacement for the removed SuiClient.
4
+ */
5
+ export type { ClientWithCoreApi } from '@mysten/sui/client'
6
+ export type { DynamicFieldInfo, SuiJsonRpcClient as SuiClient } from '@mysten/sui/jsonRpc'
7
+ export {
8
+ getJsonRpcFullnodeUrl,
9
+ JsonRpcHTTPTransport,
10
+ SuiJsonRpcClient,
11
+ } from '@mysten/sui/jsonRpc'
package/src/utils.ts CHANGED
@@ -1,8 +1,13 @@
1
- import { SuiClient, SuiHTTPTransport } from '@mysten/sui/client'
1
+ import type { SuiClientTypes } from '@mysten/sui/client'
2
+ import { JsonRpcHTTPTransport, SuiJsonRpcClient } from '@mysten/sui/jsonRpc'
2
3
 
3
4
  import type { IConsts } from './consts'
4
5
  import { Network } from './consts'
5
6
 
7
+ function toSuiNetwork(network: Network): SuiClientTypes.Network {
8
+ return network
9
+ }
10
+
6
11
  export function createJsonRpcProvider(network: Network) {
7
12
  let url = ''
8
13
  switch (network) {
@@ -23,8 +28,9 @@ export function createJsonRpcProvider(network: Network) {
23
28
  }
24
29
  }
25
30
 
26
- return new SuiClient({
27
- transport: new SuiHTTPTransport({ url }),
31
+ return new SuiJsonRpcClient({
32
+ transport: new JsonRpcHTTPTransport({ url }),
33
+ network: toSuiNetwork(network),
28
34
  })
29
35
  }
30
36
 
package/tsconfig.json CHANGED
@@ -2,7 +2,14 @@
2
2
  "compilerOptions": {
3
3
  "target": "ES2020",
4
4
  "module": "ESNext",
5
- "moduleResolution": "node",
5
+ "moduleResolution": "bundler",
6
+ "baseUrl": ".",
7
+ "paths": {
8
+ "@mysten/sui/transactions": ["node_modules/@mysten/sui/dist/transactions/index.d.mts"],
9
+ "@mysten/sui/utils": ["node_modules/@mysten/sui/dist/utils/index.d.mts"],
10
+ "@mysten/sui/jsonRpc": ["node_modules/@mysten/sui/dist/jsonRpc/index.d.mts"],
11
+ "@mysten/sui/client": ["node_modules/@mysten/sui/dist/client/index.d.mts"]
12
+ },
6
13
  "esModuleInterop": true,
7
14
  "forceConsistentCasingInFileNames": true,
8
15
  "strict": true,