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

    Invokes wallet-api (packages/wallet-api), { op, identity, args } in and { ok, value | error } out. functionName picks the deployment: the create-and-import cfx-wallet-create (grantWalletCreate), the deploy, timelock and NTT cfx-wallet-deploy (grantWalletDeploy), or the signing cfx-wallet-api (grantWalletApi, temporal-worker and background-worker; WALLETS.md §5.7).

    Index
    • Parameters

      • __namedParameters: {
            deployment: "create" | "deploy" | "sign";
            identity?: string;
            lambda?: Pick<LambdaClient, "send">;
        }
        • deployment: "create" | "deploy" | "sign"

          Picks the function (WALLET_FUNCTION_NAME, WALLET_CREATE_FUNCTION_NAME or WALLET_DEPLOY_FUNCTION_NAME, a live alias when deployed) and so which ops it serves.

        • Optionalidentity?: string

          Recorded in wallet-api's invoke log, e.g. cfx-temporal-worker; absent, wallet-api records its own name.

        • Optionallambda?: Pick<LambdaClient, "send">

      Returns WalletApiClient

    instance: (
        ...args: [{ deployment: "create" | "deploy" | "sign" }],
    ) => WalletApiClient = ...

    The process client for one deployment: its function name and the local endpoint from the wallet-api namespace at each call, and this process's name (CFX_APP_NAME, else its Lambda's) as the identity.

    • The wallet's live BIP39 secret's account-0 address on chain (EVM, TRON or a Bitcoin script type), derived through its CFX share and recorded; created: false when the wallet already held it.

      Parameters

      • args: {
            accountIndex: 0;
            chain: "EVM" | "BITCOIN_SEGWIT" | "BITCOIN_TAPROOT" | "TRON";
            walletId: string;
        }

      Returns Promise<
          | { ok: true; value: WalletApiDerived }
          | { error: WalletApiDeriveError; ok: false },
      >

    • An EIP-191, EIP-712 or EIP-7702 signature by the role signer.

      Parameters

      Returns Promise<
          | { ok: true; value: WalletApiEvmMessageSigned }
          | {
              error:
                  | ServiceError<"WALLET_API_ERROR">
                  | ServiceError<
                      | "SIGNER_MISMATCH"
                      | "SIGNER_NOT_FOUND"
                      | "INVALID_ARGS"
                      | "CHAIN_NOT_CONFIGURED"
                      | "DELEGATE_MISMATCH",
                  >;
              ok: false;
          },
      >