UNPKG

opensea-js

Version:

TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data

30 lines 956 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AccountsAPI = void 0; const apiPaths_1 = require("./apiPaths"); const converters_1 = require("../utils/converters"); /** * Account and payment token related API operations */ class AccountsAPI { constructor(fetcher, chain) { this.fetcher = fetcher; this.chain = chain; } /** * Fetch a payment token. */ async getPaymentToken(address, chain = this.chain) { const json = await this.fetcher.get((0, apiPaths_1.getPaymentTokenPath)(chain, address)); return (0, converters_1.paymentTokenFromJSON)(json); } /** * Fetch account for an address. */ async getAccount(address) { const json = await this.fetcher.get((0, apiPaths_1.getAccountPath)(address)); return (0, converters_1.accountFromJSON)(json); } } exports.AccountsAPI = AccountsAPI; //# sourceMappingURL=accounts.js.map