11import { AbiFunction , AbiParameters , Address , Bytes , Hex , Provider } from 'ox'
2- import { WrappedSignature } from 'ox/erc6492'
2+ import { SignatureErc6492 } from 'ox/erc6492'
33import { DEPLOY } from './constants.js'
44import { Context } from './context.js'
55
@@ -29,7 +29,7 @@ export function wrap<T extends Bytes.Bytes | Hex.Hex>(
2929 [ { type : 'address' } , { type : 'bytes' } , { type : 'bytes' } ] ,
3030 [ to , Hex . from ( data ) , Hex . from ( signature ) ] ,
3131 ) ,
32- WrappedSignature . magicBytes ,
32+ SignatureErc6492 . magicBytes ,
3333 )
3434
3535 switch ( typeof signature ) {
@@ -46,24 +46,24 @@ export function decode<T extends Bytes.Bytes | Hex.Hex>(
4646 switch ( typeof signature ) {
4747 case 'object' :
4848 if (
49- Bytes . toHex ( signature . subarray ( - WrappedSignature . magicBytes . slice ( 2 ) . length / 2 ) ) ===
50- WrappedSignature . magicBytes
49+ Bytes . toHex ( signature . subarray ( - SignatureErc6492 . magicBytes . slice ( 2 ) . length / 2 ) ) ===
50+ SignatureErc6492 . magicBytes
5151 ) {
5252 const [ to , data , decoded ] = AbiParameters . decode (
5353 [ { type : 'address' } , { type : 'bytes' } , { type : 'bytes' } ] ,
54- signature . subarray ( 0 , - WrappedSignature . magicBytes . slice ( 2 ) . length / 2 ) ,
54+ signature . subarray ( 0 , - SignatureErc6492 . magicBytes . slice ( 2 ) . length / 2 ) ,
5555 )
5656 return { signature : Hex . toBytes ( decoded ) as T , erc6492 : { to, data : Hex . toBytes ( data ) as T } }
5757 } else {
5858 return { signature }
5959 }
6060
6161 case 'string' :
62- if ( signature . endsWith ( WrappedSignature . magicBytes . slice ( 2 ) ) ) {
62+ if ( signature . endsWith ( SignatureErc6492 . magicBytes . slice ( 2 ) ) ) {
6363 try {
6464 const [ to , data , decoded ] = AbiParameters . decode (
6565 [ { type : 'address' } , { type : 'bytes' } , { type : 'bytes' } ] ,
66- signature . slice ( 0 , - WrappedSignature . magicBytes . slice ( 2 ) . length ) as Hex . Hex ,
66+ signature . slice ( 0 , - SignatureErc6492 . magicBytes . slice ( 2 ) . length ) as Hex . Hex ,
6767 )
6868 return { signature : decoded as T , erc6492 : { to, data : data as T } }
6969 } catch {
0 commit comments