1- import  {  Address  }  from  'ox' 
21import  { 
32  Precondition , 
43  NativeBalancePrecondition , 
@@ -41,52 +40,37 @@ export function decodePrecondition(p: IntentPrecondition): Precondition | undefi
4140    switch  ( p . type )  { 
4241      case  'native-balance' :
4342        precondition  =  new  NativeBalancePrecondition ( 
44-           Address . from ( data . address ) , 
43+           data . address , 
4544          data . min  ? BigInt ( data . min )  : undefined , 
4645          data . max  ? BigInt ( data . max )  : undefined , 
4746        ) 
4847        break 
4948
5049      case  'erc20-balance' :
5150        precondition  =  new  Erc20BalancePrecondition ( 
52-           Address . from ( data . address ) , 
53-           Address . from ( data . token ) , 
51+           data . address , 
52+           data . token , 
5453          data . min  ? BigInt ( data . min )  : undefined , 
5554          data . max  ? BigInt ( data . max )  : undefined , 
5655        ) 
5756        break 
5857
5958      case  'erc20-approval' :
60-         precondition  =  new  Erc20ApprovalPrecondition ( 
61-           Address . from ( data . address ) , 
62-           Address . from ( data . token ) , 
63-           Address . from ( data . operator ) , 
64-           BigInt ( data . min ) , 
65-         ) 
59+         precondition  =  new  Erc20ApprovalPrecondition ( data . address ,  data . token ,  data . operator ,  BigInt ( data . min ) ) 
6660        break 
6761
6862      case  'erc721-ownership' :
69-         precondition  =  new  Erc721OwnershipPrecondition ( 
70-           Address . from ( data . address ) , 
71-           Address . from ( data . token ) , 
72-           BigInt ( data . tokenId ) , 
73-           data . owned , 
74-         ) 
63+         precondition  =  new  Erc721OwnershipPrecondition ( data . address ,  data . token ,  BigInt ( data . tokenId ) ,  data . owned ) 
7564        break 
7665
7766      case  'erc721-approval' :
78-         precondition  =  new  Erc721ApprovalPrecondition ( 
79-           Address . from ( data . address ) , 
80-           Address . from ( data . token ) , 
81-           BigInt ( data . tokenId ) , 
82-           Address . from ( data . operator ) , 
83-         ) 
67+         precondition  =  new  Erc721ApprovalPrecondition ( data . address ,  data . token ,  BigInt ( data . tokenId ) ,  data . operator ) 
8468        break 
8569
8670      case  'erc1155-balance' :
8771        precondition  =  new  Erc1155BalancePrecondition ( 
88-           Address . from ( data . address ) , 
89-           Address . from ( data . token ) , 
72+           data . address , 
73+           data . token , 
9074          BigInt ( data . tokenId ) , 
9175          data . min  ? BigInt ( data . min )  : undefined , 
9276          data . max  ? BigInt ( data . max )  : undefined , 
@@ -95,10 +79,10 @@ export function decodePrecondition(p: IntentPrecondition): Precondition | undefi
9579
9680      case  'erc1155-approval' :
9781        precondition  =  new  Erc1155ApprovalPrecondition ( 
98-           Address . from ( data . address ) , 
99-           Address . from ( data . token ) , 
82+           data . address , 
83+           data . token , 
10084          BigInt ( data . tokenId ) , 
101-           Address . from ( data . operator ) , 
85+           data . operator , 
10286          BigInt ( data . min ) , 
10387        ) 
10488        break 
0 commit comments