@dfares/serde
TypeScript icon, indicating that this package has built-in type declarations

7.1.4 • Public • Published

@dfares/serde

This package contains serializers and deserializers for converting between various representations of Dark Forest data, for example between raw data received from blockchain calls to Dark Forest contracts and the typescript types used across the client.

Installation

You can install this package using npm or yarn by running:

npm install --save @dfares/serde
yarn add @dfares/serde

When using this in a plugin, you might want to load it with skypack

import * as serde from 'http://cdn.skypack.dev/@dfares/serde';

Table of contents

Type aliases

Functions

Type aliases

RawArrival

Ƭ RawArrival: Awaited<ReturnType<DarkForest["getPlanetArrival"]>>


RawArtifactPointValues

Ƭ RawArtifactPointValues: Awaited<ReturnType<DarkForest["getArtifactPointValues"]>>


RawArtifactWithMetadata

Ƭ RawArtifactWithMetadata: Awaited<ReturnType<DarkForest["getArtifactById"]>>


RawBurnedCoords

Ƭ RawBurnedCoords: Awaited<ReturnType<DarkForest["burnedCoords"]>>


RawClaimedCoords

Ƭ RawClaimedCoords: Awaited<ReturnType<DarkForest["claimedCoords"]>>


RawKardashevCoords

Ƭ RawKardashevCoords: Awaited<ReturnType<DarkForest["kardashevCoords"]>>


RawPlanet

Ƭ RawPlanet: Awaited<ReturnType<DarkForest["planets"]>>


RawPlayer

Ƭ RawPlayer: Awaited<ReturnType<DarkForest["players"]>>


RawRevealedCoords

Ƭ RawRevealedCoords: Awaited<ReturnType<DarkForest["revealedCoords"]>>


RawUnion

Ƭ RawUnion: Awaited<ReturnType<DarkForest["unions"]>>


RawUpgrade

Ƭ RawUpgrade: Awaited<ReturnType<DarkForest["getArtifactById"]>>["upgrade"]


RawUpgradesBranches

Ƭ RawUpgradesBranches: Awaited<ReturnType<DarkForest["getUpgrades"]>>

Functions

address

address(str): EthAddress

Converts a string to an EthAddress: a 0x-prefixed all lowercase hex string of 40 hex characters. An object of the EthAddress type should only ever be initialized through this constructor-like method. Throws if the provided string cannot be parsed as an Ethereum address.

Parameters

Name Type Description
str string An address-like string

Returns

EthAddress


artifactIdFromDecStr

artifactIdFromDecStr(artifactId): ArtifactId

Converts a string representing a decimal number into an ArtifactID: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded if necessary). ArtifactIDs should only be instantiated through artifactIdFromHexStr, artifactIdFromDecStr, and artifactIdFromEthersBN.

Parameters

Name Type Description
artifactId string string of decimal digits, the base 10 representation of an artifact ID.

Returns

ArtifactId


artifactIdFromEthersBN

artifactIdFromEthersBN(artifactId): ArtifactId

Converts a ethers.js BigNumber (type aliased here as EthersBN) representing a decimal number into an ArtifactID: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded if necessary). ArtifactIDs should only be instantiated through artifactIdFromHexStr, artifactIdFromDecStr, and artifactIdFromEthersBN.

Parameters

Name Type Description
artifactId BigNumber ether.js BigNumber representing artifact's ID

Returns

ArtifactId


artifactIdFromHexStr

artifactIdFromHexStr(artifactId): ArtifactId

Converts a possibly 0x-prefixed string of hex digits to an ArtifactId: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded if necessary). ArtifactIDs should only be instantiated through artifactIdFromHexStr, artifactIdFromDecStr, and artifactIdFromEthersBN.

Parameters

Name Type Description
artifactId string Possibly 0x-prefixed, possibly unpadded hex string representation of an artifact's ID.

Returns

ArtifactId


artifactIdToDecStr

artifactIdToDecStr(artifactId): string

Converts an ArtifactID to a decimal string with equivalent numerical value; can be used if you need to pass an artifact ID into a web3 call.

