Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create dns known xml #157

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 122 additions & 8 deletions abi/get_methods.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package abi
// Code autogenerated. DO NOT EDIT.

// Code autogenerated. DO NOT EDIT.

import (
"context"
"fmt"
"github.com/tonkeeper/tongo"
"github.com/tonkeeper/tongo/boc"
"github.com/tonkeeper/tongo/tlb"
"context"
"fmt"

"github.com/tonkeeper/tongo"
"github.com/tonkeeper/tongo/boc"
"github.com/tonkeeper/tongo/tlb"
)

var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error){
Expand All @@ -17,6 +19,9 @@ var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error)
"get_channel_state": {DecodeGetChannelStateResult},
"get_collection_data": {DecodeGetCollectionDataResult},
"get_domain": {DecodeGetDomainResult},
"get_domain_auction_info": {DecodeGetDomainAuctionInfoResult},
"get_domain_data": {DecodeGetDomainDataResult},
"get_domain_editor": {DecodeGetDomainEditorResult},
"get_editor": {DecodeGetEditorResult},
"get_full_domain": {DecodeGetFullDomainResult},
"get_jetton_data": {DecodeGetJettonDataResult},
Expand Down Expand Up @@ -60,9 +65,11 @@ var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error)

var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executor, reqAccountID tongo.AccountID) (string, any, error){
66763: {GetFullDomain},
67859: {GetDomainAuctionInfo},
69506: {GetTelemintTokenName},
71463: {GetTorrentHash},
72748: {GetSaleData},
72859: {GetDomainData},
78748: {GetPublicKey},
80697: {GetAuctionInfo},
81467: {GetSubwalletId},
Expand Down Expand Up @@ -92,6 +99,7 @@ var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executo
119378: {GetDomain},
120146: {GetPoolStatus},
122058: {IsActive},
122184: {GetDomainEditor},
122498: {GetTelemintAuctionState},
123928: {GetStakingStatus},
129619: {GetTelemintAuctionConfig},
Expand All @@ -106,6 +114,9 @@ var ResultTypes = []interface{}{
&GetBillAmountResult{},
&GetChannelStateResult{},
&GetCollectionDataResult{},
&GetDomainAuctionInfoResult{},
&GetDomainDataResult{},
&GetDomainEditorResult{},
&GetDomainResult{},
&GetEditorResult{},
&GetFullDomainResult{},
Expand Down Expand Up @@ -402,6 +413,111 @@ func DecodeGetDomainResult(stack tlb.VmStack) (resultType string, resultAny any,
return "GetDomainResult", result, err
}

type GetDomainAuctionInfoResult struct {
MaxBidAddress []byte
MaxBidAmount tlb.Int256
AuctionEndTime int64
}

func GetDomainAuctionInfo(ctx context.Context, executor Executor, reqAccountID tongo.AccountID) (string, any, error) {
stack := tlb.VmStack{}

// MethodID = 67859 for "get_domain_auction_info" method
errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 67859, stack)
if err != nil {
return "", nil, err
}
if errCode != 0 && errCode != 1 {
return "", nil, fmt.Errorf("method execution failed with code: %v", errCode)
}
for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetDomainAuctionInfoResult} {
s, r, err := f(stack)
if err == nil {
return s, r, nil
}
}
return "", nil, fmt.Errorf("can not decode outputs")
}

func DecodeGetDomainAuctionInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) != 3 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetDomainAuctionInfoResult
err = stack.Unmarshal(&result)
return "GetDomainAuctionInfoResult", result, err
}

type GetDomainDataResult struct {
Init tlb.Int256
Index tlb.Int256
CollectionAddress []byte
OwnerAddress []byte
Content []byte
}

