func (txn JSONTransaction) MarshalJSON() ([]byte, error) {
	type encodedTransaction struct {
		SiacoinInputs []struct {
			ParentID         types.SiacoinOutputID   `json:"parentID"`
			UnlockConditions encodedUnlockConditions `json:"unlockConditions"`
		} `json:"siacoinInputs,omitempty"`
		SiacoinOutputs []encodedSiacoinOutput `json:"siacoinOutputs,omitempty"`
		FileContracts  []struct {
			FileSize           uint64                 `json:"fileSize"`
			FileMerkleRoot     crypto.Hash            `json:"fileMerkleRoot"`
			WindowStart        types.BlockHeight      `json:"windowStart"`
			WindowEnd          types.BlockHeight      `json:"windowEnd"`
			Payout             types.Currency         `json:"payout"`
			ValidProofOutputs  []encodedSiacoinOutput `json:"validProofOutputs"`
			MissedProofOutputs []encodedSiacoinOutput `json:"missedProofOutputs"`
			UnlockHash         types.UnlockHash       `json:"unlockHash"`
			RevisionNumber     uint64                 `json:"revisionNumber"`
		} `json:"fileContracts,omitempty"`
		FileContractRevisions []struct {
			ParentID              types.FileContractID    `json:"parentID"`
			UnlockConditions      encodedUnlockConditions `json:"unlockConditions"`
			NewRevisionNumber     uint64                  `json:"newRevisionNumber"`
			NewFileSize           uint64                  `json:"newFileSize"`
			NewFileMerkleRoot     crypto.Hash             `json:"newFileMerkleRoot"`
			NewWindowStart        types.BlockHeight       `json:"newWindowStart"`
			NewWindowEnd          types.BlockHeight       `json:"newWindowEnd"`
			NewValidProofOutputs  []encodedSiacoinOutput  `json:"newValidProofOutputs"`
			NewMissedProofOutputs []encodedSiacoinOutput  `json:"newMissedProofOutputs"`
			NewUnlockHash         types.UnlockHash        `json:"newUnlockHash"`
		} `json:"fileContractRevisions,omitempty"`
		StorageProofs []types.StorageProof `json:"storageProofs,omitempty"`
		SiafundInputs []struct {
			ParentID         types.SiafundOutputID   `json:"parentID"`
			UnlockConditions encodedUnlockConditions `json:"unlockConditions"`
			ClaimUnlockHash  types.UnlockHash        `json:"claimUnlockHash"`
		} `json:"siafundInputs,omitempty"`
		SiafundOutputs []struct {
			Value      types.Currency   `json:"value"`
			UnlockHash types.UnlockHash `json:"unlockHash"`
			ClaimStart types.Currency   `json:"-"`  
		} `json:"siafundOutputs,omitempty"`
		MinerFees             []types.Currency `json:"minerFees,omitempty"`
		ArbitraryData         [][]byte         `json:"arbitraryData,omitempty"`
		TransactionSignatures []struct {
			ParentID       crypto.Hash       `json:"parentID"`
			PublicKeyIndex uint64            `json:"publicKeyIndex"`
			Timelock       types.BlockHeight `json:"timelock,omitempty"`
			CoveredFields  struct {
				WholeTransaction      bool     `json:"wholeTransaction,omitempty"`
				SiacoinInputs         []uint64 `json:"siacoinInputs,omitempty"`
				SiacoinOutputs        []uint64 `json:"siacoinOutputs,omitempty"`
				FileContracts         []uint64 `json:"fileContracts,omitempty"`
				FileContractRevisions []uint64 `json:"fileContractRevisions,omitempty"`
				StorageProofs         []uint64 `json:"storageProofs,omitempty"`
				SiafundInputs         []uint64 `json:"siafundInputs,omitempty"`
				SiafundOutputs        []uint64 `json:"siafundOutputs,omitempty"`
				MinerFees             []uint64 `json:"minerFees,omitempty"`
				ArbitraryData         []uint64 `json:"arbitraryData,omitempty"`
				TransactionSignatures []uint64 `json:"transactionSignatures,omitempty"`
			} `json:"coveredFields"`
			Signature []byte `json:"signature"`
		} `json:"transactionSignatures,omitempty"`
	}
	return json.Marshal(*(*encodedTransaction)(unsafe.Pointer(&txn)))
}
MarshalJSON implements json.Marshaler.
package walrus  
import (
	"encoding/hex"
	"encoding/json"
	"time"
	"unsafe"
	"go.sia.tech/siad/crypto"
	"go.sia.tech/siad/types"
	"lukechampine.com/us/wallet"
)
type JSONTransaction types.Transaction