Skip to content

Patched package #272

Description

@adedamolabasit

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch ox@0.14.29 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/ox/tempo/KeyAuthorization.ts b/node_modules/ox/tempo/KeyAuthorization.ts
index 4978460..d86a2f3 100644
--- a/node_modules/ox/tempo/KeyAuthorization.ts
+++ b/node_modules/ox/tempo/KeyAuthorization.ts
@@ -512,8 +512,8 @@ export function fromRpc(authorization: Rpc): Signed {
   const { allowedCalls, chainId, keyId, expiry, limits, keyType } =
     authorization
   const witness = authorization.witness ?? undefined
-  const isAdmin = authorization.isAdmin ?? undefined
-  const account = authorization.account ?? undefined
+  const isAdmin = authorization.isAdmin ?? false 
+  const account = authorization.account ?? '0x'
   const signature = SignatureEnvelope.fromRpc(authorization.signature)
   if (witness !== undefined) assertWitness(witness)
 
@@ -534,7 +534,7 @@ export function fromRpc(authorization: Rpc): Signed {
       })
     : undefined
 
-  return {
+return {
     address: keyId,
     chainId: chainId === '0x' ? 0n : Hex.toBigInt(chainId),
     ...(expiry != null ? { expiry: Number(expiry) } : {}),
@@ -549,8 +549,8 @@ export function fromRpc(authorization: Rpc): Signed {
     signature,
     type: keyType,
     ...(witness !== undefined ? { witness } : {}),
-    ...(isAdmin ? { isAdmin: true } : {}),
-    ...(account !== undefined ? { account } : {}),
+    isAdmin,          // ← always include, no longer conditional
+    account,          // ← always include, no longer conditional
   }
 }
 

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions