Skip to main content

Reference / Modules / client

Module: client

Exposes tools enabling interaction with a Logion network. An instance of LogionClient must be created. Most features of the client require authentication.

Table of contents

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

TermsAndConditions

Type Aliases

AnyLocState

Ƭ AnyLocState: OffchainLocState | OnchainLocState

Defined in

packages/client/src/Loc.ts:751


CreativeCommonsCode

Ƭ CreativeCommonsCode: typeof values extends Set<infer T> ? T : never

Defined in

packages/client/src/license/CreativeCommons.ts:6


EnvironmentString

Ƭ EnvironmentString: keyof typeof Environment

Defined in

packages/client/src/Environment.ts:33


FullSigner

Ƭ FullSigner: RawSigner & Signer

Defined in

packages/client/src/Signer.ts:53


IdenfySessionStatus

Ƭ IdenfySessionStatus: "APPROVED" | "DENIED" | "SUSPECTED" | "EXPIRED" | "PENDING"

Defined in

packages/client/src/LocClient.ts:163


ItemStatus

Ƭ ItemStatus: "DRAFT" | "REVIEW_PENDING" | "REVIEW_ACCEPTED" | "REVIEW_REJECTED" | "PUBLISHED" | "ACKNOWLEDGED"

Defined in

packages/client/src/LocClient.ts:60


Language

Ƭ Language: "en" | "fr"

Defined in

packages/client/src/Types.ts:35


LocRequestStatus

Ƭ LocRequestStatus: "DRAFT" | "REVIEW_PENDING" | "REVIEW_REJECTED" | "REVIEW_ACCEPTED" | "OPEN" | "CLOSED"

Defined in

packages/client/src/LocClient.ts:165


MultiResponse

Ƭ MultiResponse<R>: Record<string, R>

Type parameters

Name
R

Defined in

packages/client/src/Http.ts:19


NetworkType

Ƭ NetworkType: "ETHEREUM" | "POLKADOT" | "MULTIVERSX"

Defined in

packages/client/src/Token.ts:33


OffchainLocState

Ƭ OffchainLocState: DraftRequest | PendingRequest | RejectedRequest | AcceptedRequest

Defined in

packages/client/src/Loc.ts:753


OnchainLocState

Ƭ OnchainLocState: OpenLoc | ClosedLoc | ClosedCollectionLoc | VoidedLoc | VoidedCollectionLoc

Defined in

packages/client/src/Loc.ts:755


ProtectionRequestStatus

Ƭ ProtectionRequestStatus: "PENDING" | "REJECTED" | "ACCEPTED" | "ACTIVATED" | "CANCELLED" | "REJECTED_CANCELLED" | "ACCEPTED_CANCELLED"

Defined in

packages/client/src/RecoveryClient.ts:16


ProtectionState

Ƭ ProtectionState: NoProtection | PendingProtection | AcceptedProtection | ActiveProtection | PendingRecovery | ClaimedRecovery | UnavailableProtection | RejectedRecovery

Defined in

packages/client/src/Recovery.ts:24


Query

Ƭ Query<E, R>: (axios: AxiosInstance, endpoint: E) => Promise<R>

Type parameters

Name
E
R

Type declaration

▸ (axios, endpoint): Promise<R>

Parameters
NameType
axiosAxiosInstance
endpointE
Returns

Promise<R>

Defined in

packages/client/src/Http.ts:33


ReviewResult

Ƭ ReviewResult: "ACCEPT" | "REJECT"

Defined in

packages/client/src/LocClient.ts:2409


ReviewableRequest

Ƭ ReviewableRequest: OpenLoc | PendingRequest

Defined in

packages/client/src/Loc.ts:1263


SignAndSendFunction

Ƭ SignAndSendFunction: (statusCallback: (result: ISubmittableResult) => void) => Promise<() => void>

Type declaration

▸ (statusCallback): Promise<() => void>

Parameters
NameType
statusCallback(result: ISubmittableResult) => void
Returns

Promise<() => void>

Defined in

packages/client/src/Signer.ts:55


SignCallback

Ƭ SignCallback: (result: ISubmittableResult) => void

