diff --git a/packages/wrapped-keys/src/lib/api/batch-generate-private-keys.ts b/packages/wrapped-keys/src/lib/api/batch-generate-private-keys.ts index 1d738ca92..e5a4ca2f1 100644 --- a/packages/wrapped-keys/src/lib/api/batch-generate-private-keys.ts +++ b/packages/wrapped-keys/src/lib/api/batch-generate-private-keys.ts @@ -62,10 +62,16 @@ export async function batchGeneratePrivateKeys( } = actionResult; const id = ids[ndx]; // Result of writes is in same order as provided - const signature = actionResult.signMessage?.signature; + const messageSignature = actionResult.signMessage?.signature; + const transactionSignature = actionResult.signTransaction?.signature; return { - ...(signature ? { signMessage: { signature } } : {}), + ...(messageSignature + ? { signMessage: { signature: messageSignature } } + : {}), + ...(transactionSignature + ? { signTransaction: { signature: transactionSignature } } + : {}), generateEncryptedPrivateKey: { memo: memo, id, diff --git a/packages/wrapped-keys/src/lib/lit-actions-client/batch-generate-keys.ts b/packages/wrapped-keys/src/lib/lit-actions-client/batch-generate-keys.ts index 4a041da3a..dc6136734 100644 --- a/packages/wrapped-keys/src/lib/lit-actions-client/batch-generate-keys.ts +++ b/packages/wrapped-keys/src/lib/lit-actions-client/batch-generate-keys.ts @@ -21,6 +21,7 @@ interface GeneratePrivateKeyLitActionResult { interface BatchGeneratePrivateKeysWithLitActionResult { network: Network; signMessage?: { signature: string }; + signTransaction?: { signature: string }; generateEncryptedPrivateKey: GeneratePrivateKeyLitActionResult; } diff --git a/packages/wrapped-keys/src/lib/types.ts b/packages/wrapped-keys/src/lib/types.ts index b3742ff69..d40cf2431 100644 --- a/packages/wrapped-keys/src/lib/types.ts +++ b/packages/wrapped-keys/src/lib/types.ts @@ -159,14 +159,33 @@ export interface ExportPrivateKeyResult { id: string; } -/** @typedef GeneratePrivateKeyAction - * @extends ApiParamsSupportedNetworks - */ -export type GeneratePrivateKeyAction = ApiParamsSupportedNetworks & { +export type GeneratePrivateKeyActionBase = ApiParamsSupportedNetworks & { generateKeyParams: { memo: string }; signMessageParams?: { messageToSign: string | Uint8Array }; }; +export type GeneratePrivateKeyActionSolana = GeneratePrivateKeyActionBase & { + network: Extract; + signTransactionParams: { + unsignedTransaction: SerializedTransaction; + broadcast?: boolean; + }; +}; + +export type GeneratePrivateKeyActionEthereum = GeneratePrivateKeyActionBase & { + network: Extract; + signTransactionParams: { + unsignedTransaction: EthereumLitTransaction; + broadcast?: boolean; + }; +}; + +/** @typedef GeneratePrivateKeyAction + */ +export type GeneratePrivateKeyAction = + | GeneratePrivateKeyActionSolana + | GeneratePrivateKeyActionEthereum; + /** @typedef BatchGeneratePrivateKeysParams * @extends BaseApiParams */ @@ -180,6 +199,7 @@ export type BatchGeneratePrivateKeysParams = BaseApiParams & { export interface BatchGeneratePrivateKeysActionResult { generateEncryptedPrivateKey: GeneratePrivateKeyResult & { memo: string }; signMessage?: { signature: string }; + signTransaction?: { signature: string }; } export interface BatchGeneratePrivateKeysResult {