separation from main repo
This commit is contained in:
parent
cf703947bb
commit
432a51e65f
2 changed files with 46 additions and 0 deletions
3
go.mod
Normal file
3
go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
module github.com/gregorybednov/lbc_sdk
|
||||||
|
|
||||||
|
go 1.24.2
|
||||||
43
types.go
Normal file
43
types.go
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
package types
|
||||||
|
|
||||||
|
// Types module
|
||||||
|
// Can be used for an import
|
||||||
|
// TODO someday it could be migrated onto generated types
|
||||||
|
|
||||||
|
|
||||||
|
type CommiterTxBody struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
ID string `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
CommiterPubKey string `json:"commiter_pubkey"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PromiseTxBody struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
ID string `json:"id"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Timestamp int64 `json:"timestamp,omitempty"` // ← чтобы понимать клиент
|
||||||
|
Title string `json:"title,omitempty"` // ← опционально, если когда-нибудь пригодится
|
||||||
|
Deadline string `json:"deadline,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CommitmentTxBody struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
ID string `json:"id"`
|
||||||
|
PromiseID string `json:"promise_id"`
|
||||||
|
CommiterID string `json:"commiter_id"`
|
||||||
|
CommiterSig string `json:"commiter_sig,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CompoundTx struct {
|
||||||
|
Body struct {
|
||||||
|
Promise *PromiseTxBody `json:"promise"`
|
||||||
|
Commitment *CommitmentTxBody `json:"commitment"`
|
||||||
|
} `json:"body"`
|
||||||
|
Signature string `json:"signature"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SignedTx struct {
|
||||||
|
Body any `json:"body"` // TODO someday it should become less abstract
|
||||||
|
Signature string `json:"signature"`
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue