Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
Id uint64
Address string
Bump uint8
VaultAddress string
VaultBump uint8
VaultOwner string
VaultState timelock_token_v1.TimelockState // Uses the original Timelock account state since the CVM only defines enum states for unlock
DepositPdaAddress string
DepositPdaBump uint8
SwapPdaAddress string
SwapPdaBump uint8
UnlockAt *uint64
Block uint64
LastUpdatedAt time.Time
}
Time/close authorities and lock duration are configured at the VM level
todo: Assumes a single VM.
func (*Record) ExistsOnBlockchain ¶
type Store ¶
type Store interface {
// Save saves a timelock account's state
Save(ctx context.Context, record *Record) error
// GetByAddress gets a timelock account's state by the state address
GetByAddress(ctx context.Context, address string) (*Record, error)
// GetByVault gets a timelock account's state by the vault address it's locking
GetByVault(ctx context.Context, vault string) (*Record, error)
// GetByVaultBatch is like GetByVault, but for multiple accounts. If any one account
// is missing, ErrTimelockNotFound is returned.
GetByVaultBatch(ctx context.Context, vaults ...string) (map[string]*Record, error)
// GetByDepositPda gets a timelock account's state by the deposit PDA address
GetByDepositPda(ctx context.Context, depositPda string) (*Record, error)
// GetBySwapPda gets a timelock account's state by the swap PDA address
GetBySwapPda(ctx context.Context, depositPda string) (*Record, error)
// GetAllByState gets all timelock accounts in the provided state
GetAllByState(ctx context.Context, state timelock_token.TimelockState, cursor query.Cursor, limit uint64, direction query.Ordering) ([]*Record, error)
// GetCountByState gets the count of records in the provided state
GetCountByState(ctx context.Context, state timelock_token.TimelockState) (uint64, error)
}
Click to show internal directories.
Click to hide internal directories.