UNPKG

@rarible/types

Version:

`@rarible/types` is a TypeScript library that provides type definitions and interfaces for the Rarible ecosystem. This package is designed to facilitate seamless integration with Rarible's APIs and services, ensuring type safety and improved developer exp

20 lines (19 loc) 657 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.toCurrencyId = void 0; const index_js_1 = require("../../blockchains/index.js"); /** * Convert string to {@link CurrencyId}. Examples: * * - "ETHEREUM:native" for ETH * - "ETHEREUM:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" for WETH * - "POLYGON:native" for Matic * @param value string value to convert */ function toCurrencyId(value) { if (!(0, index_js_1.isRealBlockchainSpecified)(value)) { throw new Error(`Not an CurrencyId: ${value}`); } return value.replace("native", index_js_1.EVM_ZERO_ADDRESS); } exports.toCurrencyId = toCurrencyId;