Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
eeca6f9
wallet interface
sukantoraymond Sep 10, 2025
389ebf1
working example
sukantoraymond Sep 10, 2025
b0f59bf
remove unused func
sukantoraymond Sep 10, 2025
f68a2c1
lint
sukantoraymond Sep 10, 2025
032be93
lint
sukantoraymond Sep 10, 2025
222aa15
Merge branch 'main' into wallet-interfface
sukantoraymond Sep 11, 2025
dce58ba
lint
sukantoraymond Sep 11, 2025
15ff102
account interface
sukantoraymond Sep 11, 2025
a357da8
server wallet
sukantoraymond Sep 15, 2025
90b6351
server wallet api
sukantoraymond Sep 16, 2025
9182628
server wallet api
sukantoraymond Sep 22, 2025
3a97bc1
using go sdk
sukantoraymond Sep 24, 2025
20d1693
using go sdk cleanup
sukantoraymond Sep 24, 2025
4832988
modified create account
sukantoraymond Sep 25, 2025
ea90578
we have server api
sukantoraymond Sep 25, 2025
bc57486
remove unused files
sukantoraymond Sep 25, 2025
ad22346
remove unused fields in response
sukantoraymond Sep 25, 2025
6e3a82c
get account
sukantoraymond Sep 25, 2025
68a4c18
Add server wallet API and CLI functionality
sukantoraymond Sep 25, 2025
5de4e0a
fix
sukantoraymond Sep 25, 2025
d8b3db1
cleanup
sukantoraymond Sep 25, 2025
294c153
add REST API on top of RPC
sukantoraymond Sep 26, 2025
88904eb
file cleanup
sukantoraymond Sep 29, 2025
bfd6479
Remove data/accounts.json from tracking (now in .gitignore)
sukantoraymond Sep 29, 2025
503e1e8
file cleanup
sukantoraymond Sep 29, 2025
944369c
cleanup
sukantoraymond Sep 29, 2025
fb92990
reorganize wallet
sukantoraymond Sep 30, 2025
8cb27b9
multi chain signer
sukantoraymond Sep 30, 2025
8a5b2cc
sign tx result
sukantoraymond Oct 2, 2025
4dd6554
sender multichain
sukantoraymond Oct 2, 2025
5d66fee
reorganize wallet dir
sukantoraymond Oct 2, 2025
052434f
Merge branch 'main' into wallet-interfface
sukantoraymond Oct 6, 2025
24351e0
address comments
sukantoraymond Oct 6, 2025
34dcb2c
address comments
sukantoraymond Oct 6, 2025
139bec1
rename wallet
sukantoraymond Oct 6, 2025
26f20b7
address comments
sukantoraymond Oct 6, 2025
6160624
Update tx/tx.go
sukantoraymond Oct 6, 2025
bd39276
address comments
sukantoraymond Oct 6, 2025
21a38b5
wallet sdk
sukantoraymond Oct 8, 2025
c0efbb4
Merge branch 'wallet-interfface' into reorganized-sdk-wo-server
sukantoraymond Oct 8, 2025
850d1e1
remove unused files
sukantoraymond Oct 8, 2025
94df610
lint
sukantoraymond Oct 8, 2025
3f9ca27
lint
sukantoraymond Oct 8, 2025
c6d551f
lint
sukantoraymond Oct 8, 2025
61842ca
lint
sukantoraymond Oct 8, 2025
578247f
lint
sukantoraymond Oct 8, 2025
b419716
lint
sukantoraymond Oct 8, 2025
212ba38
lint
sukantoraymond Oct 8, 2025
2ac7a0f
lint
sukantoraymond Oct 8, 2025
476e2c6
lint
sukantoraymond Oct 8, 2025
188dff9
Revert "lint"
sukantoraymond Oct 8, 2025
796f416
lint
sukantoraymond Oct 8, 2025
44df716
lint
sukantoraymond Oct 8, 2025
060399b
lint
sukantoraymond Oct 8, 2025
83ca7ed
lint
sukantoraymond Oct 8, 2025
89a4155
lint
sukantoraymond Oct 8, 2025
6838d48
lint
sukantoraymond Oct 8, 2025
63e86a6
lint
sukantoraymond Oct 8, 2025
e6ef9b1
lint
sukantoraymond Oct 8, 2025
f09f22d
lint
sukantoraymond Oct 8, 2025
35c9269
lint
sukantoraymond Oct 8, 2025
39a39c4
Merge pull request #177 from ava-labs/reorganized-sdk-wo-server
sukantoraymond Oct 8, 2025
1c891cf
address comments
sukantoraymond Oct 8, 2025
4963e9e
address comments
sukantoraymond Oct 8, 2025
bc594f8
lint
sukantoraymond Oct 13, 2025
17588bb
address comments
sukantoraymond Oct 13, 2025
b3c5331
address comments
sukantoraymond Oct 13, 2025
d90f236
address comments
sukantoraymond Oct 13, 2025
2d2dc8a
remove clients
sukantoraymond Oct 13, 2025
628e243
address comments
sukantoraymond Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ linters-settings:
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
- name: unused-receiver
disabled: false
disabled: true
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
disabled: false
Expand Down
17 changes: 17 additions & 0 deletions account/account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (C) 2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package account

