2022-05-20 10:18:59 +01:00
|
|
|
// 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
|
|
|
|
// Get returns the wallet address associated with the given user.
|
|
|
|
Get(ctx context.Context, userID uuid.UUID) (blockchain.Address, error)
|
2022-05-10 20:19:53 +01:00
|
|
|
// 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
|
2022-05-20 10:18:59 +01:00
|
|
|
}
|