mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 04:34:19 +01:00
* Add method to compute vtxo taproot script * Drop debug logs * Refactor client: * Remove dep from stubs in interface * Remove redeem branch, out of scope (moved to ark client) * Add example for covenant and covenantless sdk * Simplify explorer - No need for bitcoin and liquid impls * Refactor wallet: * wallet struct for common operations (create, lock/unlock, getType, isLocked) * liquidWallet struct for liquid operations (derive/get addresses, sign tx) * bitcoinWallet struct for bitcoin operations (derive/get addresses, sign tx) * Update utils: * drop methods to parse tree (moved to ark client) * add methods for encryption, network parsing, key generation * add methods for covenant/covenantless redeem branches (move to common?) * Add support for covenantless sdk: * move interface to dedicated file * arkCLient struct for common operations (Init, lock/unlock, get config data, receive) * covenantArkClient struct for covenant operations (onboard, balance, send, redeem) * covenantlessArkClient struct for covenantless operations (onboard, balance, send, redeem) * Fix wasm * Fixes * Make explorer use utils.Cache * Renamings * Lint * Fix e2e tests * Fix e2e test
35 lines
621 B
Go
35 lines
621 B
Go
//go:build js && wasm
|
|
// +build js,wasm
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
inmemorystore "github.com/ark-network/ark-sdk/store/inmemory"
|
|
arksdkwasm "github.com/ark-network/ark-sdk/wasm"
|
|
)
|
|
|
|
func main() {
|
|
var (
|
|
ctx = context.Background()
|
|
)
|
|
|
|
store, _ := arksdkwasm.NewLocalStorageStore()
|
|
if store != nil {
|
|
if err := arksdkwasm.NewCovenantClient(ctx, store); err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
} else {
|
|
storeSvc, err := inmemorystore.NewConfigStore()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
return
|
|
}
|
|
if err := arksdkwasm.NewCovenantClient(ctx, storeSvc); err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|
|
}
|