@typus/typus-sdk 1.4.8 → 1.4.10
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/config.json +19 -14
- package/dist/src/dice/api.d.ts +1 -0
- package/dist/src/{tails-exp-dice → dice}/api.js +8 -3
- package/dist/src/{tails-exp-dice → dice}/fetch.d.ts +15 -12
- package/dist/src/{tails-exp-dice → dice}/fetch.js +48 -148
- package/dist/src/{tails-exp-dice → dice}/user-entry.d.ts +4 -4
- package/dist/src/{tails-exp-dice → dice}/user-entry.js +26 -11
- package/dist/src/dice/view-function.d.ts +8 -0
- package/dist/src/{tails-exp-dice → dice}/view-function.js +3 -3
- package/dist/src/{leaderboard → typus/leaderboard}/view-function.js +2 -2
- package/dist/src/{tails-staking → typus/tails-staking}/user-entry.js +1 -1
- package/dist/src/{tails-staking → typus/tails-staking}/view-function.js +2 -2
- package/dist/src/typus-dov-single-v2/{entry/authority-entry.js → authority-entry.js} +1 -1
- package/dist/src/typus-dov-single-v2/function/bidding.d.ts +2 -2
- package/dist/src/typus-dov-single-v2/function/bidding.js +21 -23
- package/dist/src/typus-dov-single-v2/function/vault.js +2 -2
- package/dist/src/typus-dov-single-v2/history/user-history.js +43 -43
- package/dist/src/typus-dov-single-v2/history/vault-history.js +11 -11
- package/dist/src/typus-dov-single-v2/index.d.ts +3 -1
- package/dist/src/typus-dov-single-v2/index.js +3 -1
- package/dist/src/typus-dov-single-v2/{entry/mfud-user-entry.js → token-user-entry.js} +1 -1
- package/dist/src/typus-dov-single-v2/{entry/user-entry.js → user-entry.js} +1 -1
- package/dist/src/typus-dov-single-v2/view-function.js +8 -8
- package/dist/src/typus-nft/fetch.js +1 -0
- package/dist/src/typus-perp/fetch.d.ts +10 -10
- package/dist/src/typus-perp/fetch.js +20 -21
- package/dist/src/typus-perp/readVec.js +6 -6
- package/dist/src/typus-perp/user/order.d.ts +10 -10
- package/dist/src/typus-perp/user/order.js +31 -32
- package/dist/src/typus-perp/user/orderWithBidReceipt.d.ts +6 -6
- package/dist/src/typus-perp/user/orderWithBidReceipt.js +15 -17
- package/dist/src/typus-perp/user/tlp.d.ts +12 -13
- package/dist/src/typus-perp/user/tlp.js +38 -41
- package/dist/src/typus-safu/index.d.ts +3 -0
- package/dist/src/typus-safu/index.js +20 -0
- package/dist/src/typus-safu/user-entry.d.ts +84 -0
- package/dist/src/typus-safu/user-entry.js +158 -0
- package/dist/src/typus-safu/view-function.d.ts +31 -0
- package/dist/src/typus-safu/view-function.js +147 -0
- package/dist/src/utils/api/sentio/reward-generated.js +3 -3
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/pyth/constant.js +1 -1
- package/dist/src/utils/pyth/pythClient.d.ts +1 -1
- package/dist/src/utils/pyth/pythClient.js +1 -1
- package/dist/src/utils/typusConfig.d.ts +93 -0
- package/dist/src/utils/typusConfig.js +21 -0
- package/package.json +4 -1
- package/dist/src/index.d.ts +0 -11
- package/dist/src/index.js +0 -27
- package/dist/src/tails-exp-dice/api.d.ts +0 -1
- package/dist/src/tails-exp-dice/view-function.d.ts +0 -8
- package/dist/src/typus-dov-single-v2/entry/index.d.ts +0 -3
- package/dist/src/typus-dov-single-v2/entry/index.js +0 -19
- /package/dist/src/{tails-exp-dice → dice}/index.d.ts +0 -0
- /package/dist/src/{tails-exp-dice → dice}/index.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/authority-entry.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/authority-entry.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/index.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/index.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/user-entry.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/user-entry.js +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/view-function.d.ts +0 -0
- /package/dist/src/{airdrop → typus/airdrop}/view-function.js +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/authority-entry.d.ts +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/authority-entry.js +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/index.d.ts +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/index.js +0 -0
- /package/dist/src/{leaderboard → typus/leaderboard}/view-function.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/authority-entry.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/authority-entry.js +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/index.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/index.js +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/user-entry.d.ts +0 -0
- /package/dist/src/{tails-staking → typus/tails-staking}/view-function.d.ts +0 -0
- /package/dist/src/{user → typus/user}/index.d.ts +0 -0
- /package/dist/src/{user → typus/user}/index.js +0 -0
- /package/dist/src/{user → typus/user}/view-function.d.ts +0 -0
- /package/dist/src/{user → typus/user}/view-function.js +0 -0
- /package/dist/src/typus-dov-single-v2/{entry/authority-entry.d.ts → authority-entry.d.ts} +0 -0
- /package/dist/src/typus-dov-single-v2/{entry/mfud-user-entry.d.ts → token-user-entry.d.ts} +0 -0
- /package/dist/src/typus-dov-single-v2/{entry/user-entry.d.ts → user-entry.d.ts} +0 -0
|
@@ -56,7 +56,7 @@ exports.priceInfoObjectIds = {
|
|
|
56
56
|
// Get the state IDs of the Pyth and Wormhole contracts from
|
|
57
57
|
// https://docs.pyth.network/price-feeds/contract-addresses/sui
|
|
58
58
|
exports.wormholeStateId = {
|
|
59
|
-
MAINNET: "
|
|
59
|
+
MAINNET: "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",
|
|
60
60
|
TESTNET: "0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",
|
|
61
61
|
};
|
|
62
62
|
exports.pythStateId = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SuiPriceServiceConnection, SuiPythClient } from "@pythnetwork/pyth-sui-js";
|
|
2
2
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
3
|
-
import { TOKEN } from "../../constants
|
|
3
|
+
import { TOKEN } from "../../constants";
|
|
4
4
|
import { ObjectId } from "@pythnetwork/pyth-sui-js/lib/client";
|
|
5
5
|
export declare class PythClient {
|
|
6
6
|
network: "MAINNET" | "TESTNET";
|
|
@@ -43,7 +43,7 @@ var pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js");
|
|
|
43
43
|
var constant_1 = require("./constant");
|
|
44
44
|
function createPythClient(provider, network) {
|
|
45
45
|
var client = new pyth_sui_js_1.SuiPythClient(provider, constant_1.pythStateId[network], constant_1.wormholeStateId[network]);
|
|
46
|
-
var connection = new pyth_sui_js_1.SuiPriceServiceConnection("https://hermes-beta.pyth.network");
|
|
46
|
+
var connection = network == "MAINNET" ? new pyth_sui_js_1.SuiPriceServiceConnection("https://hermes.pyth.network") : new pyth_sui_js_1.SuiPriceServiceConnection("https://hermes-beta.pyth.network");
|
|
47
47
|
var pythClient = { network: network, client: client, connection: connection };
|
|
48
48
|
return pythClient;
|
|
49
49
|
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare class TypusConfig {
|
|
2
|
+
rpcEndpoint: string;
|
|
3
|
+
packageOrigin: Package;
|
|
4
|
+
package: Package;
|
|
5
|
+
version: Version;
|
|
6
|
+
registry: Registry;
|
|
7
|
+
object: Object;
|
|
8
|
+
oracle: Oracle;
|
|
9
|
+
token: Token;
|
|
10
|
+
static parse(json: any): TypusConfig;
|
|
11
|
+
}
|
|
12
|
+
export interface Package {
|
|
13
|
+
dice: string;
|
|
14
|
+
dovSingle: string;
|
|
15
|
+
framework: string;
|
|
16
|
+
mfud: string;
|
|
17
|
+
nft: string;
|
|
18
|
+
oracle: string;
|
|
19
|
+
perp: string;
|
|
20
|
+
safu: string;
|
|
21
|
+
typus: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Version {
|
|
24
|
+
perp: string;
|
|
25
|
+
safu: string;
|
|
26
|
+
typus: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Registry {
|
|
29
|
+
dice: {
|
|
30
|
+
comboDice: string;
|
|
31
|
+
tailsExp: string;
|
|
32
|
+
};
|
|
33
|
+
dov: {
|
|
34
|
+
dovSingle: string;
|
|
35
|
+
};
|
|
36
|
+
perp: {
|
|
37
|
+
liquidityPool: string;
|
|
38
|
+
lpPool: string;
|
|
39
|
+
market: string;
|
|
40
|
+
stakePool: string;
|
|
41
|
+
tlp: string;
|
|
42
|
+
};
|
|
43
|
+
safu: {
|
|
44
|
+
safu: string;
|
|
45
|
+
};
|
|
46
|
+
token: {
|
|
47
|
+
inj: string;
|
|
48
|
+
mfud: string;
|
|
49
|
+
sei: string;
|
|
50
|
+
};
|
|
51
|
+
typus: {
|
|
52
|
+
airdrop: string;
|
|
53
|
+
leaderboard: string;
|
|
54
|
+
tailsStaking: string;
|
|
55
|
+
tgld: string;
|
|
56
|
+
user: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface Object {
|
|
60
|
+
nftTransferPolicy: string;
|
|
61
|
+
strategyPool: string;
|
|
62
|
+
tailsIds: string;
|
|
63
|
+
tgldCoinMetadata: string;
|
|
64
|
+
tgldTokenPolicy: string;
|
|
65
|
+
tlpTreasuryCap: string;
|
|
66
|
+
}
|
|
67
|
+
export interface Oracle {
|
|
68
|
+
afsui: string;
|
|
69
|
+
apt: string;
|
|
70
|
+
buck: string;
|
|
71
|
+
cetus: string;
|
|
72
|
+
inj: string;
|
|
73
|
+
jup: string;
|
|
74
|
+
navx: string;
|
|
75
|
+
sca: string;
|
|
76
|
+
sei: string;
|
|
77
|
+
sol: string;
|
|
78
|
+
sui: string;
|
|
79
|
+
turbos: string;
|
|
80
|
+
usdy: string;
|
|
81
|
+
wbtc: string;
|
|
82
|
+
weth: string;
|
|
83
|
+
}
|
|
84
|
+
export interface Token {
|
|
85
|
+
afsui: string;
|
|
86
|
+
fud: string;
|
|
87
|
+
mfud: string;
|
|
88
|
+
sui: string;
|
|
89
|
+
tgld: string;
|
|
90
|
+
tlp: string;
|
|
91
|
+
usd: string;
|
|
92
|
+
usdt: string;
|
|
93
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypusConfig = void 0;
|
|
4
|
+
var camelcaseKeysDeep = require("camelcase-keys-deep");
|
|
5
|
+
var TypusConfig = /** @class */ (function () {
|
|
6
|
+
function TypusConfig() {
|
|
7
|
+
}
|
|
8
|
+
TypusConfig.parse = function (json) {
|
|
9
|
+
return JSON.parse(JSON.stringify(camelcaseKeysDeep(json)));
|
|
10
|
+
};
|
|
11
|
+
return TypusConfig;
|
|
12
|
+
}());
|
|
13
|
+
exports.TypusConfig = TypusConfig;
|
|
14
|
+
// (async () => {
|
|
15
|
+
// const { default: json } = await import("../../config-testnet.json");
|
|
16
|
+
// let config = TypusConfig.parse(json);
|
|
17
|
+
// console.log(config);
|
|
18
|
+
// console.log(config.rpcEndpoint);
|
|
19
|
+
// console.log(config.registry.dice.comboDice);
|
|
20
|
+
// console.log(config.token.tgld);
|
|
21
|
+
// })();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typus/typus-sdk",
|
|
3
3
|
"author": "Typus",
|
|
4
4
|
"description": "typus sdk",
|
|
5
|
-
"version": "1.4.
|
|
5
|
+
"version": "1.4.10",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mysten/bcs": "^0.11.1",
|
|
8
8
|
"@mysten/kiosk": "0.8.10",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"bls-signatures": "^2.0.2",
|
|
18
18
|
"bs58": "^5.0.0",
|
|
19
19
|
"builtin-modules": "^3.3.0",
|
|
20
|
+
"camelcase-keys-deep": "^0.1.0",
|
|
20
21
|
"chai": "^4.3.7",
|
|
21
22
|
"decimal.js": "^10.3.1",
|
|
22
23
|
"diff": "^5.1.0",
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"resolve": "^1.20.0",
|
|
53
54
|
"rxjs": "^7.8.1",
|
|
54
55
|
"semver": "^7.5.4",
|
|
56
|
+
"slack": "^11.0.2",
|
|
55
57
|
"sprintf-js": "^1.0.3",
|
|
56
58
|
"superstruct": "^1.0.3",
|
|
57
59
|
"supports-color": "^9.4.0",
|
|
@@ -67,6 +69,7 @@
|
|
|
67
69
|
},
|
|
68
70
|
"devDependencies": {
|
|
69
71
|
"@types/bs58": "^4.0.1",
|
|
72
|
+
"@types/camelcase-keys-deep": "^0.1.2",
|
|
70
73
|
"@types/expect": "^24.3.0",
|
|
71
74
|
"@types/mocha": "^10.0.1",
|
|
72
75
|
"@types/rx": "^4.1.2",
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from "./airdrop";
|
|
2
|
-
export * from "./auto-bid";
|
|
3
|
-
export * from "./constants";
|
|
4
|
-
export * from "./leaderboard";
|
|
5
|
-
export * from "./tails-exp-dice";
|
|
6
|
-
export * from "./tails-staking";
|
|
7
|
-
export * from "./typus-dov-single-v2";
|
|
8
|
-
export * from "./typus-nft";
|
|
9
|
-
export * from "./typus-perp";
|
|
10
|
-
export * from "./user";
|
|
11
|
-
export * from "./utils";
|
package/dist/src/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./airdrop"), exports);
|
|
18
|
-
__exportStar(require("./auto-bid"), exports);
|
|
19
|
-
__exportStar(require("./constants"), exports);
|
|
20
|
-
__exportStar(require("./leaderboard"), exports);
|
|
21
|
-
__exportStar(require("./tails-exp-dice"), exports);
|
|
22
|
-
__exportStar(require("./tails-staking"), exports);
|
|
23
|
-
__exportStar(require("./typus-dov-single-v2"), exports);
|
|
24
|
-
__exportStar(require("./typus-nft"), exports);
|
|
25
|
-
__exportStar(require("./typus-perp"), exports);
|
|
26
|
-
__exportStar(require("./user"), exports);
|
|
27
|
-
__exportStar(require("./utils"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getDrawResult(network: "mainnet" | "testnet", packageId: string, registry: string, index: string, amount: string, guess_1: string, larger_than_1: boolean, guess_2: string, larger_than_2: boolean, vrf_input_1: number[], vrf_input_2: number[]): Promise<any>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface DrawResult {
|
|
2
|
-
answer_1: string;
|
|
3
|
-
result_1: string;
|
|
4
|
-
answer_2: string;
|
|
5
|
-
result_2: string;
|
|
6
|
-
exp: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function simulateGame(network: "mainnet" | "testnet", packageId: string, registry: string, index: string, amount: string, guess_1: string, larger_than_1: boolean, guess_2: string, larger_than_2: boolean, vrf_input_1: number[], vrf_input_2: number[], drawKeys: any, sender?: string): Promise<DrawResult>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./user-entry"), exports);
|
|
18
|
-
__exportStar(require("./authority-entry"), exports);
|
|
19
|
-
__exportStar(require("./mfud-user-entry"), exports);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|