Type declaration

▸ (result): void

Parameters
NameType
resultISubmittableResult
Returns

void

Defined in

packages/client/src/Signer.ts:33


SignatureType

Ƭ SignatureType: "POLKADOT" | "ETHEREUM" | "CROSSMINT_ETHEREUM" | "MULTIVERSX"

Defined in

packages/client/src/Signer.ts:21


TokenIdType

Ƭ TokenIdType: "U8" | "U16" | "U32" | "U64" | "U128" | "Bytes"

This is a rewrite of the function get_item_id implemented by Logion Smart Contract: https://github.com/logion-network/logion-ink/blob/41d7aeb1ac746d8a557f0592f82f0bcb206f6e7a/logics/impls/logion.rs#L38-L43

Defined in

packages/client/src/PSP34.ts:8


TokenType

Ƭ TokenType: "ethereum_erc721" | "ethereum_erc1155" | "goerli_erc721" | "goerli_erc1155" | "singular_kusama" | "polygon_erc721" | "polygon_erc1155" | "polygon_mumbai_erc721" | "polygon_mumbai_erc1155" | "ethereum_erc20" | "goerli_erc20" | "polygon_erc20" | "polygon_mumbai_erc20" | "owner" | "multiversx_devnet_esdt" | "multiversx_testnet_esdt" | "multiversx_esdt" | "astar_psp34" | "astar_shiden_psp34" | "astar_shibuya_psp34"

Defined in

packages/client/src/Token.ts:10


TransactionType

Ƭ TransactionType: "EXTRINSIC" | "VAULT_OUT" | "LEGAL_FEE" | "STORAGE_FEE" | "CERTIFICATE_FEE" | "OTHER_FEES" | "VALUE_FEE" | "RESERVE" | "COLLECTION_ITEM_FEE" | "TOKENS_RECORD_FEE"

Defined in

packages/client/src/TransactionClient.ts:32


TransferDirection

Ƭ TransferDirection: "Sent" | "Received" | "None"

Defined in

packages/client/src/Balance.ts:45


VaultStateCreationParameters

Ƭ VaultStateCreationParameters: SharedState & { isRecovery: boolean ; recoveredAccount?: ValidAccountId ; selectedLegalOfficers: LegalOfficer[] }

Defined in

packages/client/src/Vault.ts:31


VaultTransferRequestStatus

Ƭ VaultTransferRequestStatus: "ACCEPTED" | "PENDING" | "REJECTED" | "CANCELLED" | "REJECTED_CANCELLED"

Defined in

packages/client/src/VaultClient.ts:9


VerifiedIssuerWithSelect

Ƭ VerifiedIssuerWithSelect: VerifiedIssuer & { selected: boolean }

Defined in

packages/client/src/Loc.ts:2088


VoteResult

Ƭ VoteResult: "Yes" | "No"

Defined in

packages/client/src/Votes.ts:132


VoteStatus

Ƭ VoteStatus: "PENDING" | "APPROVED" | "REJECTED"

Defined in

packages/client/src/Votes.ts:120

Variables

CoreComponentFactoryInstance

Const CoreComponentFactoryInstance: CoreComponentFactory

Defined in

packages/client/src/ComponentFactory.ts:92


DEFAULT_POLLING_PARAMETERS

Const DEFAULT_POLLING_PARAMETERS: PollingParameters

Defined in

packages/client/src/Polling.ts:14


EMPTY_LOC_ISSUERS

Const EMPTY_LOC_ISSUERS: LocVerifiedIssuers

Defined in

packages/client/src/LocClient.ts:2481


ISO_DATETIME_PATTERN

Const ISO_DATETIME_PATTERN: RegExp

Defined in

packages/client/src/DateTimeUtil.ts:12


TERMS_AND_CONDITIONS_TYPES

Const TERMS_AND_CONDITIONS_TYPES: readonly ["logion_classification", "specific_license", "CC4.0"]

Defined in

packages/client/src/license/TermsAndConditions.ts:3


values

Const values: Set<"BY" | "BY-SA" | "BY-NC" | "BY-NC-SA" | "BY-ND" | "BY-NC-ND">

