@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.
- package/dist/abstract/BaseAPI.d.cts +3 -3
- package/dist/abstract/BaseAPI.d.cts.map +1 -1
- package/dist/abstract/BaseAPI.d.mts +3 -3
- package/dist/abstract/BaseAPI.d.mts.map +1 -1
- package/dist/abstract/BaseDataAPI.d.cts +1 -1
- package/dist/abstract/BaseDataAPI.d.cts.map +1 -1
- package/dist/abstract/BaseDataAPI.d.mts +1 -1
- package/dist/abstract/BaseDataAPI.d.mts.map +1 -1
- package/dist/api.cjs +7 -7
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +7 -7
- package/dist/api.mjs.map +1 -1
- package/dist/bcs.d.cts +41 -71
- package/dist/bcs.d.cts.map +1 -1
- package/dist/bcs.d.mts +41 -71
- package/dist/bcs.d.mts.map +1 -1
- package/dist/coins.cjs.map +1 -1
- package/dist/coins.d.cts +1 -1
- package/dist/coins.d.cts.map +1 -1
- package/dist/coins.d.mts +1 -1
- package/dist/coins.d.mts.map +1 -1
- package/dist/coins.mjs.map +1 -1
- package/dist/data.d.cts +6 -6
- package/dist/data.d.cts.map +1 -1
- package/dist/data.d.mts +6 -6
- package/dist/data.d.mts.map +1 -1
- package/dist/factory/SDKFactory.d.cts +1 -1
- package/dist/factory/SDKFactory.d.cts.map +1 -1
- package/dist/factory/SDKFactory.d.mts +1 -1
- package/dist/factory/SDKFactory.d.mts.map +1 -1
- package/dist/implementations/SLPAPI.cjs.map +1 -1
- package/dist/implementations/SLPAPI.d.cts +1 -1
- package/dist/implementations/SLPAPI.d.cts.map +1 -1
- package/dist/implementations/SLPAPI.d.mts +1 -1
- package/dist/implementations/SLPAPI.d.mts.map +1 -1
- package/dist/implementations/SLPAPI.mjs.map +1 -1
- package/dist/implementations/SLPDataAPI.cjs.map +1 -1
- package/dist/implementations/SLPDataAPI.d.cts +5 -5
- package/dist/implementations/SLPDataAPI.d.cts.map +1 -1
- package/dist/implementations/SLPDataAPI.d.mts +5 -5
- package/dist/implementations/SLPDataAPI.d.mts.map +1 -1
- package/dist/implementations/SLPDataAPI.mjs.map +1 -1
- package/dist/implementations/USDZAPI.cjs.map +1 -1
- package/dist/implementations/USDZAPI.d.cts +1 -1
- package/dist/implementations/USDZAPI.d.cts.map +1 -1
- package/dist/implementations/USDZAPI.d.mts +1 -1
- package/dist/implementations/USDZAPI.d.mts.map +1 -1
- package/dist/implementations/USDZAPI.mjs.map +1 -1
- package/dist/implementations/USDZDataAPI.d.cts +5 -5
- package/dist/implementations/USDZDataAPI.d.cts.map +1 -1
- package/dist/implementations/USDZDataAPI.d.mts +5 -5
- package/dist/implementations/USDZDataAPI.d.mts.map +1 -1
- package/dist/implementations/ZBTCVCAPI.cjs.map +1 -1
- package/dist/implementations/ZBTCVCAPI.d.cts +1 -1
- package/dist/implementations/ZBTCVCAPI.d.cts.map +1 -1
- package/dist/implementations/ZBTCVCAPI.d.mts +1 -1
- package/dist/implementations/ZBTCVCAPI.d.mts.map +1 -1
- package/dist/implementations/ZBTCVCAPI.mjs.map +1 -1
- package/dist/implementations/ZBTCVCDataAPI.cjs.map +1 -1
- package/dist/implementations/ZBTCVCDataAPI.d.cts +5 -5
- package/dist/implementations/ZBTCVCDataAPI.d.cts.map +1 -1
- package/dist/implementations/ZBTCVCDataAPI.d.mts +5 -5
- package/dist/implementations/ZBTCVCDataAPI.d.mts.map +1 -1
- package/dist/implementations/ZBTCVCDataAPI.mjs.map +1 -1
- package/dist/implementations/ZLPAPI.cjs.map +1 -1
- package/dist/implementations/ZLPAPI.d.cts +1 -1
- package/dist/implementations/ZLPAPI.d.cts.map +1 -1
- package/dist/implementations/ZLPAPI.d.mts +1 -1
- package/dist/implementations/ZLPAPI.d.mts.map +1 -1
- package/dist/implementations/ZLPAPI.mjs.map +1 -1
- package/dist/implementations/ZLPDataAPI.cjs.map +1 -1
- package/dist/implementations/ZLPDataAPI.d.cts +5 -5
- package/dist/implementations/ZLPDataAPI.d.cts.map +1 -1
- package/dist/implementations/ZLPDataAPI.d.mts +5 -5
- package/dist/implementations/ZLPDataAPI.d.mts.map +1 -1
- package/dist/implementations/ZLPDataAPI.mjs.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/base.d.cts +1 -1
- package/dist/interfaces/base.d.cts.map +1 -1
- package/dist/interfaces/base.d.mts +1 -1
- package/dist/interfaces/base.d.mts.map +1 -1
- package/dist/oracle.cjs.map +1 -1
- package/dist/oracle.d.cts +1 -1
- package/dist/oracle.d.cts.map +1 -1
- package/dist/oracle.d.mts +1 -1
- package/dist/oracle.d.mts.map +1 -1
- package/dist/oracle.mjs.map +1 -1
- package/dist/suiClient.cjs +8 -0
- package/dist/suiClient.cjs.map +1 -0
- package/dist/suiClient.d.cts +8 -0
- package/dist/suiClient.d.cts.map +1 -0
- package/dist/suiClient.d.mts +8 -0
- package/dist/suiClient.d.mts.map +1 -0
- package/dist/suiClient.mjs +2 -0
- package/dist/suiClient.mjs.map +1 -0
- package/dist/utils.cjs +7 -3
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.mts.map +1 -1
- package/dist/utils.mjs +7 -3
- package/dist/utils.mjs.map +1 -1
- package/package.json +4 -4
- package/src/abstract/BaseAPI.ts +1 -1
- package/src/abstract/BaseDataAPI.ts +1 -1
- package/src/api.ts +8 -12
- package/src/coins.ts +2 -1
- package/src/data.ts +1 -1
- package/src/factory/SDKFactory.ts +1 -1
- package/src/implementations/SLPAPI.ts +1 -1
- package/src/implementations/SLPDataAPI.ts +1 -1
- package/src/implementations/USDZAPI.ts +1 -1
- package/src/implementations/USDZDataAPI.ts +1 -1
- package/src/implementations/ZBTCVCAPI.ts +1 -1
- package/src/implementations/ZBTCVCDataAPI.ts +1 -1
- package/src/implementations/ZLPAPI.ts +1 -1
- package/src/implementations/ZLPDataAPI.ts +1 -1
- package/src/index.ts +2 -1
- package/src/interfaces/base.ts +1 -1
- package/src/oracle.ts +6 -2
- package/src/suiClient.ts +11 -0
- package/src/utils.ts +9 -3
- 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(
|
|
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() {
|
package/src/suiClient.ts
ADDED
|
@@ -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 {
|
|
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
|
|
27
|
-
transport: new
|
|
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": "
|
|
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,
|