func GetDomainData(ctx context.Context, executor Executor, reqAccountID tongo.AccountID) (string, any, error) {
stack := tlb.VmStack{}

// MethodID = 72859 for "get_domain_data" method
errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 72859, stack)
if err != nil {
return "", nil, err
}
if errCode != 0 && errCode != 1 {
return "", nil, fmt.Errorf("method execution failed with code: %v", errCode)
}
for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetDomainDataResult} {
s, r, err := f(stack)
if err == nil {
return s, r, nil
}
}
return "", nil, fmt.Errorf("can not decode outputs")
}

func DecodeGetDomainDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) < 5 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkCell") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetDomainDataResult
err = stack.Unmarshal(&result)
return "GetDomainDataResult", result, err
}

type GetDomainEditorResult struct {
OwnerAddress []byte
}

func GetDomainEditor(ctx context.Context, executor Executor, reqAccountID tongo.AccountID) (string, any, error) {
stack := tlb.VmStack{}

// MethodID = 122184 for "get_domain_editor" method
errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 122184, stack)
if err != nil {
return "", nil, err
}
if errCode != 0 && errCode != 1 {
return "", nil, fmt.Errorf("method execution failed with code: %v", errCode)
}
for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetDomainEditorResult} {
s, r, err := f(stack)
if err == nil {
return s, r, nil
}
}
return "", nil, fmt.Errorf("can not decode outputs")
}

func DecodeGetDomainEditorResult(stack tlb.VmStack) (resultType string, resultAny any, err error) {
if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") {
return "", nil, fmt.Errorf("invalid stack format")
}
var result GetDomainEditorResult
err = stack.Unmarshal(&result)
return "GetDomainEditorResult", result, err
}

type GetEditorResult struct {
Editor tlb.MsgAddress
}
Expand Down Expand Up @@ -2000,5 +2116,3 @@ func DecodeSeqnoResult(stack tlb.VmStack) (resultType string, resultAny any, err
err = stack.Unmarshal(&result)
return "SeqnoResult", result, err
}


37 changes: 37 additions & 0 deletions abi/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package abi

