Files
ark/pkg/client-sdk/ark_sdk.go
Dusan Sekulic 4304626d08 CLI with ARK Sdk (#307)
* Export new methods

* Use sdk in CLI

* pr review refactor

* go sync

* Fixes

* run integration test on every change

* fixes

* go sync

* fix

* Persist explorer url

* Fix decoding bitcoin address

* Add missing timeout to e2e test

* Fix

* Fixes

---------

Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
2024-09-13 19:13:48 +02:00

40 lines
1.3 KiB
Go

package arksdk
import (
"context"
"github.com/ark-network/ark/pkg/client-sdk/client"
"github.com/ark-network/ark/pkg/client-sdk/store"
)
type ArkClient interface {
GetConfigData(ctx context.Context) (*store.StoreData, 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) (string, string, 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)
Claim(ctx context.Context) (string, error)
ListVtxos(ctx context.Context) ([]client.Vtxo, []client.Vtxo, error)
GetTransactionHistory(ctx context.Context) ([]Transaction, error)
Dump(ctx context.Context) (seed string, err error)
}
type Receiver interface {
To() string
Amount() uint64
IsOnchain() bool
}