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

24 lines (23 loc) 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRandomContractAddress = void 0; const index_js_1 = require("../../evm/index.js"); const index_js_2 = require("../../flow/contract-address/index.js"); const index_js_3 = require("../../solana/address/index.js"); const index_js_4 = require("../../tezos/contract-address/index.js"); const index_js_5 = require("../../aptos/address/index.js"); const domain_js_1 = require("../enum/domain.js"); const dictionary = { [domain_js_1.BlockchainLayer1Enum.ETHEREUM]: index_js_1.randomEVMAddress, [domain_js_1.BlockchainLayer1Enum.FLOW]: index_js_2.randomFlowContractAddress, [domain_js_1.BlockchainLayer1Enum.SOLANA]: index_js_3.randomSolanaAddress, [domain_js_1.BlockchainLayer1Enum.TEZOS]: index_js_4.randomTezosContractAddress, [domain_js_1.BlockchainLayer1Enum.APTOS]: index_js_5.randomAptosAddress, }; function getRandomContractAddress(blockchain) { const fn = dictionary[blockchain]; if (!fn) throw new Error(`Unhandled blockchain - ${blockchain}`); return fn(); } exports.getRandomContractAddress = getRandomContractAddress;