SDK reference
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.
A caller reaches its own accounts, holdings, subjects, addresses and endpoints only. Another client's
object answers 404 pathglobal.core.not_found.
pg.accounts
Scope accounts. An Omni Account holds value in holdings; every balance of a holding is an account
of the ledger.
| Call | Returns | |
|---|---|---|
openOmni(input, opts?) | AccountView | Opens an Omni Account, with its holdings; holder.path_id, when given, names a subject of the caller |
list(reference?) | Account[] | The caller's accounts; with reference, the one the client gave that id |
get(id) | AccountView | One account, its holdings, their balances and endpoints |
openHolding(input, opts?) | Holding | Opens a holding (HoldingRequest) |
holdings(reference?) | Holding[] | The caller's holdings, or the one with that reference |
holding(id) | HoldingView | One holding, with balances and endpoints |
freeze(holding, { reason, scope? }) | Holding | debits (default) stops what leaves; all also holds its deposits for review |
unfreeze(holding) | Holding | Lifts the freeze |
entries(holding) | LedgerEntry[] | The statement of the holding |
fund(holding, amount, reference?) | LedgerEntry | Test mode only. Credits a holding without a deposit. reference defaults to 'test funding' |
openOmni takes:
{
holder: { path_id?: string; name?: string };
subject?: string; // a subject of pg.addresses
reference?: string; // the client's own id, unique per client
holdings?: { kind: 'wallet' | 'virtual_account'; currency?: string; backing?: 'fiat' | 'stablecoin';
backing_asset?: string; label?: string; reference?: string }[];
}A virtual_account takes a currency; a stablecoin-backed one takes a token in backing_asset.
An external_wallet is opened with openHolding and external: { network, address }.
| Code | Status | When |
|---|---|---|
pathglobal.core.reference_taken | 409 | The reference names another account or holding of the client |
pathglobal.accounts.frozen | 409 | The holding is frozen |
pathglobal.accounts.insufficient_funds | 422 | The holding does not hold the amount |
pathglobal.accounts.asset_not_held | 422 | The holding does not hold that asset |
pathglobal.accounts.holder_unknown | 422 | holder.path_id names no subject of the caller |
pg.addresses
Scope addresses. A subject is a client of yours, a person or a legal entity, verified by Proof. A
PATH address is issued to a verified subject.
| Call | Returns | |
|---|---|---|
membership() | Membership | The PATH membership addresses are issued under |
setMembership(input) | Membership | { mode: 'hosted' } (Path Global's); applies to addresses issued from then on. { mode: 'own', member, network } answers 409 pathglobal.addresses.membership_unverified in this version |
createSubject(input, opts?) | Subject | { type: 'individual' | 'legal_entity', name, country?, reference? } |
subjects(reference?) | Subject[] | The caller's subjects |
subject(id) | Subject & { addresses } | One subject and its addresses |
verifySubject(id, verdict?) | Subject | Runs the identity check again, or records a verdict decided in Proof |
registerIdentifier(subject, input, opts?) | Subject | Registers an identifier of a verified subject on the PATH network (IdentifierRequest). The subject lists its type, discoverability and whether it is verified, never its value. idempotencyKey covers the type, the method and the discoverability |
withdraw(subject) | Subject | Every identifier and alias of the subject reads discoverability: 'private' |
claimAlias(subject, { name, address?, discoverability? }) | Subject | Issues the subject's alias in the network of its member. The name is read in lower case; one alias per network |
releaseAlias(subject, network) | AliasRelease | Releases the alias of that network; released: { alias, quarantine_days } |
transferAlias(subject, network, toMember) | Subject | Transfers the alias of that network to another member of the network, which registers it for the subject. The subject's addresses and endpoints stay |
issue({ subject, profile?, label?, discoverability? }, opts?) | AddressView | Issues a PATH address on derived terms; profile is directory or relationship |
list(subject?) | PathAddress[] | The caller's addresses |
get(id) | AddressView | The address, its endpoints, its rails, what it accepts now, its terms, commitment and sync |
setRail(id, { network, asset?, enabled }) | AddressView | Turns a rail on or off, for one asset or every asset it carries |
pledge(id, { accepts }) | AddressView | Pledges what the address accepts (PledgeRequest): 1 to 64 rails in order of preference, with limits and reference_required. The address is on pledged terms from then on |
accepts(id) | StandingIntent[] | Every pledged version of what the address accepted, newest first |
rotate(id) | AddressView | Replaces the address; the one before is revoked and kept: a quote or a route to it answers 410 pathglobal.addresses.moved, and Path Tools answer path.address.revoked with rotated: true, without naming the new one. Endpoints, rails and anchors stay |
revoke(id) | AddressView | Revokes the address |
On derived terms, a rail is accepted when it is on and an endpoint that receives it is anchored, and
commitment is null. On pledged terms, a rail is accepted when the latest pledge also names its
capability, and commitment is the PATH commitment of that pledge. Each rail carries its PATH
capability, published and pledged. A PathAddress is kind: 'pathglobal.address' and a
StandingIntent kind: 'pathglobal.standing_intent': records of Path Global, signed. A version in
grammar 2 carries grammar: 2, its accepts as IntentEntry[] and its limits.
| Code | Status | When |
|---|---|---|
pathglobal.addresses.subject_not_verified | 422 | The subject's identity is not verified |
pathglobal.addresses.alias_unavailable | 409, 422 | The alias is not available, or the address cannot carry one |
pathglobal.addresses.alias_held | 409 | The subject holds an alias in this network; release it first |
pathglobal.addresses.alias_change_limit | 409 | The subject has made the alias changes the network allows in a year |
pathglobal.addresses.revoked | 409, 410 | The address is revoked; a quote or a route to it answers 410 with details.rotated: false |
pathglobal.addresses.moved | 410 | A quote or a route names an address its holder replaced. The answer does not name the new address |
pathglobal.addresses.rail_not_on_address | 422 | The address does not carry that rail; on a pledge, details.index names the entry |
pathglobal.addresses.registrar_unavailable | 503 | The PATH network did not take the write. Send the same request again |
pg.endpoints
Scope endpoints. An endpoint is what an address receives on: an identifier, the networks and
assets it receives, and its anchor. It has no balance: its anchor says where a deposit goes.
| Call | Returns | |
|---|---|---|
issuable(filter?) | { type, issuer, asset, networks, format }[] | What can be issued: per type, format and asset, the networks an identifier receives on. filter takes network, type, asset and format, each one value or a list |
issue(input, opts?) | DepositEndpoint | Adds an endpoint to an address (EndpointRequest, with format to choose the endpoint format) |
list(address?) | DepositEndpoint[] | The caller's endpoints |
get(id) | DepositEndpoint | One endpoint |
anchor(id, target) | DepositEndpoint | Anchors it to { holding } or { forward }, replacing its anchor |
release(id) | DepositEndpoint | Removes the anchor; the address stops accepting the rails only this endpoint served |
remove(id) | DepositEndpoint | Removes the endpoint from its address |
deposits(endpoint?) | Deposit[] | The deposits of one endpoint, or of every endpoint of the caller |
simulateDeposit(endpoint, input) | Deposit | Test mode only. { amount, network?, payer?: { name? }, rail_reference?, rail_reference_type? } |
Endpoint types: wallet_address, wallet_address_memo, virtual_address, viban,
account_number, alias, card_pan, card_token; the fields of each are on
Endpoints. An endpoint carries format, its endpoint
format, and pay_to, what the payer sends in the form of that format: the value, the memo of an address
with a memo, and for an account number the account part with fields (routing, branch, …).
A Deposit is received,
converting (carried by a route), credited, forwarded, review, returned or failed. A
deposit on an endpoint without an anchor returns to the payer; on a holding frozen with scope all,
it is held for review. A deposit on a rail published on the PATH network that carries a rail
reference has a receipt: { reference, status, reason_code? }, the PATH receipt of the payee
side. An endpoint carries format_status, the status of the link of its format on its first
network.
| Code | Status | When |
|---|---|---|
pathglobal.endpoints.anchor_incompatible | 422 | The target does not receive what the endpoint receives |
pathglobal.endpoints.issuer_unavailable | 422 | No endpoint of that type is issued for that asset, network or country, or the format is not issued on that network on this date |
A deposit, credited
const subject = await pg.addresses.createSubject({ type: 'legal_entity', name: 'Example Treasury Ltd', country: 'GB' });
const address = await pg.addresses.issue({ subject: subject.id });
const holding = await pg.accounts.openHolding({ kind: 'virtual_account', currency: 'EUR' });
const endpoint = await pg.endpoints.issue({
address: address.id,
type: 'viban',
asset: 'EUR',
anchor: { holding: holding.id },
});
await pg.endpoints.simulateDeposit(endpoint.id, { amount: { value: '120.00', asset: 'EUR' } }); // test mode
const entries = await pg.accounts.entries(holding.id);The recipe is Credit a deposit to its holder. The routes are on Accounts, Addresses and Endpoints.
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.
Treasury
pg.treasury — positions and the treasury view, policies, transfers under dual control, expected fundings, the allowlist, reconciliation, inbound items, refuel cycles and the ledger.