Skip to main content

TransactionContext

For the complete documentation index, see llms.txt

Midnight.js API Reference v4.0.4


Midnight.js API Reference / @midnight-ntwrk/midnight-js-contracts / TransactionContext

Interface: TransactionContext<C, PCK>

스코프 컨트랙트 트랜잭션을 관리하기 위한 컨텍스트를 캡슐화합니다.

Type Parameters

C

C extends Contract.Any

PCK

PCK extends Contract.ProvableCircuitId<C> = Contract.ProvableCircuitId<C>

Properties

[CacheStates]

readonly [CacheStates]: (states, identity) => void

Parameters

states

PublicContractStates | ContractStates<PrivateState<C>>

identity

CachedStateIdentity

Returns

void


[GetCurrentStatesForIdentity]

readonly [GetCurrentStatesForIdentity]: (identity) => PublicContractStates | ContractStates<PrivateState<C>> | undefined

Parameters

identity

CachedStateIdentity

Returns

PublicContractStates | ContractStates<PrivateState<C>> | undefined


[MergeUnsubmittedCallTxData]

readonly [MergeUnsubmittedCallTxData]: (circuitId, callData, privateStateId?) => void

Parameters

circuitId

PCK

callData

UnsubmittedCallTxData<C, PCK>

privateStateId?

string

Returns

void


[Submit]

readonly [Submit]: () => Promise<FinalizedCallTxData<C, PCK>>

Returns

Promise<FinalizedCallTxData<C, PCK>>


[TypeId]

readonly [TypeId]: typeof TypeId

Methods

getAdditionalMappings()

getAdditionalMappings(): ReadonlyMap<string, string> | undefined

Gets the additional scoped CoinPublicKey to EncPublicKey mappings.

Returns

ReadonlyMap<string, string> | undefined

A ReadonlyMap<CoinPublicKey, EncPublicKey> instance, or undefined if no additional mappings were specified for the current transaction context.


getCurrentStates()

getCurrentStates(): PublicContractStates | ContractStates<PrivateState<C>> | undefined

트랜잭션 컨텍스트 내에서 현재 캐시된 컨트랙트 상태를 가져옵니다.

Returns

PublicContractStates | ContractStates<PrivateState<C>> | undefined

캐시된 ContractStates 인스턴스이거나, 아직 서킷 호출이 이루어지지 않은 경우 undefined입니다.

Remarks

반환된 상태는 트랜잭션 컨텍스트 내에서 컨트랙트의 미제출 진행 중 상태를 나타내며, 트랜잭션 스코프 동안 컨트랙트에 대해 수행된 미제출 서킷 호출을 반영합니다.


getLastUnsubmittedCallTxDataToTransact()

getLastUnsubmittedCallTxDataToTransact(): [UnsubmittedCallTxData<C, PCK>, string?] | undefined

마지막 미제출 호출 트랜잭션 데이터를 가져옵니다.

Returns

[UnsubmittedCallTxData<C, PCK>, string?] | undefined

UnsubmittedCallTxData 인스턴스와 선택적 프라이빗 상태 ID를 포함하는 튜플이거나, 아직 서킷 호출이 이루어지지 않은 경우 undefined입니다.