Parameters

Name Type Description
artifactId ArtifactId non-0x-prefixed lowercase hex string of 64 hex characters representing an artifact's ID

Returns

string


decodeArrival

decodeArrival(rawArrival): QueuedArrival

Converts the raw typechain result of ArrivalTypes.ArrivalData struct to to a QueuedArrival typescript typed object (see @dfares/types)

Parameters

Name Type Description
rawArrival [BigNumber, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, number, BigNumber] & { arrivalTime: BigNumber ; arrivalType: number ; carriedArtifactId: BigNumber ; departureTime: BigNumber ; distance: BigNumber ; fromPlanet: BigNumber ; id: BigNumber ; invitees: string[] ; leader: string ; level: BigNumber ; members: string[] ; name: string ; player: string ; popArriving: BigNumber ; silverMoved: BigNumber ; toPlanet: BigNumber ; unionId: BigNumber } Raw data of a ArrivalTypes.ArrivalData struct, returned from a blockchain call (assumed to be typed with typechain).

Returns

QueuedArrival


decodeArtifact

decodeArtifact(rawArtifactWithMetadata): Artifact

Converts the raw typechain result of ArtifactTypes.ArtifactWithMetadata struct to an Artifact typescript typed object (see @dfares/types).

Parameters

Name Type Description
rawArtifactWithMetadata [[boolean, BigNumber, BigNumber, number, number, BigNumber, string, number, BigNumber, BigNumber, BigNumber, BigNumber, string, BigNumber] & { activations: BigNumber ; artifactType: number ; controller: string ; discoverer: string ; id: BigNumber ; imageType: BigNumber ; isInitialized: boolean ; lastActivated: BigNumber ; lastDeactivated: BigNumber ; linkTo: BigNumber ; mintedAtTimestamp: BigNumber ; planetBiome: number ; planetDiscoveredOn: BigNumber ; rarity: number }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }] & { artifact: [boolean, BigNumber, BigNumber, number, number, BigNumber, string, number, BigNumber, BigNumber, BigNumber, BigNumber, string, BigNumber] & { activations: BigNumber ; artifactType: number ; controller: string ; discoverer: string ; id: BigNumber ; imageType: BigNumber ; isInitialized: boolean ; lastActivated: BigNumber ; lastDeactivated: BigNumber ; linkTo: BigNumber ; mintedAtTimestamp: BigNumber ; planetBiome: number ; planetDiscoveredOn: BigNumber ; rarity: number } ; locationId: BigNumber ; owner: string ; timeDelayedUpgrade: [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber } ; upgrade: [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber } ; voyageId: BigNumber } Raw data of an ArtifactWithMetadata struct, returned from a blockchain call (assumed to be typed with typechain).

Returns

Artifact


decodeArtifactPointValues

decodeArtifactPointValues(rawPointValues): ArtifactPointValues

Converts the raw typechain result of a call to DarkForest.getArtifactPointValues to an ArtifactPointValues typescript typed object (see @dfares/types).

Parameters

Name Type
rawPointValues [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber]

Returns

ArtifactPointValues


decodeBurnedCoords

decodeBurnedCoords(rawBurnedCoords): BurnedCoords

Converts the result of a typechain-typed ethers.js contract call returning a RevealTypes.RevealedCoords struct into a RevealedCoords object (see

dfares/types)

Parameters

Name Type
rawBurnedCoords [BigNumber, BigNumber, BigNumber, string, BigNumber] & { burnedAt: BigNumber ; locationId: BigNumber ; operator: string ; x: BigNumber ; y: BigNumber }

Returns

BurnedCoords


decodeClaimedCoords

decodeClaimedCoords(rawClaimedCoords): ClaimedCoords

Converts the result of a typechain-typed ethers.js contract call returning a DarkForestTypes.ClaimedCoords struct into a ClaimedCoords object (see

darkforest_eth/types)

Parameters

