@cfxlabsinc/b2b-services
    Preparing search index...

    Hierarchy

    • UtilaBaseClient
      • UtilaWalletClient
    Index
    client: Client<paths>
    • Archive a wallet — the only mutation Utila exposes on an existing wallet. There is no rename or delete: /v2/vaults/{vault_id}/wallets/{wallet_id} is GET-only, so archiving is how a retired generation is marked as retired on the custody side rather than by a display-name convention.

      Archived wallets drop out of listWallets unless showArchived is set, which is what keeps a retired wallet from being offered up for re-linking.

      allowMissing makes the call idempotent: re-archiving an already-gone wallet succeeds instead of raising, so a retried rotation doesn't wedge on a step that already ran.

      Parameters

      • args: { allowMissing?: boolean; vaultId: string; walletId: string }

      Returns Promise<void>

    • Parameters

      Returns Promise<
          {
              archived?: boolean;
              btcDetails?: {
                  btcNetworkDetails?: {
                      mainAddress?: string;
                      network?: string;
                      xpub?: string;
                  }[];
              };
              convertedValue?: { amount?: string; currencyCode?: string };
              createParams?: { walletGroups?: string[] };
              displayName: string;
              evmDetails?: { address?: string };
              external?: boolean;
              hasFrozenAssets?: boolean;
              id: string;
              name?: string;
              networks: string[];
              solanaDetails?: { address?: string };
              tonDetails?: { address?: string };
              tronDetails?: { address?: string };
              xrplDetails?: { signingPubKey?: string };
          },
      >

    • Parameters

      Returns Promise<
          {
              address?: string;
              chain: UtilaBlockchain;
              displayName?: string;
              format?: | "BITCOIN_P2PKH"
              | "BITCOIN_P2WPKH"
              | "EVM"
              | "TRON_BASE58"
              | "BASE58"
              | "TON_NON_BOUNCEABLE"
              | "SUBSTRATE_58"
              | "BITCOIN_P2TR";
              key?: string;
              keyDerivationPath?: string[];
              name?: string;
              network: string;
              note?: string;
              type?: "MAIN"
              | "DEPOSIT"
              | "CHANGE";
          },
      >

    • A Utila service-account JWT for vaultId, cached until shortly before it expires.

      The cache is not an optimisation detail: every call site mints a token per request, and under KMS that would be a kms:Sign network round trip on every Utila API call. It is keyed by vault because the identity is — two vaults mean two subs and therefore two tokens.

      Parameters

      • vaultId: string

      Returns Promise<string>

    • Parameters

      • args: { vaultId: string; walletId: string }

      Returns Promise<
          {
              wallet?: {
                  archived?: boolean;
                  btcDetails?: {
                      btcNetworkDetails?: {
                          mainAddress?: string;
                          network?: string;
                          xpub?: string;
                      }[];
                  };
                  convertedValue?: { amount?: string; currencyCode?: string };
                  createParams?: { walletGroups?: string[] };
                  displayName: string;
                  evmDetails?: { address?: string };
                  external?: boolean;
                  hasFrozenAssets?: boolean;
                  name?: string;
                  networks: string[];
                  solanaDetails?: { address?: string };
                  tonDetails?: { address?: string };
                  tronDetails?: { address?: string };
                  xrplDetails?: { signingPubKey?: string };
              };
          },
      >

    • Parameters

      • args: { pageToken?: string; vaultId: string; walletId: string }

      Returns Promise<
          {
              nextPageToken?: string;
              totalSize?: number;
              walletAddresses: {
                  address?: string;
                  chain: UtilaBlockchain;
                  displayName?: string;
                  format?: | "BITCOIN_P2PKH"
                  | "BITCOIN_P2WPKH"
                  | "EVM"
                  | "TRON_BASE58"
                  | "BASE58"
                  | "TON_NON_BOUNCEABLE"
                  | "SUBSTRATE_58"
                  | "BITCOIN_P2TR";
                  key?: string;
                  keyDerivationPath?: string[];
                  name?: string;
                  network: string;
                  note?: string;
                  type?: "MAIN"
                  | "DEPOSIT"
                  | "CHANGE";
              }[];
          },
      >

    • Parameters

      • args: { pageToken?: string; vaultId: string }

      Returns Promise<
          {
              nextPageToken?: string;
              totalSize?: number;
              wallets?: {
                  archived?: boolean;
                  btcDetails?: {
                      btcNetworkDetails?: {
                          mainAddress?: (...)
                          | (...);
                          network?: (...) | (...);
                          xpub?: (...) | (...);
                      }[];
                  };
                  convertedValue?: { amount?: string; currencyCode?: string };
                  createParams?: { walletGroups?: string[] };
                  displayName: string;
                  evmDetails?: { address?: string };
                  external?: boolean;
                  hasFrozenAssets?: boolean;
                  name?: string;
                  networks: string[];
                  solanaDetails?: { address?: string };
                  tonDetails?: { address?: string };
                  tronDetails?: { address?: string };
                  xrplDetails?: { signingPubKey?: string };
              }[];
          },
      >

    • Asset balances held by a wallet, or by every wallet in the vault.

      Pass walletId: "-" to query the whole vault in ONE call. Each returned balance carries its own wallet resource name, so the rows can be grouped back onto wallets client-side — which is what makes balances affordable on a list page instead of an N+1 per row.

      The wallet and asset fields come back as resource names (vaults/{v}/wallets/{w}, assets/native.ethereum-mainnet); both are split to their trailing id here so callers never parse Utila's path format.

      value is the decimal amount and frozenValue the portion that cannot be moved — they are SEPARATE figures, not a total and a subset to subtract. Both are returned verbatim as strings: these are token amounts at chain precision, and rounding them through a JS number loses digits.

      Note there is no fiat conversion in this (default BASIC) response, so a multi-asset wallet has no single "balance" to total.

      Parameters

      • args: { pageSize?: number; pageToken?: string; vaultId: string; walletId: string }
        • OptionalpageSize?: number
        • OptionalpageToken?: string
        • vaultId: string
        • walletId: string

          A wallet id, or "-" for every wallet in the vault.

      Returns Promise<
          {
              balances: {
                  asset?: string;
                  assetId: string
                  | undefined;
                  frozenValue?: string;
                  rawValue?: string;
                  value?: string;
                  wallet?: string;
                  walletId: string | undefined;
              }[];
              nextPageToken: string
              | undefined;
          },
      >

    • Un-archive a wallet — the inverse of archive, needed because restoring a soft-deleted deposit wallet has to put the custody side back too. A restored row whose Utila wallet stayed archived would be live in CFX and hidden in the vault.

      Parameters

      • args: { allowMissing?: boolean; vaultId: string; walletId: string }

      Returns Promise<void>