/
schemas.ts
129 lines (117 loc) · 3.34 KB
/
schemas.ts
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* Class representing the initialization schema for the Solana token v1 bridge.
*/
export class BridgeInitSchema {
readonly algo_address: Uint8Array;
readonly amount: number;
constructor(properties: { algo_address: Uint8Array; amount: number }) {
this.algo_address = properties.algo_address;
this.amount = properties.amount;
}
static init_schema = new Map([
[
BridgeInitSchema,
{
kind: "struct",
fields: [
["algo_address", [32]],
["amount", "u64"],
],
},
],
]);
}
/**
* Class representing the set schema for the Solana token v1 bridge.
*/
export class BridgeSetSchema {
readonly validator_address: Uint8Array;
constructor(properties: { validator_address: Uint8Array }) {
this.validator_address = properties.validator_address;
}
static set_schema = new Map([
[
BridgeSetSchema,
{
kind: "struct",
fields: [["validator_address", [32]]],
},
],
]);
}
/**
* Class representing the release schema for the Solana token v1 bridge.
*/
export class BridgeReleaseSchema {
readonly algo_address: Uint8Array;
readonly algo_txn_id: Uint8Array;
readonly amount: number;
constructor(properties: { algo_address: Uint8Array; algo_txn_id: Uint8Array; amount: number }) {
this.algo_address = properties.algo_address;
this.algo_txn_id = properties.algo_txn_id;
this.amount = properties.amount;
}
static release_schema = new Map([
[
BridgeReleaseSchema,
{
kind: "struct",
fields: [
["algo_address", [32]],
["algo_txn_id", [52]],
["amount", "u64"],
],
},
],
]);
}
/**
* Class representing the approve schema for the Solana token v1 bridge.
*/
export class BridgeApproveSchema {
readonly algo_address: Uint8Array;
readonly algo_txn_id: Uint8Array;
constructor(properties: { algo_address: Uint8Array; algo_txn_id: Uint8Array }) {
this.algo_address = properties.algo_address;
this.algo_txn_id = properties.algo_txn_id;
}
static approve_schema = new Map([
[
BridgeApproveSchema,
{
kind: "struct",
fields: [
["algo_address", [32]],
["algo_txn_id", [52]],
],
},
],
]);
}
/**
* Class representing the cancel schema for the Solana token v1 bridge.
*/
export class BridgeCancelSchema {
readonly algo_address: Uint8Array;
constructor(properties: { algo_address: Uint8Array }) {
this.algo_address = properties.algo_address;
}
static cancel_schema = new Map([
[
BridgeCancelSchema,
{
kind: "struct",
fields: [["algo_address", [32]]],
},
],
]);
}
/**
* Loads the Solana schema. so long as this function is called, these static classes are loaded
*
* @function LoadSolanaSchema
* @returns {void}
*/
export function LoadSolanaSchema(){
//here to load schema - so long as this function is called, these static classes are loaded
}