"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());
    });
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
const API = __importStar(require("."));
class RestService {
    constructor(connectionService, stateService) {
        this.connectionService = connectionService;
        this.stateService = stateService;
    }
    getToken(payload) {
        return API.getToken(this.connectionService, this.stateService, payload);
    }
    me() {
        return API.getMe(this.connectionService);
    }
    wallet(payload) {
        if (payload && payload.walletId)
            return API.getWallet(this.connectionService, payload);
    }
    allWallets() {
        return API.getAllWallets(this.connectionService);
    }
    allMessages() {
        return API.getAllMessages(this.connectionService);
    }
    decryptMessage(payload) {
        return API.decryptMessage(this.connectionService, payload);
    }
    encryptMessage(payload) {
        return API.encryptMessage(this.connectionService, payload);
    }
    access(payload) {
        return API.getAccess(this.connectionService, payload);
    }
    addresses(walletId) {
        return __awaiter(this, void 0, void 0, function* () {
            return (yield API.getAddresses(this.connectionService, { walletid: walletId })).addresses;
        });
    }
    allAssetClasses() {
        return API.getAllAssetClasses(this.connectionService);
    }
    allNamespaces() {
        return API.getAllNamespaces(this.connectionService);
    }
    assetClasses(payload) {
        return API.getAssetClasses(this.connectionService, payload);
    }
    block() {
        return API.getBlock(this.connectionService);
    }
    contract(payload) {
        return API.getContract(this.connectionService, payload);
    }
    holders(payload) {
        return API.getHolders(this.connectionService, payload);
    }
    holdings(payload) {
        return API.getHoldings(this.connectionService, payload);
    }
    holdingsDetail(payload) {
        return API.getHoldingsDetail(this.connectionService, payload);
    }
    holdingsDetails(payload) {
        return API.getHoldingsDetails(this.connectionService, payload);
    }
    namespace(payload) {
        return API.getNamespace(this.connectionService, payload);
    }
    newAddress(payload) {
        return API.getNewAddress(this.connectionService, payload);
    }
    ping() {
        return API.ping(this.connectionService);
    }
    poaAttorneyDetails(payload) {
        return API.getPOAAttorneyDetails(this.connectionService, payload);
    }
    poaOwnerDetails(payload) {
        return API.getPOAOwnerDetails(this.connectionService, payload);
    }
    requestPrefix() {
        return API.requestPrefix(this.connectionService);
    }
    state() {
        return API.getState(this.connectionService);
    }
    transferAsset(payload) {
        return API.postTransferAsset(this.connectionService, payload);
    }
    encumber(payload) {
        return API.postEncumber(this.connectionService, payload);
    }
    exerciseEncumbrance(payload) {
        return API.postExerciseEncumbrance(this.connectionService, payload);
    }
    issueAsset(payload) {
        return API.postIssueAsset(this.connectionService, payload);
    }
    issuerTransfer(payload) {
        return API.postIssuerTransfer(this.connectionService, payload);
    }
    null(payload) {
        return API.postNull(this.connectionService, payload);
    }
    registerAsset(payload) {
        return API.postRegisterAsset(this.connectionService, payload);
    }
    registerNamespace(payload) {
        return API.postRegisterNamespace(this.connectionService, payload);
    }
    transferFromMany(payload) {
        return API.postTransferFromMany(this.connectionService, payload);
    }
    createTx(payload) {
        return API.postCreate(this.connectionService, payload);
    }
    unencumber(payload) {
        return API.postUnencumber(this.connectionService, payload);
    }
}
exports.RestService = RestService;
