@@ -1042,4 +1042,77 @@ impl Program {
10421042 code : Vec :: new ( )
10431043 }
10441044 }
1045- }
1045+ }
1046+
1047+ #[ derive( Clone , Debug , Default ) ]
1048+ pub struct FTx {
1049+ pub script_length : u16 ,
1050+ pub script : Vec < u8 > ,
1051+ pub gas_price : u64 ,
1052+ pub gas_limit : u64 ,
1053+ pub inputs_count : u8 ,
1054+ pub inputs : Vec < FInput > ,
1055+ pub outputs_count : u8 ,
1056+ pub outputs : Vec < FOutput > ,
1057+ }
1058+
1059+ #[ derive( Clone , Debug ) ]
1060+ pub struct FInput {
1061+ pub input_type : FInputTypeEnum ,
1062+ pub data : Vec < u8 > ,
1063+ }
1064+
1065+ #[ derive( Clone , Debug , Default ) ]
1066+ pub struct FInputCoin {
1067+ pub utxo_id : FUtxoId ,
1068+ pub data_length : u16 ,
1069+ pub data : Vec < u8 > ,
1070+ pub witness_index : u8 ,
1071+ }
1072+
1073+ #[ derive( Clone , Debug , Default ) ]
1074+ pub struct FInputContract {
1075+ pub utxo_id : FUtxoId ,
1076+ pub contract_id : FContractId ,
1077+ }
1078+
1079+ #[ derive( Clone , Debug ) ]
1080+ pub enum FInputTypeEnum {
1081+ Coin ( FInputCoin ) ,
1082+ Contract ( FInputContract )
1083+ }
1084+
1085+ #[ derive( Clone , Debug ) ]
1086+ pub struct FOutput {
1087+ pub input_type : FOutputTypeEnum ,
1088+ pub data : Vec < u8 > ,
1089+ }
1090+
1091+ #[ derive( Clone , Debug , Default ) ]
1092+ pub struct FOutputCoin {
1093+ pub to : [ u8 ; 32 ] ,
1094+ pub amount : u64 ,
1095+ }
1096+
1097+ #[ derive( Clone , Debug , Default ) ]
1098+ pub struct FOutputContract {
1099+ pub input_index : u8 ,
1100+ pub amount_witness_index : u8 ,
1101+ }
1102+
1103+ #[ derive( Clone , Debug , Default ) ]
1104+ pub struct FWitness {
1105+ pub data_length : u16 ,
1106+ pub data : Vec < u8 > ,
1107+ }
1108+
1109+ #[ derive( Clone , Debug ) ]
1110+ pub enum FOutputTypeEnum {
1111+ Coin ( FOutputCoin ) ,
1112+ Contract
1113+ }
1114+
1115+ pub type FInputType = u8 ;
1116+ pub type FOutputType = u8 ;
1117+ pub type FUtxoId = [ u8 ; 32 ] ;
1118+ pub type FContractId = [ u8 ; 32 ] ;
0 commit comments