2022-08-15 13:42:21 +00:00
|
|
|
/*
|
|
|
|
Package gas provides a convenience wrapper for GAS contract to use it via RPC.
|
|
|
|
|
|
|
|
GAS itself only has standard NEP-17 methods, so this package only contains its
|
2022-09-07 15:26:57 +00:00
|
|
|
hash and allows to create NEP-17 structures in an easier way. Refer to [nep17]
|
|
|
|
package for more details on NEP-17 interface.
|
2022-08-15 13:42:21 +00:00
|
|
|
*/
|
|
|
|
package gas
|
|
|
|
|
|
|
|
import (
|
2024-04-09 11:45:20 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/native/nativehashes"
|
2022-08-15 13:42:21 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/rpcclient/nep17"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Hash stores the hash of the native GAS contract.
|
2024-04-25 11:20:12 +00:00
|
|
|
var Hash = nativehashes.GasToken
|
2022-08-15 13:42:21 +00:00
|
|
|
|
|
|
|
// NewReader creates a NEP-17 reader for the GAS contract.
|
|
|
|
func NewReader(invoker nep17.Invoker) *nep17.TokenReader {
|
|
|
|
return nep17.NewReader(invoker, Hash)
|
|
|
|
}
|
|
|
|
|
|
|
|
// New creates a NEP-17 contract instance for the native GAS contract.
|
|
|
|
func New(actor nep17.Actor) *nep17.Token {
|
|
|
|
return nep17.New(actor, Hash)
|
|
|
|
}
|