2023-10-18 17:32:51 +00:00
|
|
|
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
|
2023-12-25 10:01:36 +00:00
|
|
|
|
|
|
|
// Package gastoken contains RPC wrappers for GasToken contract.
|
2022-11-08 12:43:32 +00:00
|
|
|
package gastoken
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/rpcclient/nep17"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Hash contains contract hash.
|
|
|
|
var Hash = util.Uint160{0xcf, 0x76, 0xe2, 0x8b, 0xd0, 0x6, 0x2c, 0x4a, 0x47, 0x8e, 0xe3, 0x55, 0x61, 0x1, 0x13, 0x19, 0xf3, 0xcf, 0xa4, 0xd2}
|
|
|
|
|
|
|
|
// Invoker is used by ContractReader to call various safe methods.
|
|
|
|
type Invoker interface {
|
|
|
|
nep17.Invoker
|
|
|
|
}
|
|
|
|
|
|
|
|
// Actor is used by Contract to call state-changing methods.
|
|
|
|
type Actor interface {
|
|
|
|
Invoker
|
2022-11-08 13:36:38 +00:00
|
|
|
|
2022-11-08 12:43:32 +00:00
|
|
|
nep17.Actor
|
|
|
|
}
|
|
|
|
|
|
|
|
// ContractReader implements safe contract methods.
|
|
|
|
type ContractReader struct {
|
|
|
|
nep17.TokenReader
|
|
|
|
invoker Invoker
|
2023-10-18 14:58:39 +00:00
|
|
|
hash util.Uint160
|
2022-11-08 12:43:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Contract implements all contract methods.
|
|
|
|
type Contract struct {
|
|
|
|
ContractReader
|
|
|
|
nep17.TokenWriter
|
|
|
|
actor Actor
|
2023-10-18 14:58:39 +00:00
|
|
|
hash util.Uint160
|
2022-11-08 12:43:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewReader creates an instance of ContractReader using Hash and the given Invoker.
|
|
|
|
func NewReader(invoker Invoker) *ContractReader {
|
2023-05-11 10:25:45 +00:00
|
|
|
var hash = Hash
|
|
|
|
return &ContractReader{*nep17.NewReader(invoker, hash), invoker, hash}
|
2022-11-08 12:43:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// New creates an instance of Contract using Hash and the given Actor.
|
|
|
|
func New(actor Actor) *Contract {
|
2023-05-11 10:25:45 +00:00
|
|
|
var hash = Hash
|
|
|
|
var nep17t = nep17.New(actor, hash)
|
|
|
|
return &Contract{ContractReader{nep17t.TokenReader, actor, hash}, nep17t.TokenWriter, actor, hash}
|
2022-11-08 12:43:32 +00:00
|
|
|
}
|