raiden-ts
Version:
Raiden Light Client Typescript/Javascript SDK
202 lines (201 loc) • 7.78 kB
TypeScript
import * as t from 'io-ts';
import type { Decodable } from '../utils/types';
export declare const Service: {
readonly PFS: "path_finding";
readonly MS: "monitoring";
};
export declare type Service = typeof Service[keyof typeof Service];
export declare const ServiceC: t.KeyofC<{
path_finding: string;
monitoring: string;
}>;
export declare const ServiceDeviceId: {
readonly [K in Service]: string;
};
export declare const PfsMode: {
readonly disabled: "disabled";
readonly auto: "auto";
readonly onlyAdditional: "onlyAdditional";
};
export declare type PfsMode = typeof PfsMode[keyof typeof PfsMode];
export declare const PfsModeC: t.KeyofC<{
disabled: string;
auto: string;
onlyAdditional: string;
}>;
export declare const Path: t.ReadonlyArrayC<import("../utils/types").AddressC>;
export declare type Path = t.TypeOf<typeof Path>;
declare const _AddressMetadata: t.ReadonlyC<t.TypeC<{
user_id: t.StringC;
displayname: t.StringC;
capabilities: t.StringC;
}>>;
export interface AddressMetadata extends t.TypeOf<typeof _AddressMetadata> {
}
export interface AddressMetadataC extends t.Type<AddressMetadata, t.OutputOf<typeof _AddressMetadata>> {
}
/** metadata/presence information of an address */
export declare const AddressMetadata: AddressMetadataC;
declare const _AddressMetadataMap: t.ReadonlyC<t.RecordC<t.StringC, AddressMetadataC>>;
export declare type AddressMetadataMap = t.TypeOf<typeof _AddressMetadataMap>;
/** an address_metadata map which decodes to checksummed addresses as keys */
export declare const AddressMetadataMap: t.RefinementType<t.ReadonlyC<t.RecordC<t.StringC, AddressMetadataC>>, Readonly<{
[x: string]: AddressMetadata;
}>, Readonly<{
[x: string]: Readonly<{
user_id: string;
displayname: string;
capabilities: string;
}>;
}>, unknown>;
export declare const RoutesExtra: t.PartialC<{
address_metadata: t.RefinementType<t.ReadonlyC<t.RecordC<t.StringC, AddressMetadataC>>, Readonly<{
[x: string]: AddressMetadata;
}>, Readonly<{
[x: string]: Readonly<{
user_id: string;
displayname: string;
capabilities: string;
}>;
}>, unknown>;
}>;
export declare const Fee: import("../utils/types").IntC<32>;
export declare type Fee = t.TypeOf<typeof Fee>;
/** Codec for raiden-ts internal representation of a PFS result/routes */
export declare const Paths: t.ReadonlyArrayC<t.ReadonlyC<t.IntersectionC<[t.TypeC<{
path: t.ReadonlyArrayC<import("../utils/types").AddressC>;
fee: import("../utils/types").IntC<32>;
}>, t.PartialC<{
address_metadata: t.RefinementType<t.ReadonlyC<t.RecordC<t.StringC, AddressMetadataC>>, Readonly<{
[x: string]: AddressMetadata;
}>, Readonly<{
[x: string]: Readonly<{
user_id: string;
displayname: string;
capabilities: string;
}>;
}>, unknown>;
}>]>>>;
export declare type Paths = t.TypeOf<typeof Paths>;
/**
* A broader codec representing paths received as input:
* - paths array can come on a `route` or `path` member
* - `fee` represents the final fee to be used, `estimated_fee` is what comes from PFS and can be
* increased of fee margins
* - rest is kept (currently, `address_metadata` map)
* Paths is a specific subset of InputPaths
*/
export declare const InputPaths: t.ReadonlyArrayC<t.ReadonlyC<t.IntersectionC<[t.UnionC<[t.TypeC<{
route: t.ReadonlyArrayC<import("../utils/types").AddressC>;
}>, t.TypeC<{
path: t.ReadonlyArrayC<import("../utils/types").AddressC>;
}>]>, t.UnionC<[t.TypeC<{
fee: import("../utils/types").IntC<32>;
}>, t.TypeC<{
estimated_fee: import("../utils/types").IntC<32>;
}>]>, t.PartialC<{
address_metadata: t.RefinementType<t.ReadonlyC<t.RecordC<t.StringC, AddressMetadataC>>, Readonly<{
[x: string]: AddressMetadata;
}>, Readonly<{
[x: string]: Readonly<{
user_id: string;
displayname: string;
capabilities: string;
}>;
}>, unknown>;
}>]>>>;
export declare type InputPaths = t.TypeOf<typeof InputPaths>;
/** Codec for result from PFS path request */
export declare const PfsResult: t.ReadonlyC<t.TypeC<{
result: t.ReadonlyArrayC<t.ReadonlyC<t.IntersectionC<[t.UnionC<[t.TypeC<{
route: t.ReadonlyArrayC<import("../utils/types").AddressC>;
}>, t.TypeC<{
path: t.ReadonlyArrayC<import("../utils/types").AddressC>;
}>]>, t.UnionC<[t.TypeC<{
fee: import("../utils/types").IntC<32>;
}>, t.TypeC<{
estimated_fee: import("../utils/types").IntC<32>;
}>]>, t.PartialC<{
address_metadata: t.RefinementType<t.ReadonlyC<t.RecordC<t.StringC, AddressMetadataC>>, Readonly<{
[x: string]: AddressMetadata;
}>, Readonly<{
[x: string]: Readonly<{
user_id: string;
displayname: string;
capabilities: string;
}>;
}>, unknown>;
}>]>>>;
}>>;
/** Codec for PFS API returned error */
export declare const PfsError: t.ReadonlyC<t.IntersectionC<[t.TypeC<{
error_code: t.NumberC;
errors: t.StringC;
}>, t.PartialC<{
error_details: t.RecordC<t.StringC, t.UnknownC>;
}>]>>;
export declare type PfsError = t.TypeOf<typeof PfsError>;
/** Public Raiden interface for routes data */
export declare type RaidenPaths = Decodable<Paths>;
/**
* A PFS server/service instance info
*/
export declare const PFS: t.ReadonlyC<t.TypeC<{
address: import("../utils/types").AddressC;
url: t.StringC;
matrixServer: t.StringC;
rtt: t.NumberC;
price: import("../utils/types").UIntC<32>;
token: import("../utils/types").AddressC;
validTill: t.NumberC;
}>>;
export interface PFS extends t.TypeOf<typeof PFS> {
}
/**
* Public Raiden interface for PFS info
*/
export declare type RaidenPFS = Decodable<PFS>;
/**
* An IOU used to pay the services
*/
export declare const IOU: t.ReadonlyC<t.TypeC<{
sender: import("../utils/types").AddressC;
receiver: import("../utils/types").AddressC;
amount: import("../utils/types").UIntC<32>;
claimable_until: import("../utils/types").UIntC<32>;
one_to_n_address: import("../utils/types").AddressC;
chain_id: import("../utils/types").UIntC<32>;
}>>;
export interface IOU extends t.TypeOf<typeof IOU> {
}
export declare const LastIOUResults: t.ReadonlyC<t.TypeC<{
last_iou: import("../utils/types").SignedC<t.ReadonlyC<t.TypeC<{
sender: import("../utils/types").AddressC;
receiver: import("../utils/types").AddressC;
amount: import("../utils/types").UIntC<32>;
claimable_until: import("../utils/types").UIntC<32>;
one_to_n_address: import("../utils/types").AddressC;
chain_id: import("../utils/types").UIntC<32>;
}>>>;
}>>;
export interface LastIOUResults extends t.TypeOf<typeof LastIOUResults> {
}
export declare const SuggestedPartner: t.ReadonlyC<t.TypeC<{
address: import("../utils/types").AddressC;
capacity: import("../utils/types").UIntC<32>;
centrality: t.UnionC<[t.NumberC, t.StringC]>;
score: t.UnionC<[t.NumberC, t.StringC]>;
uptime: t.UnionC<[t.NumberC, t.StringC]>;
}>>;
export interface SuggestedPartner extends t.TypeOf<typeof SuggestedPartner> {
}
export declare const SuggestedPartners: t.ArrayC<t.ReadonlyC<t.TypeC<{
address: import("../utils/types").AddressC;
capacity: import("../utils/types").UIntC<32>;
centrality: t.UnionC<[t.NumberC, t.StringC]>;
score: t.UnionC<[t.NumberC, t.StringC]>;
uptime: t.UnionC<[t.NumberC, t.StringC]>;
}>>>;
export declare const ServicesValidityMap: t.ReadonlyC<t.RecordC<t.StringC, t.NumberC>>;
export declare type ServicesValidityMap = t.TypeOf<typeof ServicesValidityMap>;
export {};