From 0befe361fe27d980210e23c18cf266663010d249 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 19 Aug 2024 18:04:09 +0300 Subject: [PATCH] [#104] rpcclient: Regenerate wrappers Introduced in #102. Signed-off-by: Evgenii Stratonikov --- rpcclient/nns/client.go | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/rpcclient/nns/client.go b/rpcclient/nns/client.go index 80bf39b..858819d 100644 --- a/rpcclient/nns/client.go +++ b/rpcclient/nns/client.go @@ -60,11 +60,6 @@ func New(actor Actor, hash util.Uint160) *Contract { return &Contract{ContractReader{nep11ndt.NonDivisibleReader, actor, hash}, nep11ndt.BaseWriter, actor, hash} } -// DeleteDomain invokes `deleteDomain` method of contract. -func (c *ContractReader) DeleteDomain(name string) (*result.Invoke, error) { - c.invoker.Call(c.hash, "deleteDomain", name) -} - // GetPrice invokes `getPrice` method of contract. func (c *ContractReader) GetPrice() (*big.Int, error) { return unwrap.BigInt(c.invoker.Call(c.hash, "getPrice")) @@ -126,6 +121,28 @@ func (c *Contract) AddRecordUnsigned(name string, typ *big.Int, data string) (*t return c.actor.MakeUnsignedCall(c.hash, "addRecord", nil, name, typ, data) } +// DeleteDomain creates a transaction invoking `deleteDomain` method of the contract. +// This transaction is signed and immediately sent to the network. +// The values returned are its hash, ValidUntilBlock value and error if any. +func (c *Contract) DeleteDomain(name string) (util.Uint256, uint32, error) { + return c.actor.SendCall(c.hash, "deleteDomain", name) +} + +// DeleteDomainTransaction creates a transaction invoking `deleteDomain` method of the contract. +// This transaction is signed, but not sent to the network, instead it's +// returned to the caller. +func (c *Contract) DeleteDomainTransaction(name string) (*transaction.Transaction, error) { + return c.actor.MakeCall(c.hash, "deleteDomain", name) +} + +// DeleteDomainUnsigned creates a transaction invoking `deleteDomain` method of the contract. +// This transaction is not signed, it's simply returned to the caller. +// Any fields of it that do not affect fees can be changed (ValidUntilBlock, +// Nonce), fee values (NetworkFee, SystemFee) can be increased as well. +func (c *Contract) DeleteDomainUnsigned(name string) (*transaction.Transaction, error) { + return c.actor.MakeUnsignedCall(c.hash, "deleteDomain", nil, name) +} + // DeleteRecords creates a transaction invoking `deleteRecords` method of the contract. // This transaction is signed and immediately sent to the network. // The values returned are its hash, ValidUntilBlock value and error if any.