@dahlia-labs/token-utils
Advanced tools
Comparing version 0.5.12 to 0.6.0
export * from "./price"; | ||
export * from "./splTokenRegistry"; | ||
export * from "./token"; | ||
@@ -4,0 +3,0 @@ export * from "./tokenAmount"; |
@@ -6,3 +6,2 @@ "use strict"; | ||
tslib_1.__exportStar(require("./price"), exports); | ||
tslib_1.__exportStar(require("./splTokenRegistry"), exports); | ||
tslib_1.__exportStar(require("./token"), exports); | ||
@@ -9,0 +8,0 @@ tslib_1.__exportStar(require("./tokenAmount"), exports); |
@@ -10,6 +10,2 @@ import type { BigintIsh, FractionObject } from "@ubeswap/token-math"; | ||
/** | ||
* Mint of the token. | ||
*/ | ||
mint: string; | ||
/** | ||
* Amount of tokens in string representation. | ||
@@ -16,0 +12,0 @@ */ |
@@ -37,3 +37,2 @@ "use strict"; | ||
_isTA: true, | ||
mint: this.token.address, | ||
uiAmount: this.toExact(), | ||
@@ -40,0 +39,0 @@ }; |
@@ -1,4 +0,9 @@ | ||
import type { SPLTokenExtensions, SPLTokenInfo, SPLTokenList } from "./splTokenRegistry"; | ||
import { Token } from "./token"; | ||
/** | ||
* These types are all based from the @solana/spl-token-registry package. | ||
* | ||
* We re-export them here so we do not have to have a hard dependency on | ||
* that package, which is massive. | ||
*/ | ||
/** | ||
* Known origin chains. | ||
@@ -14,6 +19,22 @@ */ | ||
*/ | ||
export declare type TokenExtensions = SPLTokenExtensions & { | ||
export declare type TokenExtensions = { | ||
readonly website?: string; | ||
readonly bridgeContract?: string; | ||
readonly assetContract?: string; | ||
readonly address?: string; | ||
readonly explorer?: string; | ||
readonly twitter?: string; | ||
readonly github?: string; | ||
readonly medium?: string; | ||
readonly tgann?: string; | ||
readonly tggroup?: string; | ||
readonly discord?: string; | ||
readonly serumV3Usdt?: string; | ||
readonly serumV3Usdc?: string; | ||
readonly coingeckoId?: string; | ||
readonly imageUrl?: string; | ||
readonly description?: string; | ||
/** | ||
* Mints of the underlying tokens that make up this token. | ||
* E.g. a Saber USDC-USDT LP token would use the USDC and USDT mints. | ||
* E.g. a Mobius USDC-USDT LP token would use the USDC and USDT mints. | ||
*/ | ||
@@ -23,3 +44,3 @@ readonly underlyingTokens?: string[]; | ||
* The protocol that this token comes from. | ||
* E.g. `wormhole-v1`, `wormhole-v2`, `allbridge`, `sollet`, `saber`. | ||
* E.g. `wormhole-v1`, `wormhole-v2`, `allbridge`, `optics`, `mobius`. | ||
*/ | ||
@@ -40,3 +61,10 @@ readonly source?: string; | ||
*/ | ||
export declare type TokenInfo = Omit<SPLTokenInfo, "extensions"> & { | ||
export declare type TokenInfo = { | ||
readonly chainId: number; | ||
readonly address: string; | ||
readonly name: string; | ||
readonly decimals: number; | ||
readonly symbol: string; | ||
readonly logoURI?: string; | ||
readonly tags?: string[]; | ||
readonly extensions?: TokenExtensions; | ||
@@ -47,6 +75,19 @@ }; | ||
*/ | ||
export declare type TokenList = Omit<SPLTokenList, "tokens"> & { | ||
export interface TokenList { | ||
readonly name: string; | ||
readonly logoURI: string; | ||
readonly tags: { | ||
[tag: string]: TagDetails; | ||
}; | ||
readonly timestamp: string; | ||
readonly tokens: TokenInfo[]; | ||
}; | ||
} | ||
/** | ||
* Tag details. | ||
*/ | ||
export interface TagDetails { | ||
readonly name: string; | ||
readonly description: string; | ||
} | ||
/** | ||
* Creates a token map from a TokenList. | ||
@@ -53,0 +94,0 @@ * @param tokens |
@@ -6,2 +6,8 @@ "use strict"; | ||
/** | ||
* These types are all based from the @solana/spl-token-registry package. | ||
* | ||
* We re-export them here so we do not have to have a hard dependency on | ||
* that package, which is massive. | ||
*/ | ||
/** | ||
* Known origin chains. | ||
@@ -8,0 +14,0 @@ */ |
export * from "./price"; | ||
export * from "./splTokenRegistry"; | ||
export * from "./token"; | ||
@@ -4,0 +3,0 @@ export * from "./tokenAmount"; |
export * from "./price"; | ||
export * from "./splTokenRegistry"; | ||
export * from "./token"; | ||
@@ -4,0 +3,0 @@ export * from "./tokenAmount"; |
@@ -10,6 +10,2 @@ import type { BigintIsh, FractionObject } from "@ubeswap/token-math"; | ||
/** | ||
* Mint of the token. | ||
*/ | ||
mint: string; | ||
/** | ||
* Amount of tokens in string representation. | ||
@@ -16,0 +12,0 @@ */ |
@@ -34,3 +34,2 @@ import { parseAmountFromString, TokenAmount as UTokenAmount, } from "@ubeswap/token-math"; | ||
_isTA: true, | ||
mint: this.token.address, | ||
uiAmount: this.toExact(), | ||
@@ -37,0 +36,0 @@ }; |
@@ -1,4 +0,9 @@ | ||
import type { SPLTokenExtensions, SPLTokenInfo, SPLTokenList } from "./splTokenRegistry"; | ||
import { Token } from "./token"; | ||
/** | ||
* These types are all based from the @solana/spl-token-registry package. | ||
* | ||
* We re-export them here so we do not have to have a hard dependency on | ||
* that package, which is massive. | ||
*/ | ||
/** | ||
* Known origin chains. | ||
@@ -14,6 +19,22 @@ */ | ||
*/ | ||
export declare type TokenExtensions = SPLTokenExtensions & { | ||
export declare type TokenExtensions = { | ||
readonly website?: string; | ||
readonly bridgeContract?: string; | ||
readonly assetContract?: string; | ||
readonly address?: string; | ||
readonly explorer?: string; | ||
readonly twitter?: string; | ||
readonly github?: string; | ||
readonly medium?: string; | ||
readonly tgann?: string; | ||
readonly tggroup?: string; | ||
readonly discord?: string; | ||
readonly serumV3Usdt?: string; | ||
readonly serumV3Usdc?: string; | ||
readonly coingeckoId?: string; | ||
readonly imageUrl?: string; | ||
readonly description?: string; | ||
/** | ||
* Mints of the underlying tokens that make up this token. | ||
* E.g. a Saber USDC-USDT LP token would use the USDC and USDT mints. | ||
* E.g. a Mobius USDC-USDT LP token would use the USDC and USDT mints. | ||
*/ | ||
@@ -23,3 +44,3 @@ readonly underlyingTokens?: string[]; | ||
* The protocol that this token comes from. | ||
* E.g. `wormhole-v1`, `wormhole-v2`, `allbridge`, `sollet`, `saber`. | ||
* E.g. `wormhole-v1`, `wormhole-v2`, `allbridge`, `optics`, `mobius`. | ||
*/ | ||
@@ -40,3 +61,10 @@ readonly source?: string; | ||
*/ | ||
export declare type TokenInfo = Omit<SPLTokenInfo, "extensions"> & { | ||
export declare type TokenInfo = { | ||
readonly chainId: number; | ||
readonly address: string; | ||
readonly name: string; | ||
readonly decimals: number; | ||
readonly symbol: string; | ||
readonly logoURI?: string; | ||
readonly tags?: string[]; | ||
readonly extensions?: TokenExtensions; | ||
@@ -47,6 +75,19 @@ }; | ||
*/ | ||
export declare type TokenList = Omit<SPLTokenList, "tokens"> & { | ||
export interface TokenList { | ||
readonly name: string; | ||
readonly logoURI: string; | ||
readonly tags: { | ||
[tag: string]: TagDetails; | ||
}; | ||
readonly timestamp: string; | ||
readonly tokens: TokenInfo[]; | ||
}; | ||
} | ||
/** | ||
* Tag details. | ||
*/ | ||
export interface TagDetails { | ||
readonly name: string; | ||
readonly description: string; | ||
} | ||
/** | ||
* Creates a token map from a TokenList. | ||
@@ -53,0 +94,0 @@ * @param tokens |
import { Token } from "./token"; | ||
/** | ||
* These types are all based from the @solana/spl-token-registry package. | ||
* | ||
* We re-export them here so we do not have to have a hard dependency on | ||
* that package, which is massive. | ||
*/ | ||
/** | ||
* Known origin chains. | ||
@@ -4,0 +10,0 @@ */ |
{ | ||
"name": "@dahlia-labs/token-utils", | ||
"description": "Token-related math and transaction utilities.", | ||
"version": "0.5.12", | ||
"version": "0.6.0", | ||
"repository": { | ||
@@ -23,3 +23,3 @@ "type": "git", | ||
"dependencies": { | ||
"@dahlia-labs/celo-contrib": "^0.5.12", | ||
"@dahlia-labs/celo-contrib": "^0.6.0", | ||
"@ubeswap/token-math": "^5.2.0", | ||
@@ -36,3 +36,3 @@ "tiny-invariant": "^1.2.0", | ||
"devDependencies": { | ||
"@saberhq/tsconfig": "^1.13.32", | ||
"@saberhq/tsconfig": "^2.0.4", | ||
"@types/bn.js": "^5.1.1", | ||
@@ -53,3 +53,3 @@ "jsbi": "^4.3.0" | ||
"homepage": "https://github.com/DahliaLabs/dahlia-common#readme", | ||
"gitHead": "83936cc4102f35853a382994cd3f0e561bf69d4c" | ||
"gitHead": "6624bfd85551b0648240ea3ea3fae0040516f69b" | ||
} |
export * from "./price"; | ||
export * from "./splTokenRegistry"; | ||
export * from "./token"; | ||
@@ -4,0 +3,0 @@ export * from "./tokenAmount"; |
@@ -15,6 +15,2 @@ import type { BigintIsh, FractionObject } from "@ubeswap/token-math"; | ||
/** | ||
* Mint of the token. | ||
*/ | ||
mint: string; | ||
/** | ||
* Amount of tokens in string representation. | ||
@@ -61,3 +57,2 @@ */ | ||
_isTA: true, | ||
mint: this.token.address, | ||
uiAmount: this.toExact(), | ||
@@ -64,0 +59,0 @@ }; |
@@ -1,9 +0,11 @@ | ||
import type { | ||
SPLTokenExtensions, | ||
SPLTokenInfo, | ||
SPLTokenList, | ||
} from "./splTokenRegistry"; | ||
import { Token } from "./token"; | ||
/** | ||
* These types are all based from the @solana/spl-token-registry package. | ||
* | ||
* We re-export them here so we do not have to have a hard dependency on | ||
* that package, which is massive. | ||
*/ | ||
/** | ||
* Known origin chains. | ||
@@ -32,6 +34,23 @@ */ | ||
*/ | ||
export type TokenExtensions = SPLTokenExtensions & { | ||
export type TokenExtensions = { | ||
readonly website?: string; | ||
readonly bridgeContract?: string; | ||
readonly assetContract?: string; | ||
readonly address?: string; | ||
readonly explorer?: string; | ||
readonly twitter?: string; | ||
readonly github?: string; | ||
readonly medium?: string; | ||
readonly tgann?: string; | ||
readonly tggroup?: string; | ||
readonly discord?: string; | ||
readonly serumV3Usdt?: string; | ||
readonly serumV3Usdc?: string; | ||
readonly coingeckoId?: string; | ||
readonly imageUrl?: string; | ||
readonly description?: string; | ||
/** | ||
* Mints of the underlying tokens that make up this token. | ||
* E.g. a Saber USDC-USDT LP token would use the USDC and USDT mints. | ||
* E.g. a Mobius USDC-USDT LP token would use the USDC and USDT mints. | ||
*/ | ||
@@ -41,3 +60,3 @@ readonly underlyingTokens?: string[]; | ||
* The protocol that this token comes from. | ||
* E.g. `wormhole-v1`, `wormhole-v2`, `allbridge`, `sollet`, `saber`. | ||
* E.g. `wormhole-v1`, `wormhole-v2`, `allbridge`, `optics`, `mobius`. | ||
*/ | ||
@@ -63,3 +82,10 @@ readonly source?: string; | ||
*/ | ||
export type TokenInfo = Omit<SPLTokenInfo, "extensions"> & { | ||
export type TokenInfo = { | ||
readonly chainId: number; | ||
readonly address: string; | ||
readonly name: string; | ||
readonly decimals: number; | ||
readonly symbol: string; | ||
readonly logoURI?: string; | ||
readonly tags?: string[]; | ||
readonly extensions?: TokenExtensions; | ||
@@ -71,7 +97,19 @@ }; | ||
*/ | ||
export type TokenList = Omit<SPLTokenList, "tokens"> & { | ||
export interface TokenList { | ||
readonly name: string; | ||
readonly logoURI: string; | ||
readonly tags: { [tag: string]: TagDetails }; | ||
readonly timestamp: string; | ||
readonly tokens: TokenInfo[]; | ||
}; | ||
} | ||
/** | ||
* Tag details. | ||
*/ | ||
export interface TagDetails { | ||
readonly name: string; | ||
readonly description: string; | ||
} | ||
/** | ||
* Creates a token map from a TokenList. | ||
@@ -78,0 +116,0 @@ * @param tokens |
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
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
81618
48
1178
+ Added@dahlia-labs/celo-contrib@0.6.2(transitive)
- Removed@dahlia-labs/celo-contrib@0.5.12(transitive)