import (
"github.com/ava-labs/avalanchego/vms/secp256k1fx"

"github.com/ava-labs/avalanche-tooling-sdk-go/network"
)

// Account represents the interface for different account implementations
type Account interface {
// GetPChainAddress returns the P-Chain address for the given network
GetPChainAddress(network network.Network) (string, error)

GetKeychain() (*secp256k1fx.Keychain, error)
}
53 changes: 53 additions & 0 deletions account/local_account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (C) 2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package account

import (
"fmt"

"github.com/ava-labs/avalanchego/vms/secp256k1fx"

"github.com/ava-labs/avalanche-tooling-sdk-go/key"
"github.com/ava-labs/avalanche-tooling-sdk-go/network"
)

// LocalAccount represents a local account implementation
type LocalAccount struct {
*key.SoftKey
}

// NewLocalAccount creates a new LocalAccount
func NewLocalAccount() (Account, error) {
k, err := key.NewSoft()
if err != nil {
return nil, err
}
return &LocalAccount{
SoftKey: k,
}, nil
}

func Import(keyPath string) (Account, error) {
k, err := key.LoadSoft(keyPath)
if err != nil {
return nil, err
}
return &LocalAccount{
SoftKey: k,
}, nil
}

func (a *LocalAccount) GetPChainAddress(network network.Network) (string, error) {
if a.SoftKey == nil {
return "", fmt.Errorf("SoftKey not initialized")
}
pchainAddrs, err := a.SoftKey.GetNetworkChainAddress(network, "P")
return pchainAddrs[0], err
}

func (a *LocalAccount) GetKeychain() (*secp256k1fx.Keychain, error) {
if a.SoftKey == nil {
return nil, fmt.Errorf("SoftKey not initialized")
}
return a.SoftKey.KeyChain(), nil
}
57 changes: 0 additions & 57 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"math/big"
"os"
"time"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/logging"
Expand All @@ -25,14 +24,9 @@ import (

"github.com/ava-labs/avalanche-tooling-sdk-go/evm"
"github.com/ava-labs/avalanche-tooling-sdk-go/interchain"
"github.com/ava-labs/avalanche-tooling-sdk-go/multisig"
"github.com/ava-labs/avalanche-tooling-sdk-go/network"
"github.com/ava-labs/avalanche-tooling-sdk-go/utils"
"github.com/ava-labs/avalanche-tooling-sdk-go/validatormanager"
"github.com/ava-labs/avalanche-tooling-sdk-go/vm"
"github.com/ava-labs/avalanche-tooling-sdk-go/wallet"

commonAvago "github.com/ava-labs/avalanchego/wallet/subnet/primary/common"
)

var (
Expand Down Expand Up @@ -306,57 +300,6 @@ func vmID(vmName string) (ids.ID, error) {
return ids.ToID(b)
}

func (c *Subnet) Commit(ms multisig.Multisig, wallet wallet.Wallet, waitForTxAcceptance bool) (ids.ID, error) {
if ms.Undefined() {
return ids.Empty, multisig.ErrUndefinedTx
}
isReady, err := ms.IsReadyToCommit()
if err != nil {
return ids.Empty, err
}
if !isReady {
return ids.Empty, errors.New("tx is not fully signed so can't be committed")
}
tx, err := ms.GetWrappedPChainTx()
if err != nil {
return ids.Empty, err
}
const (
repeats = 3
sleepBetweenRepeats = 2 * time.Second
)
var issueTxErr error
if err != nil {
return ids.Empty, err
}
for i := 0; i < repeats; i++ {
ctx, cancel := utils.GetAPILargeContext()
defer cancel()
options := []commonAvago.Option{commonAvago.WithContext(ctx)}
if !waitForTxAcceptance {
options = append(options, commonAvago.WithAssumeDecided())
}
// TODO: split error checking and recovery between issuing and waiting for status
issueTxErr = wallet.P().IssueTx(tx, options...)
if issueTxErr == nil {
break
}
if ctx.Err() != nil {
issueTxErr = fmt.Errorf("timeout issuing/verifying tx with ID %s: %w", tx.ID(), issueTxErr)
} else {
issueTxErr = fmt.Errorf("error issuing tx with ID %s: %w", tx.ID(), issueTxErr)
}
time.Sleep(sleepBetweenRepeats)
}
if issueTxErr != nil {
return ids.Empty, fmt.Errorf("issue tx error %w", issueTxErr)
}
if _, ok := ms.PChainTx.Unsigned.(*txs.CreateSubnetTx); ok {
c.SubnetID = tx.ID()
}
return tx.ID(), issueTxErr
}

// InitializeProofOfAuthority setups PoA manager after a successful execution of
// ConvertSubnetToL1Tx on P-Chain
// needs the list of validators for that tx,
Expand Down
224 changes: 0 additions & 224 deletions blockchain/blockchain_test.go

This file was deleted.

Loading
Loading