f596f72f44
Update chore to add confirmed transactions to the billing table. Change-Id: I3c9a98c2ddc96f8a8905250376a1f5490d810277
33 lines
1020 B
Go
33 lines
1020 B
Go
// Copyright (C) 2022 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package storjscan
|
|
|
|
import (
|
|
"context"
|
|
|
|
"storj.io/common/uuid"
|
|
"storj.io/storj/private/blockchain"
|
|
)
|
|
|
|
// WalletsDB is an interface which defines functionality
|
|
// of DB which stores user storjscan wallets.
|
|
//
|
|
// architecture: Database
|
|
type WalletsDB interface {
|
|
// Add adds a new storjscan wallet to the DB and associates it with a user.
|
|
Add(ctx context.Context, userID uuid.UUID, walletAddress blockchain.Address) error
|
|
// GetWallet returns the wallet address associated with the given user.
|
|
GetWallet(ctx context.Context, userID uuid.UUID) (blockchain.Address, error)
|
|
// GetUser returns the userID associated with the given wallet.
|
|
GetUser(ctx context.Context, wallet blockchain.Address) (uuid.UUID, error)
|
|
// GetAll returns all saved wallet entries.
|
|
GetAll(ctx context.Context) (_ []Wallet, err error)
|
|
}
|
|
|
|
// Wallet associates a user ID and a wallet address.
|
|
type Wallet struct {
|
|
UserID uuid.UUID
|
|
Address blockchain.Address
|
|
}
|