You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
3.8 KiB
64 lines
3.8 KiB
package zxchainsdk
|
|
|
|
// HashAttestationRequest 定义 Hash 存证请求模型。
|
|
type HashAttestationRequest struct {
|
|
BizID string // BizID 表示业务主键。
|
|
Scene string // Scene 表示业务场景,会作为官方 EvSave 的 extendInfo。
|
|
Content string // Content 表示待存证的文本内容。
|
|
ContentBytes []byte // ContentBytes 表示待存证的二进制内容,优先级高于 Content。
|
|
Hash string // Hash 表示业务侧传入的哈希值,SDK 实际上链仍按内容计算 SM3。
|
|
FileName string // FileName 表示原始文件名。
|
|
FileSize int64 // FileSize 表示原始文件大小。
|
|
ContentType string // ContentType 表示原始内容类型。
|
|
StorageURI string // StorageURI 表示业务侧保存原始文件的位置。
|
|
CreatedAt string // CreatedAt 表示业务侧创建存证请求的时间。
|
|
Metadata map[string]string // Metadata 表示附加元数据。
|
|
}
|
|
|
|
// HashAttestationQueryRequest 定义 Hash 存证取证查询请求模型。
|
|
type HashAttestationQueryRequest struct {
|
|
EvID string // EvID 表示 Hash 存证回执中的 evId。
|
|
Hash string // Hash 表示本次存证内容的 SM3 哈希。
|
|
TxID string // TxID 表示 Hash 存证回执中的 txId。
|
|
}
|
|
|
|
// KVAttestationRequest 定义 KV 存证请求模型。
|
|
type KVAttestationRequest struct {
|
|
BizID string // BizID 表示业务主键,同时作为链上 KV key。
|
|
Scene string // Scene 表示业务场景。
|
|
Fields map[string]string // Fields 表示待上链的键值字段集合。
|
|
Metadata map[string]string // Metadata 表示附加元数据。
|
|
}
|
|
|
|
// AttestationResult 定义存证结果模型。
|
|
type AttestationResult struct {
|
|
ReceiptID string // ReceiptID 表示链上回执编号,Hash 存证时对应 evId。
|
|
RequestID string // RequestID 表示请求追踪编号,通常对应 txId。
|
|
Status string // Status 表示存证状态。
|
|
RawResponse []byte // RawResponse 保存官方 SDK 原始响应内容。
|
|
ExternalRefID string // ExternalRefID 表示外部引用标识。
|
|
BlockHeight int64 `json:"blockHeight,omitempty"` // BlockHeight 表示上链区块高度。
|
|
TxTime string `json:"txTime,omitempty"` // TxTime 表示官方返回的上链时间。
|
|
FileName string `json:"fileName,omitempty"` // FileName 表示原始文件名。
|
|
FileSize int64 `json:"fileSize,omitempty"` // FileSize 表示原始文件大小。
|
|
ContentType string `json:"contentType,omitempty"` // ContentType 表示原始内容类型。
|
|
StorageURI string `json:"storageUri,omitempty"` // StorageURI 表示业务侧保存原始文件的位置。
|
|
SM3Hash string `json:"sm3Hash,omitempty"` // SM3Hash 表示本次上链内容的 SM3 哈希。
|
|
CreatedAt string `json:"createdAt,omitempty"` // CreatedAt 表示业务侧创建存证请求的时间。
|
|
}
|
|
|
|
// HashAttestationQueryResult 定义 Hash 存证取证查询结果。
|
|
type HashAttestationQueryResult struct {
|
|
EvID string `json:"evId,omitempty"` // EvID 表示 Hash 存证回执中的 evId。
|
|
TxID string `json:"txId,omitempty"` // TxID 表示 Hash 存证回执中的 txId。
|
|
BlockHeight int64 `json:"blockHeight,omitempty"` // BlockHeight 表示上链区块高度。
|
|
TxTime string `json:"txTime,omitempty"` // TxTime 表示官方返回的上链时间。
|
|
ExtendInfo string `json:"extendInfo,omitempty"` // ExtendInfo 表示存证时传入的业务场景信息。
|
|
RawResponse []byte `json:"-"` // RawResponse 保存官方 SDK 原始响应内容。
|
|
}
|
|
|
|
// HashCertResult 定义 Hash 存证证书查询结果。
|
|
type HashCertResult struct {
|
|
EvID string // EvID 表示 Hash 存证回执中的 evId。
|
|
CertURL string // CertURL 表示官方证书访问地址。
|
|
}
|
|
|