@helium/transactions
Advanced tools
Comparing version 4.7.0 to 4.7.1
@@ -89,3 +89,3 @@ "use strict"; | ||
memo: memoBuffer ? JSLong.fromBytes(Array.from(memoBuffer), true, true) : undefined, | ||
tokenType: utils_1.toTokenType(tokenType), | ||
tokenType: utils_1.toTokenType({ ticker: tokenType, defaultToUndefined: true }), | ||
}); | ||
@@ -92,0 +92,0 @@ }); |
@@ -63,3 +63,3 @@ "use strict"; | ||
return SubnetworkRewards.create({ | ||
tokenType: utils_1.toTokenType(this.tokenType), | ||
tokenType: utils_1.toTokenType({ ticker: this.tokenType }), | ||
startEpoch: this.startEpoch, | ||
@@ -66,0 +66,0 @@ endEpoch: this.endEpoch, |
@@ -49,3 +49,3 @@ "use strict"; | ||
nonce: this.nonce, | ||
tokenType: utils_1.toTokenType(this.tokenType), | ||
tokenType: utils_1.toTokenType({ ticker: this.tokenType }), | ||
signature: this.signature && !forSigning ? utils_1.toUint8Array(this.signature) : null, | ||
@@ -66,3 +66,8 @@ }); | ||
return new TokenRedeemV1({ | ||
account, amount, tokenType, fee, nonce, signature, | ||
account, | ||
amount, | ||
tokenType, | ||
fee, | ||
nonce, | ||
signature, | ||
}); | ||
@@ -69,0 +74,0 @@ } |
@@ -9,4 +9,7 @@ /// <reference types="node" /> | ||
export declare const toNumber: (long: Long | number | undefined | null) => number | undefined; | ||
export declare const toTokenType: (ticker?: string | undefined) => number; | ||
export declare const toTokenType: ({ ticker, defaultToUndefined, }: { | ||
ticker?: string | undefined; | ||
defaultToUndefined?: boolean | undefined; | ||
}) => number | undefined; | ||
export declare const toTicker: (tokenType?: number | undefined) => string; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -38,7 +38,7 @@ "use strict"; | ||
exports.toNumber = toNumber; | ||
const toTokenType = (ticker) => { | ||
const toTokenType = ({ ticker, defaultToUndefined, }) => { | ||
switch (ticker === null || ticker === void 0 ? void 0 : ticker.toLowerCase()) { | ||
case 'hnt': | ||
default: | ||
case 'hnt': | ||
return types_1.TokenType.hnt; | ||
return defaultToUndefined ? undefined : types_1.TokenType.hnt; | ||
case 'hst': | ||
@@ -45,0 +45,0 @@ return types_1.TokenType.hst; |
{ | ||
"name": "@helium/transactions", | ||
"version": "4.7.0", | ||
"version": "4.7.1", | ||
"description": "Construct and serialize Helium blockchain transaction primatives", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "20d7cf8f2002f3962dce732bf4c1f0ef7e88b6f7" | ||
"gitHead": "b2f5528751c76273c9e9149fbe01bd54f400a31a" | ||
} |
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
159475
1850