-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlsm.did
146 lines (146 loc) · 4.55 KB
/
lsm.did
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
type AddErc20Arg = record {
contract : Erc20Contract;
ledger_init_arg : LedgerInitArg;
};
type AddErc20Error = variant {
TransferIcpError : TransferFromError;
ChainIdNotSupported : text;
Erc20TwinTokenAlreadyExists;
InvalidErc20Contract : text;
InternalError : text;
};
type CanisterStatusResponse = record {
status : CanisterStatusType;
memory_size : nat;
cycles : nat;
settings : DefiniteCanisterSettings;
query_stats : QueryStats;
idle_cycles_burned_per_day : nat;
module_hash : opt blob;
reserved_cycles : nat;
};
type CanisterStatusType = variant { stopped; stopping; running };
type CyclesManagement = record {
cycles_top_up_increment : nat;
cycles_for_ledger_creation : nat;
cycles_for_archive_creation : nat;
cycles_for_index_creation : nat;
};
type DefiniteCanisterSettings = record {
freezing_threshold : nat;
controllers : vec principal;
reserved_cycles_limit : nat;
memory_allocation : nat;
compute_allocation : nat;
};
type Erc20Contract = record { chain_id : nat; address : text };
type InitArg = record {
minter_ids : vec record { nat; principal };
cycles_management : opt CyclesManagement;
more_controller_ids : vec principal;
twin_ls_creation_fee_appic_token : opt nat;
twin_ls_creation_fee_icp_token : nat;
};
type InstalledNativeLedgerSuite = record {
fee : nat;
decimals : nat8;
logo : text;
name : text;
chain_id : nat;
ledger_wasm_hash : text;
ledger : principal;
index_wasm_hash : text;
index : principal;
archives : vec principal;
symbol : text;
};
type InvalidNativeInstalledCanistersError = variant {
TokenAlreadyManaged;
NotAllowed;
WasmHashError;
FailedToNotifyAppicHelper;
AlreadyManagedPrincipals;
};
type LSMarg = variant { Upgrade : UpgradeArg; Init : InitArg };
type LedgerInitArg = record {
decimals : nat8;
token_symbol : text;
transfer_fee : nat;
token_logo : text;
token_name : text;
};
type LedgerManagerInfo = record {
minter_ids : vec record { nat; principal };
cycles_management : CyclesManagement;
managed_canisters : vec ManagedCanisters;
more_controller_ids : vec principal;
ledger_suite_version : opt LedgerSuiteVersion;
ls_creation_appic_fee : opt nat;
ls_creation_icp_fee : nat;
};
type LedgerSuiteVersion = record {
archive_compressed_wasm_hash : text;
ledger_compressed_wasm_hash : text;
index_compressed_wasm_hash : text;
};
type ManagedCanisterIds = record {
ledger : opt principal;
index : opt principal;
archives : vec principal;
};
type ManagedCanisterStatus = variant {
Created : record { canister_id : principal };
Installed : record { canister_id : principal; installed_wasm_hash : text };
};
type ManagedCanisters = record {
erc20_contract : Erc20Contract;
twin_erc20_token_symbol : text;
ledger : opt ManagedCanisterStatus;
index : opt ManagedCanisterStatus;
archives : vec principal;
};
type QueryStats = record {
response_payload_bytes_total : nat;
num_instructions_total : nat;
num_calls_total : nat;
request_payload_bytes_total : nat;
};
type Result = variant { Ok; Err : AddErc20Error };
type Result_1 = variant { Ok; Err : InvalidNativeInstalledCanistersError };
type TransferFromError = variant {
GenericError : record { message : text; error_code : nat };
TemporarilyUnavailable;
InsufficientAllowance : record { allowance : nat };
BadBurn : record { min_burn_amount : nat };
Duplicate : record { duplicate_of : nat };
BadFee : record { expected_fee : nat };
CreatedInFuture : record { ledger_time : nat64 };
TooOld;
InsufficientFunds : record { balance : nat };
};
type UpdateCyclesManagement = record {
cycles_top_up_increment : opt nat;
cycles_for_ledger_creation : opt nat;
cycles_for_archive_creation : opt nat;
cycles_for_index_creation : opt nat;
};
type UpdateLedgerSuiteCreationFee = record { icp : nat; appic : opt nat };
type UpgradeArg = record {
cycles_management : opt UpdateCyclesManagement;
archive_compressed_wasm_hash : opt text;
new_minter_ids : opt vec record { nat; principal };
ledger_compressed_wasm_hash : opt text;
index_compressed_wasm_hash : opt text;
twin_ls_creation_fees : opt UpdateLedgerSuiteCreationFee;
};
service : (LSMarg) -> {
add_erc20_ls : (AddErc20Arg) -> (Result);
add_native_ls : (InstalledNativeLedgerSuite) -> (Result_1);
all_twins_canister_ids : () -> (vec ManagedCanisters) query;
get_canister_status : () -> (CanisterStatusResponse);
get_lsm_info : () -> (LedgerManagerInfo) query;
twin_canister_ids_by_contract : (Erc20Contract) -> (
opt ManagedCanisterIds,
) query;
update_twin_creation_fees : (UpdateLedgerSuiteCreationFee) -> ();
}