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

    Signs with CFX's backoffice wallets through wallet-api, which alone holds their keys (WALLETS.md §5.8). A nonced transaction's caller finds its walletTransactionId with search, by reference or by the pool nonce it holds.

    Index
    instance: (...args: []) => BackofficeWalletService = ...

    The process default: the signing wallet-api and the worker queue from the temporal namespace.

    • Call off a transaction that was never broadcast: the row and its nonce.

      Parameters

      • __namedParameters: { reason: unknown; walletTransactionId: string }
        • reason: unknown

          Why, stored on the row as its error.

        • walletTransactionId: string

      Returns Promise<
          | { ok: true; value: { status: "CANCELLED" } }
          | { error: WalletApiCancelError; ok: false },
      >

    • The deadline check started for row walletTransactionId at deadline, if one was.

      Parameters

      • __namedParameters: { deadline: Instant; walletTransactionId: string }

      Returns Promise<
          | TemporalWorkflowExecution & {
              pendingActivities: TemporalPendingActivity[];
          }
          | null,
      >

    • Start row walletTransactionId's deadline check at deadline, idempotent by both (and by recheckAt, the backstop's re-check after that run closed). Throws when the start fails, so the activity that signed retries rather than leave the row with nothing to expire it.

      Parameters

      • __namedParameters: { deadline: Instant; recheckAt?: Instant; walletTransactionId: string }

      Returns Promise<Run>

    • Wallet transactions by reference or by the pool nonce they hold, oldest first.

      Parameters

      • __namedParameters: {
            createdAt?: DbTimestampCriteria;
            ids?: string[];
            nonceUnreleased?: boolean;
            references?: string[];
            solanaNonceAddresses?: string[];
            statuses?: WalletTransactionStatus[];
        }
        • OptionalcreatedAt?: DbTimestampCriteria
        • Optionalids?: string[]
        • OptionalnonceUnreleased?: boolean

          Only those still holding their pool nonce.

        • Optionalreferences?: string[]
        • OptionalsolanaNonceAddresses?: string[]
        • Optionalstatuses?: WalletTransactionStatus[]

      Returns Promise<
          {
              ok: true;
              value: {
                  items: (
                      Pick<
                          {
                              awsRequestId: string
                              | null;
                              blockTime: Date | null;
                              cancelledAt: Date | null;
                              chain: WalletTransactionChain;
                              chainData:
                                  | JsonObject
                                  | {
                                      blockTime: number;
                                      indexWithinBlock: number;
                                      meta: {
                                          err: JsonValue;
                                          fee: number;
                                          innerInstructions: (...)[];
                                          loadedAddresses: { readonly: ...; writable: ... };
                                          logMessages: (...)[];
                                          postBalances: (...)[];
                                          postTokenBalances: (...)[];
                                          preBalances: (...)[];
                                          preTokenBalances: (...)[];
                                      };
                                      slot: number;
                                      transaction: {
                                          message: {
                                              accountKeys: ...;
                                              addressTableLookups?: ...;
                                              header: ...;
                                              instructions: ...;
                                              recentBlockhash: ...;
                                              transactionConfig?: ...;
                                          };
                                          signatures: (...)[];
                                      };
                                      version?: 0
                                      | 1
                                      | "legacy";
                                  }
                                  | null;
                              chainId: number;
                              confirmedAt: Date
                              | null;
                              createdAt: Date;
                              data: JsonObject | null;
                              error: JsonValue;
                              evmFrom: string | null;
                              evmNonce: bigint | null;
                              externalId: string;
                              finalizedAt: Date | null;
                              id: number;
                              indexWithinBlock: number | null;
                              lastValidBlockHeight: bigint | null;
                              memoIks: string[] | null;
                              messageHash: Buffer<ArrayBufferLike> | null;
                              nonce: string | null;
                              nonceReleasedAt: Date | null;
                              parsedEvents: ParsedSolanaTransactionEvent[] | null;
                              payload: Buffer<ArrayBufferLike> | null;
                              reference: string | null;
                              requestedBy: string | null;
                              signedAt: Date | null;
                              slot: number | null;
                              solanaNonceAddress: string | null;
                              solanaNonceId: number | null;
                              source: WalletTransactionSource;
                              status: WalletTransactionStatus;
                              submittedAt: Date | null;
                              txHash: string | null;
                              type: WalletTransactionType;
                              updatedAt: Date;
                              utilaTransactionId: string | null;
                              utilaVaultExternalId: string | null;
                              utilaVaultId: number | null;
                          },
                          | "createdAt"
                          | "status"
                          | "reference"
                          | "txHash"
                          | "solanaNonceAddress"
                          | "nonce",
                      > & { id: string }
                  )[];
              };
          },
      >

    • Sign a message with the backofficeWallets roles, plus any extraSigners held in this process; fully signed, with the message's lifetime. With extraSigners wallet-api broadcasts it itself (broadcastByWalletApi); with CFX's keys alone the caller broadcasts it.

      Parameters

      • __namedParameters: {
            backofficeWallets: BackofficeWalletType[];
            extraSigners?: readonly KeyPairSigner[];
            message: TransactionMessage & (
                TransactionMessageWithFeePayer<string> & TransactionMessageWithLifetime
            );
            reference: string;
            walletId?: string;
        }
        • backofficeWallets: BackofficeWalletType[]

          Exactly the roles whose keys the message requires; wallet-api refuses any other set.

        • OptionalextraSigners?: readonly KeyPairSigner[]
        • message: TransactionMessage & (
              TransactionMessageWithFeePayer<string> & TransactionMessageWithLifetime
          )
        • reference: string

          The caller's own durable id: a quote, withdrawal, escrow or deploy.

        • OptionalwalletId?: string

          A customer wallet wallet-api also signs as, every address of it the message requires.

      Returns Promise<
          | {
              ok: true;
              value: Readonly<
                  { messageBytes: TransactionMessageBytes; signatures: SignaturesMap },
              > & TransactionWithLifetime & WalletApiBroadcast;
          }
          | { error: WalletApiSignError; ok: false },
      >

    • Add CFX's signatures to a transaction compiled elsewhere (stored unsigned, or signed by a customer), keeping every signature it already carries. One with no empty slot (signed through sign already) comes back as it is. One carrying a signer wallet-api does not hold is broadcast by wallet-api once CFX signs it (broadcastByWalletApi), so the caller never sends it again.

      Type Parameters

      • T extends Readonly<{ messageBytes: TransactionMessageBytes; signatures: SignaturesMap }>

      Parameters

      • __namedParameters: {
            backofficeWallets: BackofficeWalletType[];
            reference: string;
            transaction: T;
            walletId?: string;
        }
        • backofficeWallets: BackofficeWalletType[]

          Exactly the roles whose keys the message requires, signed slots included.

        • reference: string
        • transaction: T
        • OptionalwalletId?: string

          A customer wallet wallet-api also signs as, every address of it the message requires.

      Returns Promise<
          | { error: WalletApiSignError; ok: false }
          | { ok: true; value: T & WalletApiBroadcast },
      >