Files
ark/pkg/client-sdk/ark_sdk.go
Dusan Sekulic a8cf0ed204 [SDK] Add Transaction History (#288)
* tx history

* fix

* fix

* pr review refactor

* pr review refactor

* fix

* pr review refactor

* exclude gosec G115 Integer Overflow Conversion

* ignore some gosec errs

* ignore some gosec errs

* ignore createdat in test assertion

* Fixes (#7)

* Fixes

* Fixes

* Update golang (#8)

* update gha golangci-lint version

* update gha golangci-lint version

* fix linting issues

* fix linting issues

* fix linting issues

* add linter timeout

---------

Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>
2024-09-10 14:27:29 +02:00

39 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)
}
type Receiver interface {
To() string
Amount() uint64
isOnchain() bool
}