mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 04:34:19 +01:00
* [common] rework address encoding * new address encoding * replace offchain address by vtxo output key in DB * merge migrations files into init one * fix txbuilder fixtures * fix transaction events
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package wallet
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ark-network/ark/pkg/client-sdk/explorer"
|
|
)
|
|
|
|
const (
|
|
SingleKeyWallet = "singlekey"
|
|
)
|
|
|
|
type DescriptorAddress struct {
|
|
Descriptor string
|
|
Address string
|
|
}
|
|
|
|
type WalletService interface {
|
|
GetType() string
|
|
Create(
|
|
ctx context.Context, password, seed string,
|
|
) (walletSeed string, err error)
|
|
Lock(ctx context.Context, password string) (err error)
|
|
Unlock(ctx context.Context, password string) (alreadyUnlocked bool, err error)
|
|
IsLocked() bool
|
|
GetAddresses(
|
|
ctx context.Context,
|
|
) (offchainAddresses, boardingAddresses, redemptionAddresses []DescriptorAddress, err error)
|
|
NewAddress(
|
|
ctx context.Context, change bool,
|
|
) (offchainAddr, onchainAddr *DescriptorAddress, err error)
|
|
NewAddresses(
|
|
ctx context.Context, change bool, num int,
|
|
) (offchainAddresses, onchainAddresses []DescriptorAddress, err error)
|
|
SignTransaction(
|
|
ctx context.Context, explorerSvc explorer.Explorer, tx string,
|
|
) (signedTx string, err error)
|
|
Dump(ctx context.Context) (seed string, err error)
|
|
}
|