Skip to main content

Class: SiwxMessage

siwx/src.SiwxMessage

Parameters for SiwxMessage constructor.

Implements

Constructors

constructor

new SiwxMessage(fields): SiwxMessage

Parameters

NameType
fieldsSiwxMessageFields

Returns

SiwxMessage

Properties

address

Readonly address: string & WithOpaque<"address">

Implementation of

SiwxMessageFields.address


chainId

Readonly chainId: string & WithOpaque<"chain-id">

Implementation of

SiwxMessageFields.chainId


domain

Readonly domain: string & WithOpaque<"domain">

Implementation of

SiwxMessageFields.domain


expirationTime

Optional Readonly expirationTime: string & WithOpaque<"date-time">

Implementation of

SiwxMessageFields.expirationTime


issuedAt

Readonly issuedAt: string & WithOpaque<"date-time">

Implementation of

SiwxMessageFields.issuedAt


network

Readonly network: string & WithOpaque<"network">

Implementation of

SiwxMessageFields.network


nonce

Readonly nonce: string & WithOpaque<"nonce">

Implementation of

SiwxMessageFields.nonce


notBefore

Optional Readonly notBefore: string & WithOpaque<"date-time">

Implementation of

SiwxMessageFields.notBefore


requestId

Optional Readonly requestId: string & WithOpaque<"non-empty">

Implementation of

SiwxMessageFields.requestId


resources

Optional Readonly resources: string & WithOpaque<"URI">[]

Implementation of

SiwxMessageFields.resources


statement

Optional Readonly statement: string & WithOpaque<"non-empty">

Implementation of

SiwxMessageFields.statement


uri

Readonly uri: string & WithOpaque<"URI">

Implementation of

SiwxMessageFields.uri


version

Readonly version: "1" & WithOpaque<"version">

Implementation of

SiwxMessageFields.version


fromString

Static fromString: (input: string) => SiwxMessage = fromString

Type declaration

▸ (input): SiwxMessage

Parse SIWx message string.

Parameters
NameType
inputstring
Returns

SiwxMessage

Throws

If invalid string passed.


fromStringSafe

Static fromStringSafe: (input: string) => Maybe<SiwxMessage> = fromStringSafe

Type declaration

▸ (input): Maybe<SiwxMessage>

Parse SIWx message string. Return Maybe, thus do not throw.

Parameters
NameType
inputstring
Returns

Maybe<SiwxMessage>

Methods

toString

toString(): string

Returns

string