@@ -11,6 +11,7 @@ import { Asset } from '@/features/assets/models'
1111import { getAssetIdsForTransaction } from '../utils/get-asset-ids-for-transaction'
1212import { asAssetConfigTransaction } from './asset-config-transaction-mappers'
1313import { asAssetFreezeTransaction } from './asset-freeze-transaction-mappers'
14+ import { asStateProofTransaction } from './state-proof-transaction-mappers'
1415
1516export const asTransaction = async ( transactionResult : TransactionResult , assetResolver : ( assetId : number ) => Promise < Asset > | Asset ) => {
1617 switch ( transactionResult [ 'tx-type' ] ) {
@@ -38,6 +39,10 @@ export const asTransaction = async (transactionResult: TransactionResult, assetR
3839 const asset = await assetResolver ( assetId )
3940 return asAssetFreezeTransaction ( transactionResult , asset )
4041 }
42+ case algosdk . TransactionType . stpf : {
43+ invariant ( transactionResult [ 'state-proof-transaction' ] , 'state-proof-transaction is not set' )
44+ return asStateProofTransaction ( transactionResult )
45+ }
4146 default :
4247 // TODO: Once we support all transaction types, we should throw an error instead
4348 // throw new Error(`${transaction['tx-type']} is not supported`)
@@ -91,6 +96,13 @@ export const asTransactionSummary = (transactionResult: TransactionResult): Tran
9196 to : transactionResult [ 'asset-freeze-transaction' ] [ 'asset-id' ] ,
9297 }
9398 }
99+ case algosdk . TransactionType . stpf : {
100+ invariant ( transactionResult [ 'state-proof-transaction' ] , 'state-proof-transaction is not set' )
101+ return {
102+ ...common ,
103+ type : TransactionType . StateProof ,
104+ }
105+ }
94106 default :
95107 // TODO: Once we support all transaction types, we should throw an error instead
96108 // throw new Error(`${transaction['tx-type']} is not supported`)
0 commit comments