Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 36 additions & 22 deletions abi/get_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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
Expand All @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions abi/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1655,7 +1647,6 @@ var contractInterfacesOrder = []InterfaceDescription{
"GetLazerData_StormResult",
"GetOracleData_StormResult",
"GetPauseTime_StormResult",
"GetPositionManagerAddress_StormResult",
"GetSpotPrice_StormResult",
"GetTerminalAmmPrice_StormResult",
"GetVammType_StormResult",
Expand All @@ -1674,7 +1665,6 @@ var contractInterfacesOrder = []InterfaceDescription{
"GetLazerData_StormResult",
"GetOracleData_StormResult",
"GetPauseTime_StormResult",
"GetPositionManagerAddress_StormResult",
"GetSettlementOracleData_StormResult",
"GetSpotPrice_StormResult",
"GetTerminalAmmPrice_StormResult",
Expand Down Expand Up @@ -1724,7 +1714,6 @@ var contractInterfacesOrder = []InterfaceDescription{
"GetHighloadData_StormResult",
"GetKeysData_StormResult",
"GetNftDataResult",
"GetPosition_StormResult",
"GetStorageData_StormResult",
"GetUserPublicKeys_StormResult",
},
Expand Down
30 changes: 17 additions & 13 deletions abi/schemas/storm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,9 @@
</get_method>

<get_method name="get_position_manager_address">
<input>
<slice name="trader_address">msgaddress</slice>
</input>
<output version="storm" fixed_length="true">
<int name="trader_position_address">msgaddress</int>
</output>
Expand Down Expand Up @@ -1215,7 +1218,7 @@
<!-- Executor item -->
<get_method name="get_executor_balances">
<output version="storm" fixed_length="true">
<cell name="balances_dict">Cell</cell>
<cell name="balances_dict">cell</cell>
</output>
</get_method>

Expand Down Expand Up @@ -1245,12 +1248,6 @@

<!-- Position manager -->
<get_method name="get_position_manager_data">
<output version="storm" fixed_length="true">
<cell name="data">cell</cell>
</output>
</get_method>

<get_method name="get_position_manager_contract_data">
<output version="storm" fixed_length="true">
<slice name="trader_address">msgaddress</slice>
<slice name="vault_address">msgaddress</slice>
Expand All @@ -1259,7 +1256,13 @@
<cell name="short_record">cell</cell>
<cell name="orders_dict">cell</cell>
<cell name="referral_data">cell</cell>
<cell name="orders_bitset">cell</cell>
<int name="orders_bitset">uint8</int>
</output>
</get_method>

<get_method name="get_position_manager_contract_data">
<output version="storm" fixed_length="true">
<cell name="data">cell</cell>
</output>
</get_method>

Expand Down Expand Up @@ -1308,8 +1311,8 @@

<get_method name="get_highload_data">
<output version="storm" fixed_length="true">
<cell name="old_queries">HashmapE 13 Cell</cell>
<cell name="queries">HashmapE 13 Cell</cell>
<cell name="old_queries" nullable="true">cell</cell>
<cell name="queries" nullable="true">cell</cell>
<int name="last_clean_time">uint32</int>
<int name="timeout">uint32</int> <!-- actually we have uint24 here -->
</output>
Expand All @@ -1334,6 +1337,9 @@
</get_method>

<get_method name="get_position">
<input>
<slice name="amm_address_key">cell</slice>
</input>
<output version="storm" fixed_length="true">
<int name="locked">bool</int>
<cell name="position" nullable="true">PositionData</cell>
Expand All @@ -1347,9 +1353,7 @@
<int name="need_clean">int257</int>
</input>
<output version="storm" fixed_length="true">
<int name="shift">uint16</int> <!-- actually we have uint10 here -->
<int name="bit_number">uint16</int> <!-- actually we have uint10 here -->
<int name="need_clean">bool</int>
<int name="processed">bool</int>
</output>
</get_method>

Expand Down
Loading