PathrockNetwork Gno Explorer
HomeBlocksTransactionsRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/r/gnoswap/position/v1

Realm
Open in gnoweb ↗

Overview

Kind
Realm (renderable)
Name
v1
Namespace
gnoswap / position
Files
17 (README)(gnomod.toml)
Exported functions
1
Module
gno.land/r/gnoswap/position/v1
gno
0.9

Files (17)

  • README.mdmarkdown
  • gnomod.tomltoml
  • assert.gnogno
  • burn.gnogno
  • doc.gnogno
  • errors.gnogno
  • getter.gnogno
  • init.gnogno
  • instance.gnogno
  • liquidity_management.gnogno
  • manager.gnogno
  • mint.gnogno
  • position.gnogno
  • render.gnogno
  • reposition.gnogno
  • type.gnogno
  • utils.gnogno
  • type.gnogno
    1package position23import (4	u256 "gno.land/p/gnoswap/uint256/v1"5)67// Previously, we used a different zero address ("g1000000..."),8

    Functions

    • NewPositionV1(positionStore interface {GetPosition func(uint64) (gno.land/r/gnoswap/position.Position, bool); GetPositionNextID func() uint64; GetPositions func() *gno.land/p/nt/bptree/v0.BPTree; HasPosition func(uint64) bool; HasPositionNextIDStoreKey func() bool; HasPositionsStoreKey func() bool; RemovePosition func(int, .uverse.realm, uint64) .uverse.error; SetPosition func(int, .uverse.realm, uint64, gno.land/r/gnoswap/position.Position) .uverse.error; SetPositionNextID func(int, .uverse.realm, uint64) .uverse.error; SetPositions func(int, .uverse.realm, *gno.land/p/nt/bptree/v0.BPTree) .uverse.error}, accessor interface {Approve func(int, .uverse.realm, .uverse.address, gno.land/p/nt/grc721/v0.TokenID) .uverse.error; Burn func(int, .uverse.realm, gno.land/p/nt/grc721/v0.TokenID); Exists func(gno.land/p/nt/grc721/v0.TokenID) bool; Mint func(int, .uverse.realm, .uverse.address, gno.land/p/nt/grc721/v0.TokenID) gno.land/p/nt/grc721/v0.TokenID; OwnerOf func(gno.land/p/nt/grc721/v0.TokenID) (.uverse.address, .uverse.error); TotalSupply func() int64}) interface {CollectFee func(int, .uverse.realm, uint64) (uint64, string, string, string, string, string); DecreaseLiquidity func(int, .uverse.realm, uint64, string, string, string, int64) (uint64, string, string, string, string, string, string); GetPositionFeeGrowthInside0LastX128 func(uint64) (string, .uverse.error); GetPositionFeeGrowthInside1LastX128 func(uint64) (string, .uverse.error); GetPositionFeeGrowthInsideLastX128 func(uint64) (string, string, .uverse.error); GetPositionLiquidity func(uint64) (string, .uverse.error); GetPositionOperator func(uint64) (.uverse.address, .uverse.error); GetPositionOwner func(uint64) (.uverse.address, .uverse.error); GetPositionPoolKey func(uint64) (string, .uverse.error); GetPositionTickLower func(uint64) (int32, .uverse.error); GetPositionTickUpper func(uint64) (int32, .uverse.error); GetPositionTicks func(uint64) (int32, int32, .uverse.error); GetPositionTokenBalances func(uint64) (int64, int64, .uverse.error); GetPositionTokensOwed func(uint64) (int64, int64, .uverse.error); GetPositionTokensOwed0 func(uint64) (int64, .uverse.error); GetPositionTokensOwed1 func(uint64) (int64, .uverse.error); GetPositions func() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree; GetUnclaimedFee func(uint64) (*gno.land/p/gnoswap/uint256/v1.Uint, *gno.land/p/gnoswap/uint256/v1.Uint, .uverse.error); IncreaseLiquidity func(int, .uverse.realm, uint64, string, string, string, string, int64) (uint64, string, string, string, string); IsBurned func(uint64) (bool, .uverse.error); IsInRange func(uint64) (bool, .uverse.error); Mint func(int, .uverse.realm, string, string, uint32, int32, int32, string, string, string, string, int64, .uverse.address, string) (uint64, string, string, string); Render func(string) string; Reposition func(int, .uverse.realm, uint64, int32, int32, string, string, string, string, int64) (uint64, string, int32, int32, string, string); SetPositionOperator func(int, .uverse.realm, uint64, .uverse.address)}

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

    Rendered

    RenderedRawgnoweb ↗
    This realm does not provide renderable output (vm/qrender → NoRenderDeclError). View on gnoweb ↗

    vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.

    // but we changed the value because using the address
    9// below appears to have become the de facto standard practice.
    10const zeroAddress address = address("")
    11
    12type MintParams struct {
    13 token0 string // token0 path for a specific pool
    14 token1 string // token1 path for a specific pool
    15 fee uint32 // fee for a specific pool
    16 tickLower int32 // lower end of the tick range for the position
    17 tickUpper int32 // upper end of the tick range for the position
    18 amount0Desired *u256.Uint // desired amount of token0 to be minted
    19 amount1Desired *u256.Uint // desired amount of token1 to be minted
    20 amount0Min *u256.Uint // minimum amount of token0 to be minted
    21 amount1Min *u256.Uint // minimum amount of token1 to be minted
    22 deadline int64 // time by which the transaction must be included to effect the change
    23 mintTo address // address to mint lpToken
    24 caller address // address to call the function
    25}
    26
    27// newMintParams creates `MintParams` from processed input data.
    28func newMintParams(input ProcessedMintInput, mintInput MintInput) MintParams {
    29 return MintParams{
    30 token0: input.tokenPair.token0,
    31 token1: input.tokenPair.token1,
    32 fee: mintInput.fee,
    33 tickLower: input.tickLower,
    34 tickUpper: input.tickUpper,
    35 amount0Desired: input.amount0Desired,
    36 amount1Desired: input.amount1Desired,
    37 amount0Min: input.amount0Min,
    38 amount1Min: input.amount1Min,
    39 deadline: mintInput.deadline,
    40 mintTo: mintInput.mintTo,
    41 caller: mintInput.caller,
    42 }
    43}
    44
    45type IncreaseLiquidityParams struct {
    46 positionId uint64 // positionId of the position to increase liquidity
    47 amount0Desired *u256.Uint // desired amount of token0 to be minted
    48 amount1Desired *u256.Uint // desired amount of token1 to be minted
    49 amount0Min *u256.Uint // minimum amount of token0 to be minted
    50 amount1Min *u256.Uint // minimum amount of token1 to be minted
    51 deadline int64 // time by which the transaction must be included to effect the change
    52 caller address // address to call the function
    53}
    54
    55type DecreaseLiquidityParams struct {
    56 positionId uint64 // positionId of the position to decrease liquidity
    57 liquidity string // amount of liquidity to decrease
    58 amount0Min *u256.Uint // minimum amount of token0 to be minted
    59 amount1Min *u256.Uint // minimum amount of token1 to be minted
    60 deadline int64 // time by which the transaction must be included to effect the change
    61 caller address // address to call the function
    62}
    63
    64type MintInput struct {
    65 token0 string
    66 token1 string
    67 fee uint32
    68 tickLower int32
    69 tickUpper int32
    70 amount0Desired string
    71 amount1Desired string
    72 amount0Min string
    73 amount1Min string
    74 deadline int64
    75 mintTo address
    76 caller address
    77}
    78
    79type TokenPair struct {
    80 token0 string
    81 token1 string
    82}
    83
    84type ProcessedMintInput struct {
    85 tokenPair TokenPair
    86 amount0Desired *u256.Uint
    87 amount1Desired *u256.Uint
    88 amount0Min *u256.Uint
    89 amount1Min *u256.Uint
    90 tickLower int32
    91 tickUpper int32
    92 poolPath string
    93}
    94
    95// FeeGrowthInside represents fee growth inside ticks
    96type FeeGrowthInside struct {
    97 feeGrowthInside0LastX128 *u256.Uint
    98 feeGrowthInside1LastX128 *u256.Uint
    99}
    100