@dahlia-labs/token-utils
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -7,26 +7,2 @@ /** | ||
*/ | ||
export declare enum ChainId { | ||
Mainnet = 42220, | ||
Alfajores = 44787, | ||
Baklava = 62320 | ||
} | ||
export declare enum TradeType { | ||
EXACT_INPUT = 0, | ||
EXACT_OUTPUT = 1 | ||
} | ||
export declare enum NetworkNames { | ||
Alfajores = "Alfajores", | ||
Baklava = "Baklava", | ||
Mainnet = "Mainnet" | ||
} | ||
export interface Network { | ||
name: NetworkNames; | ||
rpcUrl: string; | ||
graphQl: string; | ||
explorer: string; | ||
chainId: ChainId; | ||
} | ||
export declare const Alfajores: Network; | ||
export declare const Baklava: Network; | ||
export declare const Mainnet: Network; | ||
/** | ||
@@ -33,0 +9,0 @@ * A token list. |
@@ -9,41 +9,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Mainnet = exports.Baklava = exports.Alfajores = exports.NetworkNames = exports.TradeType = exports.ChainId = void 0; | ||
var ChainId; | ||
(function (ChainId) { | ||
ChainId[ChainId["Mainnet"] = 42220] = "Mainnet"; | ||
ChainId[ChainId["Alfajores"] = 44787] = "Alfajores"; | ||
ChainId[ChainId["Baklava"] = 62320] = "Baklava"; | ||
})(ChainId = exports.ChainId || (exports.ChainId = {})); | ||
var TradeType; | ||
(function (TradeType) { | ||
TradeType[TradeType["EXACT_INPUT"] = 0] = "EXACT_INPUT"; | ||
TradeType[TradeType["EXACT_OUTPUT"] = 1] = "EXACT_OUTPUT"; | ||
})(TradeType = exports.TradeType || (exports.TradeType = {})); | ||
var NetworkNames; | ||
(function (NetworkNames) { | ||
NetworkNames["Alfajores"] = "Alfajores"; | ||
NetworkNames["Baklava"] = "Baklava"; | ||
NetworkNames["Mainnet"] = "Mainnet"; | ||
})(NetworkNames = exports.NetworkNames || (exports.NetworkNames = {})); | ||
exports.Alfajores = { | ||
name: NetworkNames.Alfajores, | ||
rpcUrl: "https://alfajores-forno.celo-testnet.org", | ||
graphQl: "https://alfajores-blockscout.celo-testnet.org/graphiql", | ||
explorer: "https://alfajores-blockscout.celo-testnet.org", | ||
chainId: ChainId.Alfajores, | ||
}; | ||
exports.Baklava = { | ||
name: NetworkNames.Baklava, | ||
rpcUrl: "https://baklava-forno.celo-testnet.org", | ||
graphQl: "https://baklava-blockscout.celo-testnet.org/graphiql", | ||
explorer: "https://baklava-blockscout.celo-testnet.org", | ||
chainId: ChainId.Baklava, | ||
}; | ||
exports.Mainnet = { | ||
name: NetworkNames.Mainnet, | ||
rpcUrl: "https://forno.celo.org", | ||
graphQl: "https://explorer.celo.org/graphiql", | ||
explorer: "https://explorer.celo.org", | ||
chainId: ChainId.Mainnet, | ||
}; | ||
//# sourceMappingURL=splTokenRegistry.js.map |
@@ -0,4 +1,3 @@ | ||
import type { ChainId, Network } from "@dahlia-labs/celo-contrib"; | ||
import type { Token as UToken } from "@ubeswap/token-math"; | ||
import type { Network } from "./"; | ||
import { ChainId } from "./"; | ||
import type { TokenInfo } from "./tokenList"; | ||
@@ -62,13 +61,2 @@ /** | ||
}; | ||
export declare const CHAIN_ID_TO_NETWORK: { | ||
42220: Network; | ||
44787: Network; | ||
62320: Network; | ||
}; | ||
/** | ||
* Gets the Network associated with a chain id. | ||
* @param network | ||
* @returns | ||
*/ | ||
export declare const chainIdToNetwork: (env: ChainId) => Network; | ||
//# sourceMappingURL=token.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.chainIdToNetwork = exports.CHAIN_ID_TO_NETWORK = exports.tokensEqual = exports.Token = void 0; | ||
const _1 = require("./"); | ||
exports.tokensEqual = exports.Token = void 0; | ||
const celo_contrib_1 = require("@dahlia-labs/celo-contrib"); | ||
/** | ||
@@ -12,3 +12,3 @@ * Token information. | ||
this.info = info; | ||
this.network = (_a = (0, exports.chainIdToNetwork)(info.chainId)) !== null && _a !== void 0 ? _a : _1.Mainnet; | ||
this.network = (_a = (0, celo_contrib_1.chainIdToNetwork)(info.chainId)) !== null && _a !== void 0 ? _a : celo_contrib_1.Mainnet; | ||
} | ||
@@ -82,14 +82,2 @@ /** | ||
exports.tokensEqual = tokensEqual; | ||
exports.CHAIN_ID_TO_NETWORK = { | ||
[_1.ChainId.Mainnet]: _1.Mainnet, | ||
[_1.ChainId.Alfajores]: _1.Alfajores, | ||
[_1.ChainId.Baklava]: _1.Baklava, | ||
}; | ||
/** | ||
* Gets the Network associated with a chain id. | ||
* @param network | ||
* @returns | ||
*/ | ||
const chainIdToNetwork = (env) => exports.CHAIN_ID_TO_NETWORK[env]; | ||
exports.chainIdToNetwork = chainIdToNetwork; | ||
//# sourceMappingURL=token.js.map |
@@ -7,26 +7,2 @@ /** | ||
*/ | ||
export declare enum ChainId { | ||
Mainnet = 42220, | ||
Alfajores = 44787, | ||
Baklava = 62320 | ||
} | ||
export declare enum TradeType { | ||
EXACT_INPUT = 0, | ||
EXACT_OUTPUT = 1 | ||
} | ||
export declare enum NetworkNames { | ||
Alfajores = "Alfajores", | ||
Baklava = "Baklava", | ||
Mainnet = "Mainnet" | ||
} | ||
export interface Network { | ||
name: NetworkNames; | ||
rpcUrl: string; | ||
graphQl: string; | ||
explorer: string; | ||
chainId: ChainId; | ||
} | ||
export declare const Alfajores: Network; | ||
export declare const Baklava: Network; | ||
export declare const Mainnet: Network; | ||
/** | ||
@@ -33,0 +9,0 @@ * A token list. |
@@ -7,40 +7,3 @@ /** | ||
*/ | ||
export var ChainId; | ||
(function (ChainId) { | ||
ChainId[ChainId["Mainnet"] = 42220] = "Mainnet"; | ||
ChainId[ChainId["Alfajores"] = 44787] = "Alfajores"; | ||
ChainId[ChainId["Baklava"] = 62320] = "Baklava"; | ||
})(ChainId || (ChainId = {})); | ||
export var TradeType; | ||
(function (TradeType) { | ||
TradeType[TradeType["EXACT_INPUT"] = 0] = "EXACT_INPUT"; | ||
TradeType[TradeType["EXACT_OUTPUT"] = 1] = "EXACT_OUTPUT"; | ||
})(TradeType || (TradeType = {})); | ||
export var NetworkNames; | ||
(function (NetworkNames) { | ||
NetworkNames["Alfajores"] = "Alfajores"; | ||
NetworkNames["Baklava"] = "Baklava"; | ||
NetworkNames["Mainnet"] = "Mainnet"; | ||
})(NetworkNames || (NetworkNames = {})); | ||
export const Alfajores = { | ||
name: NetworkNames.Alfajores, | ||
rpcUrl: "https://alfajores-forno.celo-testnet.org", | ||
graphQl: "https://alfajores-blockscout.celo-testnet.org/graphiql", | ||
explorer: "https://alfajores-blockscout.celo-testnet.org", | ||
chainId: ChainId.Alfajores, | ||
}; | ||
export const Baklava = { | ||
name: NetworkNames.Baklava, | ||
rpcUrl: "https://baklava-forno.celo-testnet.org", | ||
graphQl: "https://baklava-blockscout.celo-testnet.org/graphiql", | ||
explorer: "https://baklava-blockscout.celo-testnet.org", | ||
chainId: ChainId.Baklava, | ||
}; | ||
export const Mainnet = { | ||
name: NetworkNames.Mainnet, | ||
rpcUrl: "https://forno.celo.org", | ||
graphQl: "https://explorer.celo.org/graphiql", | ||
explorer: "https://explorer.celo.org", | ||
chainId: ChainId.Mainnet, | ||
}; | ||
export {}; | ||
//# sourceMappingURL=splTokenRegistry.js.map |
@@ -0,4 +1,3 @@ | ||
import type { ChainId, Network } from "@dahlia-labs/celo-contrib"; | ||
import type { Token as UToken } from "@ubeswap/token-math"; | ||
import type { Network } from "./"; | ||
import { ChainId } from "./"; | ||
import type { TokenInfo } from "./tokenList"; | ||
@@ -62,13 +61,2 @@ /** | ||
}; | ||
export declare const CHAIN_ID_TO_NETWORK: { | ||
42220: Network; | ||
44787: Network; | ||
62320: Network; | ||
}; | ||
/** | ||
* Gets the Network associated with a chain id. | ||
* @param network | ||
* @returns | ||
*/ | ||
export declare const chainIdToNetwork: (env: ChainId) => Network; | ||
//# sourceMappingURL=token.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Alfajores, Baklava, ChainId, Mainnet } from "./"; | ||
import { chainIdToNetwork, Mainnet } from "@dahlia-labs/celo-contrib"; | ||
/** | ||
@@ -76,13 +76,2 @@ * Token information. | ||
a.network === b.network; | ||
export const CHAIN_ID_TO_NETWORK = { | ||
[ChainId.Mainnet]: Mainnet, | ||
[ChainId.Alfajores]: Alfajores, | ||
[ChainId.Baklava]: Baklava, | ||
}; | ||
/** | ||
* Gets the Network associated with a chain id. | ||
* @param network | ||
* @returns | ||
*/ | ||
export const chainIdToNetwork = (env) => CHAIN_ID_TO_NETWORK[env]; | ||
//# sourceMappingURL=token.js.map |
{ | ||
"name": "@dahlia-labs/token-utils", | ||
"description": "Token-related math and transaction utilities.", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"repository": { | ||
@@ -23,2 +23,3 @@ "type": "git", | ||
"dependencies": { | ||
"@dahlia-labs/celo-contrib": "^0.3.1", | ||
"@ubeswap/token-math": "^4.4.6", | ||
@@ -51,7 +52,3 @@ "tiny-invariant": "^1.2.0", | ||
"homepage": "https://github.com/DahliaLabs/dahlia-common#readme", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"gitHead": "240539495817daf57a0fb8b95274f35b6a415e36" | ||
"gitHead": "c942528f30e528fc02200c3848f04f66f766e97a" | ||
} |
@@ -8,48 +8,2 @@ /** | ||
export enum ChainId { | ||
Mainnet = 42220, | ||
Alfajores = 44787, | ||
Baklava = 62320, | ||
} | ||
export enum TradeType { | ||
EXACT_INPUT = 0, | ||
EXACT_OUTPUT = 1, | ||
} | ||
export enum NetworkNames { | ||
Alfajores = "Alfajores", | ||
Baklava = "Baklava", | ||
Mainnet = "Mainnet", | ||
} | ||
export interface Network { | ||
name: NetworkNames; | ||
rpcUrl: string; | ||
graphQl: string; | ||
explorer: string; | ||
chainId: ChainId; | ||
} | ||
export const Alfajores: Network = { | ||
name: NetworkNames.Alfajores, | ||
rpcUrl: "https://alfajores-forno.celo-testnet.org", | ||
graphQl: "https://alfajores-blockscout.celo-testnet.org/graphiql", | ||
explorer: "https://alfajores-blockscout.celo-testnet.org", | ||
chainId: ChainId.Alfajores, | ||
}; | ||
export const Baklava: Network = { | ||
name: NetworkNames.Baklava, | ||
rpcUrl: "https://baklava-forno.celo-testnet.org", | ||
graphQl: "https://baklava-blockscout.celo-testnet.org/graphiql", | ||
explorer: "https://baklava-blockscout.celo-testnet.org", | ||
chainId: ChainId.Baklava, | ||
}; | ||
export const Mainnet: Network = { | ||
name: NetworkNames.Mainnet, | ||
rpcUrl: "https://forno.celo.org", | ||
graphQl: "https://explorer.celo.org/graphiql", | ||
explorer: "https://explorer.celo.org", | ||
chainId: ChainId.Mainnet, | ||
}; | ||
/** | ||
@@ -56,0 +10,0 @@ * A token list. |
@@ -0,5 +1,5 @@ | ||
import type { ChainId, Network } from "@dahlia-labs/celo-contrib"; | ||
import { chainIdToNetwork, Mainnet } from "@dahlia-labs/celo-contrib"; | ||
import type { Token as UToken } from "@ubeswap/token-math"; | ||
import type { Network } from "./"; | ||
import { Alfajores, Baklava, ChainId, Mainnet } from "./"; | ||
import type { TokenInfo } from "./tokenList"; | ||
@@ -103,15 +103,1 @@ | ||
export type TokenMap = { [c in ChainId]: Token }; | ||
export const CHAIN_ID_TO_NETWORK = { | ||
[ChainId.Mainnet]: Mainnet, | ||
[ChainId.Alfajores]: Alfajores, | ||
[ChainId.Baklava]: Baklava, | ||
}; | ||
/** | ||
* Gets the Network associated with a chain id. | ||
* @param network | ||
* @returns | ||
*/ | ||
export const chainIdToNetwork = (env: ChainId): Network => | ||
CHAIN_ID_TO_NETWORK[env]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97103
6
1396
+ Added@dahlia-labs/celo-contrib@0.3.5(transitive)