Skip to content

Commit

Permalink
Merge pull request #307 from tonkeeper/hipo-finance-abi
Browse files Browse the repository at this point in the history
hipo
  • Loading branch information
mr-tron authored Oct 8, 2024
2 parents 4d974d7 + 3b80a51 commit 1eecac6
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
34 changes: 34 additions & 0 deletions abi/generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,40 @@ func TestMessageDecoder(t *testing.T) {
FromAddress: mustAccountIDToMsgAddress("0:31448f1327e6819eb7d52210e9b22ef2859db9d233dfb802faf8ed2831da847f"),
},
},
{
name: "hipo_finance_deposit_coins",
boc: "te6ccgEBAQEAFQAAJT03YaYAAAAAAAAAABDuaygAQEg=",
wantOpName: HipoFinanceDepositCoinsMsgOp,
wantValue: HipoFinanceDepositCoinsMsgBody{
QueryId: 0,
Coins: mustToVarUInteger16("1000000000"),
OwnershipAssignedAmount: mustToVarUInteger16("1"),
},
},
{
name: "hipo_finance_proxy_tokens_minted",
boc: "te6ccgEBAQEAPQAAdVvldiYAAAAAAAAAAEOZsE5kO5rKAIAP5X1kydd61QPxdyzm5ynnAUduvhhB1qobiYJiW6wcGYAAAAAQ",
wantOpName: HipoFinanceProxyTokensMintedMsgOp,
wantValue: HipoFinanceProxyTokensMintedMsgBody{
QueryId: 0,
Tokens: mustToVarUInteger16("966460646"),
Coins: mustToVarUInteger16("1000000000"),
Owner: mustAccountIDToMsgAddress("0:7f2beb264ebbd6a81f8bb96737394f380a3b75f0c20eb550dc4c1312dd60e0cc"),
RoundSince: 0,
},
},
{
name: "hipo_finance_tokens_minted",
boc: "te6ccgEBAQEAPQAAdVRF7+4AAAAAAAAAAEOZsE5kO5rKAIAP5X1kydd61QPxdyzm5ynnAUduvhhB1qobiYJiW6wcGYAAAAAQ",
wantOpName: HipoFinanceTokensMintedMsgOp,
wantValue: HipoFinanceTokensMintedMsgBody{
QueryId: 0,
Tokens: mustToVarUInteger16("966460646"),
Coins: mustToVarUInteger16("1000000000"),
Owner: mustAccountIDToMsgAddress("0:7f2beb264ebbd6a81f8bb96737394f380a3b75f0c20eb550dc4c1312dd60e0cc"),
RoundSince: 0,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions abi/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ The list below contains the supported message operations, their names and opcode
| GramSubmitProofOfWork| 0x4d696e65 |
| HighloadWalletSignedV2| 0x00000000 |
| HighloadWalletSignedV3| 0x00000000 |
| HipoFinanceDepositCoins| 0x3d3761a6 |
| HipoFinanceProxyTokensMinted| 0x5be57626 |
| HipoFinanceTokensMinted| 0x5445efee |
| InitPaymentChannel| 0x0e0620c2 |
| JettonBurn| 0x595f07bc |
| JettonBurnNotification| 0x7bdd97de |
Expand Down
48 changes: 48 additions & 0 deletions abi/messages_generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ var (
decodeFuncStonfiProvideLpV2MsgBody = decodeMsg(tlb.Tag{Val: 0x37c096df, Len: 32}, StonfiProvideLpV2MsgOp, StonfiProvideLpV2MsgBody{})
// 0x3a943ce6
decodeFuncStormOrderCreatedMsgBody = decodeMsg(tlb.Tag{Val: 0x3a943ce6, Len: 32}, StormOrderCreatedMsgOp, StormOrderCreatedMsgBody{})
// 0x3d3761a6
decodeFuncHipoFinanceDepositCoinsMsgBody = decodeMsg(tlb.Tag{Val: 0x3d3761a6, Len: 32}, HipoFinanceDepositCoinsMsgOp, HipoFinanceDepositCoinsMsgBody{})
// 0x419d5d4d
decodeFuncProofStorageMsgBody = decodeMsg(tlb.Tag{Val: 0x419d5d4d, Len: 32}, ProofStorageMsgOp, ProofStorageMsgBody{})
// 0x44beae41
Expand Down Expand Up @@ -147,6 +149,8 @@ var (
decodeFuncStonfiAddLiquidityV2MsgBody = decodeMsg(tlb.Tag{Val: 0x50c6a654, Len: 32}, StonfiAddLiquidityV2MsgOp, StonfiAddLiquidityV2MsgBody{})
// 0x53f34cd6
decodeFuncUpdatePubkeyMsgBody = decodeMsg(tlb.Tag{Val: 0x53f34cd6, Len: 32}, UpdatePubkeyMsgOp, UpdatePubkeyMsgBody{})
// 0x5445efee
decodeFuncHipoFinanceTokensMintedMsgBody = decodeMsg(tlb.Tag{Val: 0x5445efee, Len: 32}, HipoFinanceTokensMintedMsgOp, HipoFinanceTokensMintedMsgBody{})
// 0x54cbf19b
decodeFuncUpdateStorageParamsMsgBody = decodeMsg(tlb.Tag{Val: 0x54cbf19b, Len: 32}, UpdateStorageParamsMsgOp, UpdateStorageParamsMsgBody{})
// 0x54d37487
Expand All @@ -159,6 +163,8 @@ var (
decodeFuncTonstakeControllerReturnAvailableFundsMsgBody = decodeMsg(tlb.Tag{Val: 0x55c26cd5, Len: 32}, TonstakeControllerReturnAvailableFundsMsgOp, TonstakeControllerReturnAvailableFundsMsgBody{})
// 0x595f07bc
decodeFuncJettonBurnMsgBody = decodeMsg(tlb.Tag{Val: 0x595f07bc, Len: 32}, JettonBurnMsgOp, JettonBurnMsgBody{})
// 0x5be57626
decodeFuncHipoFinanceProxyTokensMintedMsgBody = decodeMsg(tlb.Tag{Val: 0x5be57626, Len: 32}, HipoFinanceProxyTokensMintedMsgOp, HipoFinanceProxyTokensMintedMsgBody{})
// 0x5d1b17b8
decodeFuncStormUpdatePositionWithStopLossMsgBody = decodeMsg(tlb.Tag{Val: 0x5d1b17b8, Len: 32}, StormUpdatePositionWithStopLossMsgOp, StormUpdatePositionWithStopLossMsgBody{})
// 0x5dd66579
Expand Down Expand Up @@ -525,6 +531,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{
// 0x3a943ce6
StormOrderCreatedMsgOpCode: decodeFuncStormOrderCreatedMsgBody,

// 0x3d3761a6
HipoFinanceDepositCoinsMsgOpCode: decodeFuncHipoFinanceDepositCoinsMsgBody,

// 0x419d5d4d
ProofStorageMsgOpCode: decodeFuncProofStorageMsgBody,

Expand Down Expand Up @@ -583,6 +592,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{
// 0x53f34cd6
UpdatePubkeyMsgOpCode: decodeFuncUpdatePubkeyMsgBody,

// 0x5445efee
HipoFinanceTokensMintedMsgOpCode: decodeFuncHipoFinanceTokensMintedMsgBody,

// 0x54cbf19b
UpdateStorageParamsMsgOpCode: decodeFuncUpdateStorageParamsMsgBody,

Expand All @@ -601,6 +613,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{
// 0x595f07bc
JettonBurnMsgOpCode: decodeFuncJettonBurnMsgBody,

// 0x5be57626
HipoFinanceProxyTokensMintedMsgOpCode: decodeFuncHipoFinanceProxyTokensMintedMsgBody,

// 0x5d1b17b8
StormUpdatePositionWithStopLossMsgOpCode: decodeFuncStormUpdatePositionWithStopLossMsgBody,

Expand Down Expand Up @@ -966,6 +981,7 @@ const (
TeleitemCancelAuctionMsgOp MsgOpName = "TeleitemCancelAuction"
StonfiProvideLpV2MsgOp MsgOpName = "StonfiProvideLpV2"
StormOrderCreatedMsgOp MsgOpName = "StormOrderCreated"
HipoFinanceDepositCoinsMsgOp MsgOpName = "HipoFinanceDepositCoins"
ProofStorageMsgOp MsgOpName = "ProofStorage"
ProcessGovernanceDecisionMsgOp MsgOpName = "ProcessGovernanceDecision"
TelemintDeployMsgOp MsgOpName = "TelemintDeploy"
Expand All @@ -985,12 +1001,14 @@ const (
PtonDeployWalletMsgOp MsgOpName = "PtonDeployWallet"
StonfiAddLiquidityV2MsgOp MsgOpName = "StonfiAddLiquidityV2"
UpdatePubkeyMsgOp MsgOpName = "UpdatePubkey"
HipoFinanceTokensMintedMsgOp MsgOpName = "HipoFinanceTokensMinted"
UpdateStorageParamsMsgOp MsgOpName = "UpdateStorageParams"
TonstakeImanagerOperationFeeMsgOp MsgOpName = "TonstakeImanagerOperationFee"
ChannelCooperativeCloseMsgOp MsgOpName = "ChannelCooperativeClose"
OutbidNotificationMsgOp MsgOpName = "OutbidNotification"
TonstakeControllerReturnAvailableFundsMsgOp MsgOpName = "TonstakeControllerReturnAvailableFunds"
JettonBurnMsgOp MsgOpName = "JettonBurn"
HipoFinanceProxyTokensMintedMsgOp MsgOpName = "HipoFinanceProxyTokensMinted"
StormUpdatePositionWithStopLossMsgOp MsgOpName = "StormUpdatePositionWithStopLoss"
StormAddExecutorAmountMsgOp MsgOpName = "StormAddExecutorAmount"
TonstakePoolSetRolesMsgOp MsgOpName = "TonstakePoolSetRoles"
Expand Down Expand Up @@ -1149,6 +1167,7 @@ const (
TeleitemCancelAuctionMsgOpCode MsgOpCode = 0x371638ae
StonfiProvideLpV2MsgOpCode MsgOpCode = 0x37c096df
StormOrderCreatedMsgOpCode MsgOpCode = 0x3a943ce6
HipoFinanceDepositCoinsMsgOpCode MsgOpCode = 0x3d3761a6
ProofStorageMsgOpCode MsgOpCode = 0x419d5d4d
ProcessGovernanceDecisionMsgOpCode MsgOpCode = 0x44beae41
TelemintDeployMsgOpCode MsgOpCode = 0x4637289a
Expand All @@ -1168,12 +1187,14 @@ const (
PtonDeployWalletMsgOpCode MsgOpCode = 0x4f5f4313
StonfiAddLiquidityV2MsgOpCode MsgOpCode = 0x50c6a654
UpdatePubkeyMsgOpCode MsgOpCode = 0x53f34cd6
HipoFinanceTokensMintedMsgOpCode MsgOpCode = 0x5445efee
UpdateStorageParamsMsgOpCode MsgOpCode = 0x54cbf19b
TonstakeImanagerOperationFeeMsgOpCode MsgOpCode = 0x54d37487
ChannelCooperativeCloseMsgOpCode MsgOpCode = 0x5577587e
OutbidNotificationMsgOpCode MsgOpCode = 0x557cea20
TonstakeControllerReturnAvailableFundsMsgOpCode MsgOpCode = 0x55c26cd5
JettonBurnMsgOpCode MsgOpCode = 0x595f07bc
HipoFinanceProxyTokensMintedMsgOpCode MsgOpCode = 0x5be57626
StormUpdatePositionWithStopLossMsgOpCode MsgOpCode = 0x5d1b17b8
StormAddExecutorAmountMsgOpCode MsgOpCode = 0x5dd66579
TonstakePoolSetRolesMsgOpCode MsgOpCode = 0x5e517f36
Expand Down Expand Up @@ -1614,6 +1635,14 @@ type StonfiProvideLpV2MsgBody struct {

type StormOrderCreatedMsgBody struct{}

type HipoFinanceDepositCoinsMsgBody struct {
QueryId uint64
Owner tlb.MsgAddress
Coins tlb.VarUInteger16
OwnershipAssignedAmount tlb.VarUInteger16
Referrer tlb.MsgAddress
}

type ProofStorageMsgBody struct {
QueryId uint64
FileDictProof tlb.Any `tlb:"^"`
Expand Down Expand Up @@ -1725,6 +1754,14 @@ type UpdatePubkeyMsgBody struct {
NewPubkey tlb.Bits256
}

type HipoFinanceTokensMintedMsgBody struct {
QueryId uint64
Tokens tlb.VarUInteger16
Coins tlb.VarUInteger16
Owner tlb.MsgAddress
RoundSince uint32
}

type UpdateStorageParamsMsgBody struct {
QueryId uint64
AcceptNewContracts bool
Expand Down Expand Up @@ -1764,6 +1801,14 @@ type JettonBurnMsgBody struct {
CustomPayload *JettonPayload `tlb:"maybe^"`
}

type HipoFinanceProxyTokensMintedMsgBody struct {
QueryId uint64
Tokens tlb.VarUInteger16
Coins tlb.VarUInteger16
Owner tlb.MsgAddress
RoundSince uint32
}

type StormUpdatePositionWithStopLossMsgBody struct {
Direction tlb.Uint1
StopTriggerPrice tlb.Grams
Expand Down Expand Up @@ -2466,6 +2511,7 @@ var KnownMsgInTypes = map[string]any{
TeleitemCancelAuctionMsgOp: TeleitemCancelAuctionMsgBody{},
StonfiProvideLpV2MsgOp: StonfiProvideLpV2MsgBody{},
StormOrderCreatedMsgOp: StormOrderCreatedMsgBody{},
HipoFinanceDepositCoinsMsgOp: HipoFinanceDepositCoinsMsgBody{},
ProofStorageMsgOp: ProofStorageMsgBody{},
ProcessGovernanceDecisionMsgOp: ProcessGovernanceDecisionMsgBody{},
TelemintDeployMsgOp: TelemintDeployMsgBody{},
Expand All @@ -2485,12 +2531,14 @@ var KnownMsgInTypes = map[string]any{
PtonDeployWalletMsgOp: PtonDeployWalletMsgBody{},
StonfiAddLiquidityV2MsgOp: StonfiAddLiquidityV2MsgBody{},
UpdatePubkeyMsgOp: UpdatePubkeyMsgBody{},
HipoFinanceTokensMintedMsgOp: HipoFinanceTokensMintedMsgBody{},
UpdateStorageParamsMsgOp: UpdateStorageParamsMsgBody{},
TonstakeImanagerOperationFeeMsgOp: TonstakeImanagerOperationFeeMsgBody{},
ChannelCooperativeCloseMsgOp: ChannelCooperativeCloseMsgBody{},
OutbidNotificationMsgOp: OutbidNotificationMsgBody{},
TonstakeControllerReturnAvailableFundsMsgOp: TonstakeControllerReturnAvailableFundsMsgBody{},
JettonBurnMsgOp: JettonBurnMsgBody{},
HipoFinanceProxyTokensMintedMsgOp: HipoFinanceProxyTokensMintedMsgBody{},
StormUpdatePositionWithStopLossMsgOp: StormUpdatePositionWithStopLossMsgBody{},
StormAddExecutorAmountMsgOp: StormAddExecutorAmountMsgBody{},
TonstakePoolSetRolesMsgOp: TonstakePoolSetRolesMsgBody{},
Expand Down
29 changes: 29 additions & 0 deletions abi/schemas/hipo_finance.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<abi>
<internal name="hipo_finance_deposit_coins">
deposit_coins#3d3761a6
query_id:uint64
owner:MsgAddress
coins:(VarUInteger 16)
ownership_assigned_amount:(VarUInteger 16)
referrer:MsgAddress
= InternalMsgBody;
</internal>
<internal name="hipo_finance_proxy_tokens_minted">
proxy_tokens_minted#5be57626
query_id:uint64
tokens:(VarUInteger 16)
coins:(VarUInteger 16)
owner:MsgAddress
round_since:uint32
= InternalMsgBody;
</internal>
<internal name="hipo_finance_tokens_minted">
tokens_minted#5445efee
query_id:uint64
tokens:(VarUInteger 16)
coins:(VarUInteger 16)
owner:MsgAddress
round_since:uint32
= InternalMsgBody;
</internal>
</abi>

0 comments on commit 1eecac6

Please sign in to comment.