From b741a1cebd822efa50aa9791180aeefb67cf0f1f Mon Sep 17 00:00:00 2001 From: Oliver He Date: Tue, 22 Oct 2024 18:29:12 -0400 Subject: [PATCH] Add the ability to set options when creating a jwk_update txn (#551) --- src/api/keyless.ts | 3 ++- src/internal/keyless.ts | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api/keyless.ts b/src/api/keyless.ts index 5e1c53bb7..e1327d1b7 100644 --- a/src/api/keyless.ts +++ b/src/api/keyless.ts @@ -10,7 +10,7 @@ import { getProof, updateFederatedKeylessJwkSetTransaction, } from "../internal/keyless"; -import { SimpleTransaction } from "../transactions"; +import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions"; import { HexInput } from "../types"; import { AptosConfig } from "./aptosConfig"; @@ -214,6 +214,7 @@ export class Keyless { sender: Account; iss: string; jwksUrl?: string; + options?: InputGenerateTransactionOptions; }): Promise { return updateFederatedKeylessJwkSetTransaction({ aptosConfig: this.config, ...args }); } diff --git a/src/internal/keyless.ts b/src/internal/keyless.ts index 0a4070d1f..a96cce7a2 100644 --- a/src/internal/keyless.ts +++ b/src/internal/keyless.ts @@ -28,7 +28,7 @@ import { FederatedKeylessPublicKey } from "../core/crypto/federatedKeyless"; import { FederatedKeylessAccount } from "../account/FederatedKeylessAccount"; import { MoveVector } from "../bcs"; import { generateTransaction } from "./transactionSubmission"; -import { SimpleTransaction } from "../transactions"; +import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions"; /** * Retrieves a pepper value based on the provided configuration and authentication details. @@ -218,8 +218,9 @@ export async function updateFederatedKeylessJwkSetTransaction(args: { sender: Account; iss: string; jwksUrl?: string; + options?: InputGenerateTransactionOptions; }): Promise { - const { aptosConfig, sender, iss } = args; + const { aptosConfig, sender, iss, options } = args; const jwksUrl = args.jwksUrl ?? (iss.endsWith("/") ? `${iss}.well-known/jwks.json` : `${iss}/.well-known/jwks.json`); const response = await fetch(jwksUrl); if (!response.ok) { @@ -239,5 +240,6 @@ export async function updateFederatedKeylessJwkSetTransaction(args: { MoveVector.MoveString(jwks.keys.map((key) => key.n)), ], }, + options, }); }