@mozaic-io/mozaic-sdk-node
Version:
The Mozaic Node SDK enables you to pay your creators easily via the Mozaic API.
21 lines (20 loc) • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Wallet = void 0;
const WalletItem_1 = require("./WalletItem");
class Wallet {
/**
* @internal Please use Mozaic.Wallets to interact with the Wallet object.
* @param source The raw wallet data that is returned from the Mozaic API.
*/
constructor(source) {
var _a, _b, _c, _d, _e, _f;
this.id = (_a = source.id) !== null && _a !== void 0 ? _a : "";
this.key = (_b = source.key) !== null && _b !== void 0 ? _b : "";
if (this.key === "")
throw new Error("Unknown wallet type");
this.paymentMethods = (_d = (_c = source.payment_methods) === null || _c === void 0 ? void 0 : _c.map((value) => new WalletItem_1.WalletItem(value))) !== null && _d !== void 0 ? _d : [];
this.payoutMethods = (_f = (_e = source.payout_methods) === null || _e === void 0 ? void 0 : _e.map((value) => new WalletItem_1.WalletItem(value))) !== null && _f !== void 0 ? _f : [];
}
}
exports.Wallet = Wallet;