MCPcopy Create free account
hub / github.com/ccxt/ccxt / getCurrencyFromChaincode

Method getCurrencyFromChaincode

ts/src/woo.ts:2693–2707  ·  view source on GitHub ↗
(networkizedCode, currency)

Source from the content-addressed store, hash-verified

2691 }
2692
2693 getCurrencyFromChaincode (networkizedCode, currency) {
2694 if (currency !== undefined) {
2695 return currency;
2696 } else {
2697 const parts = networkizedCode.split ('_');
2698 const partsLength = parts.length;
2699 const firstPart = this.safeString (parts, 0);
2700 let currencyId = this.safeString (parts, 1, firstPart);
2701 if (partsLength > 2) {
2702 currencyId += '_' + this.safeString (parts, 2);
2703 }
2704 currency = this.safeCurrency (currencyId);
2705 }
2706 return currency;
2707 }
2708
2709 /**
2710 * @method

Callers 1

parseTransactionMethod · 0.95

Calls 3

splitMethod · 0.80
safeStringMethod · 0.45
safeCurrencyMethod · 0.45

Tested by

no test coverage detected