Defined in

packages/client/src/license/CreativeCommons.ts:5

Functions

aggregateArrays

aggregateArrays<E>(response): E[]

Type parameters

Name
E

Parameters

NameType
responseMultiResponse<E[]>

Returns

E[]

Defined in

packages/client/src/Http.ts:141


allUp

allUp<E>(endpoints): MultiSourceHttpClientState<E>

Type parameters

NameType
Eextends Endpoint

Parameters

NameType
endpointsE[]

Returns

MultiSourceHttpClientState<E>

Defined in

packages/client/src/Http.ts:26


authenticatedCurrentAccount

authenticatedCurrentAccount(sharedState): Object

Parameters

NameType
sharedStateSharedState

Returns

Object

NameType
currentAccountValidAccountId
tokenToken

Defined in

packages/client/src/SharedClient.ts:42


buildComponentFactory

buildComponentFactory(buildFileUploader): ComponentFactory

Parameters

NameType
buildFileUploader() => FileUploader

Returns

ComponentFactory

Defined in

packages/client/src/ComponentFactory.ts:104


checkCertifiedCopy

checkCertifiedCopy(deliveries, hash): CheckCertifiedCopyResult

Parameters

NameType
deliveriesItemDeliveries
hashHash

Returns

CheckCertifiedCopyResult

Defined in

packages/client/src/Deliveries.ts:3


createLogionClientConfig

createLogionClientConfig(env, buildFileUploader): LogionClientConfig

Parameters

NameType
env"DEV" | "TEST" | "MVP" | Environment
buildFileUploader() => FileUploader

Returns

LogionClientConfig

Defined in

packages/client/src/Environment.ts:35


downloadFile

downloadFile(axios, url): Promise<TypedFile>

Parameters

NameType
axiosAxiosInstance
urlstring

Returns

Promise<TypedFile>

Defined in

packages/client/src/Http.ts:154


fromIsoString

fromIsoString(isoString): DateTime

Parameters

NameType
isoStringstring

Returns

DateTime

Defined in

packages/client/src/DateTimeUtil.ts:14


generateEthereumTokenItemId

generateEthereumTokenItemId(nonce, tokenId): Hash

This is a rewrite of the function getItemId implemented by Logion Smart Contract: https://github.com/logion-network/logion-solidity/blob/main/contracts/Logion.sol

Parameters

NameType
noncestring
tokenIdstring

Returns

Hash

Defined in

packages/client/src/Ethereum.ts:7


generatePSP34TokenItemId

generatePSP34TokenItemId(nonce, tokenId): Hash

Parameters

NameType
noncestring
tokenIdObject
tokenId.typeTokenIdType
tokenId.valuestring

Returns

Hash

Defined in

packages/client/src/PSP34.ts:10


getBalanceState

getBalanceState(sharedState): Promise<BalanceState>

Parameters

NameType
sharedStateSharedState & { isRecovery: boolean ; recoveredAccount?: ValidAccountId }

Returns

Promise<BalanceState>

Defined in

packages/client/src/Balance.ts:65


getCollectionItem

getCollectionItem(parameters): Promise<CollectionItem | undefined>

Parameters

NameType
parametersObject
parameters.itemIdHash
parameters.locClientLocClient
parameters.locIdUUID

Returns

Promise<CollectionItem | undefined>

Defined in

packages/client/src/Loc.ts:2169


getDefinedCurrentAccount

getDefinedCurrentAccount(sharedState): ValidAccountId

Parameters

NameType
sharedStateSharedState

Returns

ValidAccountId

Defined in

packages/client/src/SharedClient.ts:54


getInitialState

getInitialState(data, pSharedState): ProtectionState

Parameters

NameType
dataFetchAllResult
pSharedStateSharedState

Returns

ProtectionState

Defined in

packages/client/src/Recovery.ts:79


getLegalOfficer

getLegalOfficer(sharedState, account): LegalOfficerClass

Parameters

NameType
sharedStateSharedState
accountValidAccountId

Returns

LegalOfficerClass

Defined in

