Skip to main content

findDeployedContract

For the complete documentation index, see llms.txt

Midnight.js API Reference v4.0.4


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

Function: findDeployedContract()

배포된 컨트랙트의 주소와 기존 프라이빗 상태가 저장된 선택적 프라이빗 상태 ID를 사용하여 FoundContract 인스턴스를 생성합니다. 프라이빗 상태 ID가 제공되면, 해당 ID의 현재 값이 반환되는 FoundContract의 finalizedDeployTxData 속성에서 initialPrivateState 값으로 사용됩니다.

Param​

트랜잭션 수명 주기를 관리하는 데 사용되는 프로바이더입니다.

Param​

설정입니다.

Throws​

Error privateStateId와 initialPrivateState 설정이 올바르지 않은 경우.

Throws​

Error contractAddress에서 컨트랙트 상태를 찾을 수 없는 경우.

Throws​

TypeError contractAddress가 올바른 컨트랙트 주소 형식이 아닌 경우.

Throws​

ContractTypeError contract에 정의된 서킷 중 하나 이상이 contractAddress에서 찾은 컨트랙트 상태에 정의되지 않았거나 검증자 키가 일치하지 않는 경우.

Throws​

IncompleteFindContractPrivateStateConfig initialPrivateState가 제공되었지만 이를 저장할 privateStateId가 제공되지 않은 경우.

Call Signature​

findDeployedContract<C>(providers, options): Promise<FoundContract<C>>

Type Parameters​

C​

C extends Contract<undefined, Witnesses<undefined>>

Parameters​

providers​

ContractProviders<C, ProvableCircuitId<C>, unknown>

options​

FindDeployedContractOptionsBase<C>

Returns​

Promise<FoundContract<C>>

Call Signature​

findDeployedContract<C>(providers, options): Promise<FoundContract<C>>

Type Parameters​

C​

C extends Any

Parameters​

providers​

ContractProviders<C>

options​

FindDeployedContractOptionsExistingPrivateState<C>

Returns​

Promise<FoundContract<C>>

Call Signature​

findDeployedContract<C>(providers, options): Promise<FoundContract<C>>

Type Parameters​

C​

C extends Any

Parameters​

providers​

ContractProviders<C>

options​

FindDeployedContractOptionsStorePrivateState<C>

Returns​

Promise<FoundContract<C>>