import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().sparkSignFrost({ signWith: "<string> (A Spark wallet account address identifying the wallet to sign with.)", signatures: [{ // Batched sign requests. Each produces a partial signature plus Turnkey's public commitments., derivation: { // derivation field, identity: { /* object */ } // identity field, signingLeaf: { // signingLeaf field, leafId: "<string> (Unique identifier for the Spark signing leaf.)", }, deposit: { /* object */ } // deposit field, staticDeposit: { // staticDeposit field, index: 0 // Index used to derive the static deposit key., }, htlcPreimage: { /* object */ } // htlcPreimage field, }, message: "<string> (Hex-encoded 32-byte sighash to sign.)", verifyingKey: "<string> (Aggregate group verifying key (hex-encoded compressed secp256k1 point), computed as P_ops + P_user. Bound into the nonce HMAC.)", operatorCommitments: [{ // Commitments for every non-Turnkey participant. MUST NOT include an entry under Turnkey's identifier. Bound into the nonce HMAC., id: "<string> (FROST participant identifier, hex-encoded (32-byte scalar).)", hiding: "<string> (Hiding commitment D, hex-encoded compressed secp256k1 point.)", binding: "<string> (Binding commitment E, hex-encoded compressed secp256k1 point.)", }], adaptorPublicKey: "<string> (Optional adaptor point T (hex-encoded 33-byte compressed secp256k1 pubkey). When set, Turnkey produces a Schnorr adaptor pre-signature with the FROST challenge bound to `R+T` (where `R` is the aggregate group nonce commitment from FROST). The party holding the discrete log `t` completes the pre-sig to a valid BIP-340 signature by adding `t` (or `-t`, for parity) to the signature scalar `s`. This is primarily used by Spark leaves-swap and other adaptor-bound flows; absent or empty leads to plain FROST signing (the typical case).)", }]});
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().sparkSignFrost({ signWith: "<string> (A Spark wallet account address identifying the wallet to sign with.)", signatures: [{ // Batched sign requests. Each produces a partial signature plus Turnkey's public commitments., derivation: { // derivation field, identity: { /* object */ } // identity field, signingLeaf: { // signingLeaf field, leafId: "<string> (Unique identifier for the Spark signing leaf.)", }, deposit: { /* object */ } // deposit field, staticDeposit: { // staticDeposit field, index: 0 // Index used to derive the static deposit key., }, htlcPreimage: { /* object */ } // htlcPreimage field, }, message: "<string> (Hex-encoded 32-byte sighash to sign.)", verifyingKey: "<string> (Aggregate group verifying key (hex-encoded compressed secp256k1 point), computed as P_ops + P_user. Bound into the nonce HMAC.)", operatorCommitments: [{ // Commitments for every non-Turnkey participant. MUST NOT include an entry under Turnkey's identifier. Bound into the nonce HMAC., id: "<string> (FROST participant identifier, hex-encoded (32-byte scalar).)", hiding: "<string> (Hiding commitment D, hex-encoded compressed secp256k1 point.)", binding: "<string> (Binding commitment E, hex-encoded compressed secp256k1 point.)", }], adaptorPublicKey: "<string> (Optional adaptor point T (hex-encoded 33-byte compressed secp256k1 pubkey). When set, Turnkey produces a Schnorr adaptor pre-signature with the FROST challenge bound to `R+T` (where `R` is the aggregate group nonce commitment from FROST). The party holding the discrete log `t` completes the pre-sig to a valid BIP-340 signature by adding `t` (or `-t`, for parity) to the signature scalar `s`. This is primarily used by Spark leaves-swap and other adaptor-bound flows; absent or empty leads to plain FROST signing (the typical case).)", }]});
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().sparkSignFrost({ signWith: "<string> (A Spark wallet account address identifying the wallet to sign with.)", signatures: [{ // Batched sign requests. Each produces a partial signature plus Turnkey's public commitments., derivation: { // derivation field, identity: { /* object */ } // identity field, signingLeaf: { // signingLeaf field, leafId: "<string> (Unique identifier for the Spark signing leaf.)", }, deposit: { /* object */ } // deposit field, staticDeposit: { // staticDeposit field, index: 0 // Index used to derive the static deposit key., }, htlcPreimage: { /* object */ } // htlcPreimage field, }, message: "<string> (Hex-encoded 32-byte sighash to sign.)", verifyingKey: "<string> (Aggregate group verifying key (hex-encoded compressed secp256k1 point), computed as P_ops + P_user. Bound into the nonce HMAC.)", operatorCommitments: [{ // Commitments for every non-Turnkey participant. MUST NOT include an entry under Turnkey's identifier. Bound into the nonce HMAC., id: "<string> (FROST participant identifier, hex-encoded (32-byte scalar).)", hiding: "<string> (Hiding commitment D, hex-encoded compressed secp256k1 point.)", binding: "<string> (Binding commitment E, hex-encoded compressed secp256k1 point.)", }], adaptorPublicKey: "<string> (Optional adaptor point T (hex-encoded 33-byte compressed secp256k1 pubkey). When set, Turnkey produces a Schnorr adaptor pre-signature with the FROST challenge bound to `R+T` (where `R` is the aggregate group nonce commitment from FROST). The party holding the discrete log `t` completes the pre-sig to a valid BIP-340 signature by adding `t` (or `-t`, for parity) to the signature scalar `s`. This is primarily used by Spark leaves-swap and other adaptor-bound flows; absent or empty leads to plain FROST signing (the typical case).)", }]});