Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsupportedTxType = errors.New("unsupported tx type")
)
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
builder.Backend
signer.Backend
AcceptTx(ctx context.Context, tx *txs.Tx) error
}
Backend defines the full interface required to support a P-chain wallet.
func NewBackend ¶
type Wallet ¶
type Wallet interface {
Client
// Builder returns the builder that will be used to create the transactions.
Builder() builder.Builder
// Signer returns the signer that will be used to sign the transactions.
Signer() walletsigner.Signer
// IssueBaseTx creates, signs, and issues a new simple value transfer.
IssueBaseTx(
outputs []*lux.TransferableOutput,
options ...common.Option,
) (*txs.Tx, error)
// IssueAddValidatorTx creates, signs, and issues a new validator of the
// primary network.
IssueAddValidatorTx(
vdr *txs.Validator,
rewardsOwner *secp256k1fx.OutputOwners,
shares uint32,
options ...common.Option,
) (*txs.Tx, error)
// IssueAddNetValidatorTx creates, signs, and issues a new validator of a
// subnet.
IssueAddNetValidatorTx(
vdr *txs.NetValidator,
options ...common.Option,
) (*txs.Tx, error)
// IssueRemoveNetValidatorTx creates, signs, and issues a transaction
// that removes a validator of a subnet.
IssueRemoveNetValidatorTx(
nodeID ids.NodeID,
netID ids.ID,
options ...common.Option,
) (*txs.Tx, error)
// IssueAddDelegatorTx creates, signs, and issues a new delegator to a
// validator on the primary network.
IssueAddDelegatorTx(
vdr *txs.Validator,
rewardsOwner *secp256k1fx.OutputOwners,
options ...common.Option,
) (*txs.Tx, error)
// IssueCreateChainTx creates, signs, and issues a new chain in the named
// subnet.
IssueCreateChainTx(
netID ids.ID,
genesis []byte,
vmID ids.ID,
fxIDs []ids.ID,
chainName string,
options ...common.Option,
) (*txs.Tx, error)
// IssueCreateNetTx creates, signs, and issues a new net with the
// specified owner.
IssueCreateNetTx(
owner *secp256k1fx.OutputOwners,
options ...common.Option,
) (*txs.Tx, error)
// IssueTransferNetOwnershipTx creates, signs, and issues a transaction that
// changes the owner of the named subnet.
IssueTransferNetOwnershipTx(
netID ids.ID,
owner *secp256k1fx.OutputOwners,
options ...common.Option,
) (*txs.Tx, error)
// IssueConvertNetToL1Tx creates, signs, and issues a transaction that
// converts the net to a Permissionless L1.
IssueConvertNetToL1Tx(
netID ids.ID,
chainID ids.ID,
address []byte,
validators []*txs.ConvertNetToL1Validator,
options ...common.Option,
) (*txs.Tx, error)
// IssueRegisterL1ValidatorTx creates, signs, and issues a transaction that
// adds a validator to an L1.
IssueRegisterL1ValidatorTx(
balance uint64,
proofOfPossession [bls.SignatureLen]byte,
message []byte,
options ...common.Option,
) (*txs.Tx, error)
// IssueSetL1ValidatorWeightTx creates, signs, and issues a transaction that
// sets the weight of a validator on an L1.
IssueSetL1ValidatorWeightTx(
message []byte,
options ...common.Option,
) (*txs.Tx, error)
// IssueIncreaseL1ValidatorBalanceTx creates, signs, and issues a
// transaction that increases the balance of a validator on an L1 for the
// continuous fee.
IssueIncreaseL1ValidatorBalanceTx(
validationID ids.ID,
balance uint64,
options ...common.Option,
) (*txs.Tx, error)
// IssueDisableL1ValidatorTx creates, signs, and issues a transaction that
// disables an L1 validator.
IssueDisableL1ValidatorTx(
validationID ids.ID,
options ...common.Option,
) (*txs.Tx, error)
// IssueImportTx creates, signs, and issues an import transaction.
IssueImportTx(
chainID ids.ID,
to *secp256k1fx.OutputOwners,
options ...common.Option,
) (*txs.Tx, error)
// IssueExportTx creates, signs, and issues an export transaction.
IssueExportTx(
chainID ids.ID,
outputs []*lux.TransferableOutput,
options ...common.Option,
) (*txs.Tx, error)
// IssueTransformNetTx creates a transform net transaction.
IssueTransformNetTx(
netID ids.ID,
assetID ids.ID,
initialSupply uint64,
maxSupply uint64,
minConsumptionRate uint64,
maxConsumptionRate uint64,
minValidatorStake uint64,
maxValidatorStake uint64,
minStakeDuration time.Duration,
maxStakeDuration time.Duration,
minDelegationFee uint32,
minDelegatorStake uint64,
maxValidatorWeightFactor byte,
uptimeRequirement uint32,
options ...common.Option,
) (*txs.Tx, error)
// IssueAddPermissionlessValidatorTx creates, signs, and issues a new
// validator of the specified subnet.
IssueAddPermissionlessValidatorTx(
vdr *txs.NetValidator,
signer vmsigner.Signer,
assetID ids.ID,
validationRewardsOwner *secp256k1fx.OutputOwners,
delegationRewardsOwner *secp256k1fx.OutputOwners,
shares uint32,
options ...common.Option,
) (*txs.Tx, error)
// IssueAddPermissionlessDelegatorTx creates, signs, and issues a new
// delegator of the specified subnet.
IssueAddPermissionlessDelegatorTx(
vdr *txs.NetValidator,
assetID ids.ID,
rewardsOwner *secp256k1fx.OutputOwners,
options ...common.Option,
) (*txs.Tx, error)
// IssueUnsignedTx signs and issues the unsigned tx.
IssueUnsignedTx(
utx txs.UnsignedTx,
options ...common.Option,
) (*txs.Tx, error)
}
Click to show internal directories.
Click to hide internal directories.