From 966e11c0e026c9afe4817a67fa5c941bc678d086 Mon Sep 17 00:00:00 2001 From: Spite Date: Thu, 25 Dec 2025 17:35:56 +0400 Subject: [PATCH 1/2] feat: update storm get methods --- abi/schemas/storm.xml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/abi/schemas/storm.xml b/abi/schemas/storm.xml index 4df2733d..76357666 100644 --- a/abi/schemas/storm.xml +++ b/abi/schemas/storm.xml @@ -867,6 +867,9 @@ + + msgaddress + msgaddress @@ -1215,7 +1218,7 @@ - Cell + cell @@ -1245,12 +1248,6 @@ - - cell - - - - msgaddress msgaddress @@ -1259,7 +1256,13 @@ cell cell cell - cell + uint8 + + + + + + cell @@ -1308,8 +1311,8 @@ - HashmapE 13 Cell - HashmapE 13 Cell + cell + cell uint32 uint32 @@ -1334,6 +1337,9 @@ + + cell + bool PositionData @@ -1347,9 +1353,7 @@ int257 - uint16 - uint16 - bool + bool From bdffbdc7e2d9d5fc692de56007c0f5fbcfec66b8 Mon Sep 17 00:00:00 2001 From: Spite Date: Thu, 25 Dec 2025 17:36:03 +0400 Subject: [PATCH 2/2] feat: update generated files --- abi/get_methods.go | 58 ++++++++++++++++++++++++++++------------------ abi/interfaces.go | 11 --------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/abi/get_methods.go b/abi/get_methods.go index d12ed4b9..7eeb60e7 100644 --- a/abi/get_methods.go +++ b/abi/get_methods.go @@ -318,7 +318,6 @@ var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executo 102351: {GetNftData}, 102491: {GetCollectionData}, 102917: {GetDayTradingData}, - 103148: {GetPosition}, 103232: {GetValidatorControllerData}, 103471: {GetRouterState}, 103723: {IsStable}, @@ -379,7 +378,6 @@ var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executo 127226: {GetPool}, 128085: {GetRouterData}, 128568: {GetLiquidityData}, - 128710: {GetPositionManagerAddress}, 128979: {JettonWalletLockData}, 129292: {GetSubscriptionInfo}, 129581: {GetSeedPubkey}, @@ -3592,8 +3590,8 @@ func DecodeGetFundingSettings_StormResult(stack tlb.VmStack) (resultType string, } type GetHighloadData_StormResult struct { - OldQueries tlb.HashmapE[tlb.Uint13, boc.Cell] - Queries tlb.HashmapE[tlb.Uint13, boc.Cell] + OldQueries *boc.Cell + Queries *boc.Cell LastCleanTime uint32 Timeout uint32 } @@ -3619,7 +3617,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 len(stack) != 4 || (stack[0].SumType != "VmStkCell" && stack[0].SumType != "VmStkNull") || (stack[1].SumType != "VmStkCell" && stack[1].SumType != "VmStkNull") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") || (stack[3].SumType != "VmStkTinyInt" && stack[3].SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetHighloadData_StormResult @@ -6196,8 +6194,17 @@ type GetPosition_StormResult struct { Position *PositionData } -func GetPosition(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { +func GetPosition(ctx context.Context, executor Executor, reqAccountID ton.AccountID, ammAddressKey boc.Cell) (string, any, error) { stack := tlb.VmStack{} + var ( + val tlb.VmStackValue + err error + ) + val, err = tlb.TlbStructToVmCellSlice(ammAddressKey) + if err != nil { + return "", nil, err + } + stack.Put(val) // MethodID = 103148 for "get_position" method errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 103148, stack) @@ -6276,8 +6283,17 @@ type GetPositionManagerAddress_StormResult struct { TraderPositionAddress tlb.MsgAddress } -func GetPositionManagerAddress(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { +func GetPositionManagerAddress(ctx context.Context, executor Executor, reqAccountID ton.AccountID, traderAddress tlb.MsgAddress) (string, any, error) { stack := tlb.VmStack{} + var ( + val tlb.VmStackValue + err error + ) + val, err = tlb.TlbStructToVmCellSlice(traderAddress) + if err != nil { + return "", nil, err + } + stack.Put(val) // MethodID = 128710 for "get_position_manager_address" method errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 128710, stack) @@ -6306,14 +6322,7 @@ func DecodeGetPositionManagerAddress_StormResult(stack tlb.VmStack) (resultType } type GetPositionManagerContractData_StormResult struct { - TraderAddress tlb.MsgAddress - VaultAddress tlb.MsgAddress - VammAddress tlb.MsgAddress - LongRecord boc.Cell - ShortRecord boc.Cell - OrdersDict boc.Cell - ReferralData boc.Cell - OrdersBitset boc.Cell + Data boc.Cell } func GetPositionManagerContractData(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { @@ -6337,7 +6346,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 len(stack) != 1 || (stack[0].SumType != "VmStkCell") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPositionManagerContractData_StormResult @@ -6346,7 +6355,14 @@ func DecodeGetPositionManagerContractData_StormResult(stack tlb.VmStack) (result } type GetPositionManagerData_StormResult struct { - Data boc.Cell + TraderAddress tlb.MsgAddress + VaultAddress tlb.MsgAddress + VammAddress tlb.MsgAddress + LongRecord boc.Cell + ShortRecord boc.Cell + OrdersDict boc.Cell + ReferralData boc.Cell + OrdersBitset uint8 } func GetPositionManagerData(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { @@ -6370,7 +6386,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 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 != "VmStkTinyInt" && stack[7].SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result GetPositionManagerData_StormResult @@ -9181,9 +9197,7 @@ func DecodeListVotesResult(stack tlb.VmStack) (resultType string, resultAny any, } type Processed_StormResult struct { - Shift uint16 - BitNumber uint16 - NeedClean bool + Processed bool } func Processed(ctx context.Context, executor Executor, reqAccountID ton.AccountID, shift tlb.Int257, bitNumber tlb.Int257, needClean tlb.Int257) (string, any, error) { @@ -9217,7 +9231,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 len(stack) != 1 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") } var result Processed_StormResult diff --git a/abi/interfaces.go b/abi/interfaces.go index e129acb2..b5d83b41 100644 --- a/abi/interfaces.go +++ b/abi/interfaces.go @@ -1052,14 +1052,6 @@ var methodInvocationOrder = []MethodDescription{ Name: "get_pool_type", InvokeFn: GetPoolType, }, - { - Name: "get_position", - InvokeFn: GetPosition, - }, - { - Name: "get_position_manager_address", - InvokeFn: GetPositionManagerAddress, - }, { Name: "get_position_manager_contract_data", InvokeFn: GetPositionManagerContractData, @@ -1655,7 +1647,6 @@ var contractInterfacesOrder = []InterfaceDescription{ "GetLazerData_StormResult", "GetOracleData_StormResult", "GetPauseTime_StormResult", - "GetPositionManagerAddress_StormResult", "GetSpotPrice_StormResult", "GetTerminalAmmPrice_StormResult", "GetVammType_StormResult", @@ -1674,7 +1665,6 @@ var contractInterfacesOrder = []InterfaceDescription{ "GetLazerData_StormResult", "GetOracleData_StormResult", "GetPauseTime_StormResult", - "GetPositionManagerAddress_StormResult", "GetSettlementOracleData_StormResult", "GetSpotPrice_StormResult", "GetTerminalAmmPrice_StormResult", @@ -1724,7 +1714,6 @@ var contractInterfacesOrder = []InterfaceDescription{ "GetHighloadData_StormResult", "GetKeysData_StormResult", "GetNftDataResult", - "GetPosition_StormResult", "GetStorageData_StormResult", "GetUserPublicKeys_StormResult", },