diff --git a/src/piratechain/PiratechainTools.ts b/src/piratechain/PiratechainTools.ts index 37998f448..daa818261 100644 --- a/src/piratechain/PiratechainTools.ts +++ b/src/piratechain/PiratechainTools.ts @@ -20,7 +20,7 @@ import { import { PluginEnvironment } from '../common/innerPlugin' import { asIntegerString } from '../common/types' import { encodeUriCommon, parseUriCommon } from '../common/uriHelpers' -import { getDenomInfo } from '../common/utils' +import { getLegacyDenomination } from '../common/utils' import { asArrrPublicKey, asPiratechainPrivateKeys, @@ -191,7 +191,7 @@ export class PiratechainTools implements EdgeCurrencyTools { async encodeUri( obj: EdgeEncodeUri, - customTokens?: EdgeMetaToken[] + customTokens: EdgeMetaToken[] = [] ): Promise { const { pluginId } = this.currencyInfo const { nativeAmount, currencyCode, publicAddress } = obj @@ -202,9 +202,9 @@ export class PiratechainTools implements EdgeCurrencyTools { let amount if (nativeAmount != null) { - const denom = getDenomInfo( - this.currencyInfo, + const denom = getLegacyDenomination( currencyCode ?? this.currencyInfo.currencyCode, + this.currencyInfo, customTokens ) if (denom == null) {