Name Type Description
rawClaimedCoords [BigNumber, BigNumber, BigNumber, string, BigNumber, BigNumber] & { claimedAt: BigNumber ; claimer: string ; locationId: BigNumber ; score: BigNumber ; x: BigNumber ; y: BigNumber } the result of a typechain-typed ethers.js contract call returning a DarkForestTypes.RevealedCoords` struct

Returns

ClaimedCoords


decodeKardashevCoords

decodeKardashevCoords(rawKardashevCoords): KardashevCoords

Converts the result of a typechain-typed ethers.js contract call returning a RevealTypes.RevealedCoords struct into a RevealedCoords object (see

dfares/types)

Parameters

Name Type
rawKardashevCoords [BigNumber, BigNumber, BigNumber, string, BigNumber] & { kardashevAt: BigNumber ; locationId: BigNumber ; operator: string ; x: BigNumber ; y: BigNumber }

Returns

KardashevCoords


decodePlanet

decodePlanet(rawLocationId, rawPlanet): Planet

Converts data obtained from a contract call (typed with Typechain) into a Planet that can be used by the client (see @dfares/types). Note that some Planet fields (1) store client data that the blockchain is not aware of, such as unconfirmedDepartures, (2) store derived data that is calculated later by the client, such as silverSpent and bonus, or (3) store data which must be added later from the results of additional contract calls, such as coordsRevealed and heldArtifactIds. Therefore this function may not be very useful to you outside of the specific context of the provided Dark Forest web client.

Parameters

Name Type Description
rawLocationId string string of decimal digits representing a number equal to a planet's ID
rawPlanet [string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { adminProtect: boolean ; burnOperator: string ; burnStartTimestamp: BigNumber ; canShow: boolean ; capturer: string ; createdAt: BigNumber ; defense: BigNumber ; destroyed: boolean ; energyGroDoublers: BigNumber ; frozen: boolean ; hasTriedFindingArtifact: boolean ; hatLevel: BigNumber ; hatType: BigNumber ; invadeStartBlock: BigNumber ; invader: string ; isHomePlanet: boolean ; isInitialized: boolean ; kardashevOperator: string ; kardashevTimestamp: BigNumber ; lastUpdated: BigNumber ; locationId: BigNumber ; owner: string ; pausers: BigNumber ; perlin: BigNumber ; pinkOperator: string ; planetLevel: BigNumber ; planetType: number ; population: BigNumber ; populationCap: BigNumber ; populationGrowth: BigNumber ; prospectedBlockNumber: BigNumber ; range: BigNumber ; silver: BigNumber ; silverCap: BigNumber ; silverGroDoublers: BigNumber ; silverGrowth: BigNumber ; spaceJunk: BigNumber ; spaceType: number ; speed: BigNumber ; upgradeState0: BigNumber ; upgradeState1: BigNumber ; upgradeState2: BigNumber } typechain-typed result of a call returning a PlanetTypes.Planet

Returns

Planet


decodePlanetDefaults

decodePlanetDefaults(rawDefaults): PlanetDefaults

Converts the raw typechain result of a call which fetches a PlanetTypes.PlanetDefaultStats[] array of structs, and converts it into an object with type PlanetDefaults (see @dfares/types).

Parameters

Name Type Description
rawDefaults [string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { barbarianPercentage: BigNumber ; defense: BigNumber ; label: string ; populationCap: BigNumber ; populationGrowth: BigNumber ; range: BigNumber ; silverCap: BigNumber ; silverGrowth: BigNumber ; speed: BigNumber }[] result of a ethers.js contract call which returns a raw PlanetTypes.PlanetDefaultStats struct, typed with typechain.

Returns

PlanetDefaults


decodePlayer

decodePlayer(rawPlayer): Player

Converts the raw typechain result of a call which fetches a PlayerTypes.Player struct, and converts it into an object with type Player (see @dfares/types) that can be used by a client.

Parameters

Name Type Description
rawPlayer [boolean, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber, boolean, BigNumber, boolean, BigNumber] & { activateArtifactAmount: BigNumber ; buyArtifactAmount: BigNumber ; buyPlanetAmount: BigNumber ; buySpaceshipAmount: BigNumber ; claimedReward: boolean ; claimedShips: boolean ; donationAmount: BigNumber ; dropBombAmount: BigNumber ; finalRank: BigNumber ; hatCount: BigNumber ; homePlanetId: BigNumber ; initTimestamp: BigNumber ; isInitialized: boolean ; kardashevAmount: BigNumber ; lastRevealTimestamp: BigNumber ; leaveUnionTimestamp: BigNumber ; moveCount: BigNumber ; pinkAmount: BigNumber ; pinkedAmount: BigNumber ; player: string ; score: BigNumber ; silver: BigNumber ; spaceJunk: BigNumber ; spaceJunkLimit: BigNumber ; unionId: BigNumber } result of an ethers.js contract call which returns a raw PlayerTypes.Player struct, typed with typechain.

Returns

Player


decodeRevealedCoords

decodeRevealedCoords(rawRevealedCoords): RevealedCoords

Converts the result of a typechain-typed ethers.js contract call returning a RevealTypes.RevealedCoords struct into a RevealedCoords object (see

dfares/types)

Parameters

Name Type Description
rawRevealedCoords [BigNumber, BigNumber, BigNumber, string] & { locationId: BigNumber ; revealer: string ; x: BigNumber ; y: BigNumber } the result of a typechain-typed ethers.js contract call returning a RevealTypes.RevealedCoords` struct

