Source

constants.ts

export enum AkashicError {
  TestNetOtkOnboardingFailed = 'Failed to setup test-otk. Please try again',
  IncorrectPrivateKeyFormat = 'Private Key is not in correct format',
  TransactionCanNotBeCompletedInOne = 'Transaction could not be completed right now. Try a smaller amount or wait a few minutes',
  UnknownError = 'Akashic failed with an unknown error. Please try again later',
  KeyCreationFailure = 'Failed to generate new wallet. Try again.',
  UnHealthyKey = 'New wallet was not created safely, please re-create',
  AccessDenied = 'Unauthorized attempt to access production Akashic Link secrets',
  L2AddressNotFound = 'L2 Address not found',
  IsNotBp = 'Please sign up on AkashicPay.com first',
  SavingsExceeded = 'Transaction amount exceeds total savings',
}

export const AkashicBaseUrl = 'https://api.akashicpay.com/api' as const;
export const AkashicBaseUrlDev = 'https://api.staging-akashicpay.com/api';

export enum AkashicEndpoints {
  PrepareTx = '/v0/l1-txn-orchestrator/prepare-withdrawal',
  L2Lookup = '/v0/nft/look-for-l2-address',
  OwnerTransaction = '/v0/owner/transactions',
  OwnerBalance = '/v0/owner/details',
  TransactionsDetails = `/v0/transactions/transfer`,
  IdentifierLookup = `/v0/key/bp-deposit-key`,
  IsBp = `/v0/owner/is-bp`,
}

/**
 * ACNodes
 *
 * @property {Object} Singapore1 Singapore 1
 * @property {Object} Singapore2 Singapore 2
 * @property {Object} HongKong1 Hong Kong 1
 * @property {Object} HongKong2 Hong Kong 2
 * @property {Object} Japan1 Japan 1
 * @property {Object} Japan2 Japan 2
 */
export const ACNodes = {
  Singapore1: {
    minigate: 'https://sg1-minigate.akashicchain.com/',
    node: 'https://sg1.akashicchain.com/',
  },
  Singapore2: {
    minigate: 'https://sg2-minigate.akashicchain.com/',
    node: 'https://sg2.akashicchain.com/',
  },
  HongKong1: {
    minigate: 'https://hk1-minigate.akashicchain.com/',
    node: 'https://hk1.akashicchain.com/',
  },
  HongKong2: {
    minigate: 'https://hk2-minigate.akashicchain.com/',
    node: 'https://hk2.akashicchain.com/',
  },
  Japan1: {
    minigate: 'https://jp1-minigate.akashicchain.com/',
    node: 'https://jp1.akashicchain.com/',
  },
  Japan2: {
    minigate: 'https://jp2-minigate.akashicchain.com/',
    node: 'https://jp2.akashicchain.com/',
  },
};

export type ACNode = typeof ACNodes.HongKong1;

/**
 * ACDevNodes
 *
 * @property {Object} Singapore1 Singapore 1
 * @property {Object} Singapore2 Singapore 2
 * @property {Object} Japan1 Japan 1
 */
export const ACDevNodes = {
  Singapore1: {
    minigate: 'https://sg1-minigate.testnet.akashicchain.com/',
    node: 'https://sg1.testnet.akashicchain.com/',
  },
  Singapore2: {
    minigate: 'https://sg2-minigate.testnet.akashicchain.com/',
    node: 'https://sg2.testnet.akashicchain.com/',
  },
  Japan1: {
    minigate: 'https://jp1-minigate.testnet.akashicchain.com/',
    node: 'https://jp1.testnet.akashicchain.com/',
  },
};

export type ACDevNode = typeof ACDevNodes.Singapore1;

/**
 * @enum {string}
 * @property {string} Production 'production'
 * @property {string} Development 'development'
 */
export enum Environment {
  Production = 'production',
  Development = 'development',
}

export const otherError = {
  unsupportedCoinError: 'Coin not supported',
  transactionTooSmallError: 'Transaction is too small',
};