@turnkey/core
Version:
A core JavaScript web and React Native package for interfacing with Turnkey's infrastructure.
1,160 lines (1,157 loc) • 184 kB
JavaScript
'use strict';
var enums = require('../__types__/enums.js');
var error = require('../__types__/error.js');
var http = require('../__types__/http.js');
var version = require('./version.js');
var sdkTypes = require('@turnkey/sdk-types');
/* @generated by codegen. DO NOT EDIT BY HAND */
class TurnkeySDKClientBase {
constructor(config) {
this.getActivity = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_activity", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetActivity = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_activity";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getApiKey = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_api_key", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetApiKey = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_key";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getApiKeys = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_api_keys", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetApiKeys = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_keys";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAuthenticator = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_authenticator", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetAuthenticator = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticator";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAuthenticators = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_authenticators", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetAuthenticators = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticators";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getBootProof = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_boot_proof", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetBootProof = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_boot_proof";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getGasUsage = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_gas_usage", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetGasUsage = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_gas_usage";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getLatestBootProof = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_latest_boot_proof", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetLatestBootProof = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_latest_boot_proof";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getNonces = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_nonces", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetNonces = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_nonces";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOauth2Credential = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_oauth2_credential", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetOauth2Credential = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth2_credential";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOauthProviders = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_oauth_providers", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetOauthProviders = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth_providers";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOnRampTransactionStatus = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_onramp_transaction_status", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetOnRampTransactionStatus = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_onramp_transaction_status";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOrganizationConfigs = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_organization_configs", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetOrganizationConfigs = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization_configs";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPolicy = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_policy", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetPolicy = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPolicyEvaluations = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_policy_evaluations", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetPolicyEvaluations = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy_evaluations";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPrivateKey = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_private_key", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetPrivateKey = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_private_key";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSendTransactionStatus = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_send_transaction_status", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetSendTransactionStatus = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_send_transaction_status";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSmartContractInterface = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_smart_contract_interface", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetSmartContractInterface = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_smart_contract_interface";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getUser = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_user", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetUser = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_user";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWallet = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_wallet", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetWallet = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWalletAccount = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_wallet_account", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetWalletAccount = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_account";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWalletAddressBalances = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/get_wallet_address_balances", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetWalletAddressBalances = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_address_balances";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getActivities = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_activities", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetActivities = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_activities";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAppProofs = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_app_proofs", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetAppProofs = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_app_proofs";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listFiatOnRampCredentials = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_fiat_on_ramp_credentials", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampListFiatOnRampCredentials = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_fiat_on_ramp_credentials";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listOauth2Credentials = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_oauth2_credentials", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampListOauth2Credentials = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_oauth2_credentials";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPolicies = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_policies", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetPolicies = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_policies";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listPrivateKeyTags = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_private_key_tags", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampListPrivateKeyTags = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_key_tags";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPrivateKeys = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_private_keys", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetPrivateKeys = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_keys";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSmartContractInterfaces = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_smart_contract_interfaces", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetSmartContractInterfaces = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl +
"/public/v1/query/list_smart_contract_interfaces";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSubOrgIds = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_suborgs", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetSubOrgIds = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_suborgs";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listSupportedAssets = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_supported_assets", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampListSupportedAssets = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_supported_assets";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listUserTags = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_user_tags", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampListUserTags = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_user_tags";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getUsers = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_users", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetUsers = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_users";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getVerifiedSubOrgIds = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_verified_suborgs", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetVerifiedSubOrgIds = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWalletAccounts = async (input, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_wallet_accounts", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetWalletAccounts = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallet_accounts";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWallets = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/list_wallets", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetWallets = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallets";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWhoami = async (input = {}, stampWith) => {
const session = await this.storageManager?.getActiveSession();
return this.request("/public/v1/query/whoami", {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
}, stampWith);
};
this.stampGetWhoami = async (input, stampWith) => {
const activeStamper = this.getStamper(stampWith);
if (!activeStamper) {
return undefined;
}
const session = await this.storageManager?.getActiveSession();
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/whoami";
const body = {
...input,
organizationId: input.organizationId ??
session?.organizationId ??
this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await activeStamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.approveActivity = async (input, stampWith) => {
const { organizationId, timestampMs, ...rest } = input;
const session = await this.storageManager?.getActiveSession();
return this.activityDecision("/public/v1/submit/approve_activity", {
parameters: rest,
organizationId: organizationId ??
session?.organizationId ??