packages/client/src/SharedClient.ts:38


getTokensRecord

getTokensRecord(parameters): Promise<TokensRecord | undefined>

Parameters

NameType
parametersObject
parameters.locClientLocClient
parameters.locIdUUID
parameters.recordIdHash

Returns

Promise<TokensRecord | undefined>

Defined in

packages/client/src/Loc.ts:2186


getTokensRecords

getTokensRecords(parameters): Promise<TokensRecord[]>

Parameters

NameType
parameters{ locClient: LocClient } & GetTokensRecordsRequest

Returns

Promise<TokensRecord[]>

Defined in

packages/client/src/Loc.ts:2203


hashAttributes

hashAttributes(attributes): string

Parameters

NameType
attributesstring[]

Returns

string

Defined in

packages/client/src/Signer.ts:212


initMultiSourceHttpClientState

initMultiSourceHttpClientState(networkState, legalOfficers?): MultiSourceHttpClientState<LegalOfficerEndpoint>

Parameters

NameType
networkStateNetworkState<LegalOfficerEndpoint>
legalOfficers?LegalOfficer[]

Returns

MultiSourceHttpClientState<LegalOfficerEndpoint>

Defined in

packages/client/src/Http.ts:79


isErcNft

isErcNft(type): boolean

Parameters

NameType
typeTokenType

Returns

boolean

Defined in

packages/client/src/Token.ts:142


isMultiversxESDTId

isMultiversxESDTId(tokenId): boolean

Parameters

NameType
tokenIdstring

Returns

boolean

Defined in

packages/client/src/Token.ts:187


isSingularKusamaId

isSingularKusamaId(tokenId): boolean

Parameters

NameType
tokenIdstring

Returns

boolean

Defined in

packages/client/src/Token.ts:183


isTokenCompatibleWith

isTokenCompatibleWith(type, networkType): boolean

Parameters

NameType
typeTokenType
networkTypeNetworkType

Returns

boolean

Defined in

packages/client/src/Token.ts:60


isTokenType

isTokenType(type): type is TokenType

Parameters

NameType
typestring

Returns

type is TokenType

Defined in

packages/client/src/Token.ts:35


isValidMime

isValidMime(mimeType): boolean

Parameters

NameType
mimeTypestring

Returns

boolean

Defined in

packages/client/src/Mime.ts:31


requestSort

requestSort(a, b): number

Parameters

NameType
aVaultTransferRequest
bVaultTransferRequest

Returns

number

Defined in

packages/client/src/VaultClient.ts:223


requireDefined

requireDefined<T>(value, errorSupplier?): T

Type parameters

Name
T

Parameters

NameType
valueundefined | T
errorSupplier?() => Error

Returns

T

Defined in

packages/client/src/assertions.ts:1


toBlockchainSubmission

toBlockchainSubmission<T>(params): BlockchainSubmission<T>

Type parameters

Name
T

Parameters

NameType
paramsT & BlockchainSubmissionParams

Returns

BlockchainSubmission<T>

Defined in

packages/client/src/LocClient.ts:209


toFeesClass

toFeesClass(fees): FeesClass | undefined

Parameters

NameType
feesundefined | Fees

Returns

FeesClass | undefined

Defined in

packages/client/src/Fees.ts:25


toIsoString

toIsoString(moment): string

Parameters

NameType
momentDateTime

Returns

string

Defined in

packages/client/src/DateTimeUtil.ts:3


toTransaction

toTransaction(transaction, account): Transaction

Parameters

NameType
transactionBackendTransaction
accountValidAccountId

Returns

Transaction

Defined in

packages/client/src/Balance.ts:47


validateErcToken

validateErcToken(itemToken): Object

Parameters

NameType
itemTokenItemTokenWithRestrictedType

Returns

Object

NameType
idObject?any
resultTokenValidationResult

Defined in

packages/client/src/Token.ts:146


validatePsp34TokenId

validatePsp34TokenId(tokenId): TokenValidationResult

Parameters

NameType
tokenIdstring

Returns

TokenValidationResult

Defined in

packages/client/src/Token.ts:191


validateToken

