Infer type of last element of a tuple or array Currently supports tuples of up to 9 elements before falling back to array's inference
Public Raiden interface for PFS info
Public Raiden interface for routes data
Helper type to extend a given type T to contain a timestamp ts member
Converts a union to the respective intersection Example: type UnionToIntersection<{ a: string } | { b: number }> = { a: string } & { b: number }
Simple Error codec
This codec doesn't decode to an instance of the exact same error class object, but instead to a generic Error, but assigning 'name', 'stack' & 'message' properties, more as an informative object.
A Raiden configuration object with required and optional params from [[PartialRaidenConfig]].
Notice partial/undefined values are special: when a raidenConfigUpdate is called with an undefined value, it won't be set, as they can't be [re]stored in the JSON state, but instead means it'll be reset to the default value; therefore, if a partial value has a defined default, it can't be unset; if you want to support "empty" values, use null, empty string or other falsy serializable types, and/or ensure it never gets a default
1.1
to add a 10% over estimated fee
margin, or [0.03, 0.0005]
to add a 3% over fee plus 0.05% over amount.approve
on tokens; default to MaxUint256, so
approving tokens should be needed only once, trusting TokenNetwork's & UDC contracts;
Set to Zero to fallback to approving the strictly needed deposit amountsmaxPriorityFeePerGas
, or eth-node's
eth_gasPrice
returned value; default does nothing and let provider guess (e.g. Metamask);
default ethers maxPriorityFeePerGas
is 2.5 GweiHelper function to create codecs to validate an arbitrary or variable-sized hex bytestring A branded codec to indicate validated hex-strings
Required number of bytes. Pass undefined or zero to have a variable-sized type
branded codec for hex-encoded bytestrings
Helper function to create codecs to validate an arbitrary or variable-sized BigNumbers A branded codec/type to indicate size-validated BigNumbers
Required number of bytes. Pass undefined to have a variable-sized type
branded codec for hex-encoded bytestrings
Helper function to create codecs to validate derived types containing a timestamp ts
Codec to compose with a ts timestamp property
Codec validating such subtype
Helper function to create codecs to validate an arbitrary or variable-sized BigNumbers A branded codec/type to indicate size-validated BigNumbers
Required number of bytes. Pass undefined to have a variable-sized type
branded codec for hex-encoded bytestrings
Type-safe assertion function (TS3.7)
Condition to validate as truthy
Message, Error, error factory or tuple of RaidenError constructor parameters to throw if condition is falsy
Logger to log error to
Math.max for BigNumbers
Parameters to compare, must have at least one element
Maxium of parameters as per BigNumber's lt comparison
Decode/validate like codec.decode, but throw or return right instead of Either
io-ts codec to be used for decoding/validation
data to decode/validate
Message or error to throw if the decoding fails
Logger to log error to
Decoded value of codec type
Return a network name, if known, or stringified chainId otherwise
Network to get name from
name or chainId as string
Memoized factory to create codecs validating an arbitrary class C
Class to create a codec for
Codec validating class C
Test for value's non-nulliness Like lodash's negate(isNil), but also works as type guard (e.g. useful for filters)
to be tested
true if value is not null nor undefined
Like lodash's last, but properly infer return type when argument is a tuple
Tuple or array to get last element from
Last element from arr
Creates a function to decide if a given error should be retried or not
Options object
Log using this function
maximum number of retries before rejecting
Never retry on these errors
retry only on these errors
Retry if this predicate matches
Don't retry if this predicate match
Function to test if errors should be retried or not
Creates a refinement of t.string which validates a template literal string
Regex which matches the generic parameter L
codec name
refinement type of string to tempalte literal
Given a value of type T, returns a Timed
Value to return with time
Timestamp to use, defaults to now
copy of v added of a ts numeric timestamp
Remove ts timestamp field (from timed) from object passed as parameter (immutably)
Timed object
return a copy of v without ts property
Generated using TypeDoc
Type helper to recursively map decodable properties to their simpler encoded types; This allows e.g. types decodable as BigNumbers to be passed in [recursive] properties where BigNumbers are expected at runtime, as long as the object is decoded/validated before use.