@typus/typus-sdk 1.6.4-tk → 1.6.4-tk2
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.
|
@@ -276,21 +276,22 @@ exports.tokenType = {
|
|
|
276
276
|
exports.oracle = {
|
|
277
277
|
MAINNET: {},
|
|
278
278
|
TESTNET: {
|
|
279
|
-
SUI: "
|
|
280
|
-
USDC: "
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
279
|
+
SUI: "0x9083c9ce1a1eef569bb1a8b31dfa5e0fce2e05887e68ba79ca6ae522acd041f3",
|
|
280
|
+
USDC: "0xb2c06a7b3831c92193c978ee225cac87500b8d858bcc853b6bf81d055886f057",
|
|
281
|
+
wUSDC: "0xa547855d0e0579dfa38b0b83fc5ff55746c4bc629363920ba84aef7c1e70a818",
|
|
282
|
+
wUSDT: "0x5c1b997c58ab64151e7f114f6a5c8b966aed871a06b3eb0730cf79822e894323",
|
|
283
|
+
wBTC: "0xc4ae30a21401fa66dc095ec7947d392cbabb7777f470b37d7c73b30574a614a7",
|
|
284
|
+
wETH: "0x1c36306a416d08895b6cdc64467c8987b1c1c88c0b46645c252b4c7b635586b1",
|
|
285
|
+
wSOL: "0x24372c35d30c6187d2377af195627d4ad9ed2acc195d8830b819d47312982011",
|
|
286
|
+
CETUS: "0xa4a561eb803df50be1633ab2fea597991ccb3cf35f0aac849f8742e54bd4ea9e",
|
|
287
|
+
TURBOS: "0xc811467327673c231815e26e7a139fb0acb8238441d341cbc3dbf556eeeefcc2",
|
|
288
|
+
SCA: "0xff5e6420079d2ea8b89e487bbe5ea0cbe2721fcf4391fa22b10302c8e2b45a3c",
|
|
289
|
+
SEI: "0x8143fba1105a0015680c7a7719193fedd9826972494a946f660fe3791a6f7e12",
|
|
290
|
+
INJ: "0xef20f3562324e8c408949a14bc7f5a37e8ce639aeaed80f07fd3552b0130bac8",
|
|
291
|
+
AFSUI: "0x03dd52c8b773e5d3886608efda6fa430774f12196aa349d989dde5c3636e49f9",
|
|
292
|
+
MFUD: "0x54f153e45008fcb7e2adf781d750f1bcbcd85e72bec6df769b6fe3e1ad6c02e4",
|
|
293
|
+
MBLUB: "0x826253a1dde9907e28f465df8b2a19ba5994b4b069abad98658532785940338a",
|
|
294
|
+
TYPUS: "0x73bb8651018bced7e737557fc9e4a7cf02ae28345b645566d0fd4df2da183048",
|
|
294
295
|
},
|
|
295
296
|
};
|
|
296
297
|
exports.tokenRegistry = {
|
|
@@ -510,7 +510,7 @@ function parseTxHistory(datas, vaults) {
|
|
|
510
510
|
break;
|
|
511
511
|
case "ExerciseEvent":
|
|
512
512
|
token = (0, constants_1.typeArgToAsset)("0x" + event.parsedJson.token.name);
|
|
513
|
-
amount = Number(event.parsedJson.amount) / Math.pow(10,
|
|
513
|
+
amount = Number(event.parsedJson.amount) / Math.pow(10, (0, constants_1.assetToDecimal)(token));
|
|
514
514
|
Action = "Exercise";
|
|
515
515
|
Amount = "".concat((0, bignumber_js_1.default)(amount).toFixed(), " ").concat(token);
|
|
516
516
|
if (event.parsedJson.u64_padding[0]) {
|
|
@@ -9,4 +9,4 @@ export declare class PythClient {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function createPythClient(provider: any, network: "MAINNET" | "TESTNET"): PythClient;
|
|
11
11
|
export declare function updatePyth(pythClient: PythClient, tx: Transaction, tokens: string[]): Promise<ObjectId[]>;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function updateOracleWithPythUsd(pythClient: PythClient, tx: Transaction, oraclePackage: string, baseToken: TOKEN): void;
|
|
@@ -38,9 +38,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.createPythClient = createPythClient;
|
|
40
40
|
exports.updatePyth = updatePyth;
|
|
41
|
-
exports.
|
|
41
|
+
exports.updateOracleWithPythUsd = updateOracleWithPythUsd;
|
|
42
42
|
var pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js");
|
|
43
43
|
var constant_1 = require("./constant");
|
|
44
|
+
var constants_1 = require("../../../src/constants");
|
|
44
45
|
function createPythClient(provider, network) {
|
|
45
46
|
var client = new pyth_sui_js_1.SuiPythClient(provider, constant_1.pythStateId[network], constant_1.wormholeStateId[network]);
|
|
46
47
|
var connection = network == "MAINNET"
|
|
@@ -67,15 +68,14 @@ function updatePyth(pythClient, tx, tokens) {
|
|
|
67
68
|
});
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
+
function updateOracleWithPythUsd(pythClient, tx, oraclePackage, baseToken) {
|
|
71
72
|
tx.moveCall({
|
|
72
|
-
target: "".concat(oraclePackage, "::oracle::
|
|
73
|
+
target: "".concat(oraclePackage, "::oracle::update_with_pyth_usd"),
|
|
73
74
|
typeArguments: [],
|
|
74
75
|
arguments: [
|
|
75
|
-
tx.object(
|
|
76
|
+
tx.object(constants_1.oracle[pythClient.network][baseToken]),
|
|
76
77
|
tx.object(constant_1.pythStateId[pythClient.network]),
|
|
77
78
|
tx.object(constant_1.priceInfoObjectIds[pythClient.network][baseToken]),
|
|
78
|
-
tx.object(constant_1.priceInfoObjectIds[pythClient.network][quoteToken]),
|
|
79
79
|
tx.object("0x6"),
|
|
80
80
|
],
|
|
81
81
|
});
|