@bitgo/statics
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -34,2 +34,5 @@ import { BaseCoin, CoinFeature, UnderlyingAsset } from './base'; | ||
} | ||
export declare class AccountCoinToken extends AccountCoin { | ||
constructor(options: AccountConstructorOptions); | ||
} | ||
/** | ||
@@ -39,3 +42,3 @@ * ERC 20 is a token standard for the Ethereum blockchain. They are similar to other account coins, but have a | ||
*/ | ||
export declare class Erc20Coin extends AccountCoin { | ||
export declare class Erc20Coin extends AccountCoinToken { | ||
contractAddress: ContractAddress; | ||
@@ -45,2 +48,11 @@ constructor(options: Erc20ConstructorOptions); | ||
/** | ||
* The Stellar network supports tokens (non-native assets) | ||
* XLM is also known as the native asset. | ||
* Stellar tokens work similar to XLM, but the token name is determined by the chain, | ||
* the token code and the issuer account in the form: (t)xlm:<token>-<issuer> | ||
*/ | ||
export declare class StellarCoin extends AccountCoinToken { | ||
constructor(options: AccountConstructorOptions); | ||
} | ||
/** | ||
* Factory function for account coin instances. | ||
@@ -87,1 +99,27 @@ * | ||
export declare function terc20(name: string, fullName: string, decimalPlaces: number, contractAddress: string, asset: UnderlyingAsset, features?: CoinFeature[], prefix?: string, suffix?: string, network?: AccountNetwork): Readonly<Erc20Coin>; | ||
/** | ||
* Factory function for Stellar token instances. | ||
* | ||
* @param name unique identifier of the token | ||
* @param fullName Complete human-readable name of the token | ||
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent) | ||
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin. | ||
* @param prefix? Optional token prefix. Defaults to empty string | ||
* @param suffix? Optional token suffix. Defaults to token name. | ||
* @param network? Optional token network. Defaults to Stellar mainnet. | ||
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin` | ||
*/ | ||
export declare function stellarToken(name: string, fullName: string, decimalPlaces: number, asset: UnderlyingAsset, features?: CoinFeature[], prefix?: string, suffix?: string, network?: AccountNetwork): Readonly<StellarCoin>; | ||
/** | ||
* Factory function for testnet Stellar token instances. | ||
* | ||
* @param name unique identifier of the token | ||
* @param fullName Complete human-readable name of the token | ||
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent) | ||
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin. | ||
* @param prefix? Optional token prefix. Defaults to empty string | ||
* @param suffix? Optional token suffix. Defaults to token name. | ||
* @param network? Optional token network. Defaults to Stellar testnet. | ||
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin` | ||
*/ | ||
export declare function tstellarToken(name: string, fullName: string, decimalPlaces: number, asset: UnderlyingAsset, features?: CoinFeature[], prefix?: string, suffix?: string, network?: AccountNetwork): Readonly<StellarCoin>; |
@@ -59,2 +59,10 @@ "use strict"; | ||
exports.AccountCoin = AccountCoin; | ||
var AccountCoinToken = /** @class */ (function (_super) { | ||
__extends(AccountCoinToken, _super); | ||
function AccountCoinToken(options) { | ||
return _super.call(this, __assign({}, options, { isToken: true })) || this; | ||
} | ||
return AccountCoinToken; | ||
}(AccountCoin)); | ||
exports.AccountCoinToken = AccountCoinToken; | ||
/** | ||
@@ -67,3 +75,3 @@ * ERC 20 is a token standard for the Ethereum blockchain. They are similar to other account coins, but have a | ||
function Erc20Coin(options) { | ||
var _this = _super.call(this, __assign({}, options, { isToken: true })) || this; | ||
var _this = _super.call(this, __assign({}, options)) || this; | ||
// valid ERC 20 contract addresses are "0x" followed by 40 lowercase hex characters | ||
@@ -77,5 +85,19 @@ if (!options.contractAddress.match(/^0x[a-f0-9]{40}$/)) { | ||
return Erc20Coin; | ||
}(AccountCoin)); | ||
}(AccountCoinToken)); | ||
exports.Erc20Coin = Erc20Coin; | ||
/** | ||
* The Stellar network supports tokens (non-native assets) | ||
* XLM is also known as the native asset. | ||
* Stellar tokens work similar to XLM, but the token name is determined by the chain, | ||
* the token code and the issuer account in the form: (t)xlm:<token>-<issuer> | ||
*/ | ||
var StellarCoin = /** @class */ (function (_super) { | ||
__extends(StellarCoin, _super); | ||
function StellarCoin(options) { | ||
return _super.call(this, __assign({}, options)) || this; | ||
} | ||
return StellarCoin; | ||
}(AccountCoinToken)); | ||
exports.StellarCoin = StellarCoin; | ||
/** | ||
* Factory function for account coin instances. | ||
@@ -164,2 +186,52 @@ * | ||
exports.terc20 = terc20; | ||
/** | ||
* Factory function for Stellar token instances. | ||
* | ||
* @param name unique identifier of the token | ||
* @param fullName Complete human-readable name of the token | ||
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent) | ||
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin. | ||
* @param prefix? Optional token prefix. Defaults to empty string | ||
* @param suffix? Optional token suffix. Defaults to token name. | ||
* @param network? Optional token network. Defaults to Stellar mainnet. | ||
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin` | ||
*/ | ||
function stellarToken(name, fullName, decimalPlaces, asset, features, prefix, suffix, network) { | ||
if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; } | ||
if (prefix === void 0) { prefix = ''; } | ||
if (suffix === void 0) { suffix = name.toUpperCase(); } | ||
if (network === void 0) { network = networks_1.Networks.main.stellar; } | ||
return Object.freeze(new StellarCoin({ | ||
name: name, | ||
fullName: fullName, | ||
network: network, | ||
prefix: prefix, | ||
suffix: suffix, | ||
features: features, | ||
decimalPlaces: decimalPlaces, | ||
asset: asset, | ||
isToken: true, | ||
})); | ||
} | ||
exports.stellarToken = stellarToken; | ||
/** | ||
* Factory function for testnet Stellar token instances. | ||
* | ||
* @param name unique identifier of the token | ||
* @param fullName Complete human-readable name of the token | ||
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent) | ||
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin. | ||
* @param prefix? Optional token prefix. Defaults to empty string | ||
* @param suffix? Optional token suffix. Defaults to token name. | ||
* @param network? Optional token network. Defaults to Stellar testnet. | ||
* @param features? Features of this coin. Defaults to the DEFAULT_FEATURES defined in `AccountCoin` | ||
*/ | ||
function tstellarToken(name, fullName, decimalPlaces, asset, features, prefix, suffix, network) { | ||
if (features === void 0) { features = AccountCoin.DEFAULT_FEATURES; } | ||
if (prefix === void 0) { prefix = ''; } | ||
if (suffix === void 0) { suffix = name.toUpperCase(); } | ||
if (network === void 0) { network = networks_1.Networks.test.stellar; } | ||
return stellarToken(name, fullName, decimalPlaces, asset, features, prefix, suffix, network); | ||
} | ||
exports.tstellarToken = tstellarToken; | ||
//# sourceMappingURL=account.js.map |
@@ -330,5 +330,7 @@ import { BaseNetwork } from './networks'; | ||
ZRX = "zrx", | ||
'xlm:VELO-GC7GMEKN2P5LKGOVW55WGHMVQRPPRPHIRFMIC75Z6WPYPYR7B3Z3WEKH' = "xlm:VELO-GC7GMEKN2P5LKGOVW55WGHMVQRPPRPHIRFMIC75Z6WPYPYR7B3Z3WEKH", | ||
TEST = "test", | ||
SCHZ = "schz", | ||
TCAT = "tcat" | ||
TCAT = "tcat", | ||
'txlm:BST-GBQTIOS3XGHB7LVYGBKQVJGCZ3R4JL5E4CBSWJ5ALIJUHBKS6263644L' = "txlm:BST-GBQTIOS3XGHB7LVYGBKQVJGCZ3R4JL5E4CBSWJ5ALIJUHBKS6263644L" | ||
} | ||
@@ -335,0 +337,0 @@ export interface BaseCoinConstructorOptions { |
@@ -318,2 +318,3 @@ "use strict"; | ||
account_1.erc20('zrx', '0x Token', 18, '0xe41d2489571d322189246dafa5ebde1f4699f498', "zrx" /* ZRX */), | ||
account_1.stellarToken('xlm:VELO-GC7GMEKN2P5LKGOVW55WGHMVQRPPRPHIRFMIC75Z6WPYPYR7B3Z3WEKH', 'Velo Token', 7, "xlm:VELO-GC7GMEKN2P5LKGOVW55WGHMVQRPPRPHIRFMIC75Z6WPYPYR7B3Z3WEKH" /* 'xlm:VELO-GC7GMEKN2P5LKGOVW55WGHMVQRPPRPHIRFMIC75Z6WPYPYR7B3Z3WEKH' */), | ||
account_1.terc20('terc', 'ERC Test Token', 0, '0x945ac907cf021a6bcd07852bb3b8c087051706a9', "erc" /* ERC */), | ||
@@ -325,2 +326,3 @@ account_1.terc20('test', 'Test Mintable ERC20 Token', 18, '0x1fb879581f31687b905653d4bbcbe3af507bed37', "test" /* TEST */), | ||
account_1.terc20('tfmf', 'Test Formosa Financial Token', 18, '0xd8463d2f8c5b3be9de95c63b73a0ae4c79423452', "fmf" /* FMF */), | ||
account_1.tstellarToken('txlm:BST-GBQTIOS3XGHB7LVYGBKQVJGCZ3R4JL5E4CBSWJ5ALIJUHBKS6263644L', 'Test BST Token', 7, "txlm:BST-GBQTIOS3XGHB7LVYGBKQVJGCZ3R4JL5E4CBSWJ5ALIJUHBKS6263644L" /* 'txlm:BST-GBQTIOS3XGHB7LVYGBKQVJGCZ3R4JL5E4CBSWJ5ALIJUHBKS6263644L' */), | ||
ofc_1.tofcerc20('ofcterc', 'ERC Test Token', 0, "erc" /* ERC */), | ||
@@ -327,0 +329,0 @@ ofc_1.ofcerc20('ofcerc', 'ERC Token', 0, "erc" /* ERC */), |
@@ -7,3 +7,3 @@ export * from './base'; | ||
export { UtxoCoin } from './utxo'; | ||
export { AccountCoin, Erc20Coin } from './account'; | ||
export { AccountCoin, Erc20Coin, StellarCoin } from './account'; | ||
export { CoinMap } from './map'; |
@@ -17,4 +17,5 @@ "use strict"; | ||
exports.Erc20Coin = account_1.Erc20Coin; | ||
exports.StellarCoin = account_1.StellarCoin; | ||
var map_1 = require("./map"); | ||
exports.CoinMap = map_1.CoinMap; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@bitgo/statics", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "dependency-free static configuration for the bitgo platform", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
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
161914
2427