import (
"fmt"

"github.com/tonkeeper/tongo/boc"
"github.com/tonkeeper/tongo/tlb"
)
Expand Down Expand Up @@ -106,6 +107,12 @@ func MessageDecoder(cell *boc.Cell) (MsgOpName, any, error) {
return JettonInternalTransferMsgOp, nil, err
}
return JettonInternalTransferMsgOp, res, nil
case EditContentMsgOpCode: // 0x1a0b9d51
var res EditContentMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
return EditContentMsgOp, nil, err
}
return EditContentMsgOp, res, nil
case WhalesNominatorsWithdrawUnownedResponseMsgOpCode: // 0x1d1715bf
var res WhalesNominatorsWithdrawUnownedResponseMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
Expand Down Expand Up @@ -208,6 +215,12 @@ func MessageDecoder(cell *boc.Cell) (MsgOpName, any, error) {
return ProofStorageMsgOp, nil, err
}
return ProofStorageMsgOp, res, nil
case ProcessGovernanceDecisionMsgOpCode: // 0x44beae41
var res ProcessGovernanceDecisionMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
return ProcessGovernanceDecisionMsgOp, nil, err
}
return ProcessGovernanceDecisionMsgOp, res, nil
case TelemintDeployMsgOpCode: // 0x4637289a
var res TelemintDeployMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
Expand Down Expand Up @@ -256,6 +269,18 @@ func MessageDecoder(cell *boc.Cell) (MsgOpName, any, error) {
return ElectorNewStakeMsgOp, nil, err
}
return ElectorNewStakeMsgOp, res, nil
case ChangeDnsRecordMsgOpCode: // 0x4eb1f0f9
var res ChangeDnsRecordMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
return ChangeDnsRecordMsgOp, nil, err
}
return ChangeDnsRecordMsgOp, res, nil
case DnsBalanceReleaseMsgOpCode: // 0x4ed14b65
var res DnsBalanceReleaseMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
return DnsBalanceReleaseMsgOp, nil, err
}
return DnsBalanceReleaseMsgOp, res, nil
case UpdatePubkeyMsgOpCode: // 0x53f34cd6
var res UpdatePubkeyMsgBody
if err := tlb.Unmarshal(cell, &res); err != nil {
Expand Down Expand Up @@ -654,6 +679,7 @@ const (
WhalesNominatorsForceKickMsgOp MsgOpName = "WhalesNominatorsForceKick"
TonstakeControllerCreditMsgOp MsgOpName = "TonstakeControllerCredit"
JettonInternalTransferMsgOp MsgOpName = "JettonInternalTransfer"
EditContentMsgOp MsgOpName = "EditContent"
WhalesNominatorsWithdrawUnownedResponseMsgOp MsgOpName = "WhalesNominatorsWithdrawUnownedResponse"
SbtDestroyMsgOp MsgOpName = "SbtDestroy"
StartUncooperativeChannelCloseMsgOp MsgOpName = "StartUncooperativeChannelClose"
Expand All @@ -670,6 +696,7 @@ const (
TonstakePoolWithdrawMsgOp MsgOpName = "TonstakePoolWithdraw"
TeleitemCancelAuctionMsgOp MsgOpName = "TeleitemCancelAuction"
ProofStorageMsgOp MsgOpName = "ProofStorage"
ProcessGovernanceDecisionMsgOp MsgOpName = "ProcessGovernanceDecision"
TelemintDeployMsgOp MsgOpName = "TelemintDeploy"
TelemintDeployV2MsgOp MsgOpName = "TelemintDeployV2"
StorageWithdrawMsgOp MsgOpName = "StorageWithdraw"
Expand All @@ -678,6 +705,8 @@ const (
TeleitemStartAuctionMsgOp MsgOpName = "TeleitemStartAuction"
TonstakePoolTouchMsgOp MsgOpName = "TonstakePoolTouch"
ElectorNewStakeMsgOp MsgOpName = "ElectorNewStake"
ChangeDnsRecordMsgOp MsgOpName = "ChangeDnsRecord"
DnsBalanceReleaseMsgOp MsgOpName = "DnsBalanceRelease"
UpdatePubkeyMsgOp MsgOpName = "UpdatePubkey"
UpdateStorageParamsMsgOp MsgOpName = "UpdateStorageParams"
TonstakeImanagerOperationFeeMsgOp MsgOpName = "TonstakeImanagerOperationFee"
Expand Down Expand Up @@ -760,6 +789,7 @@ const (
WhalesNominatorsForceKickMsgOpCode MsgOpCode = 0x1596920c
TonstakeControllerCreditMsgOpCode MsgOpCode = 0x1690c604
JettonInternalTransferMsgOpCode MsgOpCode = 0x178d4519
EditContentMsgOpCode MsgOpCode = 0x1a0b9d51
WhalesNominatorsWithdrawUnownedResponseMsgOpCode MsgOpCode = 0x1d1715bf
SbtDestroyMsgOpCode MsgOpCode = 0x1f04537a
StartUncooperativeChannelCloseMsgOpCode MsgOpCode = 0x1f151acf
Expand All @@ -776,6 +806,7 @@ const (
TonstakePoolWithdrawMsgOpCode MsgOpCode = 0x319b0cdc
TeleitemCancelAuctionMsgOpCode MsgOpCode = 0x371638ae
ProofStorageMsgOpCode MsgOpCode = 0x419d5d4d
ProcessGovernanceDecisionMsgOpCode MsgOpCode = 0x44beae41
TelemintDeployMsgOpCode MsgOpCode = 0x4637289a
TelemintDeployV2MsgOpCode MsgOpCode = 0x4637289b
StorageWithdrawMsgOpCode MsgOpCode = 0x46ed2e94
Expand All @@ -784,6 +815,8 @@ const (
TeleitemStartAuctionMsgOpCode MsgOpCode = 0x487a8e81
TonstakePoolTouchMsgOpCode MsgOpCode = 0x4bc7c2df
ElectorNewStakeMsgOpCode MsgOpCode = 0x4e73744b
ChangeDnsRecordMsgOpCode MsgOpCode = 0x4eb1f0f9
DnsBalanceReleaseMsgOpCode MsgOpCode = 0x4ed14b65
UpdatePubkeyMsgOpCode MsgOpCode = 0x53f34cd6
UpdateStorageParamsMsgOpCode MsgOpCode = 0x54cbf19b
TonstakeImanagerOperationFeeMsgOpCode MsgOpCode = 0x54d37487
Expand Down Expand Up @@ -863,6 +896,7 @@ var KnownMsgTypes = map[string]any{
WhalesNominatorsForceKickMsgOp: WhalesNominatorsForceKickMsgBody{},
TonstakeControllerCreditMsgOp: TonstakeControllerCreditMsgBody{},
JettonInternalTransferMsgOp: JettonInternalTransferMsgBody{},
EditContentMsgOp: EditContentMsgBody{},
WhalesNominatorsWithdrawUnownedResponseMsgOp: WhalesNominatorsWithdrawUnownedResponseMsgBody{},
SbtDestroyMsgOp: SbtDestroyMsgBody{},
StartUncooperativeChannelCloseMsgOp: StartUncooperativeChannelCloseMsgBody{},
Expand All @@ -879,6 +913,7 @@ var KnownMsgTypes = map[string]any{
TonstakePoolWithdrawMsgOp: TonstakePoolWithdrawMsgBody{},
TeleitemCancelAuctionMsgOp: TeleitemCancelAuctionMsgBody{},
ProofStorageMsgOp: ProofStorageMsgBody{},
ProcessGovernanceDecisionMsgOp: ProcessGovernanceDecisionMsgBody{},
TelemintDeployMsgOp: TelemintDeployMsgBody{},
TelemintDeployV2MsgOp: TelemintDeployV2MsgBody{},
StorageWithdrawMsgOp: StorageWithdrawMsgBody{},
Expand All @@ -887,6 +922,8 @@ var KnownMsgTypes = map[string]any{
TeleitemStartAuctionMsgOp: TeleitemStartAuctionMsgBody{},
TonstakePoolTouchMsgOp: TonstakePoolTouchMsgBody{},
ElectorNewStakeMsgOp: ElectorNewStakeMsgBody{},
ChangeDnsRecordMsgOp: ChangeDnsRecordMsgBody{},
DnsBalanceReleaseMsgOp: DnsBalanceReleaseMsgBody{},
UpdatePubkeyMsgOp: UpdatePubkeyMsgBody{},
UpdateStorageParamsMsgOp: UpdateStorageParamsMsgBody{},
TonstakeImanagerOperationFeeMsgOp: TonstakeImanagerOperationFeeMsgBody{},
Expand Down
24 changes: 20 additions & 4 deletions abi/ordering.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package abi
// Code autogenerated. DO NOT EDIT.

// Code autogenerated. DO NOT EDIT.

import (
"context"
"github.com/tonkeeper/tongo"
)
"context"

"github.com/tonkeeper/tongo"
)

type ContractInterface string

Expand Down Expand Up @@ -83,6 +84,21 @@ var methodInvocationOrder = []MethodDescription{
InvokeFn: GetDomain,
ImplementedBy: []ContractInterface{Domain},
},
{
Name: "get_domain_auction_info",
InvokeFn: GetDomainAuctionInfo,
ImplementedBy: []ContractInterface{Domain},
},
{
Name: "get_domain_data",
InvokeFn: GetDomainData,
ImplementedBy: []ContractInterface{Domain},
},
{
Name: "get_domain_editor",
InvokeFn: GetDomainEditor,
ImplementedBy: []ContractInterface{Domain},
},
{
Name: "get_editor",
InvokeFn: GetEditor,
Expand Down
Loading
Loading