InterledgerTypes
DEFINITIONS
AUTOMATIC TAGS ::=
BEGIN
IMPORTS
UInt64
FROM GenericTypes
;
-- Readable names for special characters that may appear in ILP addresses
hyphen IA5String ::= "-"
period IA5String ::= "."
underscore IA5String ::= "_"
tilde IA5String ::= "~"
-- A standard interledger address
Address ::= IA5String
(FROM
( hyphen
| period
| "0".."9"
| "A".."Z"
| underscore
| "a".."z"
| tilde )
)
(SIZE (0..1023))
-- We are using ISO 8601 and not POSIX time, because ISO 8601 increases
-- monotonically and never "travels back in time" which could cause issues
-- with transfer expiries. It is also one of the most widely supported and most
-- well-defined date formats as of 2017.
--
-- Our actual wire format leaves out any fixed/redundant characters, such as
-- hyphens, colons, the "T" separator, the decimal period and the "Z" timezone
-- indicator.
--
-- The wire format is four digits for the year, two digits for the month,
-- two digits for the day, two digits for the hour, two digits for the minutes,
-- two digits for the seconds and three digits for the milliseconds.
--
-- I.e. the wire format is: 'YYYYMMDDHHmmSSfff'
--
-- All times MUST be expressed in UTC time.
Timestamp ::= PrintableString (SIZE(17))
-- Liquidity curves describe the relationship between input and output amount
-- for a given path between a pair of ledgers.
--
-- The curve is expressed as a series of points given as coordinates of the form
-- . If a sender sends inputAmount
units to the
-- connector, the recipient will receive outputAmount
. The curve may represent
-- the liquidity through a single connector, or multiple liquidity curves can be
-- combined into one to represent the liquidity through a given path of
-- connectors.
--
-- Points are ordered by inputAmount. The inputAmount is strictly increasing
-- from point to point. The outputAmount is monotonically increasing, meaning
-- each successively point must have an equal or greater outputAmount.
--
-- The first point represents the minimum amount that can be transacted, while
-- the final point represents the maximum amount that can be transacted.
--
-- If a query does not match a point exactly, implementations MUST use linear
-- interpolation. When querying by outputAmount, if multiple points match
-- exactly, the lowest inputAmount of any of these points MUST be returned.
LiquidityCurve ::= SEQUENCE OF SEQUENCE {
x UInt64,
y UInt64
}
END