Returns

RevealedCoords


decodeUnion

decodeUnion(rawUnion): Union

Converts the raw typechain result of a call which fetches a UnionTypes.Union struct, and converts it into an object with type Union (see @dfares/types) that can be used by a client.

Parameters

Name Type Description
rawUnion [BigNumber, string, string, BigNumber, string[], string[], string[]] & { applicants: string[] ; invitees: string[] ; leader: string ; level: BigNumber ; members: string[] ; name: string ; unionId: BigNumber } result of an ethers.js contract call which returns a raw UnionTypes.Union struct, typed with typechain.

Returns

Union


decodeUpgrade

decodeUpgrade(rawUpgrade): Upgrade

Converts raw data received from a typechain-typed ethers.js contract call returning a UpgradeTypes.Upgrade into an Upgrade object (see

dfares/types)

Parameters

Name Type Description
rawUpgrade [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber } raw data received from a typechain-typed ethers.js contract call returning a UpgradeTypes.Upgrade

Returns

Upgrade


decodeUpgradeBranches

decodeUpgradeBranches(rawUpgradeBranches): UpgradeBranches

Converts the raw return value of an ether.js contract call to DarkForest.getUpgrades to a 2D array of Upgrades.

Parameters

Name Type Description
rawUpgradeBranches [[[BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }], [[BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }], [[BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }, [BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & { defMultiplier: BigNumber ; popCapMultiplier: BigNumber ; popGroMultiplier: BigNumber ; rangeMultiplier: BigNumber ; speedMultiplier: BigNumber }]] raw return value of ether.js contract call to DarkForest.getUpgrades

Returns

UpgradeBranches


hashToInt

hashToInt(hash): number

Parameters

Name Type
hash string

Returns

number


isNetworkEvent

isNetworkEvent(event): event is NetworkEvent

Returns whether or not the given event is an instance of {@link NetworkEvent}. Not super stringent but works for now.

Parameters

Name Type
event any

Returns

event is NetworkEvent


isUnconfirmedAcceptApplication

isUnconfirmedAcceptApplication(txIntent): txIntent is UnconfirmedAcceptApplication

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedAcceptApplication


isUnconfirmedAcceptApplicationTx

isUnconfirmedAcceptApplicationTx(tx): tx is Transaction<UnconfirmedAcceptApplication>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedAcceptApplication>


isUnconfirmedAcceptInvite

isUnconfirmedAcceptInvite(txIntent): txIntent is UnconfirmedAcceptInvite

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedAcceptInvite


isUnconfirmedAcceptInviteTx

isUnconfirmedAcceptInviteTx(tx): tx is Transaction<UnconfirmedAcceptInvite>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedAcceptInvite>


isUnconfirmedActivateArtifact

isUnconfirmedActivateArtifact(txIntent): txIntent is UnconfirmedActivateArtifact

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedActivateArtifact


isUnconfirmedActivateArtifactTx

isUnconfirmedActivateArtifactTx(tx): tx is Transaction<UnconfirmedActivateArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedActivateArtifact>


isUnconfirmedAddMemberByAdmin

isUnconfirmedAddMemberByAdmin(txIntent): txIntent is UnconfirmedAddMemberByAdmin

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedAddMemberByAdmin


isUnconfirmedAddMemberByAdminTx

isUnconfirmedAddMemberByAdminTx(tx): tx is Transaction<UnconfirmedAddMemberByAdmin>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedAddMemberByAdmin>


isUnconfirmedBlue

isUnconfirmedBlue(txIntent): txIntent is UnconfirmedBlue

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedBlue


isUnconfirmedBlueTx

isUnconfirmedBlueTx(tx): tx is Transaction<UnconfirmedBlue>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedBlue>


isUnconfirmedBurn

isUnconfirmedBurn(txIntent): txIntent is UnconfirmedBurn

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedBurn


isUnconfirmedBurnTx

isUnconfirmedBurnTx(tx): tx is Transaction<UnconfirmedBurn>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedBurn>


isUnconfirmedBuyArtifact

isUnconfirmedBuyArtifact(txIntent): txIntent is UnconfirmedBuyArtifact

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedBuyArtifact


isUnconfirmedBuyArtifactTx

isUnconfirmedBuyArtifactTx(tx): tx is Transaction<UnconfirmedBuyArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedBuyArtifact>


isUnconfirmedBuyHat

isUnconfirmedBuyHat(txIntent): txIntent is UnconfirmedBuyHat

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedBuyHat


isUnconfirmedBuyHatTx

isUnconfirmedBuyHatTx(tx): tx is Transaction<UnconfirmedBuyHat>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedBuyHat>


isUnconfirmedBuyPlanet

isUnconfirmedBuyPlanet(txIntent): txIntent is UnconfirmedBuyPlanet

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedBuyPlanet


isUnconfirmedBuyPlanetTx

isUnconfirmedBuyPlanetTx(tx): tx is Transaction<UnconfirmedBuyPlanet>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedBuyPlanet>


isUnconfirmedBuySpaceship

isUnconfirmedBuySpaceship(txIntent): txIntent is UnconfirmedBuySpaceship

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedBuySpaceship


isUnconfirmedBuySpaceshipTx

isUnconfirmedBuySpaceshipTx(tx): tx is Transaction<UnconfirmedBuySpaceship>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedBuySpaceship>


isUnconfirmedCancelApplication

isUnconfirmedCancelApplication(txIntent): txIntent is UnconfirmedCancelApplication

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedCancelApplication


isUnconfirmedCancelApplicationTx

isUnconfirmedCancelApplicationTx(tx): tx is Transaction<UnconfirmedCancelApplication>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedCancelApplication>


isUnconfirmedCancelInvite

isUnconfirmedCancelInvite(txIntent): txIntent is UnconfirmedCancelInvite

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedCancelInvite


isUnconfirmedCancelInviteTx

isUnconfirmedCancelInviteTx(tx): tx is Transaction<UnconfirmedCancelInvite>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedCancelInvite>


isUnconfirmedCapturePlanet

isUnconfirmedCapturePlanet(txIntent): txIntent is UnconfirmedCapturePlanet

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedCapturePlanet


isUnconfirmedCapturePlanetTx

isUnconfirmedCapturePlanetTx(tx): tx is Transaction<UnconfirmedCapturePlanet>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedCapturePlanet>


isUnconfirmedChangeArtifactImageType

isUnconfirmedChangeArtifactImageType(txIntent): txIntent is UnconfirmedChangeArtifactImageType

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedChangeArtifactImageType


isUnconfirmedChangeArtifactImageTypeTx

isUnconfirmedChangeArtifactImageTypeTx(tx): tx is Transaction<UnconfirmedDeactivateArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedDeactivateArtifact>


isUnconfirmedChangeUnionName

isUnconfirmedChangeUnionName(txIntent): txIntent is UnconfirmedChangeUnionName

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedChangeUnionName


isUnconfirmedChangeUnionNameTx

isUnconfirmedChangeUnionNameTx(tx): tx is Transaction<UnconfirmedChangeUnionName>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedChangeUnionName>


isUnconfirmedClaim

isUnconfirmedClaim(txIntent): txIntent is UnconfirmedClaim

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedClaim


isUnconfirmedClaimTx

isUnconfirmedClaimTx(tx): tx is Transaction<UnconfirmedReveal>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedReveal>


isUnconfirmedCreateUnion

isUnconfirmedCreateUnion(txIntent): txIntent is UnconfirmedCreateUnion

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedCreateUnion


isUnconfirmedCreateUnionTx

isUnconfirmedCreateUnionTx(tx): tx is Transaction<UnconfirmedCreateUnion>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedCreateUnion>


isUnconfirmedDeactivateArtifact

isUnconfirmedDeactivateArtifact(txIntent): txIntent is UnconfirmedDeactivateArtifact

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedDeactivateArtifact


isUnconfirmedDeactivateArtifactTx

isUnconfirmedDeactivateArtifactTx(tx): tx is Transaction<UnconfirmedDeactivateArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedDeactivateArtifact>


isUnconfirmedDepositArtifact

isUnconfirmedDepositArtifact(txIntent): txIntent is UnconfirmedDepositArtifact

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedDepositArtifact


isUnconfirmedDepositArtifactTx

isUnconfirmedDepositArtifactTx(tx): tx is Transaction<UnconfirmedDepositArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedDepositArtifact>


isUnconfirmedDisbandUnion

isUnconfirmedDisbandUnion(txIntent): txIntent is UnconfirmedDisbandUnion

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedDisbandUnion


isUnconfirmedDisbandUnionTx

isUnconfirmedDisbandUnionTx(tx): tx is Transaction<UnconfirmedDisbandUnion>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedDisbandUnion>


isUnconfirmedDonate

isUnconfirmedDonate(txIntent): txIntent is UnconfirmedDonate

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedDonate


isUnconfirmedDonateTx

isUnconfirmedDonateTx(tx): tx is Transaction<UnconfirmedDonate>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedDonate>


isUnconfirmedFindArtifact

isUnconfirmedFindArtifact(txIntent): txIntent is UnconfirmedFindArtifact

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedFindArtifact


isUnconfirmedFindArtifactTx

isUnconfirmedFindArtifactTx(tx): tx is Transaction<UnconfirmedFindArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedFindArtifact>


isUnconfirmedGetShips

isUnconfirmedGetShips(txIntent): txIntent is UnconfirmedGetShips

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedGetShips


isUnconfirmedGetShipsTx

isUnconfirmedGetShipsTx(tx): tx is Transaction<UnconfirmedGetShips>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedGetShips>


isUnconfirmedInit

isUnconfirmedInit(txIntent): txIntent is UnconfirmedInit

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedInit


isUnconfirmedInitTx

isUnconfirmedInitTx(tx): tx is Transaction<UnconfirmedInit>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedInit>


isUnconfirmedInvadePlanet

isUnconfirmedInvadePlanet(txIntent): txIntent is UnconfirmedInvadePlanet

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedInvadePlanet


isUnconfirmedInvadePlanetTx

isUnconfirmedInvadePlanetTx(tx): tx is Transaction<UnconfirmedInvadePlanet>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedInvadePlanet>


isUnconfirmedInviteMember

isUnconfirmedInviteMember(txIntent): txIntent is UnconfirmedInviteMember

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedInviteMember


isUnconfirmedInviteMemberTx

isUnconfirmedInviteMemberTx(tx): tx is Transaction<UnconfirmedInviteMember>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedInviteMember>


isUnconfirmedKardashev

isUnconfirmedKardashev(txIntent): txIntent is UnconfirmedKardashev

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedKardashev


isUnconfirmedKardashevTx

isUnconfirmedKardashevTx(tx): tx is Transaction<UnconfirmedKardashev>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedKardashev>


isUnconfirmedKickMember

isUnconfirmedKickMember(txIntent): txIntent is UnconfirmedKickMember

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedKickMember


isUnconfirmedKickMemberTx

isUnconfirmedKickMemberTx(tx): tx is Transaction<UnconfirmedKickMember>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedKickMember>


isUnconfirmedLeaveUnion

isUnconfirmedLeaveUnion(txIntent): txIntent is UnconfirmedLeaveUnion

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedLeaveUnion


isUnconfirmedLeaveUnionTx

isUnconfirmedLeaveUnionTx(tx): tx is Transaction<UnconfirmedLeaveUnion>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedLeaveUnion>


isUnconfirmedLevelUpUnion

isUnconfirmedLevelUpUnion(txIntent): txIntent is UnconfirmedLevelUpUnion

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedLevelUpUnion


isUnconfirmedLevelUpUnionTx

isUnconfirmedLevelUpUnionTx(tx): tx is Transaction<UnconfirmedLevelUpUnion>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedLevelUpUnion>


isUnconfirmedMove

isUnconfirmedMove(txIntent): txIntent is UnconfirmedMove

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedMove


isUnconfirmedMoveTx

isUnconfirmedMoveTx(tx): tx is Transaction<UnconfirmedMove>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedMove>


isUnconfirmedPink

isUnconfirmedPink(txIntent): txIntent is UnconfirmedPink

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedPink


isUnconfirmedPinkTx

isUnconfirmedPinkTx(tx): tx is Transaction<UnconfirmedPink>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedPink>


isUnconfirmedProspectPlanet

isUnconfirmedProspectPlanet(txIntent): txIntent is UnconfirmedProspectPlanet

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedProspectPlanet


isUnconfirmedProspectPlanetTx

isUnconfirmedProspectPlanetTx(tx): tx is Transaction<UnconfirmedProspectPlanet>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedProspectPlanet>


isUnconfirmedRefreshPlanet

isUnconfirmedRefreshPlanet(txIntent): txIntent is UnconfirmedRefreshPlanet

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedRefreshPlanet


isUnconfirmedRefreshPlanetTx

isUnconfirmedRefreshPlanetTx(tx): tx is Transaction<UnconfirmedRefreshPlanet>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedRefreshPlanet>


isUnconfirmedRejectApplication

isUnconfirmedRejectApplication(txIntent): txIntent is UnconfirmedCancelApplication

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedCancelApplication


isUnconfirmedRejectApplicationTx

isUnconfirmedRejectApplicationTx(tx): tx is Transaction<UnconfirmedRejectApplication>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedRejectApplication>


isUnconfirmedRelease

isUnconfirmedRelease(txIntent): txIntent is UnconfirmedMove

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedMove


isUnconfirmedReleaseTx

isUnconfirmedReleaseTx(tx): tx is Transaction<UnconfirmedMove>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedMove>


isUnconfirmedReveal

isUnconfirmedReveal(txIntent): txIntent is UnconfirmedReveal

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedReveal


isUnconfirmedRevealTx

isUnconfirmedRevealTx(tx): tx is Transaction<UnconfirmedReveal>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedReveal>


isUnconfirmedSendApplication

isUnconfirmedSendApplication(txIntent): txIntent is UnconfirmedSendApplication

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedSendApplication


isUnconfirmedSendApplicationTx

isUnconfirmedSendApplicationTx(tx): tx is Transaction<UnconfirmedSendApplication>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedSendApplication>


isUnconfirmedTransfer

isUnconfirmedTransfer(txIntent): txIntent is UnconfirmedPlanetTransfer

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedPlanetTransfer


isUnconfirmedTransferLeaderRole

isUnconfirmedTransferLeaderRole(txIntent): txIntent is UnconfirmedTransferLeaderRole

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedTransferLeaderRole


isUnconfirmedTransferLeaderRoleTx

isUnconfirmedTransferLeaderRoleTx(tx): tx is Transaction<UnconfirmedTransferLeaderRole>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedTransferLeaderRole>


isUnconfirmedTransferTx

isUnconfirmedTransferTx(tx): tx is Transaction<UnconfirmedPlanetTransfer>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedPlanetTransfer>


isUnconfirmedUpgrade

isUnconfirmedUpgrade(txIntent): txIntent is UnconfirmedUpgrade

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedUpgrade


isUnconfirmedUpgradeTx

isUnconfirmedUpgradeTx(tx): tx is Transaction<UnconfirmedUpgrade>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedUpgrade>


isUnconfirmedUseKey

isUnconfirmedUseKey(txIntent): txIntent is UnconfirmedUseKey

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedUseKey


isUnconfirmedUseKeyTx

isUnconfirmedUseKeyTx(tx): tx is Transaction<UnconfirmedUseKey>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedUseKey>


isUnconfirmedWithdrawArtifact

isUnconfirmedWithdrawArtifact(txIntent): txIntent is UnconfirmedWithdrawArtifact

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedWithdrawArtifact


isUnconfirmedWithdrawArtifactTx

isUnconfirmedWithdrawArtifactTx(tx): tx is Transaction<UnconfirmedWithdrawArtifact>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedWithdrawArtifact>


isUnconfirmedWithdrawSilver

isUnconfirmedWithdrawSilver(txIntent): txIntent is UnconfirmedWithdrawSilver

Parameters

Name Type
txIntent TxIntent

Returns

txIntent is UnconfirmedWithdrawSilver


isUnconfirmedWithdrawSilverTx

isUnconfirmedWithdrawSilverTx(tx): tx is Transaction<UnconfirmedWithdrawSilver>

Parameters

Name Type
tx Transaction<TxIntent>

Returns

tx is Transaction<UnconfirmedWithdrawSilver>


locationIdFromBigInt

locationIdFromBigInt(location): LocationId

Converts a BigInteger representation of location ID into a LocationID: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded). LocationIDs should only be instantiated through locationIdFromHexStr, locationIdFromDecStr, locationIdFromBigInt, and locationIdFromEthersBN.

