솔라나 문서지침
특정 자격 증명 및 스키마 하에 새로운 증명을 생성합니다. 이 명령어는 승인된 서명자가 검증된 데이터를 포함하고 정의된 만료 시간을 가진 증명을 생성할 수 있도록 합니다.
매개변수
| 매개변수 | 타입 | 설명 |
|---|---|---|
payer | Signer | 트랜잭션 비용을 지불할 계정 |
authority | Signer | 자격 증명의 승인된 서명자 |
credential | PublicKey | Pda | 스키마와 연결된 자격 증명 계정 |
schema | PublicKey | Pda | 증명 구조를 정의하는 스키마 계정 |
attestation | PublicKey | Pda | 생성할 증명 계정 |
systemProgram | PublicKey | Pda | System Program 계정 (기본값: '11111111111111111111111111111111') |
nonce | Address | 증명의 고유 식별자 |
data | ReadonlyUint8Array | 스키마를 준수해야 하는 증명 데이터 |
expiry | number | bigint | 증명의 만료 타임스탬프 |
반환값
트랜잭션을 구성하고 전송하는 데 사용할 수 있는 TransactionBuilder을
반환합니다.
예제
import { getCreateAttestationInstruction } from "sas-lib";const transaction = getCreateAttestationInstruction({payer: payerSigner,authority: authoritySigner,credential: credentialPublicKey,schema: schemaPublicKey,attestation: attestationPublicKey,systemProgram: systemProgramPublicKey,nonce: noncePublicKey,data: attestationData,expiry: expiryTimestamp});// Send the transactionawait transaction.sendAndConfirm();
중요 사항
- 자격 증명의 승인된 서명자만 증명을 생성할 수 있습니다
- 권한 보유자는 트랜잭션의 서명자여야 합니다
- 지불자는 트랜잭션의 서명자여야 합니다
- 증명 계정은 쓰기 가능해야 합니다
- 자격 증명 및 스키마 계정은 읽기 가능해야 합니다
- 이 작업은 rent 면제 계산을 위해 System Program이 필요합니다
- 스키마는 일시 중지 상태가 아니어야 합니다
- 데이터는 스키마의 구조 및 유효성 검사 규칙을 준수해야 합니다
- nonce는 각 증명마다 고유해야 합니다
- 만료 타임스탬프는 미래 시점이어야 합니다
- 증명은 만료 타임스탬프 이후에는 유효하지 않습니다
- 자격 증명은 스키마와 연결되어 있어야 합니다
Is this page helpful?