import { C as Connection } from './index.js';

var __awaiter = (undefined && undefined.__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());
    });
};
class Contact {
    constructor(connection) {
        this.connection = connection;
    }
    getPaymentOptions(currency, amount, contact) {
        return __awaiter(this, void 0, void 0, function* () {
            return yield this.connection.get(`contact/${contact}/payment-option/${currency}/${amount}`);
        });
    }
    get(identityNumber, zipCode, countryCode) {
        return __awaiter(this, void 0, void 0, function* () {
            return yield this.connection.get("contact?countryCode=" + countryCode + "&identityNumber=" + identityNumber + "&zipCode=" + zipCode);
        });
    }
    static open(url, key) {
        const connection = Connection.open(url, key);
        return connection && new Contact(connection);
    }
}

export { Contact };
