@gearbox-protocol/sdk 1.27.4 → 1.27.5
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.
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { NetworkType } from "../core/chains";
|
|
2
2
|
import { TokenDataPayload } from "../payload/token";
|
|
3
3
|
import { SupportedToken } from "./token";
|
|
4
|
-
type SymbolReplacements = Record<string, string>;
|
|
5
4
|
export declare class TokenData {
|
|
6
5
|
readonly id: string;
|
|
7
6
|
readonly symbol: string;
|
|
8
7
|
readonly address: string;
|
|
9
8
|
readonly decimals: number;
|
|
10
9
|
readonly icon?: string;
|
|
11
|
-
constructor(payload: TokenDataPayload, symbolReplacements?:
|
|
10
|
+
constructor(payload: TokenDataPayload, symbolReplacements?: Record<string, string>);
|
|
12
11
|
compareBySymbol(b: TokenData): number;
|
|
13
12
|
}
|
|
14
13
|
export declare const connectors: Record<NetworkType, Array<SupportedToken>>;
|
|
15
14
|
export declare function getConnectors(networkType: NetworkType): string[];
|
|
16
|
-
export {};
|
package/lib/tokens/tokenData.js
CHANGED
|
@@ -3,17 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getConnectors = exports.connectors = exports.TokenData = void 0;
|
|
4
4
|
const config_1 = require("../config");
|
|
5
5
|
const token_1 = require("./token");
|
|
6
|
-
const defaultSymbolReplacement = {
|
|
7
|
-
dWETH: "dETH",
|
|
8
|
-
WETH: "ETH",
|
|
9
|
-
};
|
|
10
6
|
class TokenData {
|
|
11
7
|
id;
|
|
12
8
|
symbol;
|
|
13
9
|
address;
|
|
14
10
|
decimals;
|
|
15
11
|
icon;
|
|
16
|
-
constructor(payload, symbolReplacements =
|
|
12
|
+
constructor(payload, symbolReplacements = {}) {
|
|
17
13
|
this.id = payload.addr.toLowerCase();
|
|
18
14
|
this.address = payload.addr.toLowerCase();
|
|
19
15
|
this.symbol = symbolReplacements[payload.symbol] || payload.symbol;
|