validateToken(api, itemToken): TokenValidationResult

Parameters

NameType
apiLogionNodeApiClass
itemTokenItemTokenWithRestrictedType

Returns

TokenValidationResult

Defined in

packages/client/src/Token.ts:81


waitFor

waitFor<T>(params): Promise<T>

Type parameters

Name
T

Parameters

NameType
paramsWaitForParameters<T>

Returns

Promise<T>

Defined in

packages/client/src/Polling.ts:19


withAdditional

withAdditional<T, P>(additionalPayload, params): BlockchainSubmission<T & P>

Type parameters

Name
T
P

Parameters

NameType
additionalPayloadP
paramsBlockchainSubmission<T>

Returns

BlockchainSubmission<T & P>

Defined in

packages/client/src/LocClient.ts:197


withLocId

withLocId<T>(locId, params): BlockchainSubmission<T & FetchParameters>

Type parameters

Name
T

Parameters

NameType
locIdUUID
paramsBlockchainSubmission<T>

Returns

BlockchainSubmission<T & FetchParameters>

Defined in

packages/client/src/LocClient.ts:193

TermsAndConditions

Abstract AbstractTermsAndConditionsElement<P>: Object

Provides a re-usable base implementation of TermsAndConditionsElement.

Type parameters

NameDescription
PType of Terms&Conditions parameters.

Defined in

packages/client/src/license/TermsAndConditions.ts:36

CreativeCommons: Object

Provides Terms and Conditions under the Creative Commons Attribution License 4.0

Defined in

packages/client/src/license/CreativeCommons.ts:13

LogionClassification: Object

Provides a Logion Classification.

Defined in

packages/client/src/license/LogionClassification.ts:267

SpecificLicense: Object

A Terms and Conditions element defining a specific license, where details are stored "as is".

Defined in

packages/client/src/license/SpecificLicense.ts:9

LogionClassificationParameters: Object

Defines the parameters of a Logion Classification.

Defined in

packages/client/src/license/LogionClassification.ts:246

TermsAndConditionsElement: Object

Common contract to all Terms and Conditions elements.

Defined in

packages/client/src/license/TermsAndConditions.ts:15

LogionTransferredRight

Ƭ LogionTransferredRight: { code: LogionTransferredRightCode } & LogionTransferredRightDescription

A transferred right code associated with description in one language.

Defined in

packages/client/src/license/LogionClassification.ts:43


LogionTransferredRightCode

Ƭ LogionTransferredRightCode: "PER-PRIV" | "PER-PUB" | "COM-NOMOD" | "COM-MOD" | "EX" | "NOEX" | "WW" | "REG" | "NOTIME" | "TIME"

List of available code to describe transferred rights.

Defined in

packages/client/src/license/LogionClassification.ts:12


LogionTransferredRightDescription

Ƭ LogionTransferredRightDescription: Object

Describes a transferred right.

Type declaration

NameTypeDescription
descriptionstringLong description
shortDescriptionstringShort description

Defined in

packages/client/src/license/LogionClassification.ts:28


TermsAndConditionsElementType

Ƭ TermsAndConditionsElementType: typeof TERMS_AND_CONDITIONS_TYPES[number]

Defines available Terms&Conditions types.

Defined in

packages/client/src/license/TermsAndConditions.ts:9


logionLicenseItems

Const logionLicenseItems: Record<LogionTransferredRightCode, Record<Language, LogionTransferredRightDescription>>

The dictionary of available transferred rights, with description in both fr and en.

Defined in

packages/client/src/license/LogionClassification.ts:49


newTermsAndConditions

newTermsAndConditions(onchainTCs, offchainTCs): MergedTermsAndConditionsElement[]

Creates a new Terms and Conditions, based on given type.

Parameters

NameTypeDescription
onchainTCsTermsAndConditionsElement[]the Terms and Conditions elements, as stored on the chain.
offchainTCsOffchainTermsAndConditionsElement[]the Terms and Conditions elements, as stored on the off-chain backend.

Returns

MergedTermsAndConditionsElement[]

an array of terms and conditions element

Defined in

packages/client/src/license/Factory.ts:46