mirror of
https://github.com/luxfi/netrunner.git
synced 2026-07-27 00:04:23 +00:00
- Update github.com/luxfi/keys v1.0.5 → v1.0.6 - Update github.com/luxfi/genesis v1.5.18 → v1.5.19 - Remove local replace directives for keys and genesis - Use published package versions for reproducible builds
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc All rights reserved.
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package local
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/luxfi/node/vms/platformvm"
|
|
"github.com/luxfi/node/vms/platformvm/txs"
|
|
pwalletwallet "github.com/luxfi/node/wallet/chain/p/wallet"
|
|
"github.com/luxfi/node/wallet/net/primary/common"
|
|
)
|
|
|
|
// walletClient wraps platformvm.Client to implement wallet.Client
|
|
type walletClient struct {
|
|
platformClient *platformvm.Client
|
|
}
|
|
|
|
// newWalletClient creates a new wallet client wrapper
|
|
func newWalletClient(platformClient *platformvm.Client) pwalletwallet.Client {
|
|
return &walletClient{
|
|
platformClient: platformClient,
|
|
}
|
|
}
|
|
|
|
// IssueTx implements wallet.Client
|
|
func (w *walletClient) IssueTx(tx *txs.Tx, options ...common.Option) error {
|
|
ops := common.NewOptions(options)
|
|
ctx := ops.Context()
|
|
if ctx == nil {
|
|
ctx = context.Background()
|
|
}
|
|
|
|
// Serialize the transaction
|
|
txBytes := tx.Bytes()
|
|
|
|
// Issue through platform client
|
|
_, err := w.platformClient.IssueTx(ctx, txBytes)
|
|
return err
|
|
}
|