@huma-finance/soroban-pool-credit 0.0.8-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # tb-poolCredit JS
2
+
3
+ JS library for interacting with [Soroban](https://soroban.stellar.org/) smart contract `tb-poolCredit` via Soroban RPC.
4
+
5
+ This library was automatically generated by Soroban CLI using a command similar to:
6
+
7
+ ```bash
8
+ soroban contract bindings ts \
9
+ --rpc-url https://soroban-testnet.stellar.org:443 \
10
+ --network-passphrase "Test SDF Network ; September 2015" \
11
+ --contract-id CBI7LGEWCJFO2APREGBRTUXB5JMZHJOVD76MESEB7V6W4IJ4ZLQJILDB \
12
+ --output-dir ./path/to/tb-poolCredit
13
+ ```
14
+
15
+ The network passphrase and contract ID are exported from [index.ts](./src/index.ts) in the `networks` constant. If you are the one who generated this library and you know that this contract is also deployed to other networks, feel free to update `networks` with other valid options. This will help your contract consumers use this library more easily.
16
+
17
+ # To publish or not to publish
18
+
19
+ This library is suitable for publishing to NPM. You can publish it to NPM using the `npm publish` command.
20
+
21
+ But you don't need to publish this library to NPM to use it. You can add it to your project's `package.json` using a file path:
22
+
23
+ ```json
24
+ "dependencies": {
25
+ "tb-poolCredit": "./path/to/this/folder"
26
+ }
27
+ ```
28
+
29
+ However, we've actually encountered [frustration](https://github.com/stellar/soroban-example-dapp/pull/117#discussion_r1232873560) using local libraries with NPM in this way. Though it seems a bit messy, we suggest generating the library directly to your `node_modules` folder automatically after each install by using a `postinstall` script. We've had the least trouble with this approach. NPM will automatically remove what it sees as erroneous directories during the `install` step, and then regenerate them when it gets to your `postinstall` step, which will keep the library up-to-date with your contract.
30
+
31
+ ```json
32
+ "scripts": {
33
+ "postinstall": "soroban contract bindings ts --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase \"Test SDF Network ; September 2015\" --id CBI7LGEWCJFO2APREGBRTUXB5JMZHJOVD76MESEB7V6W4IJ4ZLQJILDB --name tb-poolCredit"
34
+ }
35
+ ```
36
+
37
+ Obviously you need to adjust the above command based on the actual command you used to generate the library.
38
+
39
+ # Use it
40
+
41
+ Now that you have your library up-to-date and added to your project, you can import it in a file and see inline documentation for all of its exported methods:
42
+
43
+ ```js
44
+ import { Contract, networks } from "tb-poolCredit"
45
+
46
+ const contract = new Contract({
47
+ ...networks.futurenet, // for example; check which networks this library exports
48
+ rpcUrl: '...', // use your own, or find one for testing at https://soroban.stellar.org/docs/reference/rpc#public-rpc-providers
49
+ })
50
+
51
+ contract.|
52
+ ```
53
+
54
+ As long as your editor is configured to show JavaScript/TypeScript documentation, you can pause your typing at that `|` to get a list of all exports and inline-documentation for each. It exports a separate [async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function for each method in the smart contract, with documentation for each generated from the comments the contract's author included in the original source code.
@@ -0,0 +1,401 @@
1
+ /// <reference types="node" />
2
+ import { Buffer } from 'buffer';
3
+ import { AssembledTransaction, ContractClient, ContractClientOptions } from '@stellar/stellar-sdk/lib/contract_client/index.js';
4
+ import type { u32, u64, u128, Option } from '@stellar/stellar-sdk/lib/contract_client';
5
+ export * from '@stellar/stellar-sdk';
6
+ export * from '@stellar/stellar-sdk/lib/contract_client/index.js';
7
+ export * from '@stellar/stellar-sdk/lib/rust_types/index.js';
8
+ export declare const networks: {
9
+ readonly testnet: {
10
+ readonly networkPassphrase: "Test SDF Network ; September 2015";
11
+ readonly contractId: "CBI7LGEWCJFO2APREGBRTUXB5JMZHJOVD76MESEB7V6W4IJ4ZLQJILDB";
12
+ };
13
+ };
14
+ export type ClientDataKey = {
15
+ tag: 'Pool';
16
+ values: void;
17
+ } | {
18
+ tag: 'PoolStorage';
19
+ values: void;
20
+ } | {
21
+ tag: 'CreditStorage';
22
+ values: void;
23
+ } | {
24
+ tag: 'UnderlyingToken';
25
+ values: void;
26
+ };
27
+ export declare const Errors: {
28
+ 51: {
29
+ message: string;
30
+ };
31
+ 55: {
32
+ message: string;
33
+ };
34
+ 71: {
35
+ message: string;
36
+ };
37
+ 222: {
38
+ message: string;
39
+ };
40
+ 202: {
41
+ message: string;
42
+ };
43
+ 203: {
44
+ message: string;
45
+ };
46
+ 204: {
47
+ message: string;
48
+ };
49
+ 215: {
50
+ message: string;
51
+ };
52
+ 205: {
53
+ message: string;
54
+ };
55
+ 206: {
56
+ message: string;
57
+ };
58
+ 207: {
59
+ message: string;
60
+ };
61
+ 219: {
62
+ message: string;
63
+ };
64
+ 101: {
65
+ message: string;
66
+ };
67
+ };
68
+ /**
69
+ * Account billing info refreshed with the updated due amount and date.
70
+ * # Fields:
71
+ * * `credit_hash` - The hash of the credit.
72
+ * * `new_due_date` - The updated due date of the bill.
73
+ * * `next_due` - The amount of next due on the bill.
74
+ * * `total_past_due` - The total amount of past due on the bill.
75
+ */
76
+ export interface BillRefreshedEvent {
77
+ credit_hash: Buffer;
78
+ new_due_date: u64;
79
+ next_due: u128;
80
+ total_past_due: u128;
81
+ }
82
+ /**
83
+ * A credit has been borrowed from.
84
+ * # Fields:
85
+ * * `borrower` - The address of the borrower.
86
+ * * `borrow_amount` - The amount the user has borrowed.
87
+ * * `net_amount_to_borrower` - The borrowing amount minus the fees that are charged upfront.
88
+ */
89
+ export interface DrawdownMadeEvent {
90
+ borrow_amount: u128;
91
+ borrower: string;
92
+ net_amount_to_borrower: u128;
93
+ }
94
+ /**
95
+ * A payment has been made against the credit.
96
+ * # Fields:
97
+ * * `borrower` - The address of the borrower.
98
+ * * `amount` - The payback amount.
99
+ * * `next_due_date` - The due date of the next payment.
100
+ * * `yield_due` - The yield due on the credit after processing the payment.
101
+ * * `principal_due` - The principal due on the credit after processing the payment.
102
+ * * `yield_due_paid` - The amount of this payment applied to yield due in the current billing cycle.
103
+ * * `principal_due_paid` - The amount of this payment applied to principal due in the current billing cycle.
104
+ * * `unbilled_principal_paid` - The amount of this payment applied to unbilled principal.
105
+ * * `yield_past_due_paid` - The amount of this payment applied to yield past due.
106
+ * * `late_fee_paid` - The amount of this payment applied to late fee.
107
+ * * `principal_past_due_paid` - The amount of this payment applied to principal past due.
108
+ */
109
+ export interface PaymentMadeEvent {
110
+ amount: u128;
111
+ borrower: string;
112
+ late_fee_paid: u128;
113
+ next_due_date: u64;
114
+ principal_due: u128;
115
+ principal_due_paid: u128;
116
+ principal_past_due_paid: u128;
117
+ unbilled_principal_paid: u128;
118
+ yield_due: u128;
119
+ yield_due_paid: u128;
120
+ yield_past_due_paid: u128;
121
+ }
122
+ /**
123
+ * A principal payment has been made against the credit.
124
+ * # Fields:
125
+ * * `borrower` - The address of the borrower.
126
+ * * `payer` - The address from which the money is coming.
127
+ * * `amount` - The payback amount.
128
+ * * `next_due_date` - The due date of the next payment.
129
+ * * `principal_due` - The principal due on the credit after processing the payment.
130
+ * * `unbilled_principal` - The unbilled principal on the credit after processing the payment.
131
+ * * `principal_due_paid` - The amount of this payment applied to principal due.
132
+ * * `unbilled_principal_paid` - The amount of this payment applied to unbilled principal.
133
+ */
134
+ export interface PrincipalPaymentMadeEvent {
135
+ amount: u128;
136
+ borrower: string;
137
+ next_due_date: u64;
138
+ principal_due: u128;
139
+ principal_due_paid: u128;
140
+ unbilled_principal: u128;
141
+ unbilled_principal_paid: u128;
142
+ }
143
+ /**
144
+ * An existing credit has been closed.
145
+ * # Fields:
146
+ * * `credit_hash` - The credit hash.
147
+ */
148
+ export interface CreditClosedAfterPayOffEvent {
149
+ credit_hash: Buffer;
150
+ }
151
+ export type PayPeriodDuration = {
152
+ tag: 'Monthly';
153
+ values: void;
154
+ } | {
155
+ tag: 'Quarterly';
156
+ values: void;
157
+ } | {
158
+ tag: 'SemiAnnually';
159
+ values: void;
160
+ };
161
+ export type CreditState = {
162
+ tag: 'Deleted';
163
+ values: void;
164
+ } | {
165
+ tag: 'Approved';
166
+ values: void;
167
+ } | {
168
+ tag: 'GoodStanding';
169
+ values: void;
170
+ } | {
171
+ tag: 'Delayed';
172
+ values: void;
173
+ } | {
174
+ tag: 'Defaulted';
175
+ values: void;
176
+ };
177
+ /**
178
+ * `CreditConfig` keeps track of the static settings of a credit.
179
+ * A `CreditConfig` is created after the approval of each credit.
180
+ * # Fields:
181
+ * * `credit_limit` - The maximum amount that can be borrowed.
182
+ * * `committed_amount` - The amount that the borrower has committed to use. If the used credit
183
+ * is less than this amount, the borrower will be charged yield using this amount.
184
+ * * `pay_period_duration` - The duration of each pay period, e.g., monthly, quarterly, or semi-annually.
185
+ * * `num_of_periods` - The number of periods before the credit expires.
186
+ * * `yield_bps` - The expected yield expressed in basis points, where 1% is 100, and 100% is 10,000. It means different things
187
+ * for different credit types:
188
+ * 1. For credit line, it is APR.
189
+ * 2. For factoring, it is factoring fee for the given period.
190
+ * 3. For dynamic yield credit, it is the estimated APY.
191
+ * * `revolving` - A flag indicating if repeated borrowing is allowed.
192
+ */
193
+ export interface CreditConfig {
194
+ committed_amount: u128;
195
+ credit_limit: u128;
196
+ num_periods: u32;
197
+ pay_period_duration: PayPeriodDuration;
198
+ revolving: boolean;
199
+ yield_bps: u32;
200
+ }
201
+ export interface CreditRecord {
202
+ missed_periods: u32;
203
+ next_due: u128;
204
+ next_due_date: u64;
205
+ remaining_periods: u32;
206
+ state: CreditState;
207
+ total_past_due: u128;
208
+ unbilled_principal: u128;
209
+ yield_due: u128;
210
+ }
211
+ export interface DueDetail {
212
+ accrued: u128;
213
+ committed: u128;
214
+ late_fee: u128;
215
+ late_fee_updated_date: u64;
216
+ paid: u128;
217
+ principal_past_due: u128;
218
+ yield_past_due: u128;
219
+ }
220
+ export interface PoolSettings {
221
+ default_grace_period_days: u32;
222
+ late_payment_grace_period_days: u32;
223
+ max_credit_line: u128;
224
+ min_deposit_amount: u128;
225
+ pay_period_duration: PayPeriodDuration;
226
+ principal_only_payment_allowed: boolean;
227
+ }
228
+ export interface LPConfig {
229
+ fixed_senior_yield_bps: u32;
230
+ liquidity_cap: u128;
231
+ max_senior_junior_ratio: u32;
232
+ tranches_risk_adjustment_bps: u32;
233
+ withdrawal_lockout_period_days: u32;
234
+ }
235
+ export interface FeeStructure {
236
+ front_loading_fee_bps: u32;
237
+ front_loading_fee_flat: u128;
238
+ late_fee_bps: u32;
239
+ yield_bps: u32;
240
+ }
241
+ export type PoolStatus = {
242
+ tag: 'Off';
243
+ values: void;
244
+ } | {
245
+ tag: 'On';
246
+ values: void;
247
+ } | {
248
+ tag: 'Closed';
249
+ values: void;
250
+ };
251
+ export interface CurrentEpoch {
252
+ end_time: u64;
253
+ id: u64;
254
+ }
255
+ export interface AdminRnR {
256
+ liquidity_rate_bps_ea: u32;
257
+ liquidity_rate_bps_pool_owner: u32;
258
+ reward_rate_bps_ea: u32;
259
+ reward_rate_bps_pool_owner: u32;
260
+ }
261
+ export interface TrancheAddresses {
262
+ addrs: Array<Option<string>>;
263
+ }
264
+ export interface TrancheAssets {
265
+ assets: Array<u128>;
266
+ }
267
+ export interface Client {
268
+ /**
269
+ * Construct and simulate a initialize transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
270
+ */
271
+ initialize: ({ pool, pool_storage, credit_storage, underlying_token, }: {
272
+ pool: string;
273
+ pool_storage: string;
274
+ credit_storage: string;
275
+ underlying_token: string;
276
+ }, options?: {
277
+ /**
278
+ * The fee to pay for the transaction. Default: BASE_FEE
279
+ */
280
+ fee?: number;
281
+ /**
282
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
283
+ */
284
+ timeoutInSeconds?: number;
285
+ /**
286
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
287
+ */
288
+ simulate?: boolean;
289
+ }) => Promise<AssembledTransaction<null>>;
290
+ /**
291
+ * Construct and simulate a get_due_info transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
292
+ */
293
+ get_due_info: ({ borrower }: {
294
+ borrower: string;
295
+ }, options?: {
296
+ /**
297
+ * The fee to pay for the transaction. Default: BASE_FEE
298
+ */
299
+ fee?: number;
300
+ /**
301
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
302
+ */
303
+ timeoutInSeconds?: number;
304
+ /**
305
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
306
+ */
307
+ simulate?: boolean;
308
+ }) => Promise<AssembledTransaction<readonly [CreditRecord, DueDetail]>>;
309
+ /**
310
+ * Construct and simulate a get_next_bill_refresh_date transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
311
+ */
312
+ get_next_bill_refresh_date: ({ borrower }: {
313
+ borrower: string;
314
+ }, options?: {
315
+ /**
316
+ * The fee to pay for the transaction. Default: BASE_FEE
317
+ */
318
+ fee?: number;
319
+ /**
320
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
321
+ */
322
+ timeoutInSeconds?: number;
323
+ /**
324
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
325
+ */
326
+ simulate?: boolean;
327
+ }) => Promise<AssembledTransaction<u64>>;
328
+ /**
329
+ * Construct and simulate a drawdown transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
330
+ */
331
+ drawdown: ({ borrower, amount }: {
332
+ borrower: string;
333
+ amount: u128;
334
+ }, options?: {
335
+ /**
336
+ * The fee to pay for the transaction. Default: BASE_FEE
337
+ */
338
+ fee?: number;
339
+ /**
340
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
341
+ */
342
+ timeoutInSeconds?: number;
343
+ /**
344
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
345
+ */
346
+ simulate?: boolean;
347
+ }) => Promise<AssembledTransaction<null>>;
348
+ /**
349
+ * Construct and simulate a make_payment transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
350
+ */
351
+ make_payment: ({ caller, borrower, amount, }: {
352
+ caller: string;
353
+ borrower: string;
354
+ amount: u128;
355
+ }, options?: {
356
+ /**
357
+ * The fee to pay for the transaction. Default: BASE_FEE
358
+ */
359
+ fee?: number;
360
+ /**
361
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
362
+ */
363
+ timeoutInSeconds?: number;
364
+ /**
365
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
366
+ */
367
+ simulate?: boolean;
368
+ }) => Promise<AssembledTransaction<readonly [u128, boolean]>>;
369
+ /**
370
+ * Construct and simulate a make_principal_payment transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
371
+ */
372
+ make_principal_payment: ({ borrower, amount }: {
373
+ borrower: string;
374
+ amount: u128;
375
+ }, options?: {
376
+ /**
377
+ * The fee to pay for the transaction. Default: BASE_FEE
378
+ */
379
+ fee?: number;
380
+ /**
381
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
382
+ */
383
+ timeoutInSeconds?: number;
384
+ /**
385
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
386
+ */
387
+ simulate?: boolean;
388
+ }) => Promise<AssembledTransaction<readonly [u128, boolean]>>;
389
+ }
390
+ export declare class Client extends ContractClient {
391
+ readonly options: ContractClientOptions;
392
+ constructor(options: ContractClientOptions);
393
+ readonly fromJSON: {
394
+ initialize: (json: string) => AssembledTransaction<null>;
395
+ get_due_info: (json: string) => AssembledTransaction<readonly [CreditRecord, DueDetail]>;
396
+ get_next_bill_refresh_date: (json: string) => AssembledTransaction<bigint>;
397
+ drawdown: (json: string) => AssembledTransaction<null>;
398
+ make_payment: (json: string) => AssembledTransaction<readonly [bigint, boolean]>;
399
+ make_principal_payment: (json: string) => AssembledTransaction<readonly [bigint, boolean]>;
400
+ };
401
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Client = exports.Errors = exports.networks = void 0;
18
+ const stellar_sdk_1 = require("@stellar/stellar-sdk");
19
+ const buffer_1 = require("buffer");
20
+ const index_js_1 = require("@stellar/stellar-sdk/lib/contract_client/index.js");
21
+ __exportStar(require("@stellar/stellar-sdk"), exports);
22
+ __exportStar(require("@stellar/stellar-sdk/lib/contract_client/index.js"), exports);
23
+ __exportStar(require("@stellar/stellar-sdk/lib/rust_types/index.js"), exports);
24
+ if (typeof window !== 'undefined') {
25
+ //@ts-ignore Buffer exists
26
+ window.Buffer = window.Buffer || buffer_1.Buffer;
27
+ }
28
+ exports.networks = {
29
+ testnet: {
30
+ networkPassphrase: 'Test SDF Network ; September 2015',
31
+ contractId: 'CBI7LGEWCJFO2APREGBRTUXB5JMZHJOVD76MESEB7V6W4IJ4ZLQJILDB',
32
+ },
33
+ };
34
+ exports.Errors = {
35
+ 51: { message: '' },
36
+ 55: { message: '' },
37
+ 71: { message: '' },
38
+ 222: { message: '' },
39
+ 202: { message: '' },
40
+ 203: { message: '' },
41
+ 204: { message: '' },
42
+ 215: { message: '' },
43
+ 205: { message: '' },
44
+ 206: { message: '' },
45
+ 207: { message: '' },
46
+ 219: { message: '' },
47
+ 101: { message: '' },
48
+ };
49
+ class Client extends index_js_1.ContractClient {
50
+ options;
51
+ constructor(options) {
52
+ super(new stellar_sdk_1.ContractSpec([
53
+ 'AAAAAgAAAAAAAAAAAAAADUNsaWVudERhdGFLZXkAAAAAAAAEAAAAAAAAAAAAAAAEUG9vbAAAAAAAAAAAAAAAC1Bvb2xTdG9yYWdlAAAAAAAAAAAAAAAADUNyZWRpdFN0b3JhZ2UAAAAAAAAAAAAAAAAAAA9VbmRlcmx5aW5nVG9rZW4A',
54
+ 'AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAABAAAAAAAAAAEcG9vbAAAABMAAAAAAAAADHBvb2xfc3RvcmFnZQAAABMAAAAAAAAADmNyZWRpdF9zdG9yYWdlAAAAAAATAAAAAAAAABB1bmRlcmx5aW5nX3Rva2VuAAAAEwAAAAA=',
55
+ 'AAAAAAAAAAAAAAAMZ2V0X2R1ZV9pbmZvAAAAAQAAAAAAAAAIYm9ycm93ZXIAAAATAAAAAQAAA+0AAAACAAAH0AAAAAxDcmVkaXRSZWNvcmQAAAfQAAAACUR1ZURldGFpbAAAAA==',
56
+ 'AAAAAAAAAAAAAAAaZ2V0X25leHRfYmlsbF9yZWZyZXNoX2RhdGUAAAAAAAEAAAAAAAAACGJvcnJvd2VyAAAAEwAAAAEAAAAG',
57
+ 'AAAAAAAAAAAAAAAIZHJhd2Rvd24AAAACAAAAAAAAAAhib3Jyb3dlcgAAABMAAAAAAAAABmFtb3VudAAAAAAACgAAAAA=',
58
+ 'AAAAAAAAAAAAAAAMbWFrZV9wYXltZW50AAAAAwAAAAAAAAAGY2FsbGVyAAAAAAATAAAAAAAAAAhib3Jyb3dlcgAAABMAAAAAAAAABmFtb3VudAAAAAAACgAAAAEAAAPtAAAAAgAAAAoAAAAB',
59
+ 'AAAAAAAAAAAAAAAWbWFrZV9wcmluY2lwYWxfcGF5bWVudAAAAAAAAgAAAAAAAAAIYm9ycm93ZXIAAAATAAAAAAAAAAZhbW91bnQAAAAAAA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AAAAAAAAADEZlZVN0cnVjdHVyZQAAAAQAAAAAAAAAFWZyb250X2xvYWRpbmdfZmVlX2JwcwAAAAAAAAQAAAAAAAAAFmZyb250X2xvYWRpbmdfZmVlX2ZsYXQAAAAAAAoAAAAAAAAADGxhdGVfZmVlX2JwcwAAAAQAAAAAAAAACXlpZWxkX2JwcwAAAAAAAAQ=',
77
+ 'AAAAAgAAAAAAAAAAAAAAClBvb2xTdGF0dXMAAAAAAAMAAAAAAAAAAAAAAANPZmYAAAAAAAAAAAAAAAACT24AAAAAAAAAAAAAAAAABkNsb3NlZAAA',
78
+ 'AAAAAQAAAAAAAAAAAAAADEN1cnJlbnRFcG9jaAAAAAIAAAAAAAAACGVuZF90aW1lAAAABgAAAAAAAAACaWQAAAAAAAY=',
79
+ 'AAAAAQAAAAAAAAAAAAAACEFkbWluUm5SAAAABAAAAAAAAAAVbGlxdWlkaXR5X3JhdGVfYnBzX2VhAAAAAAAABAAAAAAAAAAdbGlxdWlkaXR5X3JhdGVfYnBzX3Bvb2xfb3duZXIAAAAAAAAEAAAAAAAAABJyZXdhcmRfcmF0ZV9icHNfZWEAAAAAAAQAAAAAAAAAGnJld2FyZF9yYXRlX2Jwc19wb29sX293bmVyAAAAAAAE',
80
+ 'AAAAAQAAAAAAAAAAAAAAEFRyYW5jaGVBZGRyZXNzZXMAAAABAAAAAAAAAAVhZGRycwAAAAAAA+oAAAPoAAAAEw==',
81
+ 'AAAAAQAAAAAAAAAAAAAADVRyYW5jaGVBc3NldHMAAAAAAAABAAAAAAAAAAZhc3NldHMAAAAAA+oAAAAK',
82
+ ]), options);
83
+ this.options = options;
84
+ }
85
+ fromJSON = {
86
+ initialize: (this.txFromJSON),
87
+ get_due_info: (this.txFromJSON),
88
+ get_next_bill_refresh_date: (this.txFromJSON),
89
+ drawdown: (this.txFromJSON),
90
+ make_payment: (this.txFromJSON),
91
+ make_principal_payment: (this.txFromJSON),
92
+ };
93
+ }
94
+ exports.Client = Client;