@turnkey/sdk-server
Version:
JavaScript Server SDK
1,204 lines (1,203 loc) • 140 kB
JavaScript
import { TERMINAL_ACTIVITY_STATUSES } from '@turnkey/http';
import { TurnkeyRequestError } from '../__types__/base.mjs';
import { VERSION } from './version.mjs';
/* @generated by codegen. DO NOT EDIT BY HAND */
class TurnkeySDKClientBase {
constructor(config) {
this.getActivity = async (input) => {
return this.request("/public/v1/query/get_activity", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetActivity = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_activity";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getApiKey = async (input) => {
return this.request("/public/v1/query/get_api_key", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetApiKey = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_key";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getApiKeys = async (input = {}) => {
return this.request("/public/v1/query/get_api_keys", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetApiKeys = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_api_keys";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAttestationDocument = async (input) => {
return this.request("/public/v1/query/get_attestation", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetAttestationDocument = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_attestation";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAuthenticator = async (input) => {
return this.request("/public/v1/query/get_authenticator", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetAuthenticator = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticator";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAuthenticators = async (input) => {
return this.request("/public/v1/query/get_authenticators", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetAuthenticators = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_authenticators";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getBootProof = async (input) => {
return this.request("/public/v1/query/get_boot_proof", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetBootProof = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_boot_proof";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getGasUsage = async (input) => {
return this.request("/public/v1/query/get_gas_usage", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetGasUsage = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_gas_usage";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getLatestBootProof = async (input) => {
return this.request("/public/v1/query/get_latest_boot_proof", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetLatestBootProof = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_latest_boot_proof";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getNonces = async (input) => {
return this.request("/public/v1/query/get_nonces", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetNonces = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_nonces";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOauth2Credential = async (input) => {
return this.request("/public/v1/query/get_oauth2_credential", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetOauth2Credential = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth2_credential";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOauthProviders = async (input) => {
return this.request("/public/v1/query/get_oauth_providers", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetOauthProviders = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_oauth_providers";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOnRampTransactionStatus = async (input) => {
return this.request("/public/v1/query/get_onramp_transaction_status", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetOnRampTransactionStatus = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_onramp_transaction_status";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOrganization = async (input = {}) => {
return this.request("/public/v1/query/get_organization", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetOrganization = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getOrganizationConfigs = async (input) => {
return this.request("/public/v1/query/get_organization_configs", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetOrganizationConfigs = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_organization_configs";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPolicy = async (input) => {
return this.request("/public/v1/query/get_policy", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetPolicy = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPolicyEvaluations = async (input) => {
return this.request("/public/v1/query/get_policy_evaluations", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetPolicyEvaluations = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_policy_evaluations";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPrivateKey = async (input) => {
return this.request("/public/v1/query/get_private_key", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetPrivateKey = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_private_key";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSendTransactionStatus = async (input) => {
return this.request("/public/v1/query/get_send_transaction_status", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetSendTransactionStatus = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_send_transaction_status";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSmartContractInterface = async (input) => {
return this.request("/public/v1/query/get_smart_contract_interface", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetSmartContractInterface = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_smart_contract_interface";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getUser = async (input) => {
return this.request("/public/v1/query/get_user", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetUser = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_user";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWallet = async (input) => {
return this.request("/public/v1/query/get_wallet", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetWallet = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWalletAccount = async (input) => {
return this.request("/public/v1/query/get_wallet_account", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetWalletAccount = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_wallet_account";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getActivities = async (input = {}) => {
return this.request("/public/v1/query/list_activities", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetActivities = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_activities";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getAppProofs = async (input) => {
return this.request("/public/v1/query/list_app_proofs", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetAppProofs = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_app_proofs";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listFiatOnRampCredentials = async (input) => {
return this.request("/public/v1/query/list_fiat_on_ramp_credentials", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampListFiatOnRampCredentials = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_fiat_on_ramp_credentials";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listOauth2Credentials = async (input) => {
return this.request("/public/v1/query/list_oauth2_credentials", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampListOauth2Credentials = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_oauth2_credentials";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPolicies = async (input = {}) => {
return this.request("/public/v1/query/list_policies", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetPolicies = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_policies";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listPrivateKeyTags = async (input) => {
return this.request("/public/v1/query/list_private_key_tags", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampListPrivateKeyTags = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_key_tags";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getPrivateKeys = async (input = {}) => {
return this.request("/public/v1/query/list_private_keys", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetPrivateKeys = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_private_keys";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSmartContractInterfaces = async (input) => {
return this.request("/public/v1/query/list_smart_contract_interfaces", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetSmartContractInterfaces = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl +
"/public/v1/query/list_smart_contract_interfaces";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getSubOrgIds = async (input = {}) => {
return this.request("/public/v1/query/list_suborgs", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetSubOrgIds = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_suborgs";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.listUserTags = async (input = {}) => {
return this.request("/public/v1/query/list_user_tags", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampListUserTags = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_user_tags";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getUsers = async (input = {}) => {
return this.request("/public/v1/query/list_users", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetUsers = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_users";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getVerifiedSubOrgIds = async (input) => {
return this.request("/public/v1/query/list_verified_suborgs", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetVerifiedSubOrgIds = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_verified_suborgs";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWalletAccounts = async (input) => {
return this.request("/public/v1/query/list_wallet_accounts", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetWalletAccounts = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallet_accounts";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWallets = async (input = {}) => {
return this.request("/public/v1/query/list_wallets", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetWallets = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_wallets";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.getWhoami = async (input = {}) => {
return this.request("/public/v1/query/whoami", {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
});
};
this.stampGetWhoami = async (input) => {
if (!this.stamper) {
return undefined;
}
const fullUrl = this.config.apiBaseUrl + "/public/v1/query/whoami";
const body = {
...input,
organizationId: input.organizationId ?? this.config.organizationId,
};
const stringifiedBody = JSON.stringify(body);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.approveActivity = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.activityDecision("/public/v1/submit/approve_activity", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_APPROVE_ACTIVITY",
});
};
this.stampApproveActivity = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/approve_activity";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_APPROVE_ACTIVITY",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createApiKeys = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_api_keys", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_API_KEYS_V2",
}, "createApiKeysResult");
};
this.stampCreateApiKeys = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_keys";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_API_KEYS_V2",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createApiOnlyUsers = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_api_only_users", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
}, "createApiOnlyUsersResult");
};
this.stampCreateApiOnlyUsers = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createAuthenticators = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_authenticators", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2",
}, "createAuthenticatorsResult");
};
this.stampCreateAuthenticators = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_authenticators";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createFiatOnRampCredential = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_fiat_on_ramp_credential", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL",
}, "createFiatOnRampCredentialResult");
};
this.stampCreateFiatOnRampCredential = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl +
"/public/v1/submit/create_fiat_on_ramp_credential";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createInvitations = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_invitations", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_INVITATIONS",
}, "createInvitationsResult");
};
this.stampCreateInvitations = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_invitations";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_INVITATIONS",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createOauth2Credential = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_oauth2_credential", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL",
}, "createOauth2CredentialResult");
};
this.stampCreateOauth2Credential = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth2_credential";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createOauthProviders = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_oauth_providers", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
}, "createOauthProvidersResult");
};
this.stampCreateOauthProviders = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_oauth_providers";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createPolicies = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_policies", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_POLICIES",
}, "createPoliciesResult");
};
this.stampCreatePolicies = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_policies";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_POLICIES",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createPolicy = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_policy", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_POLICY_V3",
}, "createPolicyResult");
};
this.stampCreatePolicy = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_policy";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_POLICY_V3",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createPrivateKeyTag = async (input) => {
const { organizationId, timestampMs, ...rest } = input;
return this.command("/public/v1/submit/create_private_key_tag", {
parameters: rest,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG",
}, "createPrivateKeyTagResult");
};
this.stampCreatePrivateKeyTag = async (input) => {
if (!this.stamper) {
return undefined;
}
const { organizationId, timestampMs, ...parameters } = input;
const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_private_key_tag";
const bodyWithType = {
parameters,
organizationId: organizationId ?? this.config.organizationId,
timestampMs: timestampMs ?? String(Date.now()),
type: "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG",
};
const stringifiedBody = JSON.stringify(bodyWithType);
const stamp = await this.stamper.stamp(stringifiedBody);
return {
body: stringifiedBody,
stamp: stamp,
url: fullUrl,
};
};
this.createPrivateKeys = async (input) => {
const { organizationId,