Account

account

Interface

get_account_data

(address, address, int, int, int, cell?) get_account_data ()

This function provides current state of the user account

Return Values

#
Type
Description

0

address

account::user_address Address of the owner of the account

1

address

account::pool_address Address of the pool that this account is attached to

2

int

account::amount0 Amount of jetton0 that was deposited for mint

3

int

account::amount1 Amount of jetton1 that was deposited for mint

4

int

account::posCount

5

cell?

account::order

Messages

ACCOUNT_ADD_LIQUIDITY

Opcode : 0x3ebe5431

This operation adds liquidity and a minting request to the account. This contract is used as a barrier to collect together data about the proofs of funding two tokens and the request to mint some liquidity. Common usage is as follows - send one jetton with the mint instructions and the second jetton with the mint instructions. And as soon as they will both arrive AccountV3 would trigger the minting request in the pool. This makes minting independent of the order in which jettons arrive. Account refers to jettons in the pool (account::pool_address) order Access Rights: This operation is allowed for account::pool_address

Path
Mnemonic
Type
Description

op

Uint(32),op

query_id

Uint(64)

queryid as of the TON documentation

new_amount0

Coins(124)

Amount of jetton0 that is funded for the mint

new_amount1

Coins(124)

Amount of jetton1 that is funded for the mint

enough0

Coins(124)

When temporary storage (user account) satisfy both enough0/1 amounts - mint would trigger

enough1

Coins(124)

When temporary storage (user account) satisfy both enough0/1 amounts - mint would trigger

needPos

Uint(64)

Amount of positions that are enough for the order to be executed

passthrough

Uint(4)

Amount of positions that will be untouched

target_action

Uint(32)

target_action

0

Maybe Cell(1) MintOrder0

Cell with mint order

0

op0

Uint(32)

0

liquidity0

Uint(128)

Amount of liquidity to mint

0

tickLower0

Int(24)

lower bound of the range in which to mint

0

tickUpper0

Int(24)

upper bound of the range in which to mint

0

receiver0

Address(267)

Address of receiver of the NFT

1

Maybe Cell(1) MintOrder1

Cell with mint order

1

op1

Uint(32)

1

liquidity1

Uint(128)

Amount of liquidity to mint

1

tickLower1

Int(24)

lower bound of the range in which to mint

1

tickUpper1

Int(24)

upper bound of the range in which to mint

1

receiver1

Address(267)

Address of receiver of the NFT

2

Maybe Cell(1) MintOrder2

Cell with mint order

2

op2

Uint(32)

2

liquidity2

Uint(128)

Amount of liquidity to mint

2

tickLower2

Int(24)

lower bound of the range in which to mint

2

tickUpper2

Int(24)

upper bound of the range in which to mint

2

receiver2

Address(267)

Address of receiver of the NFT

3

Maybe Cell(1) MintOrder3

Cell with mint order

3

op3

Uint(32)

3

liquidity3

Uint(128)

Amount of liquidity to mint

3

tickLower3

Int(24)

lower bound of the range in which to mint

3

tickUpper3

Int(24)

upper bound of the range in which to mint

3

receiver3

Address(267)

Address of receiver of the NFT

TL-B Description (TBD)

This is a preliminary tl-b - subject to change

Tlb for ACCOUNT_ADD_LIQUIDITY
ACCOUNT_ADD_LIQUIDITY#3ebe5431 
    query_id:uint64
    new_amount0:(VarUInteger 16)
    new_amount1:(VarUInteger 16)
    enough0:(VarUInteger 16)
    enough1:(VarUInteger 16)
    needPos:uint64
    passthrough:uint4
    target_action:uint32
    MintOrder0:(Maybe ^[
        op0:uint32
        liquidity0:uint128
        tickLower0:int24
        tickUpper0:int24
        receiver0:MsgAddress
    ] ) 
    MintOrder1:(Maybe ^[
        op1:uint32
        liquidity1:uint128
        tickLower1:int24
        tickUpper1:int24
        receiver1:MsgAddress
    ] ) 
    MintOrder2:(Maybe ^[
        op2:uint32
        liquidity2:uint128
        tickLower2:int24
        tickUpper2:int24
        receiver2:MsgAddress
    ] ) 
    MintOrder3:(Maybe ^[
        op3:uint32
        liquidity3:uint128
        tickLower3:int24
        tickUpper3:int24
        receiver3:MsgAddress
    ] ) 
