Files
ark/pkg/client-sdk/ark_sdk.go
Louis Singer bcb2b2075f Add support for Out Of Round txs (#359)
* [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

* OOR scheme

* fix conflicts

* [sdk] OOR

* update WASM wrappers

* revert renaming

* revert API changes

* update parser.go

* fix vtxosToTxsCovenantless

* add settled and spent in Utxo and Transaction

* Fixes (#5)

* Revert unneeded changes and rename claim to settle

* Revert changes to wasm and rename claim to settle

---------

Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>
2024-10-24 17:43:27 +02:00

42 lines
1.4 KiB
Go

package arksdk
import (
"context"
"github.com/ark-network/ark/pkg/client-sdk/client"
"github.com/ark-network/ark/pkg/client-sdk/types"
)
type ArkClient interface {
GetConfigData(ctx context.Context) (*types.Config, error)
Init(ctx context.Context, args InitArgs) error
InitWithWallet(ctx context.Context, args InitWithWalletArgs) error
IsLocked(ctx context.Context) bool
Unlock(ctx context.Context, password string) error
Lock(ctx context.Context, password string) error
Balance(ctx context.Context, computeExpiryDetails bool) (*Balance, error)
Receive(ctx context.Context) (offchainAddr, boardingAddr string, err error)
SendOnChain(ctx context.Context, receivers []Receiver) (string, error)
SendOffChain(
ctx context.Context, withExpiryCoinselect bool, receivers []Receiver,
) (string, error)
UnilateralRedeem(ctx context.Context) error
CollaborativeRedeem(
ctx context.Context, addr string, amount uint64, withExpiryCoinselect bool,
) (string, error)
SendAsync(ctx context.Context, withExpiryCoinselect bool, receivers []Receiver) (string, error)
Settle(ctx context.Context) (string, error)
ListVtxos(ctx context.Context) (spendable, spent []client.Vtxo, err error)
Dump(ctx context.Context) (seed string, err error)
GetTransactionHistory(ctx context.Context) ([]types.Transaction, error)
GetTransactionEventChannel() chan types.TransactionEvent
Stop() error
}
type Receiver interface {
To() string
Amount() uint64
IsOnchain() bool
}