SDK reference
Connect, ramp, Crossway and tools
pg.connect, pg.ramp, pg.crossway and pg.tools — linked accounts and their connections, on and off ramp sessions, Crossway lookups, and the PATH protocol through Path Tools.
pg.connect
Scope connect. Path Connect links accounts to a client and grants their use through connections.
A linked account is an Instrument: its identifier is not kept in clear; a token and a mask are.
A PathConnection is type: 'pathglobal.connection' and a Delegation type: 'pathglobal.delegation':
objects of Path Global, not the path.connection or path.mandate of PATH CONNECT.
Links
| Call | Returns | |
|---|---|---|
providers() | DelegatedProvider[] | The platforms and exchanges that can be linked by delegated access |
startSession(input, opts?) | LinkSession | Starts a link the person approves elsewhere: { method: 'oauth', provider, … } at a platform or an exchange, { method: 'walletconnect', chains } in a wallet |
session(id) | LinkSession | One session: pending, completed, declined or expired |
completeSession(id, input) | { session; instrument? } | Completes it: { code, state } from the provider, or { topic, accounts } from the wallet |
link(input, opts?) | Instrument | Links an account (LinkRequest): on a network, at another member ({ path }), or a holding at Path Global ({ holding }) |
instruments(subject?) | Instrument[] | The caller's instruments |
instrument(id) | Instrument | One instrument |
unlink(id) | Instrument | Unlinks it; every connection on it is revoked |
allow(instrument, { network?, amount, expires_at, signature }) | Instrument | The allowance a wallet signed (Permit2 on an EVM chain, a token delegate on Solana) |
Connections and delegations
| Call | Returns | |
|---|---|---|
grant(input, opts?) | PathConnection | Grants a grantee the use of an instrument, for named capabilities, within a policy, with the consent recorded (ConnectionRequest) |
connections(instrument?) | PathConnection[] | The caller's connections |
connection(reference) | PathConnection | One connection, for its grantor or its grantee |
consume(reference, { capability, amount?, reference? }, opts?) | { connection; usage } | Uses a connection once. A capability that is absent is denied; every limit is enforced |
usage(reference) | ConnectionUsage[] | Every use of a connection |
revoke(reference) | PathConnection | Ends a connection |
charge(reference) | { connection; route? } | A scheduled connection: draws the charge that is due and pays it to its destination |
delegate(reference, input) | Delegation | One operation of a connection, for a third party, bound to the capability, the amount and the destination |
delegations(reference) | Delegation[] | The delegations of a connection |
delegation(reference) | Delegation | One delegation |
consumeDelegation(reference, { amount, destination, reference? }) | { delegation; connection; usage } | The delegate performs the bound operation: the exact amount, to the committed destination |
revokeDelegation(reference) | Delegation | Ends a delegation |
Capabilities: payout_to, collect_from, view_balance, view_transactions, payment_request.
A schedule makes a connection a recurring mandate, with counters per period and, with charge, a
charge drawn at each due date.
| Code | Status | When |
|---|---|---|
pathglobal.connect.capability_denied | 403 | The connection does not grant the capability |
pathglobal.connect.limit_exceeded | 422 | The amount passes a limit of the connection or the delegation |
pathglobal.connect.inactive | 409 | The connection or the delegation is revoked or expired |
pathglobal.connect.not_due | 409 | charge: no charge is due, or one is under way |
pathglobal.connect.account_not_found | 422 | The account to link could not be verified |
pathglobal.connect.holder_mismatch | 422 | The holder does not match the account |
pathglobal.networks.identifier_invalid | 422 | The identifier is not one of the network |
pg.ramp
Scope ramp. A session is read by the client that opened it.
| Call | Returns | |
|---|---|---|
providers() | RampProvider[] | Every provider, its kind, categories and methods, and whether the caller offers it |
settings() | RampSettings | The caller's settings: processing (connect-pay or path-pay-wl), pay_with_connect, proximity, disabled |
updateSettings(input) | RampSettings | Changes them; a field left out keeps its value |
createSession(input, opts?) | RampSession | Opens a session: { direction: 'on' | 'off', amount, category, provider?, method?, deliver, destination, country? }. category is a RampCategory |
session(id) | RampSession | One session, its steps and its next action |
advance(id) | RampSession | Advances the session by its current step |
A session is open, completed, failed or expired.
pathglobal.ramp.provider_unavailable (422) and pathglobal.ramp.step_invalid (409) are its codes.
pg.crossway
Scope crossway. The Crossway API resolves destinations on other networks. The protocol page is
Crossway.
| Call | Returns | |
|---|---|---|
registries() | { registries; grants } | The registries, and for each grant its operations, budget and used |
discovery(key) | signed crossway.discovery | Registries that can hold a key of this form. Queries no registry and spends no lookup |
sonar(registry, key) | signed crossway.sonar | Whether the registry holds the key, and its participant |
resolver(registry, key) | Resolution | The participant and the account, shown masked |
payeeCheck(registry, key, name) | signed crossway.payee_check | match, close_match, no_match or unavailable |
key is a CrosswayKey: { type: 'phone' | 'email' | 'tax' | 'random' | 'alias' | 'iban' | 'vpa', value }.
Each sonar, resolver and payeeCheck spends one lookup of the grant's budget. A registry not
granted for the operation is 403 pathglobal.crossway.registry_not_granted, a spent budget 429 with
the same code. resolver answers a key it does not resolve with
404 pathglobal.crossway.key_unresolvable; a negative answer cannot be told apart from another.
pg.tools
Scope tools. Path Tools are the public operations of the PATH protocol, called with a Path Global
key. Answers are PATH objects, as signed.
| Call | Returns | |
|---|---|---|
list() | Tool[] | Every tool: id, group, title, method, whether it is signed, writes, and is available |
run<R>(tool, input?, opts?) | R | Runs a tool by its id |
finder<R>({ identifier_type, identifier, nonce? }) | R | { step1, step2 }: the SONAR answer, then where to resolve it |
sonar<R>({ identifier_type, identifier, nonce }) | R | A sonar_answer |
resolver<R>(key) | R | A resolver_answer: what a PATH address accepts |
payeeCheck<R>({ key, mode: 'verify' | 'display', name?, nonce }) | R | A payee_check: match, close_match, no_match, unavailable or shown |
createRequest<R>(input, opts?) | R | Issues a PATH payment request |
readObject<R>(reference) | R | Reads a PATH object by reference |
issueReceipt<R>(input, opts?) | R | Issues a PATH settlement receipt |
verifyReceipt<R>(receipt) | R | Verifies a receipt |
R defaults to unknown; type it with the PATH object you expect. A test key is answered by the
sandbox in the same shapes, signed by the test key of /.well-known/path-keys
(Path Tools in test mode). A tool that is not available is
503 pathglobal.tools.unavailable; a refusal of the protocol is pathglobal.tools.refused, with the
PATH code in details.path_code. The objects are described in the protocol SDK.
The routes are on Connect, Ramp and Path Tools.
Catalogue, router, decision and proof
pg.catalogue, pg.router, pg.decision and pg.proof — the networks, signed quotes and routes with their guarantee level, payment to a PATH address or an alias, route decisions, and Proof verdicts.
Accounts, addresses and endpoints
pg.accounts, pg.addresses and pg.endpoints — Omni Accounts and their holdings, subjects and PATH addresses, and the endpoints a deposit arrives on.