@gearbox-protocol/sdk 11.7.0 → 11.7.1
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/cjs/sdk/sdk-gov-legacy/tokens/normal.js +0 -3
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/wrapped.js +0 -24
- package/dist/cjs/sdk/sdk-legacy/core/creditAccount.spec.js +8 -4
- package/dist/cjs/sdk/sdk-legacy/tokens/tokenData.js +2 -0
- package/dist/esm/sdk/sdk-gov-legacy/tokens/normal.js +0 -2
- package/dist/esm/sdk/sdk-gov-legacy/tokens/wrapped.js +0 -16
- package/dist/esm/sdk/sdk-legacy/core/creditAccount.spec.js +8 -4
- package/dist/esm/sdk/sdk-legacy/tokens/tokenData.js +2 -0
- package/dist/types/permissionless/utils/price-update/get-prices.d.ts +1 -1
- package/dist/types/sdk/sdk-gov-legacy/tokens/normal.d.ts +0 -1
- package/dist/types/sdk/sdk-gov-legacy/tokens/wrapped.d.ts +1 -3
- package/dist/types/sdk/sdk-legacy/tokens/tokenData.d.ts +2 -0
- package/package.json +1 -1
|
@@ -18,7 +18,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var normal_exports = {};
|
|
20
20
|
__export(normal_exports, {
|
|
21
|
-
isNormalToken: () => isNormalToken,
|
|
22
21
|
normalTokens: () => normalTokens
|
|
23
22
|
});
|
|
24
23
|
module.exports = __toCommonJS(normal_exports);
|
|
@@ -557,9 +556,7 @@ const normalTokens = {
|
|
|
557
556
|
type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
|
|
558
557
|
}
|
|
559
558
|
};
|
|
560
|
-
const isNormalToken = (t) => typeof t === "string" && !!normalTokens[t];
|
|
561
559
|
// Annotate the CommonJS export names for ESM import in node:
|
|
562
560
|
0 && (module.exports = {
|
|
563
|
-
isNormalToken,
|
|
564
561
|
normalTokens
|
|
565
562
|
});
|
|
@@ -3,10 +3,6 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
6
|
var __copyProps = (to, from, except, desc) => {
|
|
11
7
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
8
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,24 +13,4 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
13
|
};
|
|
18
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
15
|
var wrapped_exports = {};
|
|
20
|
-
__export(wrapped_exports, {
|
|
21
|
-
isWrappedToken: () => isWrappedToken
|
|
22
|
-
});
|
|
23
16
|
module.exports = __toCommonJS(wrapped_exports);
|
|
24
|
-
var import_tokenType = require("./tokenType.js");
|
|
25
|
-
const wrappedTokens = {
|
|
26
|
-
sfrxETH: {
|
|
27
|
-
name: "sfrxETH",
|
|
28
|
-
symbol: "sfrxETH",
|
|
29
|
-
type: {
|
|
30
|
-
Mainnet: import_tokenType.TokenType.WRAPPED_TOKEN,
|
|
31
|
-
Arbitrum: import_tokenType.TokenType.NORMAL_TOKEN,
|
|
32
|
-
Optimism: import_tokenType.TokenType.NORMAL_TOKEN
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const isWrappedToken = (t) => typeof t === "string" && !!wrappedTokens[t];
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
isWrappedToken
|
|
40
|
-
});
|
|
@@ -15,25 +15,29 @@ const tokenDataList = {
|
|
|
15
15
|
addr: WETH,
|
|
16
16
|
decimals: 18,
|
|
17
17
|
symbol: "WETH",
|
|
18
|
-
name: ""
|
|
18
|
+
name: "",
|
|
19
|
+
isPhantom: false
|
|
19
20
|
}),
|
|
20
21
|
[DAI]: new import_tokenData.TokenData({
|
|
21
22
|
addr: DAI,
|
|
22
23
|
decimals: 18,
|
|
23
24
|
symbol: "DAI",
|
|
24
|
-
name: ""
|
|
25
|
+
name: "",
|
|
26
|
+
isPhantom: false
|
|
25
27
|
}),
|
|
26
28
|
[USDC]: new import_tokenData.TokenData({
|
|
27
29
|
addr: USDC,
|
|
28
30
|
decimals: 6,
|
|
29
31
|
symbol: "USDC",
|
|
30
|
-
name: ""
|
|
32
|
+
name: "",
|
|
33
|
+
isPhantom: false
|
|
31
34
|
}),
|
|
32
35
|
[STETH]: new import_tokenData.TokenData({
|
|
33
36
|
addr: STETH,
|
|
34
37
|
decimals: 18,
|
|
35
38
|
symbol: "STETH",
|
|
36
|
-
name: ""
|
|
39
|
+
name: "",
|
|
40
|
+
isPhantom: false
|
|
37
41
|
})
|
|
38
42
|
};
|
|
39
43
|
const prices = {
|
|
@@ -69,6 +69,7 @@ class TokenData {
|
|
|
69
69
|
name;
|
|
70
70
|
decimals;
|
|
71
71
|
icon;
|
|
72
|
+
isPhantom;
|
|
72
73
|
constructor(payload) {
|
|
73
74
|
const address = payload.addr.toLowerCase();
|
|
74
75
|
this.address = address;
|
|
@@ -77,6 +78,7 @@ class TokenData {
|
|
|
77
78
|
this.name = payload.name;
|
|
78
79
|
this.decimals = payload.decimals;
|
|
79
80
|
this.icon = TokenData.getTokenIcon(payload.symbol);
|
|
81
|
+
this.isPhantom = payload.isPhantom ?? false;
|
|
80
82
|
}
|
|
81
83
|
static getTokenIcon(symbol) {
|
|
82
84
|
return `${import_endpoint.GearboxBackendApi.getStaticTokenUrl()}${symbol.toLowerCase()}.svg`;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TokenType } from "./tokenType.js";
|
|
2
|
-
const wrappedTokens = {
|
|
3
|
-
sfrxETH: {
|
|
4
|
-
name: "sfrxETH",
|
|
5
|
-
symbol: "sfrxETH",
|
|
6
|
-
type: {
|
|
7
|
-
Mainnet: TokenType.WRAPPED_TOKEN,
|
|
8
|
-
Arbitrum: TokenType.NORMAL_TOKEN,
|
|
9
|
-
Optimism: TokenType.NORMAL_TOKEN
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const isWrappedToken = (t) => typeof t === "string" && !!wrappedTokens[t];
|
|
14
|
-
export {
|
|
15
|
-
isWrappedToken
|
|
16
|
-
};
|
|
@@ -18,25 +18,29 @@ const tokenDataList = {
|
|
|
18
18
|
addr: WETH,
|
|
19
19
|
decimals: 18,
|
|
20
20
|
symbol: "WETH",
|
|
21
|
-
name: ""
|
|
21
|
+
name: "",
|
|
22
|
+
isPhantom: false
|
|
22
23
|
}),
|
|
23
24
|
[DAI]: new TokenData({
|
|
24
25
|
addr: DAI,
|
|
25
26
|
decimals: 18,
|
|
26
27
|
symbol: "DAI",
|
|
27
|
-
name: ""
|
|
28
|
+
name: "",
|
|
29
|
+
isPhantom: false
|
|
28
30
|
}),
|
|
29
31
|
[USDC]: new TokenData({
|
|
30
32
|
addr: USDC,
|
|
31
33
|
decimals: 6,
|
|
32
34
|
symbol: "USDC",
|
|
33
|
-
name: ""
|
|
35
|
+
name: "",
|
|
36
|
+
isPhantom: false
|
|
34
37
|
}),
|
|
35
38
|
[STETH]: new TokenData({
|
|
36
39
|
addr: STETH,
|
|
37
40
|
decimals: 18,
|
|
38
41
|
symbol: "STETH",
|
|
39
|
-
name: ""
|
|
42
|
+
name: "",
|
|
43
|
+
isPhantom: false
|
|
40
44
|
})
|
|
41
45
|
};
|
|
42
46
|
const prices = {
|
|
@@ -46,6 +46,7 @@ class TokenData {
|
|
|
46
46
|
name;
|
|
47
47
|
decimals;
|
|
48
48
|
icon;
|
|
49
|
+
isPhantom;
|
|
49
50
|
constructor(payload) {
|
|
50
51
|
const address = payload.addr.toLowerCase();
|
|
51
52
|
this.address = address;
|
|
@@ -54,6 +55,7 @@ class TokenData {
|
|
|
54
55
|
this.name = payload.name;
|
|
55
56
|
this.decimals = payload.decimals;
|
|
56
57
|
this.icon = TokenData.getTokenIcon(payload.symbol);
|
|
58
|
+
this.isPhantom = payload.isPhantom ?? false;
|
|
57
59
|
}
|
|
58
60
|
static getTokenIcon(symbol) {
|
|
59
61
|
return `${GearboxBackendApi.getStaticTokenUrl()}${symbol.toLowerCase()}.svg`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Address, type PublicClient } from "viem";
|
|
2
|
-
export declare function getPrices({ client, priceFeeds, chunkSize, gasLimit }: {
|
|
2
|
+
export declare function getPrices({ client, priceFeeds, chunkSize, gasLimit, }: {
|
|
3
3
|
client: PublicClient;
|
|
4
4
|
priceFeeds: Address[];
|
|
5
5
|
chunkSize?: number;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { TokenBase } from "./token.js";
|
|
2
|
-
import type { TokenNetwork } from "./tokenType.js";
|
|
3
|
-
import { TokenType } from "./tokenType.js";
|
|
2
|
+
import type { TokenNetwork, TokenType } from "./tokenType.js";
|
|
4
3
|
export type WrappedToken = "sfrxETH";
|
|
5
4
|
export type WrappedTokenData = {
|
|
6
5
|
symbol: WrappedToken;
|
|
7
6
|
type: Partial<Record<TokenNetwork, TokenType.WRAPPED_TOKEN | TokenType.NORMAL_TOKEN>>;
|
|
8
7
|
} & TokenBase;
|
|
9
|
-
export declare const isWrappedToken: (t: unknown) => t is WrappedToken;
|
|
@@ -6,6 +6,7 @@ export interface TokenDataPayload {
|
|
|
6
6
|
title?: string;
|
|
7
7
|
name: string;
|
|
8
8
|
decimals: number;
|
|
9
|
+
isPhantom: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare class TokenData {
|
|
11
12
|
readonly address: Address;
|
|
@@ -14,6 +15,7 @@ export declare class TokenData {
|
|
|
14
15
|
readonly name: string;
|
|
15
16
|
readonly decimals: number;
|
|
16
17
|
readonly icon: string;
|
|
18
|
+
readonly isPhantom: boolean;
|
|
17
19
|
constructor(payload: TokenDataPayload);
|
|
18
20
|
static getTokenIcon(symbol: string): string;
|
|
19
21
|
}
|