= ContractMessages;

ACCOUNT_RESET_GAS

Opcode : 0x42a0fb43

This operation allows user to get back the gas it too much was sent Access Rights: This operation is allowed for account::user_address

Path
Mnemonic
Type
Description

op

Uint(32),op

query_id

Uint(64)

queryid as of the TON documentation

TL-B Description (TBD)

This is a preliminary tl-b - subject to change

Tlb for ACCOUNT_RESET_GAS
ACCOUNT_RESET_GAS#42a0fb43 
    query_id:uint64
= ContractMessages;

ACCOUNT_SET_ORDER

Opcode : 0x61d86ffe

This operation allows user to set an order (usually for minting or refunding) that will be executed if the preconditions are satisfied Access Rights: This operation is allowed for account::user_address

Path
Mnemonic
Type
Description

op

Uint(32),op

query_id

Uint(64)

queryid as of the TON documentation

enough0

Coins(124)

When temporary storage (user account) satisfy both enough0/1 amounts - mint would trigger

enough1

Coins(124)

When temporary storage (user account) satisfy both enough0/1 amounts - mint would trigger

needPos

Uint(64)

Amount of positions that are enough for the order to be executed

passthrough

Uint(4)

Amount of positions that will be untouched

target_action

Uint(32)

target_action

0

Maybe Cell(1) mint0

Cell with burn number 0

0

mintOp[0]

Uint(32)

0

liquidity[0]

Uint(128)

0

tickLower[0]

Int(24)

lower bound of the range in which to mint

0

tickUpper[0]

Int(24)

upper bound of the range in which to mint

0

nftReceiver[0]

Address(267)

Address that would receive the minted NFT, excesses and refunds

1

Maybe Cell(1) mint1

Cell with burn number 1

1

mintOp[1]

Uint(32)

1

liquidity[1]

Uint(128)

1

tickLower[1]

Int(24)

lower bound of the range in which to mint

1

tickUpper[1]

Int(24)

upper bound of the range in which to mint

1

nftReceiver[1]

Address(267)

Address that would receive the minted NFT, excesses and refunds

2

Maybe Cell(1) mint2

Cell with burn number 2

2

mintOp[2]

Uint(32)

2

liquidity[2]

Uint(128)

2

tickLower[2]

Int(24)

lower bound of the range in which to mint

2

tickUpper[2]

Int(24)

upper bound of the range in which to mint

2

nftReceiver[2]

Address(267)

Address that would receive the minted NFT, excesses and refunds

3

Maybe Cell(1) mint3

Cell with burn number 3

3

mintOp[3]

Uint(32)

3

liquidity[3]

Uint(128)

3

tickLower[3]

Int(24)

lower bound of the range in which to mint

3

tickUpper[3]

Int(24)

upper bound of the range in which to mint

3

nftReceiver[3]

Address(267)

Address that would receive the minted NFT, excesses and refunds

TL-B Description (TBD)

This is a preliminary tl-b - subject to change

Tlb for ACCOUNT_SET_ORDER
ACCOUNT_SET_ORDER#61d86ffe 
    query_id:uint64
    enough0:(VarUInteger 16)
    enough1:(VarUInteger 16)
    needPos:uint64
    passthrough:uint4
    target_action:uint32
    mint0:(Maybe ^[
        mintOp[0]:uint32
        liquidity[0]:uint128
        tickLower[0]:int24
        tickUpper[0]:int24
        nftReceiver[0]:MsgAddress
    ] ) 
    mint1:(Maybe ^[
        mintOp[1]:uint32
        liquidity[1]:uint128
        tickLower[1]:int24
        tickUpper[1]:int24
        nftReceiver[1]:MsgAddress
    ] ) 
    mint2:(Maybe ^[
        mintOp[2]:uint32
        liquidity[2]:uint128
        tickLower[2]:int24
        tickUpper[2]:int24
        nftReceiver[2]:MsgAddress
    ] ) 
    mint3:(Maybe ^[
        mintOp[3]:uint32
        liquidity[3]:uint128
        tickLower[3]:int24
        tickUpper[3]:int24
        nftReceiver[3]:MsgAddress
    ] ) 
= ContractMessages;

Last updated