Skip to main content

Interface: CreditTransaction

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:233

The rows of one transaction. Every method reads or writes inside it.

Methods​

appendEntry()​

appendEntry(row): Promise<boolean>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:261

Appends an entry; false, changing nothing, when its id exists.

Parameters​

row​

CreditEntryRow

Returns​

Promise<boolean>


findHoldByOperation()​

findHoldByOperation(scopeId, operationId): Promise<CreditHoldRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:245

Parameters​

scopeId​

string

operationId​

string

Returns​

Promise<CreditHoldRow | undefined>


findLotByFundingRef()​

findLotByFundingRef(scopeId, fundingRef): Promise<CreditLotRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:241

Parameters​

scopeId​

string

fundingRef​

string

Returns​

Promise<CreditLotRow | undefined>


getDocument()?​

optional getDocument(scopeId, documentId): Promise<CreditDocumentRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:282

Optional extension state, read while the scope account is locked. Both document methods are optional, so a store written before them still implements this interface; an allocator that needs them refuses a store without them.

Parameters​

scopeId​

string

documentId​

string

Returns​

Promise<CreditDocumentRow | undefined>


getEntry()​

getEntry(entryId): Promise<CreditEntryRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:262

Parameters​

entryId​

string

Returns​

Promise<CreditEntryRow | undefined>


getHold()​

getHold(holdId): Promise<CreditHoldRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:244

Parameters​

holdId​

string

Returns​

Promise<CreditHoldRow | undefined>


getLot()​

getLot(lotId): Promise<CreditLotRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:240

Parameters​

lotId​

string

Returns​

Promise<CreditLotRow | undefined>


listAllocations()​

listAllocations(holdId): Promise<CreditAllocationRow[]>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:251

A hold's allocations, by seq.

Parameters​

holdId​

string

Returns​

Promise<CreditAllocationRow[]>


listAllocationsByLot()​

listAllocationsByLot(lotId): Promise<CreditAllocationRow[]>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:253

A lot's allocations, by hold then seq.

Parameters​

lotId​

string

Returns​

Promise<CreditAllocationRow[]>


listAttempts()​

listAttempts(holdId): Promise<CreditAttemptRow[]>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:257

A hold's attempts, by seq.

Parameters​

holdId​

string

Returns​

Promise<CreditAttemptRow[]>


listEntries()​

listEntries(filter): Promise<CreditEntryRow[]>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:264

Entries by time then id.

Parameters​

filter​

CreditEntryFilter

Returns​

Promise<CreditEntryRow[]>


listHolds()​

listHolds(filter): Promise<CreditHoldRow[]>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:249

Holds by creation then id.

Parameters​

filter​

CreditHoldFilter

Returns​

Promise<CreditHoldRow[]>


listLots()​

listLots(scopeId): Promise<CreditLotRow[]>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:239

The scope's lots, by creation then id.

Parameters​

scopeId​

string

Returns​

Promise<CreditLotRow[]>


lockAccount()​

lockAccount(scopeId): Promise<CreditAccountRow | undefined>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:235

The scope's account, locked for the rest of the transaction; undefined when there is none.

Parameters​

scopeId​

string

Returns​

Promise<CreditAccountRow | undefined>


lockSupplierDay()​

lockSupplierDay(day): Promise<SupplierDayRow>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:270

The supplier day, made when missing and locked for the transaction. Every reservation also locks the epoch's day, 1970-01-01, through it before it reads CreditTransaction.openSupplierMicro: one platform-wide row that admissions queue on, kept like any other day.

Parameters​

day​

string

Returns​

Promise<SupplierDayRow>


openSupplierMicro()​

openSupplierMicro(scopeId?): Promise<number>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:277

The open supplier liability: across every held or deferred hold, its supplier most less what settled; across every settled or released hold, its supplierOpenMicro. Scoped to one scope when scopeId is given, across the platform otherwise.

Parameters​

scopeId?​

string

Returns​

Promise<number>


putAccount()​

putAccount(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:237

Writes the account by compare-and-set.

Parameters​

row​

CreditAccountRow

Returns​

Promise<void>


putAllocation()​

putAllocation(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:255

Writes one allocation, keyed by its hold and seq.

Parameters​

row​

CreditAllocationRow

Returns​

Promise<void>


putAttempt()​

putAttempt(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:259

Writes an attempt by compare-and-set, keyed by its hold and id.

Parameters​

row​

CreditAttemptRow

Returns​

Promise<void>


putDocument()?​

optional putDocument(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:284

Compare-and-set document write in this transaction; version starts at one.

Parameters​

row​

CreditDocumentRow

Returns​

Promise<void>


putHold()​

putHold(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:247

Writes a hold by compare-and-set; a new hold whose operation the scope has is a conflict.

Parameters​

row​

CreditHoldRow

Returns​

Promise<void>


putLot()​

putLot(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:243

Writes a lot by compare-and-set; a new lot whose funding reference the scope has is a conflict.

Parameters​

row​

CreditLotRow

Returns​

Promise<void>


putSupplierDay()​

putSupplierDay(row): Promise<void>

Defined in: packages/agentos/src/safety/runtime/CompoundCreditStore.ts:272

Writes the supplier day by compare-and-set.

Parameters​

row​

SupplierDayRow

Returns​

Promise<void>