UNPKG

@airgap/beacon-dapp

Version:

Use this package on your dApp to instanciate a DAppClient object and communicate to wallets.

55 lines • 3.18 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TzktBlockExplorer = void 0; const beacon_types_1 = require("@airgap/beacon-types"); const block_explorer_1 = require("./block-explorer"); class TzktBlockExplorer extends block_explorer_1.BlockExplorer { constructor(rpcUrls = { [beacon_types_1.NetworkType.MAINNET]: 'https://tzkt.io', [beacon_types_1.NetworkType.GHOSTNET]: 'https://ghostnet.tzkt.io', [beacon_types_1.NetworkType.WEEKLYNET]: 'https://weeklynet.tzkt.io', [beacon_types_1.NetworkType.DAILYNET]: 'https://dailynet.tzkt.io', [beacon_types_1.NetworkType.DELPHINET]: 'https://delphinet.tzkt.io', [beacon_types_1.NetworkType.EDONET]: 'https://edonet.tzkt.io', [beacon_types_1.NetworkType.FLORENCENET]: 'https://florencenet.tzkt.io', [beacon_types_1.NetworkType.GRANADANET]: 'https://granadanet.tzkt.io', [beacon_types_1.NetworkType.HANGZHOUNET]: 'https://hangzhounet.tzkt.io', [beacon_types_1.NetworkType.ITHACANET]: 'https://ithacanet.tzkt.io', [beacon_types_1.NetworkType.JAKARTANET]: 'https://jakartanet.tzkt.io', [beacon_types_1.NetworkType.KATHMANDUNET]: 'https://kathmandunet.tzkt.io', [beacon_types_1.NetworkType.LIMANET]: 'https://limanet.tzkt.io', [beacon_types_1.NetworkType.MUMBAINET]: 'https://mumbainet.tzkt.io', [beacon_types_1.NetworkType.NAIROBINET]: 'https://nairobinet.tzkt.io', [beacon_types_1.NetworkType.OXFORDNET]: 'https://oxfordnet.tzkt.io', [beacon_types_1.NetworkType.PARISNET]: 'https://parisnet.tzkt.io', [beacon_types_1.NetworkType.CUSTOM]: 'https://rionet.tzkt.io', [beacon_types_1.NetworkType.QUEBECNET]: 'https://quebecnet.tzkt.io', [beacon_types_1.NetworkType.RIONET]: 'https://rionet.tzkt.io' }) { super(rpcUrls); this.rpcUrls = rpcUrls; } getAddressLink(address, network) { return __awaiter(this, void 0, void 0, function* () { const blockExplorer = yield this.getLinkForNetwork(network); return `${blockExplorer}/${address}`; }); } getTransactionLink(transactionId, network) { return __awaiter(this, void 0, void 0, function* () { const blockExplorer = yield this.getLinkForNetwork(network); return `${blockExplorer}/${transactionId}`; }); } } exports.TzktBlockExplorer = TzktBlockExplorer; //# sourceMappingURL=tzkt-blockexplorer.js.map