Receive

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.

CallReturns
openOmni(input, opts?)AccountViewOpens 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)AccountViewOne account, its holdings, their balances and endpoints
openHolding(input, opts?)HoldingOpens a holding (HoldingRequest)
holdings(reference?)Holding[]The caller's holdings, or the one with that reference
holding(id)HoldingViewOne holding, with balances and endpoints
freeze(holding, { reason, scope? })Holdingdebits (default) stops what leaves; all also holds its deposits for review
unfreeze(holding)HoldingLifts the freeze
entries(holding)LedgerEntry[]The statement of the holding
fund(holding, amount, reference?)LedgerEntryTest 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 }.

CodeStatusWhen
pathglobal.core.reference_taken409The reference names another account or holding of the client
pathglobal.accounts.frozen409The holding is frozen
pathglobal.accounts.insufficient_funds422The holding does not hold the amount
pathglobal.accounts.asset_not_held422The holding does not hold that asset
pathglobal.accounts.holder_unknown422holder.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.

CallReturns
membership()MembershipThe 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?)SubjectRuns the identity check again, or records a verdict decided in Proof
registerIdentifier(subject, input, opts?)SubjectRegisters 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)SubjectEvery identifier and alias of the subject reads discoverability: 'private'
claimAlias(subject, { name, address?, discoverability? })SubjectIssues the subject's alias in the network of its member. The name is read in lower case; one alias per network
releaseAlias(subject, network)AliasReleaseReleases the alias of that network; released: { alias, quarantine_days }
transferAlias(subject, network, toMember)SubjectTransfers 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?)AddressViewIssues a PATH address on derived terms; profile is directory or relationship
list(subject?)PathAddress[]The caller's addresses
get(id)AddressViewThe address, its endpoints, its rails, what it accepts now, its terms, commitment and sync
setRail(id, { network, asset?, enabled })AddressViewTurns a rail on or off, for one asset or every asset it carries
pledge(id, { accepts })AddressViewPledges 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)AddressViewReplaces 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)AddressViewRevokes 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.

CodeStatusWhen
pathglobal.addresses.subject_not_verified422The subject's identity is not verified
pathglobal.addresses.alias_unavailable409, 422The alias is not available, or the address cannot carry one
pathglobal.addresses.alias_held409The subject holds an alias in this network; release it first
pathglobal.addresses.alias_change_limit409The subject has made the alias changes the network allows in a year
pathglobal.addresses.revoked409, 410The address is revoked; a quote or a route to it answers 410 with details.rotated: false
pathglobal.addresses.moved410A quote or a route names an address its holder replaced. The answer does not name the new address
pathglobal.addresses.rail_not_on_address422The address does not carry that rail; on a pledge, details.index names the entry
pathglobal.addresses.registrar_unavailable503The 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.

CallReturns
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?)DepositEndpointAdds an endpoint to an address (EndpointRequest, with format to choose the endpoint format)
list(address?)DepositEndpoint[]The caller's endpoints
get(id)DepositEndpointOne endpoint
anchor(id, target)DepositEndpointAnchors it to { holding } or { forward }, replacing its anchor
release(id)DepositEndpointRemoves the anchor; the address stops accepting the rails only this endpoint served
remove(id)DepositEndpointRemoves the endpoint from its address
deposits(endpoint?)Deposit[]The deposits of one endpoint, or of every endpoint of the caller
simulateDeposit(endpoint, input)DepositTest 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.

CodeStatusWhen
pathglobal.endpoints.anchor_incompatible422The target does not receive what the endpoint receives
pathglobal.endpoints.issuer_unavailable422No 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.

On this page