Files
ark/pkg/client-sdk/store.go
Dusan Sekulic 1f42843a69 Add first version of client SDK (#193)
* Add gRPC, REST, and gRPC-Web clients for server access

This commit introduces clients for gRPC, REST, and gRPC-Web to access the server.

- gRPC client: Includes additional argument opts ...grpc.CallOption in the interface for future extensibility.
- REST client: Factory function accepts http.Client as an argument to allow user customization.
- gRPC-Web client: Added a Log method for fast debugging in JavaScript.

The decision to use different interfaces for each client type is to accommodate specific features and extensibility requirements for each protocol.

* remove grpc web

* generate rest

* use grpc sdk in CLI

* temp wasm

* ark sdk

* renaming

* pr review refactor

* pr review refactor

* walletStore & configStore

* ark sdk wasm wrapper

* handle event stream with rest

* wip on supporting rest

* store init

* simulate event stream with rest

* fix rest sdk wip

* Fix returning forfeit txs in round event

* wasm first working e2e example

* pr review refactor

* pr review refactor

* pr review refactor

* Fixes

---------

Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
2024-07-18 16:27:14 +02:00

30 lines
751 B
Go

package arksdk
import (
"context"
"github.com/decred/dcrd/dcrec/secp256k1/v4"
)
type ConfigStore interface {
GetAspUrl(ctx context.Context) (string, error)
GetAspPubKeyHex(ctx context.Context) (string, error)
GetTransportProtocol(ctx context.Context) (TransportProtocol, error)
GetExplorerUrl(ctx context.Context) (string, error)
GetNetwork(ctx context.Context) (string, error)
SetAspUrl(aspUrl string)
SetAspPubKeyHex(aspPubKeyHex string)
SetTransportProtocol(protocol TransportProtocol)
SetExplorerUrl(explorerUrl string)
SetNetwork(net string)
Save(ctx context.Context) error
}
type WalletStore interface {
CreatePrivateKey() (*secp256k1.PrivateKey, error)
GetPrivateKeyHex() (string, error)
Save(ctx context.Context) error
}