Parameters

Name Type Description
location BigInteger BigInteger representation of a location ID.

Returns

LocationId


locationIdFromDecStr

locationIdFromDecStr(location): LocationId

Converts a string representing a decimal number into a LocationID: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded if necessary). LocationIDs should only be instantiated through locationIdFromHexStr, locationIdFromDecStr, locationIdFromBigInt, and locationIdFromEthersBN.

Parameters

Name Type Description
location string string of decimal digits, the base 10 representation of a location ID.

Returns

LocationId


locationIdFromEthersBN

locationIdFromEthersBN(location): LocationId

Converts an ethers.js BigNumber (type aliased here as EthersBN) representation of a location ID into a LocationID: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded). LocationIDs should only be instantiated through locationIdFromHexStr, locationIdFromDecStr, locationIdFromBigInt, and locationIdFromEthersBN.

Parameters

Name Type Description
location BigNumber ethers.js BigNumber representation of a locationID.

Returns

LocationId


locationIdFromHexStr

locationIdFromHexStr(location): LocationId

Converts a possibly 0x-prefixed string of hex digits to a LocationId: a non-0x-prefixed all lowercase hex string of exactly 64 hex characters (0-padded if necessary). LocationIDs should only be instantiated through locationIdFromHexStr, locationIdFromDecStr, locationIdFromBigInt, and locationIdFromEthersBN.

Parameters

Name Type Description
location string A possibly 0x-prefixed string of hex digits representing a location ID.

Returns

LocationId


locationIdToDecStr

locationIdToDecStr(locationId): string

Converts a LocationID to a decimal string with the same numerical value; can be used if you need to pass an artifact ID into a web3 call.

Parameters

Name Type Description
locationId LocationId LocationID to convert into a string of decimal digits

Returns

string

Readme

Keywords

none

Package Sidebar

Install

npm i @dfares/serde

Weekly Downloads

1

Version

7.1.4

License

MIT

Unpacked Size

244 kB

Total Files

63

Last publish

Collaborators

  • cherryblue1024
  • bitddy