SDK reference
Path Global operator calls
pg.connectivity and pg.operations — network calendars, capabilities and compatibility, sandbox scripts, closing a netting set and settling a period.
pg.connectivity and pg.operations need the operations scope; the clearing calls need risk as
well. They are operator calls: in test mode they take no signature; in live mode they are available
to a key whose agreement includes operator access, and every request carries the signature of a
registered operator (operator).
pg.connectivity
| Call | Returns | |
|---|---|---|
calendar(network) | CalendarAnswer | The calendar of a network, whether it is open for a pay-out now, opens_at, next_cutoff, and the value date of a pay-out sent now |
capabilities({ network?, router? }) | NetworkCapability[] | What each network and router can do now: per operation, supported, open_now, healthy, opens_at, limits |
compatibility({ from?, to? }) | Edge[] | The edges between two nodes, ASSET@network: kind, cost, seconds, whether open and lockable |
script(match, outcome) | { scripted: { match, outcome } } | Test mode only. Orders whose reference contains match get outcome at the sandbox bank |
A NetworkCalendar gives the timezone, the opening windows (24x7 or days with open and close
times), the cutoffs per operation, the holidays, value_date (same or next), and the recall
and dispute windows in seconds. Calendars has the contract.
const now = await pg.connectivity.calendar('sepa-inst');
if (!now.open) console.log('opens at', now.opens_at);Sandbox scripts
outcome is a SandboxOutcome: fail, timeout, unknown, slow, return, short, over,
charge or outage. The same word in a payment reference gives the same outcome without a script.
A new script with the same match replaces the one before.
await pg.connectivity.script('late', 'slow'); // test mode
await pg.router.route({ ...intent, reference: 'invoice late 42' }, { idempotencyKey: 'inv-42' });Sandbox lists what each outcome does.
pg.operations
These need risk as well.
| Call | Returns | |
|---|---|---|
closeSet(id) | ClearingPeriod | Closes the open period of a netting set now, <ASSET>@<network> |
settlePeriod(id) | ClearingPeriod | Settles a closed period, <set>#<seq>, as far as it can be now |
// A test key that carries `operations` and `risk`.
const ops = new PathGlobal({ apiKey: process.env.PATHGLOBAL_API_KEY! });
const closed = await ops.operations.closeSet('USD@book');
const settled = await ops.operations.settlePeriod(closed.id);
settled.state; // 'settling', 'settled' or 'partially_settled'Without these calls, a period closes at a cut-off of its set. See Clearing.
Reserved to Path Global
The routes that run the platform itself are reserved to Path Global. These methods ship in the package and call them.
| Method | |
|---|---|
operations.partners | Reserved to Path Global |
operations.disablePartner | Reserved to Path Global |
operations.enablePartner | Reserved to Path Global |
operations.run | Reserved to Path Global |
operations.participants | Reserved to Path Global |
operations.onboardParticipant | Reserved to Path Global |
operations.setParticipantCap | Reserved to Path Global |
operations.suspendParticipant | Reserved to Path Global |
operations.withdrawCollateral | Reserved to Path Global |
operations.clearingPositions | Reserved to Path Global |
operations.putSet | Reserved to Path Global |
operations.resolveInstruction | Reserved to Path Global |
operations.openReturn | Reserved to Path Global |
connectivity.health | Reserved to Path Global |
connectivity.accounts | Reserved to Path Global |
connectivity.registerAccount | Reserved to Path Global |
connectivity.openCircuit | Reserved to Path Global |
connectivity.closeCircuit | Reserved to Path Global |
risk.halt, risk.stop, risk.resume, risk.switchLog | Reserved to Path Global |
The routes are on Operations.