1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#![feature(min_specialization)]

use serde::{Deserialize, Serialize};
use tea_actorx_core::ActorId;
use tea_codec::pricing::Priced;
use tea_codec::serde::TypeId;
use tea_solc_codec::{
	queries::AsyncQuery,
	txns::{AsyncTxn, SingleSign},
	BlockNumber,
};
use tea_tapp_common::{
	cml::{CmlId, CmlIntrinsic},
	Account,
};
use tea_tappstore_actor_codec::txns::TopupEventItem;

pub mod error;

extern crate tea_codec as tea_sdk;

pub const NAME: &[u8] = b"tea:layer1";

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(100)]
#[response(())]
pub struct RegisterEventRequest;

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(1000)]
#[response(())]
pub struct UpdateTappStartupNodesRequest(pub Vec<(Vec<u8>, CmlId, String)>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(1000)]
#[response(())]
pub struct UpdateCmlInfoRequest(pub Vec<CmlIntrinsic>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(1000)]
pub struct TappStartupNodesFromCacheRequest;
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct TappStartupNodesFromCacheResponse(pub Option<Vec<(Vec<u8>, CmlId, String)>>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
pub struct CmlInfoFromCacheRequest(pub CmlId);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct CmlInfoFromCacheResponse(pub Option<CmlIntrinsic>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
pub struct TappStartupNodesRequest(pub AsyncQuery);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct TappStartupNodesResponse(pub Vec<(CmlId, String)>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
pub struct GetCmlInfoRequest(pub AsyncQuery);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct GetCmlInfoResponse(pub Vec<CmlIntrinsic>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
#[response(())]
pub struct SendMultisigTxnRequest(pub AsyncTxn);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
pub struct SignMultisigTxnRequest(pub AsyncTxn);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct SignMultisigTxnResponse(pub SingleSign);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
pub struct MultisigThresholdRequest(pub AsyncQuery);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct MultisigThresholdResponse(pub u8);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(10000)]
pub struct CurrentBlockNumberRequest;
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct CurrentBlockNumberResponse(pub BlockNumber);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(100)]
pub struct RegisteredActorsRequest;
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct RegisteredActorsResponse(pub Vec<ActorId>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(100)]
pub struct TappstoreOwnerRequest(pub AsyncQuery);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct TappstoreOwnerResponse(pub Account);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(100)]
pub struct TopupSinceRequest(pub BlockNumber);
#[derive(Debug, Clone, Serialize, Deserialize, TypeId)]
pub struct TopupSinceResponse(pub Vec<TopupEventItem>);

#[derive(Debug, Clone, Serialize, Deserialize, TypeId, Priced)]
#[price(100)]
#[response(())]
pub struct Layer1Event(pub Vec<u8>);