github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/p/demo/gnode/gnode.gno (about)

     1  package gnode
     2  
     3  // XXX what about Gnodes signing on behalf of others?
     4  // XXX like a multi-sig of Gnodes?
     5  
     6  type Name string
     7  
     8  type Gnode interface {
     9  	//----------------------------------------
    10  	// Basic properties
    11  	GetName() Name
    12  
    13  	//----------------------------------------
    14  	// Affiliate Gnodes
    15  	NumAffiliates() int
    16  	GetAffiliates(Name) Affiliate
    17  	AddAffiliate(Affiliate) error // must be affiliated
    18  	RemAffiliate(Name) error      // must have become unaffiliated
    19  
    20  	//----------------------------------------
    21  	// Signing
    22  	NumSignedDocuments() int
    23  	GetSignedDocument(idx int) Document
    24  	SignDocument(doc Document) (int, error) // index relative to signer
    25  
    26  	//----------------------------------------
    27  	// Rendering
    28  	RenderLines() []string
    29  }
    30  
    31  type Affiliate struct {
    32  	Type  string
    33  	Gnode Gnode
    34  	Tags  []string
    35  }
    36  
    37  type MyGnode struct {
    38  	Name
    39  	// Owners     // voting set, something that gives authority of action.
    40  	// Treasury   //
    41  	// Affiliates //
    42  	// Board      // discussions
    43  	// Data       // XXX ?
    44  }
    45  
    46  type Affiliates []*Affiliate
    47  
    48  // Documents are equal if they compare equal.
    49  // NOTE: requires all fields to be comparable.
    50  type Document struct {
    51  	Authors string
    52  	// Timestamp
    53  	// Body
    54  	// Attachments
    55  }
    56  
    57  // ACTIONS
    58  
    59  // * Lend tokens
    60  // * Pay tokens
    61  // * Administrate transferrable and non-transferrable tokens
    62  // * Sum tokens
    63  // * Passthrough dependencies
    64  // * Code
    65  // * ...