diff --git a/abi/get_methods.go b/abi/get_methods.go index 7e97a574..6311d0dc 100644 --- a/abi/get_methods.go +++ b/abi/get_methods.go @@ -669,7 +669,7 @@ func Dnsresolve(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeDnsresolve_RecordsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkCell") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result Dnsresolve_RecordsResult @@ -713,7 +713,7 @@ func EstimateLiquidityDepositAmount(ctx context.Context, executor Executor, reqA } func DecodeEstimateLiquidityDepositAmount_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result EstimateLiquidityDepositAmount_CoffeeResult @@ -753,7 +753,7 @@ func EstimateLiquidityWithdrawAmount(ctx context.Context, executor Executor, req } func DecodeEstimateLiquidityWithdrawAmount_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result EstimateLiquidityWithdrawAmount_CoffeeResult @@ -798,7 +798,7 @@ func EstimateSwapAmount(ctx context.Context, executor Executor, reqAccountID ton } func DecodeEstimateSwapAmount_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result EstimateSwapAmount_CoffeeResult @@ -844,7 +844,7 @@ func EstimateSwapOut(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeEstimateSwapOut_DedustResult(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") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result EstimateSwapOut_DedustResult @@ -877,7 +877,7 @@ func GetAllTickInfos(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetAllTickInfos_ToncoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAllTickInfos_ToncoResult @@ -919,7 +919,7 @@ func GetChildContracts(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetChildContracts_ToncoPoolResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkCell") || (stack[1].SumType != "VmStkCell") || (stack[2].SumType != "VmStkCell") || (stack[3].SumType != "VmStkCell") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetChildContracts_ToncoPoolResult @@ -928,7 +928,7 @@ func DecodeGetChildContracts_ToncoPoolResult(stack tlb.VmStack) (resultType stri } func DecodeGetChildContracts_ToncoRouterResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkCell") || (stack[1].SumType != "VmStkCell") || (stack[2].SumType != "VmStkCell") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetChildContracts_ToncoRouterResult @@ -961,7 +961,7 @@ func GetIsActive(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetIsActive_ToncoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetIsActive_ToncoResult @@ -1018,7 +1018,7 @@ func GetPoolStateAndConfiguration(ctx context.Context, executor Executor, reqAcc } func DecodeGetPoolStateAndConfiguration_ToncoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 25 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkSlice") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkSlice") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTinyInt" && stack[16].SumType != "VmStkInt") || (stack[17].SumType != "VmStkTinyInt" && stack[17].SumType != "VmStkInt") || (stack[18].SumType != "VmStkTinyInt" && stack[18].SumType != "VmStkInt") || (stack[19].SumType != "VmStkTinyInt" && stack[19].SumType != "VmStkInt") || (stack[20].SumType != "VmStkTinyInt" && stack[20].SumType != "VmStkInt") || (stack[21].SumType != "VmStkTinyInt" && stack[21].SumType != "VmStkInt") || (stack[22].SumType != "VmStkTinyInt" && stack[22].SumType != "VmStkInt") || (stack[23].SumType != "VmStkTinyInt" && stack[23].SumType != "VmStkInt") || (stack[24].SumType != "VmStkTinyInt" && stack[24].SumType != "VmStkInt") { + if stack.Len() != 25 || (stack.Peek(24).SumType != "VmStkSlice") || (stack.Peek(23).SumType != "VmStkSlice") || (stack.Peek(22).SumType != "VmStkSlice") || (stack.Peek(21).SumType != "VmStkSlice") || (stack.Peek(20).SumType != "VmStkSlice") || (stack.Peek(19).SumType != "VmStkSlice") || (stack.Peek(18).SumType != "VmStkSlice") || (stack.Peek(17).SumType != "VmStkTinyInt" && stack.Peek(17).SumType != "VmStkInt") || (stack.Peek(16).SumType != "VmStkTinyInt" && stack.Peek(16).SumType != "VmStkInt") || (stack.Peek(15).SumType != "VmStkTinyInt" && stack.Peek(15).SumType != "VmStkInt") || (stack.Peek(14).SumType != "VmStkTinyInt" && stack.Peek(14).SumType != "VmStkInt") || (stack.Peek(13).SumType != "VmStkTinyInt" && stack.Peek(13).SumType != "VmStkInt") || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolStateAndConfiguration_ToncoResult @@ -1055,7 +1055,7 @@ func GetRouterState(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetRouterState_ToncoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 5 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRouterState_ToncoResult @@ -1093,7 +1093,7 @@ func GetAccountData(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetAccountData_ToncoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAccountData_ToncoResult @@ -1126,7 +1126,7 @@ func GetActiveRange(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetActiveRange_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetActiveRange_BidaskResult @@ -1167,7 +1167,7 @@ func GetAdjustedSpotPrice(ctx context.Context, executor Executor, reqAccountID t } func DecodeGetAdjustedSpotPrice_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAdjustedSpotPrice_StormResult @@ -1200,7 +1200,7 @@ func GetAdminAddress(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetAdminAddress_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAdminAddress_CoffeeResult @@ -1233,7 +1233,7 @@ func GetAmmContractData(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetAmmContractData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAmmContractData_StormResult @@ -1267,7 +1267,7 @@ func GetAmmName(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetAmmName_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAmmName_StormResult @@ -1309,7 +1309,7 @@ func GetAmmState(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetAmmState_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 10 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") { + if stack.Len() != 10 || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAmmState_StormResult @@ -1346,7 +1346,7 @@ func GetAmmStatus(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetAmmStatus_StormResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAmmStatus_StormResult @@ -1383,7 +1383,7 @@ func GetAsset(ctx context.Context, executor Executor, reqAccountID ton.AccountID } func DecodeGetAsset_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAsset_DedustResult @@ -1392,7 +1392,7 @@ func DecodeGetAsset_DedustResult(stack tlb.VmStack) (resultType string, resultAn } func DecodeGetAsset_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAsset_CoffeeResult @@ -1431,7 +1431,7 @@ func GetAssets(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetAssets_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAssets_DedustResult @@ -1440,7 +1440,7 @@ func DecodeGetAssets_DedustResult(stack tlb.VmStack) (resultType string, resultA } func DecodeGetAssets_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAssets_MoonResult @@ -1498,7 +1498,7 @@ func GetAuctionDataV4(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetAuctionDataV4Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 26 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkSlice") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkSlice") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkSlice") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTinyInt" && stack[16].SumType != "VmStkInt") || (stack[17].SumType != "VmStkTinyInt" && stack[17].SumType != "VmStkInt") || (stack[18].SumType != "VmStkTinyInt" && stack[18].SumType != "VmStkInt") || (stack[19].SumType != "VmStkTinyInt" && stack[19].SumType != "VmStkInt") || (stack[20].SumType != "VmStkTinyInt" && stack[20].SumType != "VmStkInt") || (stack[21].SumType != "VmStkTinyInt" && stack[21].SumType != "VmStkInt") || (stack[22].SumType != "VmStkSlice") || (stack[23].SumType != "VmStkSlice") || (stack[24].SumType != "VmStkTinyInt" && stack[24].SumType != "VmStkInt") || (stack[25].SumType != "VmStkTinyInt" && stack[25].SumType != "VmStkInt") { + if stack.Len() != 26 || (stack.Peek(25).SumType != "VmStkTinyInt" && stack.Peek(25).SumType != "VmStkInt") || (stack.Peek(24).SumType != "VmStkTinyInt" && stack.Peek(24).SumType != "VmStkInt") || (stack.Peek(23).SumType != "VmStkTinyInt" && stack.Peek(23).SumType != "VmStkInt") || (stack.Peek(22).SumType != "VmStkSlice") || (stack.Peek(21).SumType != "VmStkSlice") || (stack.Peek(20).SumType != "VmStkSlice") || (stack.Peek(19).SumType != "VmStkTinyInt" && stack.Peek(19).SumType != "VmStkInt") || (stack.Peek(18).SumType != "VmStkSlice") || (stack.Peek(17).SumType != "VmStkTinyInt" && stack.Peek(17).SumType != "VmStkInt") || (stack.Peek(16).SumType != "VmStkSlice") || (stack.Peek(15).SumType != "VmStkTinyInt" && stack.Peek(15).SumType != "VmStkInt") || (stack.Peek(14).SumType != "VmStkTinyInt" && stack.Peek(14).SumType != "VmStkInt") || (stack.Peek(13).SumType != "VmStkSlice") || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAuctionDataV4Result @@ -1533,7 +1533,7 @@ func GetAuctionInfo(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetAuctionInfoResult(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") { + if stack.Len() < 3 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAuctionInfoResult @@ -1566,7 +1566,7 @@ func GetAuthorityAddress(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetAuthorityAddressResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAuthorityAddressResult @@ -1599,7 +1599,7 @@ func GetAvailableClaimAmount(ctx context.Context, executor Executor, reqAccountI } func DecodeGetAvailableClaimAmountResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetAvailableClaimAmountResult @@ -1639,7 +1639,7 @@ func GetBalances(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetBalances_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBalances_DedustResult @@ -1648,7 +1648,7 @@ func DecodeGetBalances_DedustResult(stack tlb.VmStack) (resultType string, resul } func DecodeGetBalancesResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBalancesResult @@ -1690,7 +1690,7 @@ func GetBillAddress(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetBillAddressResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBillAddressResult @@ -1723,7 +1723,7 @@ func GetBillAmount(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetBillAmountResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBillAmountResult @@ -1763,7 +1763,7 @@ func GetBinAssets(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetBinAssets_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBinAssets_BidaskResult @@ -1796,7 +1796,7 @@ func GetBinsNumber(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetBinsNumber_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBinsNumber_BidaskResult @@ -1832,7 +1832,7 @@ func GetBlankStorageData(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetBlankStorageData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkCell" && stack[3].SumType != "VmStkNull") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkCell" && stack.Peek(0).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBlankStorageData_StormResult @@ -1868,7 +1868,7 @@ func GetBufferData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetBufferData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetBufferData_StormResult @@ -1926,7 +1926,7 @@ func GetCanExecuteOrder(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetCanExecuteOrder_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCanExecuteOrder_StormResult @@ -1983,7 +1983,7 @@ func GetCanForceClose(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetCanForceClose_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCanForceClose_StormResult @@ -2042,7 +2042,7 @@ func GetCanLiquidate(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetCanLiquidate_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCanLiquidate_StormResult @@ -2103,7 +2103,7 @@ func GetChannelData(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetChannelDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 8 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTuple") || (stack[2].SumType != "VmStkTuple") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTuple") || (stack[5].SumType != "VmStkTuple") || (stack[6].SumType != "VmStkSlice" && stack[6].SumType != "VmStkNull") || (stack[7].SumType != "VmStkTuple") { + if stack.Len() < 8 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTuple") || (stack.Peek(stack.Len()-3).SumType != "VmStkTuple") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkTuple") || (stack.Peek(stack.Len()-6).SumType != "VmStkTuple") || (stack.Peek(stack.Len()-7).SumType != "VmStkSlice" && stack.Peek(stack.Len()-7).SumType != "VmStkNull") || (stack.Peek(stack.Len()-8).SumType != "VmStkTuple") { return "", nil, fmt.Errorf("invalid stack format") } var result GetChannelDataResult @@ -2136,7 +2136,7 @@ func GetClaimerAddress(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetClaimerAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetClaimerAddress_StormResult @@ -2177,7 +2177,7 @@ func GetCocoonClientData(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetCocoonClientData_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 9 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") { + if stack.Len() != 9 || (stack.Peek(8).SumType != "VmStkSlice") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCocoonClientData_CocoonResult @@ -2219,7 +2219,7 @@ func GetCocoonData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetCocoonData_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 10 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") { + if stack.Len() != 10 || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCocoonData_CocoonResult @@ -2263,7 +2263,7 @@ func GetCocoonProxyData(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetCocoonProxyData_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 12 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") { + if stack.Len() != 12 || (stack.Peek(11).SumType != "VmStkSlice") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkSlice") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCocoonProxyData_CocoonResult @@ -2300,7 +2300,7 @@ func GetCocoonWorkerData(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetCocoonWorkerData_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 5 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCocoonWorkerData_CocoonResult @@ -2334,7 +2334,7 @@ func GetCode(ctx context.Context, executor Executor, reqAccountID ton.AccountID) } func DecodeGetCode_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkCell") || (stack[1].SumType != "VmStkCell") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCode_CoffeeResult @@ -2368,7 +2368,7 @@ func GetCollectedFeesInfo(ctx context.Context, executor Executor, reqAccountID t } func DecodeGetCollectedFeesInfo_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCollectedFeesInfo_BidaskDammResult @@ -2403,7 +2403,7 @@ func GetCollectionData(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetCollectionDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkCell") || (stack[2].SumType != "VmStkSlice") { + if stack.Len() < 3 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkCell") || (stack.Peek(stack.Len()-3).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCollectionDataResult @@ -2447,7 +2447,7 @@ func GetComputeFundingData(ctx context.Context, executor Executor, reqAccountID } func DecodeGetComputeFundingData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetComputeFundingData_StormResult @@ -2483,7 +2483,7 @@ func GetContractData(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetContractData_AirdropInterlockerV1Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkSlice") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetContractData_AirdropInterlockerV1Result @@ -2519,7 +2519,7 @@ func GetCronInfo(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetCronInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCronInfoResult @@ -2565,7 +2565,7 @@ func GetCurParams(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetCurParams_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 14 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") { + if stack.Len() != 14 || (stack.Peek(13).SumType != "VmStkTinyInt" && stack.Peek(13).SumType != "VmStkInt") || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCurParams_CocoonResult @@ -2598,7 +2598,7 @@ func GetCurrentBin(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetCurrentBin_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetCurrentBin_BidaskResult @@ -2632,7 +2632,7 @@ func GetDayTradingData(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetDayTradingData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDayTradingData_StormResult @@ -2666,7 +2666,7 @@ func GetDefaultReferralFees(ctx context.Context, executor Executor, reqAccountID } func DecodeGetDefaultReferralFees_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDefaultReferralFees_StormResult @@ -2704,7 +2704,7 @@ func GetDelegationState(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetDelegationStateResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTuple") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTuple") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDelegationStateResult @@ -2738,7 +2738,7 @@ func GetDisplayMultiplier(ctx context.Context, executor Executor, reqAccountID t } func DecodeGetDisplayMultiplierResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() < 2 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDisplayMultiplierResult @@ -2774,7 +2774,7 @@ func GetDistributionInfo(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetDistributionInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDistributionInfoResult @@ -2807,7 +2807,7 @@ func GetDomain(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetDomainResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDomainResult @@ -2843,7 +2843,7 @@ func GetDynamicFeesInfo(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetDynamicFeesInfo_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetDynamicFeesInfo_BidaskResult @@ -2876,7 +2876,7 @@ func GetEditor(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetEditorResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetEditorResult @@ -2922,7 +2922,7 @@ func GetEstimatedAttachedValue(ctx context.Context, executor Executor, reqAccoun } func DecodeGetEstimatedAttachedValueResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetEstimatedAttachedValueResult @@ -2981,7 +2981,7 @@ func GetExchangeSettings(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetExchangeSettings_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 27 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTinyInt" && stack[16].SumType != "VmStkInt") || (stack[17].SumType != "VmStkTinyInt" && stack[17].SumType != "VmStkInt") || (stack[18].SumType != "VmStkTinyInt" && stack[18].SumType != "VmStkInt") || (stack[19].SumType != "VmStkTinyInt" && stack[19].SumType != "VmStkInt") || (stack[20].SumType != "VmStkCell") || (stack[21].SumType != "VmStkTinyInt" && stack[21].SumType != "VmStkInt") || (stack[22].SumType != "VmStkTinyInt" && stack[22].SumType != "VmStkInt") || (stack[23].SumType != "VmStkTinyInt" && stack[23].SumType != "VmStkInt") || (stack[24].SumType != "VmStkTinyInt" && stack[24].SumType != "VmStkInt") || (stack[25].SumType != "VmStkTinyInt" && stack[25].SumType != "VmStkInt") || (stack[26].SumType != "VmStkTinyInt" && stack[26].SumType != "VmStkInt") { + if stack.Len() != 27 || (stack.Peek(26).SumType != "VmStkTinyInt" && stack.Peek(26).SumType != "VmStkInt") || (stack.Peek(25).SumType != "VmStkTinyInt" && stack.Peek(25).SumType != "VmStkInt") || (stack.Peek(24).SumType != "VmStkTinyInt" && stack.Peek(24).SumType != "VmStkInt") || (stack.Peek(23).SumType != "VmStkTinyInt" && stack.Peek(23).SumType != "VmStkInt") || (stack.Peek(22).SumType != "VmStkTinyInt" && stack.Peek(22).SumType != "VmStkInt") || (stack.Peek(21).SumType != "VmStkTinyInt" && stack.Peek(21).SumType != "VmStkInt") || (stack.Peek(20).SumType != "VmStkTinyInt" && stack.Peek(20).SumType != "VmStkInt") || (stack.Peek(19).SumType != "VmStkTinyInt" && stack.Peek(19).SumType != "VmStkInt") || (stack.Peek(18).SumType != "VmStkTinyInt" && stack.Peek(18).SumType != "VmStkInt") || (stack.Peek(17).SumType != "VmStkTinyInt" && stack.Peek(17).SumType != "VmStkInt") || (stack.Peek(16).SumType != "VmStkTinyInt" && stack.Peek(16).SumType != "VmStkInt") || (stack.Peek(15).SumType != "VmStkTinyInt" && stack.Peek(15).SumType != "VmStkInt") || (stack.Peek(14).SumType != "VmStkTinyInt" && stack.Peek(14).SumType != "VmStkInt") || (stack.Peek(13).SumType != "VmStkTinyInt" && stack.Peek(13).SumType != "VmStkInt") || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkCell") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExchangeSettings_StormResult @@ -3014,7 +3014,7 @@ func GetExecutorBalances(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetExecutorBalances_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExecutorBalances_StormResult @@ -3047,7 +3047,7 @@ func GetExecutorCollectionAddress(ctx context.Context, executor Executor, reqAcc } func DecodeGetExecutorCollectionAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExecutorCollectionAddress_StormResult @@ -3086,7 +3086,7 @@ func GetExecutorItemAddr(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetExecutorItemAddr_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExecutorItemAddr_StormResult @@ -3119,7 +3119,7 @@ func GetExecutorVaultsWhitelist(ctx context.Context, executor Executor, reqAccou } func DecodeGetExecutorVaultsWhitelist_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExecutorVaultsWhitelist_StormResult @@ -3165,7 +3165,7 @@ func GetExpectedOutputs(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetExpectedOutputs_StonfiResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExpectedOutputs_StonfiResult @@ -3221,7 +3221,7 @@ func GetExpectedSwapResult(ctx context.Context, executor Executor, reqAccountID } func DecodeGetExpectedSwapResult_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExpectedSwapResult_BidaskDammResult @@ -3254,7 +3254,7 @@ func GetExtensions(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetExtensionsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell" && stack[0].SumType != "VmStkNull") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell" && stack.Peek(0).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetExtensionsResult @@ -3293,7 +3293,7 @@ func GetFactoryData(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetFactoryData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkCell") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFactoryData_StormResult @@ -3338,7 +3338,7 @@ func GetFarmingInfo(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetFarmingInfo_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFarmingInfo_BidaskResult @@ -3347,7 +3347,7 @@ func DecodeGetFarmingInfo_BidaskResult(stack tlb.VmStack) (resultType string, re } func DecodeGetFarmingInfo_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFarmingInfo_BidaskDammResult @@ -3385,7 +3385,7 @@ func GetFeesInfo(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetFeesInfo_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFeesInfo_BidaskDammResult @@ -3424,7 +3424,7 @@ func GetFillOut(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetFillOut_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFillOut_MoonResult @@ -3469,7 +3469,7 @@ func GetFixPriceDataV4(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetFixPriceDataV4Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 13 || (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 != "VmStkSlice" && stack[4].SumType != "VmStkNull") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkSlice") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkSlice") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkCell" && stack[12].SumType != "VmStkNull") { + if stack.Len() != 13 || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkSlice") || (stack.Peek(9).SumType != "VmStkSlice") || (stack.Peek(8).SumType != "VmStkSlice" && stack.Peek(8).SumType != "VmStkNull") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell" && stack.Peek(0).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFixPriceDataV4Result @@ -3502,7 +3502,7 @@ func GetFullDomain(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetFullDomainResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFullDomainResult @@ -3547,7 +3547,7 @@ func GetFunding(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetFunding_StormResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFunding_StormResult @@ -3584,7 +3584,7 @@ func GetFundingSettings(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetFundingSettings_StormResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetFundingSettings_StormResult @@ -3620,7 +3620,7 @@ func GetHighloadData(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetHighloadData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkCell") || (stack[1].SumType != "VmStkCell") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetHighloadData_StormResult @@ -3653,7 +3653,7 @@ func GetId(ctx context.Context, executor Executor, reqAccountID ton.AccountID) ( } func DecodeGetId_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetId_MoonResult @@ -3686,7 +3686,7 @@ func GetIsInited(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetIsInited_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetIsInited_StormResult @@ -3723,7 +3723,7 @@ func GetJettonData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetJettonDataResult(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 != "VmStkCell") || (stack[4].SumType != "VmStkCell") { + if stack.Len() < 5 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-4).SumType != "VmStkCell") || (stack.Peek(stack.Len()-5).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetJettonDataResult @@ -3759,7 +3759,7 @@ func GetKeysData(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetKeysData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkCell") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetKeysData_StormResult @@ -3792,7 +3792,7 @@ func GetLastCleanTime(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetLastCleanTimeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLastCleanTimeResult @@ -3825,7 +3825,7 @@ func GetLastFillUpTime(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetLastFillUpTimeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLastFillUpTimeResult @@ -3858,7 +3858,7 @@ func GetLastPositionManagerCode(ctx context.Context, executor Executor, reqAccou } func DecodeGetLastPositionManagerCode_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLastPositionManagerCode_StormResult @@ -3893,7 +3893,7 @@ func GetLazerData(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetLazerData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLazerData_StormResult @@ -3946,7 +3946,7 @@ func GetLiquidationPriceVpi(ctx context.Context, executor Executor, reqAccountID } func DecodeGetLiquidationPriceVpi_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLiquidationPriceVpi_StormResult @@ -3982,7 +3982,7 @@ func GetLiquidityData(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetLiquidityData_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLiquidityData_BidaskResult @@ -4036,7 +4036,7 @@ func GetLiquidityDepositAddress(ctx context.Context, executor Executor, reqAccou } func DecodeGetLiquidityDepositAddress_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLiquidityDepositAddress_DedustResult @@ -4096,7 +4096,7 @@ func GetLiquidityDepositoryAddress(ctx context.Context, executor Executor, reqAc } func DecodeGetLiquidityDepositoryAddress_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLiquidityDepositoryAddress_CoffeeResult @@ -4151,7 +4151,7 @@ func GetLiquidityDepositoryAddressNoSettings(ctx context.Context, executor Execu } func DecodeGetLiquidityDepositoryAddressNoSettings_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLiquidityDepositoryAddressNoSettings_CoffeeResult @@ -4189,7 +4189,7 @@ func GetLiquidityInfo(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetLiquidityInfo_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLiquidityInfo_BidaskDammResult @@ -4225,7 +4225,7 @@ func GetLockerBillData(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetLockerBillDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLockerBillDataResult @@ -4263,7 +4263,7 @@ func GetLockerData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetLockerDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLockerDataResult @@ -4301,7 +4301,7 @@ func GetLockupData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetLockupDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLockupDataResult @@ -4343,7 +4343,7 @@ func GetLpAccountAddress(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetLpAccountAddress_StonfiResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpAccountAddress_StonfiResult @@ -4379,7 +4379,7 @@ func GetLpAccountData(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetLpAccountData_StonfiResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpAccountData_StonfiResult @@ -4414,7 +4414,7 @@ func GetLpData(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetLpData_MegatonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkCell") || (stack[2].SumType != "VmStkCell") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpData_MegatonResult @@ -4453,7 +4453,7 @@ func GetLpMiningData(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetLpMiningData_MegatonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkCell") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpMiningData_MegatonResult @@ -4486,7 +4486,7 @@ func GetLpMinterAddress(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetLpMinterAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpMinterAddress_StormResult @@ -4528,7 +4528,7 @@ func GetLpMultitokenWallet(ctx context.Context, executor Executor, reqAccountID } func DecodeGetLpMultitokenWallet_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpMultitokenWallet_BidaskResult @@ -4571,7 +4571,7 @@ func GetLpSwapData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetLpSwapData_MegatonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 11 || (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 != "VmStkSlice") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkSlice") || (stack[8].SumType != "VmStkSlice") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") { + if stack.Len() != 11 || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkSlice") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetLpSwapData_MegatonResult @@ -4604,7 +4604,7 @@ func GetMasterAddress(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetMasterAddress_CoffeeStakingVaultResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetMasterAddress_CoffeeStakingVaultResult @@ -4649,7 +4649,7 @@ func GetMember(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetMember_WhalesNominatorResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() < 4 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetMember_WhalesNominatorResult @@ -4682,7 +4682,7 @@ func GetMembersRaw(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetMembersRaw_WhalesNominatorResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetMembersRaw_WhalesNominatorResult @@ -4720,7 +4720,7 @@ func GetMinFees(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetMinFees_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetMinFees_StormResult @@ -4758,7 +4758,7 @@ func GetMiningData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetMiningData_MegatonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetMiningData_MegatonResult @@ -4794,7 +4794,7 @@ func GetMultisigData(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetMultisigDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkCell") || (stack[3].SumType != "VmStkCell" && stack[3].SumType != "VmStkNull") { + if stack.Len() < 4 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkCell") || (stack.Peek(stack.Len()-4).SumType != "VmStkCell" && stack.Peek(stack.Len()-4).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetMultisigDataResult @@ -4827,7 +4827,7 @@ func GetNextAdminAddress(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetNextAdminAddressResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNextAdminAddressResult @@ -4862,7 +4862,7 @@ func GetNextProofInfo(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetNextProofInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() < 3 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNextProofInfoResult @@ -4901,7 +4901,7 @@ func GetNftAddressByIndex(ctx context.Context, executor Executor, reqAccountID t } func DecodeGetNftAddressByIndexResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNftAddressByIndexResult @@ -4935,7 +4935,7 @@ func GetNftApiInfo(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetNftApiInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkCell") { + if stack.Len() < 2 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNftApiInfoResult @@ -4979,7 +4979,7 @@ func GetNftContent(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetNftContentResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNftContentResult @@ -5016,7 +5016,7 @@ func GetNftData(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetNftDataResult(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") { + if stack.Len() < 5 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-4).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-5).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNftDataResult @@ -5057,7 +5057,7 @@ func GetNominatorData(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetNominatorDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() < 3 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetNominatorDataResult @@ -5096,7 +5096,7 @@ func GetOracleData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetOracleData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkCell") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetOracleData_StormResult @@ -5135,7 +5135,7 @@ func GetOrderAddress(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetOrderAddressResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetOrderAddressResult @@ -5168,7 +5168,7 @@ func GetOrderAmount(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetOrderAmount_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetOrderAmount_MoonResult @@ -5209,7 +5209,7 @@ func GetOrderData(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetOrderDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 9 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkCell") { + if stack.Len() < 9 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkCell") || (stack.Peek(stack.Len()-6).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-6).SumType != "VmStkInt") || (stack.Peek(stack.Len()-7).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-7).SumType != "VmStkInt") || (stack.Peek(stack.Len()-8).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-8).SumType != "VmStkInt") || (stack.Peek(stack.Len()-9).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetOrderDataResult @@ -5242,7 +5242,7 @@ func GetOwnerAddress(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetOwnerAddress_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetOwnerAddress_CocoonResult @@ -5281,7 +5281,7 @@ func GetParams(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetParams_WhalesNominatorResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetParams_WhalesNominatorResult @@ -5314,7 +5314,7 @@ func GetPauseTime(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetPauseTime_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPauseTime_StormResult @@ -5353,7 +5353,7 @@ func GetPaymentInfo(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetPaymentInfo_SubscriptionV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPaymentInfo_SubscriptionV2Result @@ -5392,7 +5392,7 @@ func GetPegAdjustCost(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetPegAdjustCost_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPegAdjustCost_StormResult @@ -5434,7 +5434,7 @@ func GetPipe(ctx context.Context, executor Executor, reqAccountID ton.AccountID, } func DecodeGetPipe_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPipe_MoonResult @@ -5470,7 +5470,7 @@ func GetPluginList(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetPluginListResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTuple" && stack[0].SumType != "VmStkNull") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTuple" && stack.Peek(stack.Len()-1).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPluginListResult @@ -5503,7 +5503,7 @@ func GetPool(ctx context.Context, executor Executor, reqAccountID ton.AccountID) } func DecodeGetPool_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPool_MoonResult @@ -5536,7 +5536,7 @@ func GetPoolAddr(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetPoolAddr_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolAddr_BidaskResult @@ -5583,7 +5583,7 @@ func GetPoolAddress(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetPoolAddress_StonfiResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolAddress_StonfiResult @@ -5633,7 +5633,7 @@ func GetPoolAddressNoSettings(ctx context.Context, executor Executor, reqAccount } func DecodeGetPoolAddressNoSettings_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolAddressNoSettings_CoffeeResult @@ -5693,7 +5693,7 @@ func GetPoolCreatorAddress(ctx context.Context, executor Executor, reqAccountID } func DecodeGetPoolCreatorAddress_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolCreatorAddress_CoffeeResult @@ -5748,7 +5748,7 @@ func GetPoolCreatorAddressNoSettings(ctx context.Context, executor Executor, req } func DecodeGetPoolCreatorAddressNoSettings_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolCreatorAddressNoSettings_CoffeeResult @@ -5920,7 +5920,7 @@ func GetPoolData(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetPoolData_AffluentResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 16 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice" && stack[2].SumType != "VmStkNull") || (stack[3].SumType != "VmStkSlice" && stack[3].SumType != "VmStkNull") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkSlice" && stack[5].SumType != "VmStkNull") || (stack[6].SumType != "VmStkCell" && stack[6].SumType != "VmStkNull") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTuple" && stack[13].SumType != "VmStkNull") || (stack[14].SumType != "VmStkCell" && stack[14].SumType != "VmStkNull") || (stack[15].SumType != "VmStkCell") { + if stack.Len() != 16 || (stack.Peek(15).SumType != "VmStkTinyInt" && stack.Peek(15).SumType != "VmStkInt") || (stack.Peek(14).SumType != "VmStkTinyInt" && stack.Peek(14).SumType != "VmStkInt") || (stack.Peek(13).SumType != "VmStkSlice" && stack.Peek(13).SumType != "VmStkNull") || (stack.Peek(12).SumType != "VmStkSlice" && stack.Peek(12).SumType != "VmStkNull") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkSlice" && stack.Peek(10).SumType != "VmStkNull") || (stack.Peek(9).SumType != "VmStkCell" && stack.Peek(9).SumType != "VmStkNull") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTuple" && stack.Peek(2).SumType != "VmStkNull") || (stack.Peek(1).SumType != "VmStkCell" && stack.Peek(1).SumType != "VmStkNull") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_AffluentResult @@ -5929,7 +5929,7 @@ func DecodeGetPoolData_AffluentResult(stack tlb.VmStack) (resultType string, res } func DecodeGetPoolData_DaolamaResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_DaolamaResult @@ -5938,7 +5938,7 @@ func DecodeGetPoolData_DaolamaResult(stack tlb.VmStack) (resultType string, resu } func DecodeGetPoolData_StonfiResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 10 || (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 != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkSlice") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") { + if stack.Len() != 10 || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_StonfiResult @@ -5947,7 +5947,7 @@ func DecodeGetPoolData_StonfiResult(stack tlb.VmStack) (resultType string, resul } func DecodeGetPoolData_StonfiV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 12 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkSlice") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") { + if stack.Len() != 12 || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkSlice") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_StonfiV2Result @@ -5956,7 +5956,7 @@ func DecodeGetPoolData_StonfiV2Result(stack tlb.VmStack) (resultType string, res } func DecodeGetPoolData_StonfiV2StableswapResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 13 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkSlice") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") { + if stack.Len() != 13 || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkSlice") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_StonfiV2StableswapResult @@ -5965,7 +5965,7 @@ func DecodeGetPoolData_StonfiV2StableswapResult(stack tlb.VmStack) (resultType s } func DecodeGetPoolData_StonfiV2WeightedStableswapResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 16 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkSlice") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkSlice") { + if stack.Len() != 16 || (stack.Peek(15).SumType != "VmStkTinyInt" && stack.Peek(15).SumType != "VmStkInt") || (stack.Peek(14).SumType != "VmStkSlice") || (stack.Peek(13).SumType != "VmStkTinyInt" && stack.Peek(13).SumType != "VmStkInt") || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkSlice") || (stack.Peek(9).SumType != "VmStkSlice") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_StonfiV2WeightedStableswapResult @@ -5974,7 +5974,7 @@ func DecodeGetPoolData_StonfiV2WeightedStableswapResult(stack tlb.VmStack) (resu } func DecodeGetPoolData_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 11 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkCell" && stack[4].SumType != "VmStkNull") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") { + if stack.Len() != 11 || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkSlice") || (stack.Peek(8).SumType != "VmStkSlice") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkCell" && stack.Peek(6).SumType != "VmStkNull") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_CoffeeResult @@ -5983,7 +5983,7 @@ func DecodeGetPoolData_CoffeeResult(stack tlb.VmStack) (resultType string, resul } func DecodeGetPoolData_TfResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 17 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkCell" && stack[9].SumType != "VmStkNull") || (stack[10].SumType != "VmStkCell" && stack[10].SumType != "VmStkNull") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkTinyInt" && stack[12].SumType != "VmStkInt") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTuple" && stack[16].SumType != "VmStkNull") { + if stack.Len() < 17 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-5).SumType != "VmStkInt") || (stack.Peek(stack.Len()-6).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-6).SumType != "VmStkInt") || (stack.Peek(stack.Len()-7).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-7).SumType != "VmStkInt") || (stack.Peek(stack.Len()-8).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-8).SumType != "VmStkInt") || (stack.Peek(stack.Len()-9).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-9).SumType != "VmStkInt") || (stack.Peek(stack.Len()-10).SumType != "VmStkCell" && stack.Peek(stack.Len()-10).SumType != "VmStkNull") || (stack.Peek(stack.Len()-11).SumType != "VmStkCell" && stack.Peek(stack.Len()-11).SumType != "VmStkNull") || (stack.Peek(stack.Len()-12).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-12).SumType != "VmStkInt") || (stack.Peek(stack.Len()-13).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-13).SumType != "VmStkInt") || (stack.Peek(stack.Len()-14).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-14).SumType != "VmStkInt") || (stack.Peek(stack.Len()-15).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-15).SumType != "VmStkInt") || (stack.Peek(stack.Len()-16).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-16).SumType != "VmStkInt") || (stack.Peek(stack.Len()-17).SumType != "VmStkTuple" && stack.Peek(stack.Len()-17).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolData_TfResult @@ -6063,7 +6063,7 @@ func GetPoolFullData(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetPoolFullDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 30 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTuple") || (stack[8].SumType != "VmStkTuple") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkSlice") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkSlice" && stack[14].SumType != "VmStkNull") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkSlice" && stack[16].SumType != "VmStkNull") || (stack[17].SumType != "VmStkTinyInt" && stack[17].SumType != "VmStkInt") || (stack[18].SumType != "VmStkSlice" && stack[18].SumType != "VmStkNull") || (stack[19].SumType != "VmStkTinyInt" && stack[19].SumType != "VmStkInt") || (stack[20].SumType != "VmStkSlice" && stack[20].SumType != "VmStkNull") || (stack[21].SumType != "VmStkTinyInt" && stack[21].SumType != "VmStkInt") || (stack[22].SumType != "VmStkSlice" && stack[22].SumType != "VmStkNull") || (stack[23].SumType != "VmStkSlice" && stack[23].SumType != "VmStkNull") || (stack[24].SumType != "VmStkSlice" && stack[24].SumType != "VmStkNull") || (stack[25].SumType != "VmStkCell") || (stack[26].SumType != "VmStkCell") || (stack[27].SumType != "VmStkCell") || (stack[28].SumType != "VmStkTinyInt" && stack[28].SumType != "VmStkInt") || (stack[29].SumType != "VmStkTinyInt" && stack[29].SumType != "VmStkInt") { + if stack.Len() != 30 || (stack.Peek(29).SumType != "VmStkTinyInt" && stack.Peek(29).SumType != "VmStkInt") || (stack.Peek(28).SumType != "VmStkTinyInt" && stack.Peek(28).SumType != "VmStkInt") || (stack.Peek(27).SumType != "VmStkTinyInt" && stack.Peek(27).SumType != "VmStkInt") || (stack.Peek(26).SumType != "VmStkTinyInt" && stack.Peek(26).SumType != "VmStkInt") || (stack.Peek(25).SumType != "VmStkTinyInt" && stack.Peek(25).SumType != "VmStkInt") || (stack.Peek(24).SumType != "VmStkTinyInt" && stack.Peek(24).SumType != "VmStkInt") || (stack.Peek(23).SumType != "VmStkTinyInt" && stack.Peek(23).SumType != "VmStkInt") || (stack.Peek(22).SumType != "VmStkTuple") || (stack.Peek(21).SumType != "VmStkTuple") || (stack.Peek(20).SumType != "VmStkTinyInt" && stack.Peek(20).SumType != "VmStkInt") || (stack.Peek(19).SumType != "VmStkTinyInt" && stack.Peek(19).SumType != "VmStkInt") || (stack.Peek(18).SumType != "VmStkTinyInt" && stack.Peek(18).SumType != "VmStkInt") || (stack.Peek(17).SumType != "VmStkSlice") || (stack.Peek(16).SumType != "VmStkTinyInt" && stack.Peek(16).SumType != "VmStkInt") || (stack.Peek(15).SumType != "VmStkSlice" && stack.Peek(15).SumType != "VmStkNull") || (stack.Peek(14).SumType != "VmStkTinyInt" && stack.Peek(14).SumType != "VmStkInt") || (stack.Peek(13).SumType != "VmStkSlice" && stack.Peek(13).SumType != "VmStkNull") || (stack.Peek(12).SumType != "VmStkTinyInt" && stack.Peek(12).SumType != "VmStkInt") || (stack.Peek(11).SumType != "VmStkSlice" && stack.Peek(11).SumType != "VmStkNull") || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkSlice" && stack.Peek(9).SumType != "VmStkNull") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkSlice" && stack.Peek(7).SumType != "VmStkNull") || (stack.Peek(6).SumType != "VmStkSlice" && stack.Peek(6).SumType != "VmStkNull") || (stack.Peek(5).SumType != "VmStkSlice" && stack.Peek(5).SumType != "VmStkNull") || (stack.Peek(4).SumType != "VmStkCell") || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolFullDataResult @@ -6105,7 +6105,7 @@ func GetPoolInfo(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetPoolInfo_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolInfo_BidaskResult @@ -6114,7 +6114,7 @@ func DecodeGetPoolInfo_BidaskResult(stack tlb.VmStack) (resultType string, resul } func DecodeGetPoolInfo_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolInfo_BidaskDammResult @@ -6151,7 +6151,7 @@ func GetPoolStatus(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetPoolStatusResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolStatusResult @@ -6184,7 +6184,7 @@ func GetPoolType(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetPoolType_StonfiV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPoolType_StonfiV2Result @@ -6218,7 +6218,7 @@ func GetPosition(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetPosition_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkCell" && stack[1].SumType != "VmStkNull") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell" && stack.Peek(0).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPosition_StormResult @@ -6265,7 +6265,7 @@ func GetPositionAddress(ctx context.Context, executor Executor, reqAccountID ton } func DecodeGetPositionAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPositionAddress_StormResult @@ -6298,7 +6298,7 @@ func GetPositionManagerAddress(ctx context.Context, executor Executor, reqAccoun } func DecodeGetPositionManagerAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPositionManagerAddress_StormResult @@ -6338,7 +6338,7 @@ func GetPositionManagerContractData(ctx context.Context, executor Executor, reqA } func DecodeGetPositionManagerContractData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 8 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkCell") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkCell") || (stack[6].SumType != "VmStkCell") || (stack[7].SumType != "VmStkCell") { + if stack.Len() != 8 || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkCell") || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPositionManagerContractData_StormResult @@ -6371,7 +6371,7 @@ func GetPositionManagerData(ctx context.Context, executor Executor, reqAccountID } func DecodeGetPositionManagerData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPositionManagerData_StormResult @@ -6407,7 +6407,7 @@ func GetPowParams(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetPowParamsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() < 4 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPowParamsResult @@ -6446,7 +6446,7 @@ func GetPremium(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetPremium_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPremium_StormResult @@ -6479,7 +6479,7 @@ func GetProxy(ctx context.Context, executor Executor, reqAccountID ton.AccountID } func DecodeGetProxy_WhalesNominatorResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetProxy_WhalesNominatorResult @@ -6512,7 +6512,7 @@ func GetPublicKey(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetPublicKeyResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPublicKeyResult @@ -6545,7 +6545,7 @@ func GetReferralCollectionAddress(ctx context.Context, executor Executor, reqAcc } func DecodeGetReferralCollectionAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetReferralCollectionAddress_StormResult @@ -6581,7 +6581,7 @@ func GetReferralData(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetReferralData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkCell") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetReferralData_StormResult @@ -6620,7 +6620,7 @@ func GetReferralItemAddr(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetReferralItemAddr_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetReferralItemAddr_StormResult @@ -6653,7 +6653,7 @@ func GetReferralVaultsWhitelist(ctx context.Context, executor Executor, reqAccou } func DecodeGetReferralVaultsWhitelist_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetReferralVaultsWhitelist_StormResult @@ -6707,7 +6707,7 @@ func GetRemainMarginWithFundingPayment(ctx context.Context, executor Executor, r } func DecodeGetRemainMarginWithFundingPayment_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 9 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") { + if stack.Len() != 9 || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRemainMarginWithFundingPayment_StormResult @@ -6748,7 +6748,7 @@ func GetReserves(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetReserves_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetReserves_DedustResult @@ -6757,7 +6757,7 @@ func DecodeGetReserves_DedustResult(stack tlb.VmStack) (resultType string, resul } func DecodeGetReserves_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetReserves_MoonResult @@ -6790,7 +6790,7 @@ func GetRevokedTime(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetRevokedTimeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRevokedTimeResult @@ -6829,7 +6829,7 @@ func GetRfqAddress(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetRfqAddress_AffluentResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRfqAddress_AffluentResult @@ -6862,7 +6862,7 @@ func GetRootPubkey(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetRootPubkeyResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRootPubkeyResult @@ -6912,7 +6912,7 @@ func GetRouterData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetRouterData_StonfiResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkCell") || (stack[3].SumType != "VmStkCell") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkCell") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRouterData_StonfiResult @@ -6921,7 +6921,7 @@ func DecodeGetRouterData_StonfiResult(stack tlb.VmStack) (resultType string, res } func DecodeGetRouterData_StonfiV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 9 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkCell") || (stack[6].SumType != "VmStkCell") || (stack[7].SumType != "VmStkCell") || (stack[8].SumType != "VmStkCell") { + if stack.Len() != 9 || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkCell") || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRouterData_StonfiV2Result @@ -6956,7 +6956,7 @@ func GetRouterVersion(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetRouterVersion_StonfiV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetRouterVersion_StonfiV2Result @@ -7032,7 +7032,7 @@ func GetSaleData(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetSaleData_BasicResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSaleData_BasicResult @@ -7041,7 +7041,7 @@ func DecodeGetSaleData_BasicResult(stack tlb.VmStack) (resultType string, result } func DecodeGetSaleData_GetgemsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 11 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkSlice") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkSlice") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") { + if stack.Len() != 11 || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSaleData_GetgemsResult @@ -7050,7 +7050,7 @@ func DecodeGetSaleData_GetgemsResult(stack tlb.VmStack) (resultType string, resu } func DecodeGetSaleData_GetgemsAuctionResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 20 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkSlice") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkSlice") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkTinyInt" && stack[11].SumType != "VmStkInt") || (stack[12].SumType != "VmStkSlice") || (stack[13].SumType != "VmStkTinyInt" && stack[13].SumType != "VmStkInt") || (stack[14].SumType != "VmStkTinyInt" && stack[14].SumType != "VmStkInt") || (stack[15].SumType != "VmStkTinyInt" && stack[15].SumType != "VmStkInt") || (stack[16].SumType != "VmStkTinyInt" && stack[16].SumType != "VmStkInt") || (stack[17].SumType != "VmStkTinyInt" && stack[17].SumType != "VmStkInt") || (stack[18].SumType != "VmStkTinyInt" && stack[18].SumType != "VmStkInt") || (stack[19].SumType != "VmStkTinyInt" && stack[19].SumType != "VmStkInt") { + if stack.Len() != 20 || (stack.Peek(19).SumType != "VmStkTinyInt" && stack.Peek(19).SumType != "VmStkInt") || (stack.Peek(18).SumType != "VmStkTinyInt" && stack.Peek(18).SumType != "VmStkInt") || (stack.Peek(17).SumType != "VmStkTinyInt" && stack.Peek(17).SumType != "VmStkInt") || (stack.Peek(16).SumType != "VmStkSlice") || (stack.Peek(15).SumType != "VmStkSlice") || (stack.Peek(14).SumType != "VmStkSlice") || (stack.Peek(13).SumType != "VmStkTinyInt" && stack.Peek(13).SumType != "VmStkInt") || (stack.Peek(12).SumType != "VmStkSlice") || (stack.Peek(11).SumType != "VmStkTinyInt" && stack.Peek(11).SumType != "VmStkInt") || (stack.Peek(10).SumType != "VmStkSlice") || (stack.Peek(9).SumType != "VmStkTinyInt" && stack.Peek(9).SumType != "VmStkInt") || (stack.Peek(8).SumType != "VmStkTinyInt" && stack.Peek(8).SumType != "VmStkInt") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSaleData_GetgemsAuctionResult @@ -7083,7 +7083,7 @@ func GetSeedPubkey(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetSeedPubkeyResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSeedPubkeyResult @@ -7121,7 +7121,7 @@ func GetSettlementOracleData(ctx context.Context, executor Executor, reqAccountI } func DecodeGetSettlementOracleData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSettlementOracleData_StormResult @@ -7154,7 +7154,7 @@ func GetSpotPrice(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetSpotPrice_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSpotPrice_StormResult @@ -7187,7 +7187,7 @@ func GetSqrtP(ctx context.Context, executor Executor, reqAccountID ton.AccountID } func DecodeGetSqrtP_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSqrtP_BidaskResult @@ -7226,7 +7226,7 @@ func GetStakingStatus(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetStakingStatusResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStakingStatusResult @@ -7259,7 +7259,7 @@ func GetStartTradeTime(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetStartTradeTime_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStartTradeTime_BidaskDammResult @@ -7296,7 +7296,7 @@ func GetStatus(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeGetStatusResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStatusResult @@ -7305,7 +7305,7 @@ func DecodeGetStatusResult(stack tlb.VmStack) (resultType string, resultAny any, } func DecodeGetStatus_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStatus_MoonResult @@ -7353,7 +7353,7 @@ func GetStorageContractAddress(ctx context.Context, executor Executor, reqAccoun } func DecodeGetStorageContractAddressResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStorageContractAddressResult @@ -7396,7 +7396,7 @@ func GetStorageContractData(ctx context.Context, executor Executor, reqAccountID } func DecodeGetStorageContractDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 11 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkSlice") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") { + if stack.Len() < 11 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-5).SumType != "VmStkInt") || (stack.Peek(stack.Len()-6).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-6).SumType != "VmStkInt") || (stack.Peek(stack.Len()-7).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-7).SumType != "VmStkInt") || (stack.Peek(stack.Len()-8).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-8).SumType != "VmStkInt") || (stack.Peek(stack.Len()-9).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-9).SumType != "VmStkInt") || (stack.Peek(stack.Len()-10).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-11).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-11).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStorageContractDataResult @@ -7436,7 +7436,7 @@ func GetStorageData(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetStorageData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 8 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkCell" && stack[3].SumType != "VmStkNull") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkCell") || (stack[6].SumType != "VmStkCell" && stack[6].SumType != "VmStkNull") || (stack[7].SumType != "VmStkCell") { + if stack.Len() != 8 || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkCell" && stack.Peek(4).SumType != "VmStkNull") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell" && stack.Peek(1).SumType != "VmStkNull") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStorageData_StormResult @@ -7473,7 +7473,7 @@ func GetStorageParams(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetStorageParamsResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() < 5 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-5).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStorageParamsResult @@ -7532,7 +7532,7 @@ func GetStoredData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetStoredData_CoffeeStakingMasterResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 8 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkCell") || (stack[6].SumType != "VmStkCell") || (stack[7].SumType != "VmStkCell") { + if stack.Len() != 8 || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStoredData_CoffeeStakingMasterResult @@ -7541,7 +7541,7 @@ func DecodeGetStoredData_CoffeeStakingMasterResult(stack tlb.VmStack) (resultTyp } func DecodeGetStoredData_CoffeeStakingVaultResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkCell") || (stack[3].SumType != "VmStkCell") || (stack[4].SumType != "VmStkCell") || (stack[5].SumType != "VmStkCell") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkCell") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStoredData_CoffeeStakingVaultResult @@ -7550,7 +7550,7 @@ func DecodeGetStoredData_CoffeeStakingVaultResult(stack tlb.VmStack) (resultType } func DecodeGetStoredData_CoffeeStakingItemResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (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") || (stack[5].SumType != "VmStkCell") || (stack[6].SumType != "VmStkCell") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkCell") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetStoredData_CoffeeStakingItemResult @@ -7600,7 +7600,7 @@ func GetSubscriptionData(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetSubscriptionDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 10 || (stack[0].SumType != "VmStkTuple") || (stack[1].SumType != "VmStkTuple") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") { + if stack.Len() < 10 || (stack.Peek(stack.Len()-1).SumType != "VmStkTuple") || (stack.Peek(stack.Len()-2).SumType != "VmStkTuple") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-5).SumType != "VmStkInt") || (stack.Peek(stack.Len()-6).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-6).SumType != "VmStkInt") || (stack.Peek(stack.Len()-7).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-7).SumType != "VmStkInt") || (stack.Peek(stack.Len()-8).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-8).SumType != "VmStkInt") || (stack.Peek(stack.Len()-9).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-9).SumType != "VmStkInt") || (stack.Peek(stack.Len()-10).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-10).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSubscriptionDataResult @@ -7639,7 +7639,7 @@ func GetSubscriptionInfo(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetSubscriptionInfo_V2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 7 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkSlice") || (stack[5].SumType != "VmStkCell") || (stack[6].SumType != "VmStkCell") { + if stack.Len() != 7 || (stack.Peek(6).SumType != "VmStkSlice") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSubscriptionInfo_V2Result @@ -7672,7 +7672,7 @@ func GetSubwalletId(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetSubwalletIdResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetSubwalletIdResult @@ -7706,7 +7706,7 @@ func GetTargetBalances(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetTargetBalances_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTargetBalances_DedustResult @@ -7744,7 +7744,7 @@ func GetTelemintAuctionConfig(ctx context.Context, executor Executor, reqAccount } func DecodeGetTelemintAuctionConfigResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 6 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") { + if stack.Len() != 6 || (stack.Peek(5).SumType != "VmStkSlice") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTelemintAuctionConfigResult @@ -7781,7 +7781,7 @@ func GetTelemintAuctionState(ctx context.Context, executor Executor, reqAccountI } func DecodeGetTelemintAuctionStateResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 5 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkSlice") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTelemintAuctionStateResult @@ -7814,7 +7814,7 @@ func GetTelemintTokenName(ctx context.Context, executor Executor, reqAccountID t } func DecodeGetTelemintTokenNameResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTelemintTokenNameResult @@ -7847,7 +7847,7 @@ func GetTerminalAmmPrice(ctx context.Context, executor Executor, reqAccountID to } func DecodeGetTerminalAmmPrice_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTerminalAmmPrice_StormResult @@ -7880,7 +7880,7 @@ func GetTimeout(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetTimeoutResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTimeoutResult @@ -7913,7 +7913,7 @@ func GetTorrentHash(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetTorrentHashResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTorrentHashResult @@ -7947,7 +7947,7 @@ func GetTradeFee(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetTradeFee_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetTradeFee_DedustResult @@ -7983,7 +7983,7 @@ func GetUnlocksInfo(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetUnlocksInfoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkCell") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetUnlocksInfoResult @@ -8025,7 +8025,7 @@ func GetUserBinAssets(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetUserBinAssets_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() != 2 || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetUserBinAssets_BidaskResult @@ -8061,7 +8061,7 @@ func GetUserFeesInfo(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetUserFeesInfo_BidaskDammResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetUserFeesInfo_BidaskDammResult @@ -8094,7 +8094,7 @@ func GetUserPublicKeys(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeGetUserPublicKeys_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetUserPublicKeys_StormResult @@ -8140,7 +8140,7 @@ func GetValidateSignatures(ctx context.Context, executor Executor, reqAccountID } func DecodeGetValidateSignatures_StormResult(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 != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") && stack[2].SumType != "VmStkNull") || ((stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") && stack[3].SumType != "VmStkNull") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || ((stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") && stack.Peek(2).SumType != "VmStkNull") || ((stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") && stack.Peek(1).SumType != "VmStkNull") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetValidateSignatures_StormResult @@ -8186,7 +8186,7 @@ func GetValidatorControllerData(ctx context.Context, executor Executor, reqAccou } func DecodeGetValidatorControllerDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 14 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") || (stack[9].SumType != "VmStkTinyInt" && stack[9].SumType != "VmStkInt") || (stack[10].SumType != "VmStkTinyInt" && stack[10].SumType != "VmStkInt") || (stack[11].SumType != "VmStkSlice") || (stack[12].SumType != "VmStkSlice") || (stack[13].SumType != "VmStkSlice") { + if stack.Len() < 14 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") || (stack.Peek(stack.Len()-4).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-4).SumType != "VmStkInt") || (stack.Peek(stack.Len()-5).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-5).SumType != "VmStkInt") || (stack.Peek(stack.Len()-6).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-6).SumType != "VmStkInt") || (stack.Peek(stack.Len()-7).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-7).SumType != "VmStkInt") || (stack.Peek(stack.Len()-8).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-8).SumType != "VmStkInt") || (stack.Peek(stack.Len()-9).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-9).SumType != "VmStkInt") || (stack.Peek(stack.Len()-10).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-10).SumType != "VmStkInt") || (stack.Peek(stack.Len()-11).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-11).SumType != "VmStkInt") || (stack.Peek(stack.Len()-12).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-13).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-14).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetValidatorControllerDataResult @@ -8225,7 +8225,7 @@ func GetVammAddress(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetVammAddress_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVammAddress_StormResult @@ -8258,7 +8258,7 @@ func GetVammType(ctx context.Context, executor Executor, reqAccountID ton.Accoun } func DecodeGetVammType_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVammType_StormResult @@ -8300,7 +8300,7 @@ func GetVaultAddress(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetVaultAddress_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultAddress_DedustResult @@ -8342,7 +8342,7 @@ func GetVaultBalance(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetVaultBalance_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultBalance_StormResult @@ -8375,7 +8375,7 @@ func GetVaultContractData(ctx context.Context, executor Executor, reqAccountID t } func DecodeGetVaultContractData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultContractData_StormResult @@ -8542,7 +8542,7 @@ func GetVaultData(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetVaultData_AffluentLendingVaultResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 11 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkSlice") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkSlice") || (stack[8].SumType != "VmStkTuple" && stack[8].SumType != "VmStkNull") || (stack[9].SumType != "VmStkCell") || (stack[10].SumType != "VmStkCell") { + if stack.Len() != 11 || (stack.Peek(10).SumType != "VmStkTinyInt" && stack.Peek(10).SumType != "VmStkInt") || (stack.Peek(9).SumType != "VmStkSlice") || (stack.Peek(8).SumType != "VmStkSlice") || (stack.Peek(7).SumType != "VmStkSlice") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkTuple" && stack.Peek(2).SumType != "VmStkNull") || (stack.Peek(1).SumType != "VmStkCell") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultData_AffluentLendingVaultResult @@ -8551,7 +8551,7 @@ func DecodeGetVaultData_AffluentLendingVaultResult(stack tlb.VmStack) (resultTyp } func DecodeGetVaultData_AffluentMultiplyVaultResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTuple") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTuple") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultData_AffluentMultiplyVaultResult @@ -8560,7 +8560,7 @@ func DecodeGetVaultData_AffluentMultiplyVaultResult(stack tlb.VmStack) (resultTy } func DecodeGetVaultData_AffluentMultiplyVaultV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTuple") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTuple") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultData_AffluentMultiplyVaultV2Result @@ -8569,7 +8569,7 @@ func DecodeGetVaultData_AffluentMultiplyVaultV2Result(stack tlb.VmStack) (result } func DecodeGetVaultData_StonfiV2Result(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 4 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkSlice") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultData_StonfiV2Result @@ -8578,7 +8578,7 @@ func DecodeGetVaultData_StonfiV2Result(stack tlb.VmStack) (resultType string, re } func DecodeGetVaultData_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 9 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkTinyInt" && stack[5].SumType != "VmStkInt") || (stack[6].SumType != "VmStkTinyInt" && stack[6].SumType != "VmStkInt") || (stack[7].SumType != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") || (stack[8].SumType != "VmStkTinyInt" && stack[8].SumType != "VmStkInt") { + if stack.Len() != 9 || (stack.Peek(8).SumType != "VmStkSlice") || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultData_StormResult @@ -8611,7 +8611,7 @@ func GetVaultType(ctx context.Context, executor Executor, reqAccountID ton.Accou } func DecodeGetVaultType_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultType_StormResult @@ -8644,7 +8644,7 @@ func GetVaultWhitelistedAddresses(ctx context.Context, executor Executor, reqAcc } func DecodeGetVaultWhitelistedAddresses_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkCell") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVaultWhitelistedAddresses_StormResult @@ -8677,7 +8677,7 @@ func GetVersion(ctx context.Context, executor Executor, reqAccountID ton.Account } func DecodeGetVersion_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVersion_StormResult @@ -8723,7 +8723,7 @@ func GetVestingData(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeGetVestingData_MoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVestingData_MoonResult @@ -8732,7 +8732,7 @@ func DecodeGetVestingData_MoonResult(stack tlb.VmStack) (resultType string, resu } func DecodeGetVestingDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 8 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") || (stack[4].SumType != "VmStkTinyInt" && stack[4].SumType != "VmStkInt") || (stack[5].SumType != "VmStkSlice") || (stack[6].SumType != "VmStkSlice") || (stack[7].SumType != "VmStkCell") { + if stack.Len() != 8 || (stack.Peek(7).SumType != "VmStkTinyInt" && stack.Peek(7).SumType != "VmStkInt") || (stack.Peek(6).SumType != "VmStkTinyInt" && stack.Peek(6).SumType != "VmStkInt") || (stack.Peek(5).SumType != "VmStkTinyInt" && stack.Peek(5).SumType != "VmStkInt") || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || (stack.Peek(2).SumType != "VmStkSlice") || (stack.Peek(1).SumType != "VmStkSlice") || (stack.Peek(0).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetVestingDataResult @@ -8765,7 +8765,7 @@ func GetWalletAddr(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetWalletAddrResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetWalletAddrResult @@ -8807,7 +8807,7 @@ func GetWalletAddress(ctx context.Context, executor Executor, reqAccountID ton.A } func DecodeGetWalletAddressResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result GetWalletAddressResult @@ -8843,7 +8843,7 @@ func GetWalletData(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeGetWalletDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkSlice") || (stack[2].SumType != "VmStkSlice") || (stack[3].SumType != "VmStkCell") { + if stack.Len() < 4 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-3).SumType != "VmStkSlice") || (stack.Peek(stack.Len()-4).SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetWalletDataResult @@ -8878,7 +8878,7 @@ func GetWalletParams(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeGetWalletParamsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() < 3 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-3).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetWalletParamsResult @@ -8915,7 +8915,7 @@ func IsActive(ctx context.Context, executor Executor, reqAccountID ton.AccountID } func DecodeIsActiveResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsActiveResult @@ -8924,7 +8924,7 @@ func DecodeIsActiveResult(stack tlb.VmStack) (resultType string, resultAny any, } func DecodeIsActive_CoffeeResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsActive_CoffeeResult @@ -8957,7 +8957,7 @@ func IsClaimed(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeIsClaimedResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsClaimedResult @@ -8998,7 +8998,7 @@ func IsPluginInstalled(ctx context.Context, executor Executor, reqAccountID ton. } func DecodeIsPluginInstalledResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsPluginInstalledResult @@ -9031,7 +9031,7 @@ func IsSignatureAllowed(ctx context.Context, executor Executor, reqAccountID ton } func DecodeIsSignatureAllowedResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsSignatureAllowedResult @@ -9064,7 +9064,7 @@ func IsStable(ctx context.Context, executor Executor, reqAccountID ton.AccountID } func DecodeIsStable_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsStable_DedustResult @@ -9097,7 +9097,7 @@ func IsStrategyVault(ctx context.Context, executor Executor, reqAccountID ton.Ac } func DecodeIsStrategyVault_AffluentResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result IsStrategyVault_AffluentResult @@ -9131,7 +9131,7 @@ func JettonWalletLockData(ctx context.Context, executor Executor, reqAccountID t } func DecodeJettonWalletLockDataResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + if stack.Len() < 2 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result JettonWalletLockDataResult @@ -9164,7 +9164,7 @@ func LastProxySeqno(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeLastProxySeqno_CocoonResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result LastProxySeqno_CocoonResult @@ -9202,7 +9202,7 @@ func ListNominators(ctx context.Context, executor Executor, reqAccountID ton.Acc } func DecodeListNominatorsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTuple" && stack[0].SumType != "VmStkNull") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTuple" && stack.Peek(stack.Len()-1).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result ListNominatorsResult @@ -9238,7 +9238,7 @@ func ListVotes(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeListVotesResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 1 || (stack[0].SumType != "VmStkTuple" && stack[0].SumType != "VmStkNull") { + if stack.Len() < 1 || (stack.Peek(stack.Len()-1).SumType != "VmStkTuple" && stack.Peek(stack.Len()-1).SumType != "VmStkNull") { return "", nil, fmt.Errorf("invalid stack format") } var result ListVotesResult @@ -9283,7 +9283,7 @@ func Processed(ctx context.Context, executor Executor, reqAccountID ton.AccountI } func DecodeProcessed_StormResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + if stack.Len() != 3 || (stack.Peek(2).SumType != "VmStkTinyInt" && stack.Peek(2).SumType != "VmStkInt") || (stack.Peek(1).SumType != "VmStkTinyInt" && stack.Peek(1).SumType != "VmStkInt") || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result Processed_StormResult @@ -9318,7 +9318,7 @@ func RoyaltyParams(ctx context.Context, executor Executor, reqAccountID ton.Acco } func DecodeRoyaltyParamsResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) < 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkSlice") { + if stack.Len() < 3 || (stack.Peek(stack.Len()-1).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-1).SumType != "VmStkInt") || (stack.Peek(stack.Len()-2).SumType != "VmStkTinyInt" && stack.Peek(stack.Len()-2).SumType != "VmStkInt") || (stack.Peek(stack.Len()-3).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result RoyaltyParamsResult @@ -9351,7 +9351,7 @@ func Seqno(ctx context.Context, executor Executor, reqAccountID ton.AccountID) ( } func DecodeSeqnoResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkTinyInt" && stack.Peek(0).SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result SeqnoResult @@ -9384,7 +9384,7 @@ func Whoami(ctx context.Context, executor Executor, reqAccountID ton.AccountID) } func DecodeWhoami_BidaskResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { - if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + if stack.Len() != 1 || (stack.Peek(0).SumType != "VmStkSlice") { return "", nil, fmt.Errorf("invalid stack format") } var result Whoami_BidaskResult diff --git a/abi/parser/generator.go b/abi/parser/generator.go index 326c10e4..9dca3753 100644 --- a/abi/parser/generator.go +++ b/abi/parser/generator.go @@ -410,14 +410,15 @@ func buildInputStackValues(r []StackRecord) string { func buildOutputStackCheck(r []StackRecord, isFixed bool) string { var builder strings.Builder + n := len(r) if isFixed { - builder.WriteString(fmt.Sprintf("if len(stack) != %d ", len(r))) + builder.WriteString(fmt.Sprintf("if stack.Len() != %d ", n)) } else { - builder.WriteString(fmt.Sprintf("if len(stack) < %d ", len(r))) + builder.WriteString(fmt.Sprintf("if stack.Len() < %d ", n)) } for i, s := range r { nullableCheck := "" - stackType := fmt.Sprintf("stack[%d].SumType", i) + stackType := fmt.Sprintf("stack.Peek(%d).SumType", n-1-i) if s.Nullable || (s.XMLName.Local == "tuple" && s.List) { nullableCheck = fmt.Sprintf(" && %s != \"VmStkNull\"", stackType) } diff --git a/contract/dns/dns.go b/contract/dns/dns.go index 10d42e74..4d440560 100644 --- a/contract/dns/dns.go +++ b/contract/dns/dns.go @@ -65,14 +65,14 @@ func (d *DNS) Resolve(ctx context.Context, domain string) (map[DNSCategory]tlb.D func (d *DNS) resolve(ctx context.Context, resolver ton.AccountID, dom []byte) (map[DNSCategory]tlb.DNSRecord, error) { n := int64(len(dom)) - stack := tlb.VmStack{} + argStack := tlb.VmStack{} val, err := tlb.TlbStructToVmCellSlice(dom) if err != nil { return nil, err } - stack.Put(val) - stack.Put(tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257{}}) - exitCode, stack, err := d.executor.RunSmcMethodByID(ctx, resolver, 123660, stack) + argStack.Put(val) + argStack.Put(tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257{}}) + exitCode, stack, err := d.executor.RunSmcMethodByID(ctx, resolver, 123660, argStack) if err != nil && strings.Contains(err.Error(), "method execution failed") { return nil, fmt.Errorf("%w: %v", ErrNotResolved, err) } @@ -86,7 +86,7 @@ func (d *DNS) resolve(ctx context.Context, resolver ton.AccountID, dom []byte) ( ResolvedBits int64 Result boc.Cell } - if len(stack) == 2 && stack[0].SumType == "VmStkTinyInt" && stack[0].VmStkTinyInt == 0 && stack[1].SumType == "VmStkNull" { + if stack.Len() == 2 && stack.Peek(1).SumType == "VmStkTinyInt" && stack.Peek(1).VmStkTinyInt == 0 && stack.Peek(0).SumType == "VmStkNull" { return nil, ErrNotResolved } err = stack.Unmarshal(&result) diff --git a/examples/tvm/main.go b/examples/tvm/main.go index b2321c28..6bf2e451 100644 --- a/examples/tvm/main.go +++ b/examples/tvm/main.go @@ -37,7 +37,7 @@ func main() { panic(err) } - code, res, err := emulator.RunSmcMethod(context.Background(), account.ID, "get_nft_address_by_index", tlb.VmStack{val}) + code, res, err := emulator.RunSmcMethod(context.Background(), account.ID, "get_nft_address_by_index", val.ToStack()) if err != nil { panic(err) } @@ -46,11 +46,11 @@ func main() { panic("TVM execution failed") } - if len(res) != 1 || res[0].SumType != "VmStkSlice" { + if res.Len() != 1 || res.Peek(0).SumType != "VmStkSlice" { panic("invalid stack data") } - c := res[0].VmStkSlice.Cell() + c := res.Peek(0).VmStkSlice.Cell() var a tlb.MsgAddress err = tlb.Unmarshal(c, &a) if err != nil { diff --git a/liteapi/client.go b/liteapi/client.go index c6d45b20..2549959e 100644 --- a/liteapi/client.go +++ b/liteapi/client.go @@ -518,7 +518,7 @@ func (c *Client) RunSmcMethodByID(ctx context.Context, accountID ton.AccountID, } var result tlb.VmStack if res.ExitCode == 4294967040 { //-256 - return res.ExitCode, nil, ErrAccountNotFound + return res.ExitCode, tlb.VmStack{}, ErrAccountNotFound } cells, err := boc.DeserializeBoc(res.Result) if err != nil { diff --git a/liteapi/dns.go b/liteapi/dns.go index 92f5c9a6..31b9d32f 100644 --- a/liteapi/dns.go +++ b/liteapi/dns.go @@ -39,15 +39,16 @@ func (c *Client) DnsResolve(ctx context.Context, address ton.AccountID, domain s if errCode != 0 && errCode != 1 { return 0, nil, fmt.Errorf("method execution failed with code: %v", errCode) } - if len(stack) != 2 || - stack[0].SumType != "VmStkTinyInt" || - (stack[1].SumType != "VmStkCell" && stack[1].SumType != "VmStkNull") { + if stack.Len() != 2 || + stack.Peek(1).SumType != "VmStkTinyInt" || + (stack.Peek(0).SumType != "VmStkCell" && stack.Peek(0).SumType != "VmStkNull") { return 0, nil, fmt.Errorf("invalid stack") } - if stack[1].SumType == "VmStkNull" { + if stack.Peek(0).SumType == "VmStkNull" { return 0, nil, nil } - return int(stack[0].VmStkTinyInt), &stack[1].VmStkCell.Value, err + topVal := stack.Peek(0).VmStkCell.Value + return int(stack.Peek(1).VmStkTinyInt), &topVal, err } func (c *Client) GetRootDNS(ctx context.Context) (ton.AccountID, error) { diff --git a/liteapi/jetton.go b/liteapi/jetton.go index 809d117c..8662416f 100644 --- a/liteapi/jetton.go +++ b/liteapi/jetton.go @@ -22,18 +22,18 @@ func (c *Client) GetJettonWallet(ctx context.Context, master, owner ton.AccountI if err != nil { return ton.AccountID{}, err } - errCode, stack, err := c.RunSmcMethod(ctx, master, "get_wallet_address", tlb.VmStack{val}) + errCode, stack, err := c.RunSmcMethod(ctx, master, "get_wallet_address", val.ToStack()) if err != nil { return ton.AccountID{}, err } if errCode != 0 && errCode != 1 { return ton.AccountID{}, fmt.Errorf("method execution failed with code: %v", errCode) } - if len(stack) != 1 || stack[0].SumType != "VmStkSlice" { + if stack.Len() != 1 || stack.Peek(0).SumType != "VmStkSlice" { return ton.AccountID{}, fmt.Errorf("invalid stack") } var res tlb.MsgAddress - err = stack[0].VmStkSlice.UnmarshalToTlbStruct(&res) + err = stack.Peek(0).VmStkSlice.UnmarshalToTlbStruct(&res) if err != nil { return ton.AccountID{}, err } @@ -58,14 +58,15 @@ func (c *Client) GetJettonData(ctx context.Context, master ton.AccountID) (tep64 if errCode != 0 && errCode != 1 { return tep64.Metadata{}, fmt.Errorf("method execution failed with code: %v", errCode) } - if len(stack) != 5 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || - stack[1].SumType != "VmStkTinyInt" || - stack[2].SumType != "VmStkSlice" || - stack[3].SumType != "VmStkCell" || - stack[4].SumType != "VmStkCell" { + if stack.Len() != 5 || (stack.Peek(4).SumType != "VmStkTinyInt" && stack.Peek(4).SumType != "VmStkInt") || + stack.Peek(3).SumType != "VmStkTinyInt" || + stack.Peek(2).SumType != "VmStkSlice" || + stack.Peek(1).SumType != "VmStkCell" || + stack.Peek(0).SumType != "VmStkCell" { return tep64.Metadata{}, fmt.Errorf("invalid stack") } - cell := &stack[3].VmStkCell.Value + elem1 := stack.Peek(1) + cell := &elem1.VmStkCell.Value var content tlb.FullContent err = tlb.Unmarshal(cell, &content) if err != nil { @@ -95,15 +96,16 @@ func (c *Client) GetJettonBalance(ctx context.Context, jettonWallet ton.AccountI if errCode != 0 && errCode != 1 { return nil, fmt.Errorf("method execution failed with code: %v", errCode) } - if len(stack) != 4 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || - stack[1].SumType != "VmStkSlice" || - stack[2].SumType != "VmStkSlice" || - stack[3].SumType != "VmStkCell" { + if stack.Len() != 4 || (stack.Peek(3).SumType != "VmStkTinyInt" && stack.Peek(3).SumType != "VmStkInt") || + stack.Peek(2).SumType != "VmStkSlice" || + stack.Peek(1).SumType != "VmStkSlice" || + stack.Peek(0).SumType != "VmStkCell" { return nil, fmt.Errorf("invalid stack") } - if stack[0].SumType == "VmStkTinyInt" { - return big.NewInt(stack[0].VmStkTinyInt), nil + bottom := stack.Peek(3) + if bottom.SumType == "VmStkTinyInt" { + return big.NewInt(bottom.VmStkTinyInt), nil } - res := big.Int(stack[0].VmStkInt) + res := big.Int(bottom.VmStkInt) return &res, nil } diff --git a/liteapi/wallet.go b/liteapi/wallet.go index 60e53e84..a1f0a9ba 100644 --- a/liteapi/wallet.go +++ b/liteapi/wallet.go @@ -18,8 +18,8 @@ func (c *Client) GetSeqno(ctx context.Context, account ton.AccountID) (uint32, e } else if errCode != 0 && errCode != 1 { return 0, fmt.Errorf("method execution failed with code: %v", errCode) } - if len(stack) != 1 || stack[0].SumType != "VmStkTinyInt" { + if stack.Len() != 1 || stack.Peek(0).SumType != "VmStkTinyInt" { return 0, fmt.Errorf("invalid stack") } - return uint32(stack[0].VmStkTinyInt), nil + return uint32(stack.Peek(0).VmStkTinyInt), nil } diff --git a/tlb/account.go b/tlb/account.go index e329b07f..8c5874fb 100644 --- a/tlb/account.go +++ b/tlb/account.go @@ -11,6 +11,47 @@ type ShardAccount struct { Account Account `tlb:"^"` LastTransHash Bits256 LastTransLt uint64 + + accountCell *boc.Cell +} + +func (s *ShardAccount) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { + ref, err := c.NextRef() + if err != nil { + return err + } + if ref.CellType() == boc.PrunedBranchCell { + s.Account = Account{} + s.accountCell = ref + } else { + s.accountCell = nil + if err := decoder.Unmarshal(ref, &s.Account); err != nil { + return err + } + } + if err := decoder.Unmarshal(c, &s.LastTransHash); err != nil { + return err + } + return decoder.Unmarshal(c, &s.LastTransLt) +} + +func (s ShardAccount) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + ref, err := c.NewRef() + if err != nil { + return err + } + switch { + case s.accountCell != nil && s.Account.SumType == "": + *ref = *cloneCell(s.accountCell) + default: + if err := encoder.Marshal(ref, s.Account); err != nil { + return err + } + } + if err := encoder.Marshal(c, s.LastTransHash); err != nil { + return err + } + return encoder.Marshal(c, s.LastTransLt) } // Account diff --git a/tlb/bintree.go b/tlb/bintree.go index 183f37ab..64972c4d 100644 --- a/tlb/bintree.go +++ b/tlb/bintree.go @@ -43,8 +43,35 @@ func decodeRecursiveBinTree(c *boc.Cell) ([]*boc.Cell, error) { } func (b BinTree[T]) MarshalTLB(c *boc.Cell, encoder *Encoder) error { - // TODO: implement - return fmt.Errorf("BinTree marshaling not implemented") + if len(b.Values) == 0 { + return fmt.Errorf("BinTree must have at least one value") + } + return b.marshalRecursive(c, b.Values, encoder) +} + +func (b BinTree[T]) marshalRecursive(c *boc.Cell, values []T, encoder *Encoder) error { + if len(values) == 1 { + if err := c.WriteBit(false); err != nil { + return err + } + return encoder.Marshal(c, values[0]) + } + if err := c.WriteBit(true); err != nil { + return err + } + mid := len(values) / 2 + l, err := c.NewRef() + if err != nil { + return err + } + if err := b.marshalRecursive(l, values[:mid], encoder); err != nil { + return err + } + r, err := c.NewRef() + if err != nil { + return err + } + return b.marshalRecursive(r, values[mid:], encoder) } func (b *BinTree[T]) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { diff --git a/tlb/block.go b/tlb/block.go index dcf951dc..0eecc220 100644 --- a/tlb/block.go +++ b/tlb/block.go @@ -116,6 +116,57 @@ func (i *BlockInfo) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { return nil } +func (i BlockInfo) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + var header struct { + Magic Magic `tlb:"block_info#9bc7a987"` + BlockInfo BlockInfoPart + } + header.BlockInfo = i.BlockInfoPart + if err := encoder.Marshal(c, header); err != nil { + return err + } + if i.Flags&1 == 1 { + if i.GenSoftware == nil { + return fmt.Errorf("BlockInfo: Flags&1 is set but GenSoftware is nil") + } + if err := encoder.Marshal(c, *i.GenSoftware); err != nil { + return err + } + } + if i.NotMaster { + if i.MasterRef == nil { + return fmt.Errorf("BlockInfo: NotMaster is set but MasterRef is nil") + } + ref, err := c.NewRef() + if err != nil { + return err + } + if err := encoder.Marshal(ref, *i.MasterRef); err != nil { + return err + } + } + ref, err := c.NewRef() + if err != nil { + return err + } + if err := i.PrevRef.MarshalTLB(ref, encoder); err != nil { + return err + } + if i.VertSeqnoIncr { + if i.PrevVertRef == nil { + return fmt.Errorf("BlockInfo: VertSeqnoIncr is set but PrevVertRef is nil") + } + ref, err := c.NewRef() + if err != nil { + return err + } + if err := i.PrevVertRef.MarshalTLB(ref, encoder); err != nil { + return err + } + } + return nil +} + // GlobalVersion // capabilities#c4 version:uint32 capabilities:uint64 = GlobalVersion; type GlobalVersion struct { @@ -193,6 +244,28 @@ func (i *BlkPrevInfo) UnmarshalTLB(c *boc.Cell, isBlks bool, decoder *Decoder) e return nil } +func (i *BlkPrevInfo) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + switch i.SumType { + case "PrevBlkInfo": + return encoder.Marshal(c, i.PrevBlkInfo.Prev) + case "PrevBlksInfo": + c1, err := c.NewRef() + if err != nil { + return err + } + if err := encoder.Marshal(c1, i.PrevBlksInfo.Prev1); err != nil { + return err + } + c2, err := c.NewRef() + if err != nil { + return err + } + return encoder.Marshal(c2, i.PrevBlksInfo.Prev2) + default: + return fmt.Errorf("invalid BlkPrevInfo SumType: %v", i.SumType) + } +} + // Block // block#11ef55aa global_id:int32 // info:^BlockInfo value_flow:^ValueFlow @@ -341,6 +414,73 @@ func (m *ValueFlow) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { return nil } +func (m ValueFlow) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + sumType := uint32(m.Magic) + if sumType != valueFlowV1 && sumType != valueFlowV2 { + return fmt.Errorf("value flow invalid tag: %v", sumType) + } + err := c.WriteUint(uint64(sumType), 32) + if err != nil { + return err + } + firstGroup := boc.NewCell() + err = encoder.Marshal(c, m.FeesCollected) + if err != nil { + return err + } + err = encoder.Marshal(firstGroup, m.FromPrevBlk) + if err != nil { + return err + } + err = encoder.Marshal(firstGroup, m.ToNextBlk) + if err != nil { + return err + } + err = encoder.Marshal(firstGroup, m.Imported) + if err != nil { + return err + } + err = encoder.Marshal(firstGroup, m.Exported) + if err != nil { + return err + } + err = c.AddRef(firstGroup) + if err != nil { + return err + } + if sumType == valueFlowV2 { + if m.Burned == nil { + return fmt.Errorf("ValueFlow V2 must have Burned field set") + } + err = encoder.Marshal(c, *m.Burned) + if err != nil { + return err + } + } + secondGroup := boc.NewCell() + err = encoder.Marshal(secondGroup, m.FeesImported) + if err != nil { + return err + } + err = encoder.Marshal(secondGroup, m.Recovered) + if err != nil { + return err + } + err = encoder.Marshal(secondGroup, m.Created) + if err != nil { + return err + } + err = encoder.Marshal(secondGroup, m.Minted) + if err != nil { + return err + } + err = c.AddRef(secondGroup) + if err != nil { + return err + } + return nil +} + // BlockExtra // block_extra in_msg_descr:^InMsgDescr // out_msg_descr:^OutMsgDescr diff --git a/tlb/block_test.go b/tlb/block_test.go index fce7d730..5951fcf6 100644 --- a/tlb/block_test.go +++ b/tlb/block_test.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path" + "reflect" "sort" "testing" @@ -64,18 +65,15 @@ func Test_tlb_Unmarshal(t *testing.T) { t.Run(tc.name, func(t *testing.T) { inputFilename := path.Join(tc.folder, "block.bin") - data, err := os.ReadFile(inputFilename) + block, err := readBlock(inputFilename) if err != nil { - t.Fatalf("ReadFile() failed: %v", err) + t.Fatalf("readBlock() failed: %v", err) } - cell, err := boc.DeserializeBoc(data) - if err != nil { - t.Fatalf("boc.DeserializeBoc() failed: %v", err) + if tc.folder == "testdata/block-5" && block.Magic == 0 { + t.Fatalf("block magic not set") } - var block Block - err = Unmarshal(cell[0], &block) - if err != nil { - t.Fatalf("Unmarshal() failed: %v", err) + if tc.folder == "testdata/block-5" { + t.Logf("block magic: 0x%x state sumtype: %s", block.Magic, block.StateUpdate.ToRoot.SumType) } accounts := map[string]*AccountBlock{} var txHashes []string @@ -141,6 +139,201 @@ func Test_tlb_Unmarshal(t *testing.T) { } } +func Test_tlb_MarshallingRoundtrip(t *testing.T) { + testCases := []struct { + folder string + }{ + {folder: "testdata/block-1"}, + {folder: "testdata/block-2"}, + {folder: "testdata/block-3"}, + {folder: "testdata/block-4"}, + {folder: "testdata/block-5"}, + {folder: "testdata/block-6"}, + {folder: "testdata/block-7"}, + } + + for _, tc := range testCases { + t.Run(tc.folder, func(t *testing.T) { + inputFilename := path.Join(tc.folder, "block.bin") + block, err := readBlock(inputFilename) + if err != nil { + t.Fatalf("readBlock() failed: %v", err) + } + + cell := boc.NewCell() + err = Marshal(cell, block) + if err != nil { + t.Fatalf("Marshal() failed: %v", err) + } + + bocData, err := cell.ToBoc() + if err != nil { + t.Fatalf("ToBoc() failed: %v", err) + } + cells, err := boc.DeserializeBoc(bocData) + if err != nil { + t.Fatalf("DeserializeBoc() failed: %v", err) + } + var decoded Block + if err := Unmarshal(cells[0], &decoded); err != nil { + dec := NewDecoder().WithDebug() + var dbg Block + cells[0].ResetCounters() + if dbgErr := dec.Unmarshal(cells[0], &dbg); dbgErr != nil { + t.Fatalf("Unmarshal() failed: %v", dbgErr) + } + t.Fatalf("Unmarshal() failed: %v", err) + } + if !blocksEqual(block, &decoded) { + t.Fatalf("block mismatch after marshaling round-trip: %s", describeBlockDiff(block, &decoded)) + } + }) + } +} + +func describeBlockDiff(a, b *Block) string { + switch { + case a.Magic != b.Magic: + return "Magic differs" + case a.GlobalId != b.GlobalId: + return "GlobalId differs" + case !reflect.DeepEqual(a.Info, b.Info): + return "Info differs" + case !reflect.DeepEqual(a.ValueFlow, b.ValueFlow): + return "ValueFlow differs" + case !reflect.DeepEqual(a.StateUpdate, b.StateUpdate): + return describeMerkleUpdateDiff("StateUpdate", a.StateUpdate, b.StateUpdate) + case !reflect.DeepEqual(a.Extra, b.Extra): + return "Extra differs" + default: + return "unknown difference" + } +} + +func describeMerkleUpdateDiff(name string, a, b MerkleUpdate[ShardState]) string { + switch { + case a.Magic != b.Magic: + return fmt.Sprintf("%s magic differs", name) + case a.FromHash != b.FromHash: + return fmt.Sprintf("%s FromHash differs", name) + case a.ToHash != b.ToHash: + return fmt.Sprintf("%s ToHash differs", name) + case a.FromDepth != b.FromDepth: + return fmt.Sprintf("%s FromDepth differs", name) + case a.ToDepth != b.ToDepth: + return fmt.Sprintf("%s ToDepth differs", name) + case !reflect.DeepEqual(a.FromRoot, b.FromRoot): + return describeShardStateDiff(fmt.Sprintf("%s.FromRoot", name), a.FromRoot, b.FromRoot) + case !reflect.DeepEqual(a.ToRoot, b.ToRoot): + return describeShardStateDiff(fmt.Sprintf("%s.ToRoot", name), a.ToRoot, b.ToRoot) + default: + return fmt.Sprintf("%s unknown difference", name) + } +} + +func describeShardStateDiff(name string, a, b ShardState) string { + if a.SumType != b.SumType { + return fmt.Sprintf("%s sum type differs: %s vs %s", name, a.SumType, b.SumType) + } + switch a.SumType { + case "UnsplitState": + return describeShardStateUnsplitDiff(fmt.Sprintf("%s.UnsplitState", name), a.UnsplitState.Value, b.UnsplitState.Value) + case "SplitState": + switch { + case !reflect.DeepEqual(a.SplitState.Left, b.SplitState.Left): + return describeShardStateUnsplitDiff(fmt.Sprintf("%s.SplitState.Left", name), a.SplitState.Left, b.SplitState.Left) + case !reflect.DeepEqual(a.SplitState.Right, b.SplitState.Right): + return describeShardStateUnsplitDiff(fmt.Sprintf("%s.SplitState.Right", name), a.SplitState.Right, b.SplitState.Right) + } + default: + return fmt.Sprintf("%s unknown sum type %s", name, a.SumType) + } + return fmt.Sprintf("%s unknown difference", name) +} + +func describeShardStateUnsplitDiff(name string, a, b ShardStateUnsplit) string { + switch { + case a.Magic != b.Magic: + return fmt.Sprintf("%s magic differs", name) + case a.ShardStateUnsplit.GlobalID != b.ShardStateUnsplit.GlobalID: + return fmt.Sprintf("%s GlobalID differs", name) + case a.ShardStateUnsplit.ShardID != b.ShardStateUnsplit.ShardID: + return fmt.Sprintf("%s ShardID differs", name) + case a.ShardStateUnsplit.SeqNo != b.ShardStateUnsplit.SeqNo: + return fmt.Sprintf("%s SeqNo differs", name) + case a.ShardStateUnsplit.VertSeqNo != b.ShardStateUnsplit.VertSeqNo: + return fmt.Sprintf("%s VertSeqNo differs", name) + case a.ShardStateUnsplit.GenUtime != b.ShardStateUnsplit.GenUtime: + return fmt.Sprintf("%s GenUtime differs", name) + case a.ShardStateUnsplit.GenLt != b.ShardStateUnsplit.GenLt: + return fmt.Sprintf("%s GenLt differs", name) + case a.ShardStateUnsplit.MinRefMcSeqno != b.ShardStateUnsplit.MinRefMcSeqno: + return fmt.Sprintf("%s MinRefMcSeqno differs", name) + case !reflect.DeepEqual(a.ShardStateUnsplit.OutMsgQueueInfo, b.ShardStateUnsplit.OutMsgQueueInfo): + return fmt.Sprintf("%s OutMsgQueueInfo differs", name) + case a.ShardStateUnsplit.BeforeSplit != b.ShardStateUnsplit.BeforeSplit: + return fmt.Sprintf("%s BeforeSplit differs", name) + case !reflect.DeepEqual(a.ShardStateUnsplit.Accounts, b.ShardStateUnsplit.Accounts): + return describeHashmapAugEDiff(fmt.Sprintf("%s.Accounts", name), a.ShardStateUnsplit.Accounts, b.ShardStateUnsplit.Accounts) + case !reflect.DeepEqual(a.ShardStateUnsplit.Other, b.ShardStateUnsplit.Other): + return fmt.Sprintf("%s Other differs", name) + case !reflect.DeepEqual(a.ShardStateUnsplit.Custom, b.ShardStateUnsplit.Custom): + return fmt.Sprintf("%s Custom differs", name) + default: + return fmt.Sprintf("%s unknown difference", name) + } +} + +func describeHashmapAugEDiff[keyT fixedSize, T1, T2 any](name string, a, b HashmapAugE[keyT, T1, T2]) string { + switch { + case len(a.m.keys) != len(b.m.keys): + return fmt.Sprintf("%s key count differs", name) + case !reflect.DeepEqual(a.m.keys, b.m.keys): + return fmt.Sprintf("%s keys differ", name) + case !reflect.DeepEqual(a.m.values, b.m.values): + if len(a.m.values) != len(b.m.values) { + return fmt.Sprintf("%s value count differs: %d vs %d", name, len(a.m.values), len(b.m.values)) + } + for i := range a.m.values { + if !reflect.DeepEqual(a.m.values[i], b.m.values[i]) { + return fmt.Sprintf("%s value at index %d differs: %#v vs %#v", name, i, a.m.values[i], b.m.values[i]) + } + } + return fmt.Sprintf("%s values differ", name) + case !reflect.DeepEqual(a.m.extra, b.m.extra): + return fmt.Sprintf("%s inner extras differ", name) + case !reflect.DeepEqual(a.extra, b.extra): + return fmt.Sprintf("%s extra differs", name) + default: + return fmt.Sprintf("%s unknown difference", name) + } +} + +func blocksEqual(a, b *Block) bool { + aj, err := json.Marshal(a) + if err != nil { + return false + } + bj, err := json.Marshal(b) + if err != nil { + return false + } + return bytes.Equal(aj, bj) +} + +func readBlock(filename string) (*Block, error) { + data, err := os.ReadFile(filename) + if err != nil { + return nil, fmt.Errorf("ReadFile() failed: %v", err) + } + cell, err := boc.DeserializeBoc(data) + if err != nil { + return nil, fmt.Errorf("boc.DeserializeBoc() failed: %v", err) + } + var block Block + return &block, Unmarshal(cell[0], &block) +} + func libraries(s *ShardState) map[string]map[string]struct{} { libs := map[string]map[string]struct{}{} for _, item := range s.UnsplitState.Value.ShardStateUnsplit.Other.Libraries.Items() { @@ -279,18 +472,9 @@ func Test_GetInMsgsMetadata(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { inputFilename := path.Join(tc.folder, "block.bin") - data, err := os.ReadFile(inputFilename) - if err != nil { - t.Fatalf("ReadFile() failed: %v", err) - } - cell, err := boc.DeserializeBoc(data) + block, err := readBlock(inputFilename) if err != nil { - t.Fatalf("boc.DeserializeBoc() failed: %v", err) - } - var block Block - err = Unmarshal(cell[0], &block) - if err != nil { - t.Fatalf("Unmarshal() failed: %v", err) + t.Fatalf("readBlock() failed: %v", err) } inMsgsMetadata, err := block.GetInMsgsMetadata() if err != nil { diff --git a/tlb/decoder.go b/tlb/decoder.go index 09fecf00..15884c99 100644 --- a/tlb/decoder.go +++ b/tlb/decoder.go @@ -3,6 +3,7 @@ package tlb import ( "fmt" "reflect" + "strings" "github.com/tonkeeper/tongo/boc" ) @@ -60,11 +61,19 @@ var bocCellPointerType = reflect.TypeOf(&boc.Cell{}) var bocTlbANyPointerType = reflect.TypeOf(&Any{}) var bitStringType = reflect.TypeOf(boc.BitString{}) -func decode(c *boc.Cell, tag string, val reflect.Value, decoder *Decoder) error { +func decode(c *boc.Cell, tag string, val reflect.Value, decoder *Decoder) (err error) { if decoder.withDebug { - decoder.debugPath = append(decoder.debugPath, fmt.Sprintf("%v#%v", val.Type().Name(), tag)) + typeName := val.Type().String() + decoder.debugPath = append(decoder.debugPath, fmt.Sprintf("%v#%v", typeName, tag)) defer func() { + fullPath := append([]string(nil), decoder.debugPath...) decoder.debugPath = decoder.debugPath[:len(decoder.debugPath)-1] + if err != nil && decoder.withDebug { + path := strings.Join(fullPath, " -> ") + if path != "" { + err = fmt.Errorf("%w (path: %s)", err, path) + } + } }() } if c.IsLibrary() { diff --git a/tlb/encoder.go b/tlb/encoder.go index 0cd338e7..0203e036 100644 --- a/tlb/encoder.go +++ b/tlb/encoder.go @@ -110,8 +110,9 @@ func encode(c *boc.Cell, tag string, o any, encoder *Encoder) error { return encodeStruct(c, o, encoder) } case reflect.Pointer: - if val.IsNil() && !t.IsOptional { - return fmt.Errorf("can't encode empty pointer %v if tlb scheme is not optional", val.Type()) + if val.IsNil() { + zeroVal := reflect.New(val.Type().Elem()) + return encode(c, tag, zeroVal.Elem().Interface(), encoder) } return encode(c, tag, val.Elem().Interface(), encoder) case reflect.Array: @@ -146,9 +147,12 @@ func encodeStruct(c *boc.Cell, o any, encoder *Encoder) error { func encodeBasicStruct(c *boc.Cell, o any, encoder *Encoder) error { val := reflect.ValueOf(o) for i := 0; i < val.NumField(); i++ { + if !val.Type().Field(i).IsExported() { + continue + } tag := val.Type().Field(i).Tag.Get("tlb") if err := encode(c, tag, val.Field(i).Interface(), encoder); err != nil { - return err + return fmt.Errorf("field %v.%v: %w", val.Type().Name(), val.Type().Field(i).Name, err) } } return nil @@ -159,6 +163,20 @@ func encodeSumType(c *boc.Cell, o any, encoder *Encoder) error { name := val.FieldByName("SumType").String() if name == "" { + // Default to the first non-SumType field (zero variant) + for i := 0; i < val.NumField(); i++ { + if val.Field(i).Type().Name() == "SumType" { + continue + } + tag := val.Type().Field(i).Tag.Get("tlbSumType") + if err := encodeSumTag(c, tag); err != nil { + return err + } + if err := encode(c, "", val.Field(i).Interface(), encoder); err != nil { + return err + } + return nil + } return fmt.Errorf("empty SumType value") } diff --git a/tlb/encoder_test.go b/tlb/encoder_test.go index 43ede527..b8b68c74 100644 --- a/tlb/encoder_test.go +++ b/tlb/encoder_test.go @@ -86,10 +86,8 @@ func TestEnum(t *testing.T) { } func TestEnumFail(t *testing.T) { + // Empty SumType defaults to first variant, so only invalid SumType should fail var cases = []testSumType{ - { - B: testCase{4, 6}, - }, { SumType: "C", B: testCase{4, 6}, @@ -104,6 +102,18 @@ func TestEnumFail(t *testing.T) { } } +func TestEnumEmptySumType(t *testing.T) { + // Empty SumType should default to the first variant + enum := testSumType{ + B: testCase{4, 6}, + } + b1 := boc.NewCell() + err := Marshal(b1, enum) + if err != nil { + t.Fatalf("empty SumType should default to first variant: %v", err) + } +} + func TestRef(t *testing.T) { type A struct { A uint8 diff --git a/tlb/hashmap.go b/tlb/hashmap.go index e26b605e..d1a62119 100644 --- a/tlb/hashmap.go +++ b/tlb/hashmap.go @@ -6,6 +6,7 @@ import ( "fmt" "math" "slices" + "sort" "strconv" "strings" @@ -27,6 +28,7 @@ type HashmapItem[keyT fixedSize, T any] struct { type Hashmap[keyT fixedSize, T any] struct { keys []keyT values []T + raw *boc.Cell } // NewHashmap returns a new instance of Hashmap. @@ -39,13 +41,19 @@ func NewHashmap[keyT fixedSize, T any](keys []keyT, values []T) Hashmap[keyT, T] } func (h Hashmap[keyT, T]) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + if h.raw != nil { + *c = *cloneCell(h.raw) + return nil + } // Marshal empty Hashmap if len(h.values) == 0 || h.values == nil { return nil } + order := sortedIndices(h.keys) var s keyT keys := make([]boc.BitString, 0, len(h.keys)) - for _, k := range h.keys { + for _, idx := range order { + k := h.keys[idx] cell := boc.NewCell() err := Marshal(cell, k) if err != nil { @@ -53,7 +61,11 @@ func (h Hashmap[keyT, T]) MarshalTLB(c *boc.Cell, encoder *Encoder) error { } keys = append(keys, cell.RawBitString()) } - err := h.encodeMap(c, keys, h.values, s.FixedSize()) + values := make([]T, len(h.values)) + for i, idx := range order { + values[i] = h.values[idx] + } + err := h.encodeMap(c, keys, values, s.FixedSize()) if err != nil { return err } @@ -116,6 +128,7 @@ func (h Hashmap[keyT, T]) encodeMap(c *boc.Cell, keys []boc.BitString, values [] } func (h *Hashmap[keyT, T]) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { + h.raw = cloneCell(c) var s keyT keySize := s.FixedSize() keyPrefix := boc.NewBitString(keySize) @@ -515,6 +528,7 @@ type HashmapAug[keyT fixedSize, T1, T2 any] struct { keys []keyT values []T1 extra HashMapAugExtraList[T2] + raw *boc.Cell } type HashMapAugExtraList[T any] struct { @@ -524,10 +538,111 @@ type HashMapAugExtraList[T any] struct { } func (h HashmapAug[keyT, T1, T2]) MarshalTLB(c *boc.Cell, encoder *Encoder) error { - return fmt.Errorf("not implemented") + if h.raw != nil { + *c = *cloneCell(h.raw) + return nil + } + if len(h.values) == 0 || h.values == nil { + return nil + } + order := sortedIndices(h.keys) + var s keyT + keys := make([]boc.BitString, 0, len(h.keys)) + for _, idx := range order { + k := h.keys[idx] + cell := boc.NewCell() + err := Marshal(cell, k) + if err != nil { + return err + } + keys = append(keys, cell.RawBitString()) + } + values := make([]T1, len(h.values)) + for i, idx := range order { + values[i] = h.values[idx] + } + return h.encodeMapAug(c, keys, values, s.FixedSize(), &h.extra) +} + +func (h HashmapAug[keyT, T1, T2]) encodeMapAug(c *boc.Cell, keys []boc.BitString, values []T1, keySize int, extras *HashMapAugExtraList[T2]) error { + if len(keys) == 0 || len(values) == 0 { + return fmt.Errorf("keys or values are empty") + } + extras = ensureExtras(extras) + label, err := encodeLabel(c, &keys[0], &keys[len(keys)-1], keySize) + if err != nil { + return err + } + keySize = keySize - label.BitsAvailableForRead() - 1 + if len(keys) > 1 { + var leftKeys, rightKeys []boc.BitString + var leftValues, rightValues []T1 + for i := range keys { + _, err := keys[i].ReadBits(label.BitsAvailableForRead()) + if err != nil { + return err + } + isRight, err := keys[i].ReadBit() + if err != nil { + return err + } + if isRight { + rightKeys = append(rightKeys, keys[i].ReadRemainingBits()) + rightValues = append(rightValues, values[i]) + } else { + leftKeys = append(leftKeys, keys[i].ReadRemainingBits()) + leftValues = append(leftValues, values[i]) + } + } + l, err := c.NewRef() + if err != nil { + return err + } + err = h.encodeMapAug(l, leftKeys, leftValues, keySize, extras.Left) + if err != nil { + return err + } + r, err := c.NewRef() + if err != nil { + return err + } + err = h.encodeMapAug(r, rightKeys, rightValues, keySize, extras.Right) + if err != nil { + return err + } + return Marshal(c, extras.Data) + } + err = Marshal(c, extras.Data) + if err != nil { + return err + } + return Marshal(c, values[0]) +} + +func ensureExtras[T any](extras *HashMapAugExtraList[T]) *HashMapAugExtraList[T] { + if extras == nil { + return &HashMapAugExtraList[T]{} + } + return extras +} + +func sortedIndices[keyT fixedSize](keys []keyT) []int { + order := make([]int, len(keys)) + for i := range order { + order[i] = i + } + sort.Slice(order, func(i, j int) bool { + cmp, ok := keys[order[i]].Compare(keys[order[j]]) + if !ok { + return false + } + return cmp < 0 + }) + return order } func (h *HashmapAug[keyT, T1, T2]) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { + h.raw = cloneCell(c) var t keyT keySize := t.FixedSize() keyPrefix := boc.NewBitString(keySize) diff --git a/tlb/helpers.go b/tlb/helpers.go new file mode 100644 index 00000000..95db66d9 --- /dev/null +++ b/tlb/helpers.go @@ -0,0 +1,18 @@ +package tlb + +import "github.com/tonkeeper/tongo/boc" + +func cloneCell(c *boc.Cell) *boc.Cell { + if c == nil { + return nil + } + data, err := c.ToBoc() + if err != nil { + panic(err) + } + cloned, err := boc.DeserializeBoc(data) + if err != nil || len(cloned) == 0 { + panic(err) + } + return cloned[0] +} diff --git a/tlb/messages.go b/tlb/messages.go index ed32d16f..6e44b75e 100644 --- a/tlb/messages.go +++ b/tlb/messages.go @@ -271,7 +271,7 @@ func (a *MsgAddress) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { func (a MsgAddress) MarshalTLB(c *boc.Cell, encoder *Encoder) error { switch a.SumType { - case "AddrNone": + case "AddrNone", "": return c.WriteUint(0, 2) case "AddrExtern": err := c.WriteUint(1, 2) diff --git a/tlb/primitives.go b/tlb/primitives.go index 7a5c5db6..be820ff5 100644 --- a/tlb/primitives.go +++ b/tlb/primitives.go @@ -94,6 +94,9 @@ func (m *Magic) UnmarshalJSON(b []byte) error { } func (m Magic) EncodeTag(c *boc.Cell, tag string) error { + if tag == "" { + return c.WriteUint(uint64(m), 32) + } return encodeSumTag(c, tag) } diff --git a/tlb/proof.go b/tlb/proof.go index 554c0ee7..4bc5c598 100644 --- a/tlb/proof.go +++ b/tlb/proof.go @@ -73,6 +73,9 @@ type ShardState struct { // only manual decoding Left ShardStateUnsplit `tlb:"^"` // ^ but decodes manually Right ShardStateUnsplit `tlb:"^"` // ^ but decodes manually } `tlbSumType:"split_state#5f327da5"` + + leftCell *boc.Cell + rightCell *boc.Cell } func (s *ShardState) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { @@ -91,8 +94,10 @@ func (s *ShardState) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { if err != nil { return err } + s.leftCell = nil } else { s.SplitState.Left = ShardStateUnsplit{} + s.leftCell = c1 } c1, err = c.NextRef() if err != nil { @@ -102,8 +107,10 @@ func (s *ShardState) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { if err := decoder.Unmarshal(c1, &s.SplitState.Right); err != nil { return err } + s.rightCell = nil } else { s.SplitState.Right = ShardStateUnsplit{} + s.rightCell = c1 } s.SumType = "SplitState" break @@ -122,6 +129,42 @@ func (s *ShardState) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { return nil } +func (m ShardState) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + switch m.SumType { + case "SplitState": + if err := c.WriteUint(0x5f327da5, 32); err != nil { + return err + } + c1, err := c.NewRef() + if err != nil { + return err + } + if m.leftCell != nil && m.SplitState.Left.Magic == 0 { + *c1 = *cloneCell(m.leftCell) + } else { + if err := encoder.Marshal(c1, m.SplitState.Left); err != nil { + return err + } + } + c2, err := c.NewRef() + if err != nil { + return err + } + if m.rightCell != nil && m.SplitState.Right.Magic == 0 { + *c2 = *cloneCell(m.rightCell) + } else { + if err := encoder.Marshal(c2, m.SplitState.Right); err != nil { + return err + } + } + return nil + case "UnsplitState": + return encoder.Marshal(c, m.UnsplitState.Value) + default: + return fmt.Errorf("invalid tag") + } +} + func (s *ShardState) AccountBalances() map[Bits256]CurrencyCollection { switch s.SumType { case "UnsplitState": @@ -333,6 +376,35 @@ type McStateExtra struct { type ConfigParams struct { ConfigAddr Bits256 Config Hashmap[Uint32, Ref[boc.Cell]] `tlb:"^"` + + configCell *boc.Cell +} + +func (p *ConfigParams) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { + if err := decoder.Unmarshal(c, &p.ConfigAddr); err != nil { + return err + } + ref, err := c.NextRef() + if err != nil { + return err + } + p.configCell = cloneCell(ref) + return decoder.Unmarshal(ref, &p.Config) +} + +func (p ConfigParams) MarshalTLB(c *boc.Cell, encoder *Encoder) error { + if err := encoder.Marshal(c, p.ConfigAddr); err != nil { + return err + } + ref, err := c.NewRef() + if err != nil { + return err + } + if p.configCell != nil { + *ref = *cloneCell(p.configCell) + return nil + } + return encoder.Marshal(ref, p.Config) } // CloneKeepingSubsetOfKeys returns a new ConfigParams with only the keys specified in the keys parameter. diff --git a/tlb/stack.go b/tlb/stack.go index 86987952..253f5089 100644 --- a/tlb/stack.go +++ b/tlb/stack.go @@ -15,7 +15,25 @@ import ( // vm_stack#_ depth:(## 24) stack:(VmStackList depth) = VmStack; // vm_stk_cons#_ {n:#} rest:^(VmStackList n) tos:VmStackValue = VmStackList (n + 1); // vm_stk_nil#_ = VmStackList 0; -type VmStack []VmStackValue +type VmStack struct { + values []VmStackValue // last element is top of the stack +} + +// Len returns the size of the stack +func (s VmStack) Len() int { + return len(s.values) +} + +// Peek returns the top element from the stack (if i == 0) without popping it out +// peeking empty stack will panic as out of range +func (s VmStack) Peek(i int) VmStackValue { + return s.values[len(s.values)-i-1] +} + +// Put puts the value on top of the stack +func (s *VmStack) Put(val VmStackValue) { + s.values = append(s.values, val) +} // VmCont // _ cregs:(HashmapE 4 VmStackValue) = VmSaveList; @@ -61,8 +79,74 @@ type VmTupleRef struct { } func (t VmStkTuple) MarshalTLB(c *boc.Cell, encoder *Encoder) error { - // TODO: implement - return fmt.Errorf("VmStkTuple TLB marshaling not implemented") + if err := c.WriteUint(uint64(t.Len), 16); err != nil { + return err + } + if t.Len == 0 { + if t.Data != nil { + return fmt.Errorf("tuple data must be nil when len is 0") + } + return nil + } + if t.Data == nil { + return fmt.Errorf("tuple data is nil for len %d", t.Len) + } + return marshalVmTuple(c, t.Len, t.Data, encoder) +} + +func marshalVmTuple(c *boc.Cell, length uint16, tuple *VmTuple, encoder *Encoder) error { + if length == 0 { + if tuple != nil { + return fmt.Errorf("unexpected tuple payload for len 0") + } + return nil + } + if tuple == nil { + return fmt.Errorf("tuple is nil for len %d", length) + } + n := length - 1 + if err := marshalVmTupleRef(c, n, &tuple.Head, encoder); err != nil { + return err + } + if n == 0 { + return nil + } + if tuple.Tail.SumType == "" { + return fmt.Errorf("tuple tail is empty for len %d", length) + } + ref, err := c.NewRef() + if err != nil { + return err + } + return encoder.Marshal(ref, tuple.Tail) +} + +func marshalVmTupleRef(c *boc.Cell, n uint16, ref *VmTupleRef, encoder *Encoder) error { + if ref == nil { + return fmt.Errorf("tuple ref is nil") + } + switch { + case n == 0 || n == 1: + if ref.Entry == nil { + return fmt.Errorf("tuple ref entry is nil for n=%d", n) + } + entryCell, err := c.NewRef() + if err != nil { + return err + } + return encoder.Marshal(entryCell, ref.Entry) + case n > 1: + if ref.Ref == nil { + return fmt.Errorf("tuple ref child is nil for n=%d", n) + } + childCell, err := c.NewRef() + if err != nil { + return err + } + return marshalVmTuple(childCell, n, ref.Ref, encoder) + default: + return fmt.Errorf("unsupported tuple ref size n=%d", n) + } } func (t *VmStkTuple) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { @@ -170,13 +254,17 @@ type VmStackValue struct { VmStkTuple VmStkTuple `tlbSumType:"vm_stk_tuple#07"` } +func (v VmStackValue) ToStack() VmStack { + return VmStack{values: []VmStackValue{v}} +} + func (s VmStack) MarshalTLB(c *boc.Cell, encoder *Encoder) error { - depth := uint64(len(s)) + depth := uint64(len(s.values)) err := c.WriteUint(depth, 24) if err != nil { return err } - err = putStackListItems(c, s) + err = putStackListItems(c, s.values) return err } @@ -192,7 +280,7 @@ func (s *VmStack) UnmarshalTLB(c *boc.Cell, decoder *Decoder) error { if err != nil { return err } - *s = list + s.values = list return nil } @@ -222,11 +310,12 @@ func getStackListItems(c *boc.Cell, depth uint64, decoder *Decoder) ([]VmStackVa } func putStackListItems(c *boc.Cell, list []VmStackValue) error { - if len(list) == 0 { + llen := len(list) + if llen == 0 { return nil } restCell := boc.NewCell() - err := putStackListItems(restCell, list[1:]) + err := putStackListItems(restCell, list[:llen-1]) // llen 1 -> list[0:0] if err != nil { return err } @@ -234,7 +323,7 @@ func putStackListItems(c *boc.Cell, list []VmStackValue) error { if err != nil { return err } - err = Marshal(c, list[0]) + err = Marshal(c, list[llen-1]) // llen 1 -> list[0] return err } @@ -267,10 +356,6 @@ func (s *VmStack) UnmarshalTL(r io.Reader) error { return Unmarshal(cell[0], s) } -func (s *VmStack) Put(val VmStackValue) { - *s = append(VmStack{val}, *s...) -} - func (s VmCellSlice) MarshalTLB(c *boc.Cell, encoder *Encoder) error { if s.stBits > s.endBits { return fmt.Errorf("invalid StBits and EndBits for CellSlice") @@ -617,12 +702,12 @@ func (s VmStack) Unmarshal(dest any) error { if val.Kind() != reflect.Pointer { return fmt.Errorf("value should be a pointer") } - if val.Elem().Type().NumField() > len(s) { + if val.Elem().Type().NumField() > len(s.values) { return fmt.Errorf("not enough values in stack") } for i := 0; i < val.Elem().Type().NumField(); i++ { fieldType := val.Elem().Field(i).Type() - if s[i].SumType == "VmStkNull" { + if s.values[i].SumType == "VmStkNull" { kind := fieldType.Kind() if kind == reflect.Pointer || kind == reflect.Slice { continue @@ -630,7 +715,7 @@ func (s VmStack) Unmarshal(dest any) error { return errors.New("can't unmarshal null") } value := reflect.New(fieldType) - if err := s[i].Unmarshal(value.Interface()); err != nil { + if err := s.values[i].Unmarshal(value.Interface()); err != nil { return err } val.Elem().Field(i).Set(value.Elem()) diff --git a/tlb/stack_test.go b/tlb/stack_test.go index 7cc9c068..1416ff5e 100644 --- a/tlb/stack_test.go +++ b/tlb/stack_test.go @@ -175,7 +175,7 @@ func Test_IntMatrixTupleUnmarshal(t *testing.T) { if err != nil { t.Fatal(err) } - val := stack[0] + val := stack.Peek(0) if val.SumType != "VmStkTuple" { t.Errorf("Stack value must be tuple, got %v", val.SumType) } diff --git a/tlb/testdata/block-8/block.bin b/tlb/testdata/block-8/block.bin new file mode 100644 index 00000000..349bcfc8 Binary files /dev/null and b/tlb/testdata/block-8/block.bin differ diff --git a/tlb/tuples_test.go b/tlb/tuples_test.go index 56b20e1e..a0934aa2 100644 --- a/tlb/tuples_test.go +++ b/tlb/tuples_test.go @@ -35,7 +35,8 @@ func TestTuple(t *testing.T) { PendingAmount Grams Requested bool } - err = stack[0].VmStkTuple.Unmarshal(&items) + top := stack.Peek(0) + err = top.VmStkTuple.Unmarshal(&items) if err != nil { panic(err) } @@ -87,7 +88,8 @@ func TestTuple2(t *testing.T) { Workchain int32 Address Bits256 } - err = stack[0].VmStkTuple.Unmarshal(&plugins) + top := stack.Peek(0) + err = top.VmStkTuple.Unmarshal(&plugins) if err != nil { t.Fatal(err) } diff --git a/tvm/precompiled/jettons.go b/tvm/precompiled/jettons.go index bb47d53e..3fbe2b47 100644 --- a/tvm/precompiled/jettons.go +++ b/tvm/precompiled/jettons.go @@ -16,42 +16,44 @@ func jettonV1getWalletData(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error } err := tlb.Unmarshal(data, &body) if err != nil { - return nil, err + return tlb.VmStack{}, err } - var result = make([]tlb.VmStackValue, 4) var b = big.Int(body.Amount) - if b.IsInt64() { - result[0] = tlb.VmStackValue{ - SumType: "VmStkTinyInt", - VmStkTinyInt: b.Int64(), - } - } else { - result[0] = tlb.VmStackValue{ - SumType: "VmStkInt", - VmStkInt: tlb.Int257(b), - } - } ownerCell := boc.NewCell() masterCell := boc.NewCell() err = tlb.Marshal(ownerCell, body.Owner) if err != nil { - return nil, err + return tlb.VmStack{}, err } err = tlb.Marshal(masterCell, body.Master) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[1], err = tlb.CellToVmCellSlice(ownerCell) + ownerSlice, err := tlb.CellToVmCellSlice(ownerCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[2], err = tlb.CellToVmCellSlice(masterCell) + masterSlice, err := tlb.CellToVmCellSlice(masterCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[3] = tlb.VmStackValue{ + var result tlb.VmStack + result.Put(tlb.VmStackValue{ SumType: "VmStkCell", VmStkCell: tlb.Ref[boc.Cell]{Value: body.Code}, + }) + result.Put(masterSlice) + result.Put(ownerSlice) + if b.IsInt64() { + result.Put(tlb.VmStackValue{ + SumType: "VmStkTinyInt", + VmStkTinyInt: b.Int64(), + }) + } else { + result.Put(tlb.VmStackValue{ + SumType: "VmStkInt", + VmStkInt: tlb.Int257(b), + }) } return result, nil } @@ -69,43 +71,45 @@ func jettonV2getWalletData(code string) func(data *boc.Cell, args tlb.VmStack) ( } err := tlb.Unmarshal(data, &body) if err != nil { - return nil, err + return tlb.VmStack{}, err } - var result = make([]tlb.VmStackValue, 4) var b = big.Int(body.Amount) - if b.IsInt64() { - result[0] = tlb.VmStackValue{ - SumType: "VmStkTinyInt", - VmStkTinyInt: b.Int64(), - } - } else { - result[0] = tlb.VmStackValue{ - SumType: "VmStkInt", - VmStkInt: tlb.Int257(b), - } - } ownerCell := boc.NewCell() masterCell := boc.NewCell() err = tlb.Marshal(ownerCell, body.Owner) if err != nil { - return nil, err + return tlb.VmStack{}, err } err = tlb.Marshal(masterCell, body.Master) if err != nil { - return nil, err + return tlb.VmStack{}, err } codeCell, _ := boc.DeserializeSinglRootBase64(code) - result[1], err = tlb.CellToVmCellSlice(ownerCell) + ownerSlice, err := tlb.CellToVmCellSlice(ownerCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[2], err = tlb.CellToVmCellSlice(masterCell) + masterSlice, err := tlb.CellToVmCellSlice(masterCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[3] = tlb.VmStackValue{ + var result tlb.VmStack + result.Put(tlb.VmStackValue{ SumType: "VmStkCell", VmStkCell: tlb.Ref[boc.Cell]{Value: *codeCell}, + }) + result.Put(masterSlice) + result.Put(ownerSlice) + if b.IsInt64() { + result.Put(tlb.VmStackValue{ + SumType: "VmStkTinyInt", + VmStkTinyInt: b.Int64(), + }) + } else { + result.Put(tlb.VmStackValue{ + SumType: "VmStkInt", + VmStkInt: tlb.Int257(b), + }) } return result, nil } @@ -130,43 +134,45 @@ func jettonV3getWalletData(code string) func(data *boc.Cell, args tlb.VmStack) ( } err := tlb.Unmarshal(data, &body) if err != nil { - return nil, err + return tlb.VmStack{}, err } - var result = make([]tlb.VmStackValue, 4) var b = big.Int(body.Amount) - if b.IsInt64() { - result[0] = tlb.VmStackValue{ - SumType: "VmStkTinyInt", - VmStkTinyInt: b.Int64(), - } - } else { - result[0] = tlb.VmStackValue{ - SumType: "VmStkInt", - VmStkInt: tlb.Int257(b), - } - } ownerCell := boc.NewCell() masterCell := boc.NewCell() err = tlb.Marshal(ownerCell, body.Owner) if err != nil { - return nil, err + return tlb.VmStack{}, err } err = tlb.Marshal(masterCell, body.Master) if err != nil { - return nil, err + return tlb.VmStack{}, err } codeCell, _ := boc.DeserializeSinglRootBase64(code) - result[1], err = tlb.CellToVmCellSlice(ownerCell) + ownerSlice, err := tlb.CellToVmCellSlice(ownerCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[2], err = tlb.CellToVmCellSlice(masterCell) + masterSlice, err := tlb.CellToVmCellSlice(masterCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[3] = tlb.VmStackValue{ + var result tlb.VmStack + result.Put(tlb.VmStackValue{ SumType: "VmStkCell", VmStkCell: tlb.Ref[boc.Cell]{Value: *codeCell}, + }) + result.Put(masterSlice) + result.Put(ownerSlice) + if b.IsInt64() { + result.Put(tlb.VmStackValue{ + SumType: "VmStkTinyInt", + VmStkTinyInt: b.Int64(), + }) + } else { + result.Put(tlb.VmStackValue{ + SumType: "VmStkInt", + VmStkInt: tlb.Int257(b), + }) } return result, nil } @@ -181,12 +187,10 @@ func isClaimed(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { } err := tlb.Unmarshal(data, &body) if err != nil { - return nil, err + return tlb.VmStack{}, err } - var result = make([]tlb.VmStackValue, 1) - result[0] = tlb.VmStackValue{ + return tlb.VmStackValue{ SumType: "VmStkTinyInt", VmStkTinyInt: int64(body.Status), - } - return result, nil + }.ToStack(), nil } diff --git a/tvm/precompiled/mining.go b/tvm/precompiled/mining.go index ec83be91..01104bd6 100644 --- a/tvm/precompiled/mining.go +++ b/tvm/precompiled/mining.go @@ -18,24 +18,12 @@ var getPowParamsGram = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, erro } err := tlb.Unmarshal(data, &body) if err != nil { - return nil, err + return tlb.VmStack{}, err } - return tlb.VmStack{ - { - SumType: "VmStkInt", - VmStkInt: tlb.Int257(body.Value1), - }, - { - SumType: "VmStkInt", - VmStkInt: tlb.Int257(body.Value2), - }, - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(body.Field1.Value3), - }, - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(body.Field1.Value4), - }, - }, nil + var result tlb.VmStack + result.Put(tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(body.Field1.Value4)}) + result.Put(tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(body.Field1.Value3)}) + result.Put(tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257(body.Value2)}) + result.Put(tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257(body.Value1)}) + return result, nil } diff --git a/tvm/precompiled/nft.go b/tvm/precompiled/nft.go index d34a26ee..6409e9bb 100644 --- a/tvm/precompiled/nft.go +++ b/tvm/precompiled/nft.go @@ -1,9 +1,10 @@ package precompiled import ( + "math/big" + "github.com/tonkeeper/tongo/boc" "github.com/tonkeeper/tongo/tlb" - "math/big" ) func nftV1getNftData(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -17,51 +18,64 @@ func nftV1getNftData(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { } err := tlb.Unmarshal(data, &body) if err != nil { - return nil, err + return tlb.VmStack{}, err } - var result = make([]tlb.VmStackValue, 5) - result[0].SumType = "VmStkTinyInt" + + // result[1] - index value + var indexVal tlb.VmStackValue if int64(body.Index) < 0 { var b big.Int b.SetUint64(body.Index) - result[1].SumType = "VmStkInt" - result[1].VmStkInt = tlb.Int257(b) + indexVal.SumType = "VmStkInt" + indexVal.VmStkInt = tlb.Int257(b) } else { - result[1].SumType = "VmStkTinyInt" - result[1].VmStkTinyInt = int64(body.Index) + indexVal.SumType = "VmStkTinyInt" + indexVal.VmStkTinyInt = int64(body.Index) } + + // result[2] - collection slice collectionCells := boc.NewCell() err = tlb.Marshal(collectionCells, body.Collection) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[2], err = tlb.CellToVmCellSlice(collectionCells) + collectionSlice, err := tlb.CellToVmCellSlice(collectionCells) if err != nil { - return nil, err + return tlb.VmStack{}, err } + + // result[0], result[3], result[4] - init flag, owner, data (conditional) + var initVal, ownerVal, dataVal tlb.VmStackValue if data.BitsAvailableForRead() > 0 { err = tlb.Unmarshal(data, &body2) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[0].VmStkTinyInt = -1 + initVal = tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: -1} ownerCell := boc.NewCell() err = tlb.Marshal(ownerCell, body2.Owner) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[3], err = tlb.CellToVmCellSlice(ownerCell) + ownerVal, err = tlb.CellToVmCellSlice(ownerCell) if err != nil { - return nil, err + return tlb.VmStack{}, err } - result[4] = tlb.VmStackValue{ + dataVal = tlb.VmStackValue{ SumType: "VmStkCell", VmStkCell: tlb.Ref[boc.Cell]{Value: body2.Data}, } } else { - result[0].VmStkTinyInt = 0 - result[3].SumType = "VmStkNull" - result[4].SumType = "VmStkNull" + initVal = tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: 0} + ownerVal = tlb.VmStackValue{SumType: "VmStkNull"} + dataVal = tlb.VmStackValue{SumType: "VmStkNull"} } + + var result tlb.VmStack + result.Put(dataVal) + result.Put(ownerVal) + result.Put(collectionSlice) + result.Put(indexVal) + result.Put(initVal) return result, nil } diff --git a/tvm/precompiled/precompiled_test.go b/tvm/precompiled/precompiled_test.go index 471322e1..24007872 100644 --- a/tvm/precompiled/precompiled_test.go +++ b/tvm/precompiled/precompiled_test.go @@ -119,7 +119,7 @@ func TestPrecompiles(t *testing.T) { method: 97026, account: "EQAAseW6AC4wiEWzSxusVP80xM6yYahYRvKEhKmikXBDjYWN", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetWalletDataResult @@ -142,7 +142,7 @@ func TestPrecompiles(t *testing.T) { method: 97026, account: "EQC0ZCVsOCGda8Qufyqn0WLUBFdP0vl5w09MO8JYCYVn6CjE", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetWalletDataResult @@ -166,7 +166,7 @@ func TestPrecompiles(t *testing.T) { method: 97026, account: "EQCJgWrPFPqHhJHTu0ISbIaZuc3OkQH8p7ePnmAtsIjpl3rP", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetWalletDataResult @@ -190,7 +190,7 @@ func TestPrecompiles(t *testing.T) { method: 97026, account: "kQDDNHHLAWzRDIci7_jD1An79w80ER5SzueZHmusWgJs_fG2", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetWalletDataResult @@ -214,7 +214,7 @@ func TestPrecompiles(t *testing.T) { method: 97026, account: "EQDrV3Vex_zbgvZXV0hCYTYwi3ui9yFtFJl0J4GhONs6XHiH", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetWalletDataResult @@ -238,7 +238,7 @@ func TestPrecompiles(t *testing.T) { method: 97026, account: "EQCR50nICun4QUzzXcOhrWyY1jsRNWwJm0mBHMtqlOcMSEAn", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetWalletDataResult @@ -262,7 +262,7 @@ func TestPrecompiles(t *testing.T) { method: 122284, account: "EQCR50nICun4QUzzXcOhrWyY1jsRNWwJm0mBHMtqlOcMSEAn", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } if !reflect.DeepEqual(stack1, stack2) { @@ -278,7 +278,7 @@ func TestPrecompiles(t *testing.T) { method: 102351, account: "EQBp_P5ZgufdVhOgW5Z81ckgXL2P6YEX_m_fJtsmclLH8tB7", compareFunc: func(stack1, stack2 tlb.VmStack) error { - if len(stack2) != len(stack1) { + if stack2.Len() != stack1.Len() { return fmt.Errorf("stack length mismatch") } var a, b abi.GetNftDataResult @@ -324,7 +324,7 @@ func TestPrecompiles(t *testing.T) { if err != nil { t.Fatal(err) } - exitCode, tvmStack, err := e.RunSmcMethodByID(context.Background(), ton.MustParseAccountID(c.account), c.method, nil) + exitCode, tvmStack, err := e.RunSmcMethodByID(context.Background(), ton.MustParseAccountID(c.account), c.method, tlb.VmStack{}) if exitCode != 0 { t.Fatal("exit code is not 0", exitCode) } diff --git a/tvm/precompiled/wallets.go b/tvm/precompiled/wallets.go index 452a866f..0244c5a9 100644 --- a/tvm/precompiled/wallets.go +++ b/tvm/precompiled/wallets.go @@ -16,14 +16,9 @@ func walletv3seqno(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { } err := tlb.Unmarshal(data, &dataV3) if err != nil { - return nil, err - } - return tlb.VmStack{ - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(dataV3.Seqno), - }, - }, nil + return tlb.VmStack{}, err + } + return tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(dataV3.Seqno)}.ToStack(), nil } var walletv3r2publicKey = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -34,16 +29,11 @@ var walletv3r2publicKey = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, e } err := tlb.Unmarshal(data, &dataV3) if err != nil { - return nil, err + return tlb.VmStack{}, err } var b big.Int b.SetBytes(dataV3.PublicKey[:]) - return tlb.VmStack{ - { - SumType: "VmStkInt", - VmStkInt: tlb.Int257(b), - }, - }, nil + return tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257(b)}.ToStack(), nil } var walletv4r2seqno = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -54,14 +44,9 @@ var walletv4r2seqno = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error } err := tlb.Unmarshal(data, &dataV4) if err != nil { - return nil, err - } - return tlb.VmStack{ - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(dataV4.Seqno), - }, - }, nil + return tlb.VmStack{}, err + } + return tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(dataV4.Seqno)}.ToStack(), nil } var walletv4r2SubwalletID = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -72,14 +57,9 @@ var walletv4r2SubwalletID = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, } err := tlb.Unmarshal(data, &dataV4) if err != nil { - return nil, err - } - return tlb.VmStack{ - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(dataV4.SubWalletId), - }, - }, nil + return tlb.VmStack{}, err + } + return tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(dataV4.SubWalletId)}.ToStack(), nil } var walletv4r2publicKey = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -90,16 +70,11 @@ var walletv4r2publicKey = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, e } err := tlb.Unmarshal(data, &dataV4) if err != nil { - return nil, err + return tlb.VmStack{}, err } var b big.Int b.SetBytes(dataV4.PublicKey[:]) - return tlb.VmStack{ - { - SumType: "VmStkInt", - VmStkInt: tlb.Int257(b), - }, - }, nil + return tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257(b)}.ToStack(), nil } var walletv4r2getPluginList = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -111,15 +86,13 @@ var walletv4r2getPluginList = func(data *boc.Cell, args tlb.VmStack) (tlb.VmStac } err := tlb.Unmarshal(data, &dataV4) if err != nil { - return nil, err + return tlb.VmStack{}, err } if len(dataV4.PluginDict.Keys()) == 0 { - return tlb.VmStack{ - {SumType: "VmStkNull"}, - }, nil + return tlb.VmStackValue{SumType: "VmStkNull"}.ToStack(), nil } //todo: implement - return nil, fmt.Errorf("not implemented not empty dict") + return tlb.VmStack{}, fmt.Errorf("not implemented not empty dict") } func walletv5r1seqno(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -132,14 +105,9 @@ func walletv5r1seqno(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { } err := tlb.Unmarshal(data, &dataV5) if err != nil { - return nil, err - } - return tlb.VmStack{ - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(dataV5.Seqno), - }, - }, nil + return tlb.VmStack{}, err + } + return tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(dataV5.Seqno)}.ToStack(), nil } func walletv5r1SubwalletID(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -152,14 +120,9 @@ func walletv5r1SubwalletID(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error } err := tlb.Unmarshal(data, &dataV5) if err != nil { - return nil, err - } - return tlb.VmStack{ - { - SumType: "VmStkTinyInt", - VmStkTinyInt: int64(dataV5.WalletID), - }, - }, nil + return tlb.VmStack{}, err + } + return tlb.VmStackValue{SumType: "VmStkTinyInt", VmStkTinyInt: int64(dataV5.WalletID)}.ToStack(), nil } func walletv5r1publicKey(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) { @@ -172,14 +135,9 @@ func walletv5r1publicKey(data *boc.Cell, args tlb.VmStack) (tlb.VmStack, error) } err := tlb.Unmarshal(data, &dataV5) if err != nil { - return nil, err + return tlb.VmStack{}, err } var b big.Int b.SetBytes(dataV5.PublicKey[:]) - return tlb.VmStack{ - { - SumType: "VmStkInt", - VmStkInt: tlb.Int257(b), - }, - }, nil + return tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: tlb.Int257(b)}.ToStack(), nil }