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

Realm
Open in gnoweb ↗

Overview

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

Files (12)

  • README.mdmarkdown
  • gnomod.tomltoml
  • errors.gnogno
  • getter_utils.gnogno
  • getter.gnogno
  • position.gnogno
  • proxy.gnogno
  • render.gnogno
  • state.gnogno
  • store.gnogno
  • types.gnogno
  • upgrade.gnogno
  • getter.gnogno
    1package position23import (4	rotree "gno.land/p/nt/bptree/rotree/v0"5)67// GetPositions returns a read-only view of all positions.8

    Functions

    • CollectFee(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, positionId uint64) (uint64, string, string, string, string, string)

    • DecreaseLiquidity(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, positionId uint64, liquidityStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, string, string, string, string, string)

    • GetImplementationPackagePath() string

    • GetPositionFeeGrowthInside0LastX128(positionId uint64) (string, interface {Error func() string})

    • GetPositionFeeGrowthInside1LastX128(positionId uint64) (string, interface {Error func() string})

    • GetPositionFeeGrowthInsideLastX128(positionId uint64) (string, string, interface {Error func() string})

    • GetPositionLiquidity(positionId uint64) (string, interface {Error func() string})

    • GetPositionOperator(positionId uint64) (string, interface {Error func() string})

    • GetPositionOwner(positionId uint64) (string, interface {Error func() string})

    • GetPositionPoolKey(positionId uint64) (string, interface {Error func() string})

    • GetPositions() *gno.land/p/nt/bptree/rotree/v0.ReadOnlyTree

    • GetPositionTickLower(positionId uint64) (int32, interface {Error func() string})

    • GetPositionTicks(positionId uint64) (int32, int32, interface {Error func() string})

    • GetPositionTickUpper(positionId uint64) (int32, interface {Error func() string})

    • GetPositionToken0Balance(positionId uint64) (int64, interface {Error func() string})

    • GetPositionToken1Balance(positionId uint64) (int64, interface {Error func() string})

    • GetPositionTokenBalances(positionId uint64) (int64, int64, interface {Error func() string})

    • GetPositionTokensOwed(positionId uint64) (int64, int64, interface {Error func() string})

    • GetPositionTokensOwed0(positionId uint64) (int64, interface {Error func() string})

    • GetPositionTokensOwed1(positionId uint64) (int64, interface {Error func() string})

    • GetUnclaimedFee(positionId uint64) (string, string, interface {Error func() string})

    • IncreaseLiquidity(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, positionId uint64, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, string, string, string)

    • IsBurned(positionId uint64) (bool, interface {Error func() string})

    • IsInRange(positionId uint64) (bool, interface {Error func() string})

    • Mint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, token0 string, token1 string, fee uint32, tickLower int32, tickUpper int32, amount0Desired string, amount1Desired string, amount0Min string, amount1Min string, deadline int64, mintTo string, referrer string) (uint64, string, string, string)

    • NewPosition(poolKey string, tickLower int32, tickUpper int32, liquidity string, feeGrowthInside0LastX128 string, feeGrowthInside1LastX128 string, tokensOwed0 int64, tokensOwed1 int64, burned bool, operator string) *gno.land/r/gnoswap/position.Position

    • NewPositionStore(kvStore interface {AddAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error; Delete func(int, .uverse.realm, string) .uverse.error; Get func(string) (interface {}, .uverse.error); GetAddress func(string) (.uverse.address, .uverse.error); GetAllKeys func() ([]string, .uverse.error); GetAuthorizedCallers func() (map[.uverse.address]gno.land/p/gnoswap/store/v1.Permission, .uverse.error); GetBPTree func(string) (*gno.land/p/nt/bptree/v0.BPTree, .uverse.error); GetBool func(string) (bool, .uverse.error); GetDomainAddress func() .uverse.address; GetInt64 func(string) (int64, .uverse.error); GetString func(string) (string, .uverse.error); GetUint64 func(string) (uint64, .uverse.error); Has func(string) bool; IsWriteAuthorized func(.uverse.address) bool; RemoveAuthorizedCaller func(int, .uverse.realm, .uverse.address) .uverse.error; Set func(int, .uverse.realm, string, interface {}) .uverse.error; UpdateAuthorizedCaller func(int, .uverse.realm, .uverse.address, gno.land/p/gnoswap/store/v1.Permission) .uverse.error}) 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}

    • NewPositionsTree() *gno.land/p/nt/bptree/v0.BPTree

    • RegisterInitializer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, initializer func(int, .uverse.realm, gno.land/r/gnoswap/position.IPositionStore) gno.land/r/gnoswap/position.IPosition)

    • Render(path string) string

    • Reposition(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, positionId uint64, tickLower int32, tickUpper int32, amount0DesiredStr string, amount1DesiredStr string, amount0MinStr string, amount1MinStr string, deadline int64) (uint64, string, int32, int32, string, string)

    • SetPositionOperator(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, positionId uint64, operator string)

    • UpgradeImpl(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, packagePath string)

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

    Rendered

    RenderedRawgnoweb ↗
    //
    9// Returns:
    10// - positions: read-only tree keyed by decimal position ID; callers paginate with IterateByOffset
    11func GetPositions() *rotree.ReadOnlyTree {
    12 return getImplementation().GetPositions()
    13}
    14
    15// IsBurned reports whether the position's empty-position marker is set.
    16//
    17// Parameters:
    18// - positionId: position NFT token ID
    19//
    20// Returns:
    21// - burned: whether the position's empty-position marker is set
    22// - err: non-nil when positionId cannot be resolved
    23func IsBurned(positionId uint64) (bool, error) {
    24 return getImplementation().IsBurned(positionId)
    25}
    26
    27// IsInRange reports whether a position's ticks contain the current pool tick.
    28//
    29// Parameters:
    30// - positionId: position NFT token ID
    31//
    32// Returns:
    33// - inRange: whether the position is currently in range
    34// - err: non-nil when positionId cannot be resolved or the associated pool tick cannot be read
    35func IsInRange(positionId uint64) (bool, error) {
    36 return getImplementation().IsInRange(positionId)
    37}
    38
    39// GetPositionTokenBalances calculates the current token0/token1 balances for
    40// a position from its liquidity, tick range, and pool price.
    41//
    42// These are derived balances, not permanently stored token amounts.
    43//
    44// Parameters:
    45// - positionId: position NFT token ID
    46//
    47// Returns:
    48// - balance0: current token0 balance
    49// - balance1: current token1 balance
    50// - err: non-nil when positionId cannot be resolved
    51func GetPositionTokenBalances(positionId uint64) (int64, int64, error) {
    52 return getImplementation().GetPositionTokenBalances(positionId)
    53}
    54
    55// GetPositionToken0Balance returns the token0 balance associated with a position.
    56//
    57// Parameters:
    58// - positionId: position NFT token ID
    59//
    60// Returns:
    61// - balance: token0 balance
    62// - err: non-nil when positionId cannot be resolved
    63func GetPositionToken0Balance(positionId uint64) (int64, error) {
    64 balance0, _, err := GetPositionTokenBalances(positionId)
    65 if err != nil {
    66 return 0, err
    67 }
    68
    69 return balance0, nil
    70}
    71
    72// GetPositionToken1Balance returns the token1 balance associated with a position.
    73//
    74// Parameters:
    75// - positionId: position NFT token ID
    76//
    77// Returns:
    78// - balance: token1 balance
    79// - err: non-nil when positionId cannot be resolved
    80func GetPositionToken1Balance(positionId uint64) (int64, error) {
    81 _, balance1, err := GetPositionTokenBalances(positionId)
    82 if err != nil {
    83 return 0, err
    84 }
    85
    86 return balance1, nil
    87}
    88
    89// GetPositionFeeGrowthInside0LastX128 returns the last fee-growth checkpoint inside the position's range for token0.
    90//
    91// Parameters:
    92// - positionId: position NFT token ID whose token0 fee-growth checkpoint is queried
    93//
    94// Returns:
    95// - feeGrowthInside0LastX128: token0 fee-growth checkpoint, represented as a decimal string
    96// - err: non-nil when positionId cannot be resolved
    97func GetPositionFeeGrowthInside0LastX128(positionId uint64) (string, error) {
    98 return getImplementation().GetPositionFeeGrowthInside0LastX128(positionId)
    99}
    100
    101// GetPositionFeeGrowthInside1LastX128 returns the last fee-growth checkpoint inside the position's range for token1.
    102//
    103// Parameters:
    104// - positionId: position NFT token ID whose token1 fee-growth checkpoint is queried
    105//
    106// Returns:
    107// - feeGrowthInside1LastX128: token1 fee-growth checkpoint, represented as a decimal string
    108// - err: non-nil when positionId cannot be resolved
    109func GetPositionFeeGrowthInside1LastX128(positionId uint64) (string, error) {
    110 return getImplementation().GetPositionFeeGrowthInside1LastX128(positionId)
    111}
    112
    113// GetPositionFeeGrowthInsideLastX128 returns the last fee-growth checkpoints inside the position's range for both tokens.
    114//
    115// Parameters:
    116// - positionId: position NFT token ID whose fee-growth checkpoints are queried
    117//
    118// Returns:
    119// - feeGrowthInside0LastX128: token0 fee-growth checkpoint, represented as a decimal string
    120// - feeGrowthInside1LastX128: token1 fee-growth checkpoint, represented as a decimal string
    121// - err: non-nil when positionId cannot be resolved
    122func GetPositionFeeGrowthInsideLastX128(positionId uint64) (string, string, error) {
    123 return getImplementation().GetPositionFeeGrowthInsideLastX128(positionId)
    124}
    125
    126// GetPositionLiquidity returns the stored liquidity amount of a position.
    127//
    128// Parameters:
    129// - positionId: position NFT token ID whose liquidity is queried
    130//
    131// Returns:
    132// - liquidity: position liquidity, represented as a decimal string
    133// - err: non-nil when positionId cannot be resolved
    134func GetPositionLiquidity(positionId uint64) (string, error) {
    135 return getImplementation().GetPositionLiquidity(positionId)
    136}
    137
    138// GetPositionOperator returns the approved operator address for a position.
    139//
    140// Parameters:
    141// - positionId: position NFT token ID whose operator is queried
    142//
    143// Returns:
    144// - operator: approved operator address; the zero address means no operator is set
    145// - err: non-nil when positionId cannot be resolved
    146func GetPositionOperator(positionId uint64) (address, error) {
    147 return getImplementation().GetPositionOperator(positionId)
    148}
    149
    150// GetPositionPoolKey returns the pool key associated with a position.
    151//
    152// Parameters:
    153// - positionId: position NFT token ID whose pool association is queried
    154//
    155// Returns:
    156// - poolKey: canonical pool key used by the position
    157// - err: non-nil when positionId cannot be resolved
    158func GetPositionPoolKey(positionId uint64) (string, error) {
    159 return getImplementation().GetPositionPoolKey(positionId)
    160}
    161
    162// GetPositionTickLower returns the lower tick boundary of a position.
    163//
    164// Parameters:
    165// - positionId: position NFT token ID whose lower tick is queried
    166//
    167// Returns:
    168// - tickLower: lower tick boundary of the position's price range
    169// - err: non-nil when positionId cannot be resolved
    170func GetPositionTickLower(positionId uint64) (int32, error) {
    171 return getImplementation().GetPositionTickLower(positionId)
    172}
    173
    174// GetPositionTickUpper returns the upper tick boundary of a position.
    175//
    176// Parameters:
    177// - positionId: position NFT token ID whose upper tick is queried
    178//
    179// Returns:
    180// - tickUpper: upper tick boundary of the position's price range
    181// - err: non-nil when positionId cannot be resolved
    182func GetPositionTickUpper(positionId uint64) (int32, error) {
    183 return getImplementation().GetPositionTickUpper(positionId)
    184}
    185
    186// GetPositionTicks returns the lower and upper tick boundaries of a position.
    187//
    188// Parameters:
    189// - positionId: position NFT token ID whose tick range is queried
    190//
    191// Returns:
    192// - tickLower: lower tick boundary of the position's price range
    193// - tickUpper: upper tick boundary of the position's price range
    194// - err: non-nil when positionId cannot be resolved
    195func GetPositionTicks(positionId uint64) (int32, int32, error) {
    196 return getImplementation().GetPositionTicks(positionId)
    197}
    198
    199// GetPositionTokensOwed0 returns the token0 amount accrued and owed to a position.
    200//
    201// Parameters:
    202// - positionId: position NFT token ID whose token0 debt is queried
    203//
    204// Returns:
    205// - tokensOwed0: token0 amount currently owed to the position
    206// - err: non-nil when positionId cannot be resolved
    207func GetPositionTokensOwed0(positionId uint64) (int64, error) {
    208 return getImplementation().GetPositionTokensOwed0(positionId)
    209}
    210
    211// GetPositionTokensOwed1 returns the token1 amount accrued and owed to a position.
    212//
    213// Parameters:
    214// - positionId: position NFT token ID whose token1 debt is queried
    215//
    216// Returns:
    217// - tokensOwed1: token1 amount currently owed to the position
    218// - err: non-nil when positionId cannot be resolved
    219func GetPositionTokensOwed1(positionId uint64) (int64, error) {
    220 return getImplementation().GetPositionTokensOwed1(positionId)
    221}
    222
    223// GetPositionTokensOwed returns the token0 and token1 amounts accrued and owed to a position.
    224//
    225// Parameters:
    226// - positionId: position NFT token ID whose accrued token debt is queried
    227//
    228// Returns:
    229// - tokensOwed0: token0 amount currently owed to the position
    230// - tokensOwed1: token1 amount currently owed to the position
    231// - err: non-nil when positionId cannot be resolved
    232func GetPositionTokensOwed(positionId uint64) (int64, int64, error) {
    233 return getImplementation().GetPositionTokensOwed(positionId)
    234}
    235
    236// GetUnclaimedFee returns the unclaimed fees for both tokens of a position as decimal strings.
    237//
    238// Parameters:
    239// - positionId: position NFT token ID whose unclaimed fees are queried
    240//
    241// Returns:
    242// - fee0: unclaimed token0 fee amount, represented as a decimal string
    243// - fee1: unclaimed token1 fee amount, represented as a decimal string
    244// - err: non-nil when positionId or the associated pool fee-growth data cannot be resolved
    245func GetUnclaimedFee(positionId uint64) (string, string, error) {
    246 fee0, fee1, err := getImplementation().GetUnclaimedFee(positionId)
    247 if err != nil {
    248 return "", "", err
    249 }
    250
    251 return fee0.ToString(), fee1.ToString(), nil
    252}
    253
    254// GetPositionOwner returns the owner address of a position NFT.
    255//
    256// Parameters:
    257// - positionId: position NFT token ID whose owner is queried
    258//
    259// Returns:
    260// - owner: address that owns the position NFT
    261// - err: non-nil when the NFT owner lookup fails
    262func GetPositionOwner(positionId uint64) (address, error) {
    263 return getImplementation().GetPositionOwner(positionId)
    264}
    265

    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.