@gala-chain/api ∙ API
API > DexPositionOwner
Class: DexPositionOwner
Contents
- Extends
- Constructors
- new DexPositionOwner(owner, poolHash)
- Properties
- owner
- poolHash
- tickRangeMap
- COMPOSITEKEY_NS
- ID_SPLIT_CHAR
- ID_SUB_SPLIT_CHAR
- INDEX_KEY
- MIN_UNICODE_RUNE_VALUE
- Methods
- addPosition()
- getCompositeKey()
- getPositionId()
- getTickRangeByPositionId()
- removePosition()
- serialize()
- toPlainObject()
- validate()
- validateOrReject()
- decodeFromBase58()
- deserialize()
- encodeToBase58()
- getCompositeKeyFromParts()
- getEncodableStringKeyFromParts()
- getPartsFromEncodableStringKey()
- getStringKeyFromParts()
Extends
Constructors
new DexPositionOwner(owner, poolHash)
new DexPositionOwner(
owner,poolHash):DexPositionOwner
Intiializes a new DexPositionOwner instance.
Parameters
▪ owner: string
User alias of the position owner.
▪ poolHash: string
Unique identifier of the pool.
Overrides
Source
chain-api/src/types/DexPositionOwner.ts:54
Properties
owner
owner:
string
Source
chain-api/src/types/DexPositionOwner.ts:36
poolHash
poolHash:
string
Source
chain-api/src/types/DexPositionOwner.ts:41
tickRangeMap
tickRangeMap:
Record\<string,string[]>
Source
chain-api/src/types/DexPositionOwner.ts:47
COMPOSITEKEY_NS
staticCOMPOSITEKEY_NS:string="\x00"
Inherited from
Source
chain-api/src/types/ChainObject.ts:46
ID_SPLIT_CHAR
staticID_SPLIT_CHAR:string="$"
Inherited from
Source
chain-api/src/types/ChainObject.ts:49
ID_SUB_SPLIT_CHAR
staticID_SUB_SPLIT_CHAR:string="|"
Inherited from
Source
chain-api/src/types/ChainObject.ts:51
INDEX_KEY
staticINDEX_KEY:string="GCDEXCPO"
Source
chain-api/src/types/DexPositionOwner.ts:31
MIN_UNICODE_RUNE_VALUE
staticMIN_UNICODE_RUNE_VALUE:string="\u0000"
Inherited from
ChainObject.MIN_UNICODE_RUNE_VALUE
Source
chain-api/src/types/ChainObject.ts:44
Methods
addPosition()
addPosition(
tickRange,positionId):void
Adds or updates a position ID for the specified tick range.
Parameters
▪ tickRange: string
Tick range string to map (e.g., "10:20").
▪ positionId: string
ID of the position to associate.
Source
chain-api/src/types/DexPositionOwner.ts:66
getCompositeKey()
getCompositeKey():
string
Inherited from
Source
chain-api/src/types/ChainObject.ts:80
getPositionId()
getPositionId(
tickRange):undefined|string
Retrieves the first position ID of the positions that the user owns in the specified tick range.
Parameters
▪ tickRange: string
Tick range string to look up.
Returns
The associated position ID, or undefined if not found.
Source
chain-api/src/types/DexPositionOwner.ts:91
getTickRangeByPositionId()
getTickRangeByPositionId(
positionId):undefined|string
Returns the tick range key that includes the given position ID. Searches through the tickRangeMap to find which tick range the positionId belongs to.
Parameters
▪ positionId: string
The position ID to search for
Returns
The corresponding tick range key, or undefined if not found
Source
chain-api/src/types/DexPositionOwner.ts:101
removePosition()
removePosition(
tickRange,positionId):void
Removes the position mapping for the given tick range.
Parameters
▪ tickRange: string
Tick range string to remove.
▪ positionId: string
Source
chain-api/src/types/DexPositionOwner.ts:77
serialize()
serialize():
string
Inherited from
Source
chain-api/src/types/ChainObject.ts:53
toPlainObject()
toPlainObject():
Record\<string,unknown>
Inherited from
Source
chain-api/src/types/ChainObject.ts:69
validate()
validate():
Promise\<ValidationError[]>
Inherited from
Source
chain-api/src/types/ChainObject.ts:57
validateOrReject()
validateOrReject():
Promise\<void>
Inherited from
Source
chain-api/src/types/ChainObject.ts:61
decodeFromBase58()
staticdecodeFromBase58(base58String):string
Parameters
▪ base58String: string
Inherited from
Source
chain-api/src/types/ChainObject.ts:142
deserialize()
staticdeserialize\<T>(constructor,object):T
Type parameters
▪ T
Parameters
▪ constructor: ClassConstructor\<Inferred\<T, ChainObject>>
▪ object: string | Record\<string, unknown> | Record\<string, unknown>[]
Inherited from
Source
chain-api/src/types/ChainObject.ts:73
encodeToBase58()
staticencodeToBase58(stringKey):string
Parameters
▪ stringKey: string
Inherited from
Source
chain-api/src/types/ChainObject.ts:137
getCompositeKeyFromParts()
staticgetCompositeKeyFromParts(indexKey,parts):string
Parameters
▪ indexKey: string
▪ parts: unknown[]
Inherited from
ChainObject.getCompositeKeyFromParts
Source
chain-api/src/types/ChainObject.ts:105
getEncodableStringKeyFromParts()
staticgetEncodableStringKeyFromParts(parts):string
Parameters
▪ parts: string[]
Inherited from
ChainObject.getEncodableStringKeyFromParts
Source
chain-api/src/types/ChainObject.ts:129
getPartsFromEncodableStringKey()
staticgetPartsFromEncodableStringKey(stringKey):string[]
Parameters
▪ stringKey: string
Inherited from
ChainObject.getPartsFromEncodableStringKey
Source
chain-api/src/types/ChainObject.ts:133
getStringKeyFromParts()
staticgetStringKeyFromParts(parts):string
Parameters
▪ parts: string[]
Inherited from
ChainObject.getStringKeyFromParts