-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvaultmanager.did.js
201 lines (201 loc) · 6.87 KB
/
vaultmanager.did.js
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
export const idlFactory = ({ IDL }) => {
const _InlineICRCTransferErrorGenericError = IDL.Record({
'message' : IDL.Text,
'error_code' : IDL.Nat,
});
const _InlineICRCTransferErrorBadBurn = IDL.Record({
'min_burn_amount' : IDL.Nat,
});
const _InlineICRCTransferErrorDuplicate = IDL.Record({
'duplicate_of' : IDL.Nat,
});
const _InlineICRCTransferErrorBadFee = IDL.Record({
'expected_fee' : IDL.Nat,
});
const _InlineICRCTransferErrorCreatedInFuture = IDL.Record({
'ledger_time' : IDL.Nat64,
});
const _InlineICRCTransferErrorInsufficientFunds = IDL.Record({
'balance' : IDL.Nat,
});
const ICRCTransferError = IDL.Variant({
'GenericError' : _InlineICRCTransferErrorGenericError,
'TemporarilyUnavailable' : IDL.Null,
'BadBurn' : _InlineICRCTransferErrorBadBurn,
'Duplicate' : _InlineICRCTransferErrorDuplicate,
'BadFee' : _InlineICRCTransferErrorBadFee,
'CreatedInFuture' : _InlineICRCTransferErrorCreatedInFuture,
'TooOld' : IDL.Null,
'InsufficientFunds' : _InlineICRCTransferErrorInsufficientFunds,
});
const ManualReply = IDL.Variant({
'Ok' : IDL.Nat,
'Err' : ICRCTransferError,
});
const _InlineTransferErrorGenericError = IDL.Record({
'message' : IDL.Text,
'error_code' : IDL.Nat,
});
const _InlineTransferErrorBadBurn = IDL.Record({
'min_burn_amount' : IDL.Nat,
});
const _InlineTransferErrorDuplicate = IDL.Record({
'duplicate_of' : IDL.Nat,
});
const _InlineTransferErrorBadFee = IDL.Record({ 'expected_fee' : IDL.Nat });
const _InlineTransferErrorCreatedInFuture = IDL.Record({
'ledger_time' : IDL.Nat64,
});
const _InlineTransferErrorInsufficientFunds = IDL.Record({
'balance' : IDL.Nat,
});
const TransferError = IDL.Variant({
'GenericError' : _InlineTransferErrorGenericError,
'TemporarilyUnavailable' : IDL.Null,
'BadBurn' : _InlineTransferErrorBadBurn,
'Duplicate' : _InlineTransferErrorDuplicate,
'BadFee' : _InlineTransferErrorBadFee,
'CreatedInFuture' : _InlineTransferErrorCreatedInFuture,
'TooOld' : IDL.Null,
'InsufficientFunds' : _InlineTransferErrorInsufficientFunds,
});
const ManualReply_1 = IDL.Variant({ 'Ok' : IDL.Nat, 'Err' : TransferError });
const IndividualVaultData = IDL.Record({
'vaultLtvRatio' : IDL.Float64,
'normalisedDebt' : IDL.Float64,
'primaryOwner' : IDL.Principal,
'memo' : IDL.Opt(IDL.Vec(IDL.Nat8)),
'vaultCurrentCollateral' : IDL.Float64,
'vaultCollaterisationRatio' : IDL.Float64,
'isActive' : IDL.Bool,
'VaultCreationTime' : IDL.Nat,
'vaultId' : IDL.Nat,
});
const Account = IDL.Record({
'owner' : IDL.Principal,
'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
});
const Value = IDL.Variant({
'Int' : IDL.Int,
'Nat' : IDL.Nat,
'Blob' : IDL.Vec(IDL.Nat8),
'Text' : IDL.Text,
});
const SupportedStandard = IDL.Record({ 'url' : IDL.Text, 'name' : IDL.Text });
const AllowanceArgs = IDL.Record({
'account' : Account,
'spender' : Account,
});
const Allowance = IDL.Record({
'allowance' : IDL.Nat,
'expires_at' : IDL.Opt(IDL.Nat64),
});
const VaultStateData = IDL.Record({
'DebtTokenPrincipal' : IDL.Principal,
'priimary_owner' : IDL.Principal,
'interestPerSecond' : IDL.Float64,
'oracle' : IDL.Principal,
'currentAccumulatorValue' : IDL.Float64,
'lastAccumulatorUpdateTime_seconds' : IDL.Nat32,
'CollateralPrincipal' : IDL.Principal,
'interestFeePercentage' : IDL.Float64,
});
const VaultMetadata = IDL.Record({
'DebtTokeName' : IDL.Text,
'CollateralName' : IDL.Text,
});
const AdministrativeData = IDL.Record({
'priimary_owner' : IDL.Principal,
'guardians' : IDL.Vec(IDL.Principal),
});
const VaultStorageData = IDL.Record({
'VaultStateData' : VaultStateData,
'Transactions' : IDL.Vec(IndividualVaultData),
'VaultMedata' : VaultMetadata,
'vaultCounter' : IDL.Nat,
'AdministrativeData' : AdministrativeData,
});
const _AzleResult = IDL.Variant({ 'Ok' : IDL.Text, 'Err' : IDL.Text });
const _InlineTransferFromErrorInsufficientAllowance = IDL.Record({
'allowance' : IDL.Nat,
});
const TransferFromError = IDL.Variant({
'GenericError' : _InlineTransferErrorGenericError,
'TemporarilyUnavailable' : IDL.Null,
'InsufficientAllowance' : _InlineTransferFromErrorInsufficientAllowance,
'BadBurn' : _InlineTransferErrorBadBurn,
'Duplicate' : _InlineTransferErrorDuplicate,
'BadFee' : _InlineTransferErrorBadFee,
'CreatedInFuture' : _InlineTransferErrorCreatedInFuture,
'TooOld' : IDL.Null,
'InsufficientFunds' : _InlineTransferErrorInsufficientFunds,
});
const ManualReply_2 = IDL.Variant({
'Ok' : IDL.Nat,
'Err' : TransferFromError,
});
const ManualReply_3 = IDL.Variant({
'Ok' : IDL.Float64,
'Err' : TransferError,
});
return IDL.Service({
'addCollateral' : IDL.Func([IDL.Nat, IDL.Nat], [ManualReply], []),
'borrow' : IDL.Func([IDL.Nat, IDL.Nat], [ManualReply_1], []),
'calculatenewAccumulator' : IDL.Func(
[IDL.Float64, IDL.Float64, IDL.Nat32],
[IDL.Float64],
['query'],
),
'createVault' : IDL.Func([IDL.Opt(IDL.Vec(IDL.Nat8))], [IDL.Nat], []),
'getBtcPrice' : IDL.Func([], [IDL.Text], []),
'getUserVaultIds' : IDL.Func(
[IDL.Principal],
[IDL.Vec(IDL.Nat)],
['query'],
),
'getVaultActualDebt' : IDL.Func([IDL.Nat], [IDL.Float64], ['query']),
'getVaultDetails' : IDL.Func([IDL.Nat], [IndividualVaultData], ['query']),
'icrc1_balance_of' : IDL.Func([Account], [IDL.Nat], ['query']),
'icrc1_decimals' : IDL.Func([], [IDL.Nat8], ['query']),
'icrc1_fee' : IDL.Func([], [IDL.Nat], ['query']),
'icrc1_metadata' : IDL.Func(
[],
[IDL.Vec(IDL.Tuple(IDL.Text, Value))],
['query'],
),
'icrc1_minting_account' : IDL.Func([], [IDL.Opt(Account)], ['query']),
'icrc1_name' : IDL.Func([], [IDL.Text], ['query']),
'icrc1_supported_standards' : IDL.Func(
[],
[IDL.Vec(SupportedStandard)],
['query'],
),
'icrc1_symbol' : IDL.Func([], [IDL.Text], ['query']),
'icrc1_total_supply' : IDL.Func([], [IDL.Nat], ['query']),
'icrc2_allowance' : IDL.Func([AllowanceArgs], [Allowance], ['query']),
'init' : IDL.Func([VaultStorageData], [_AzleResult], []),
'normalizeDebt' : IDL.Func(
[IDL.Float64, IDL.Float64],
[IDL.Float64],
['query'],
),
'repayDebt' : IDL.Func(
[IDL.Nat, IDL.Nat, IDL.Opt(IDL.Vec(IDL.Nat8))],
[ManualReply_2],
[],
),
'resetVault' : IDL.Func([], [IDL.Text], []),
'testInit' : IDL.Func([], [_AzleResult], []),
'testPadAccount' : IDL.Func(
[IDL.Opt(IDL.Vec(IDL.Nat8))],
[Account],
['query'],
),
'withdrawCollateral' : IDL.Func(
[IDL.Nat, IDL.Nat, Account],
[ManualReply_3],
[],
),
});
};
export const init = ({ IDL }) => { return []; };