Add transaction getter

This commit is contained in:
lash
2024-11-02 16:38:29 +00:00
parent e29a24b376
commit 14bc11f4bd
3 changed files with 44 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ const (
DATA_PUBLIC_KEY_REVERSE
DATA_ACTIVE_DECIMAL
DATA_ACTIVE_ADDRESS
DATA_TRANSACTIONS
)
func typToBytes(typ DataTyp) []byte {

View File

@@ -37,6 +37,15 @@ func ProcessVouchers(holdings []dataserviceapi.TokenHoldings) VoucherMetadata {
return data
}
//func StoreVouchers(db storage.PrefixDb, data VoucherMetadata) {
// value, err := db.Put(ctx, []byte(key))
// if err != nil {
// return nil, fmt.Errorf("failed to get %s: %v", key, err)
// }
// data[key] = string(value)
// }
//}
// GetVoucherData retrieves and matches voucher data
func GetVoucherData(ctx context.Context, db storage.PrefixDb, input string) (*dataserviceapi.TokenHoldings, error) {
keys := []string{"sym", "bal", "deci", "addr"}