@gearbox-protocol/sdk 13.7.0-kyc.2 → 13.7.0-kyc.4
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/dist/cjs/dev/RevolverTransport.js +10 -4
- package/dist/cjs/dev/logSplitterTransport.js +10 -1
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +2 -3
- package/dist/cjs/sdk/base/TokensMeta.js +1 -10
- package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +2 -3
- package/dist/esm/dev/RevolverTransport.js +10 -4
- package/dist/esm/dev/logSplitterTransport.js +10 -1
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +2 -3
- package/dist/esm/sdk/base/TokensMeta.js +1 -10
- package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +2 -3
- package/dist/types/dev/RevolverTransport.d.ts +2 -1
- package/dist/types/dev/logSplitterTransport.d.ts +3 -1
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +2 -2
- package/dist/types/sdk/accounts/types.d.ts +13 -2
- package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +2 -1
- package/dist/types/sdk/market/kyc/types.d.ts +3 -1
- package/package.json +1 -1
- package/dist/cjs/sdk/accounts/utils.js +0 -38
- package/dist/esm/sdk/accounts/utils.js +0 -14
- package/dist/types/sdk/accounts/utils.d.ts +0 -2
|
@@ -87,8 +87,14 @@ const revolverTransportConfigSchema = import_v4.z.union([
|
|
|
87
87
|
})
|
|
88
88
|
]);
|
|
89
89
|
class NoAvailableTransportsError extends import_viem.BaseError {
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
statuses;
|
|
91
|
+
constructor(statuses, cause) {
|
|
92
|
+
super("No available transports", {
|
|
93
|
+
cause,
|
|
94
|
+
metaMessages: statuses.length > 0 ? statuses.map((s) => `- ${s.id}: ${s.status}`) : ["No transports configured"],
|
|
95
|
+
name: "NoAvailableTransportsError"
|
|
96
|
+
});
|
|
97
|
+
this.statuses = statuses;
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
class RevolverTransport {
|
|
@@ -146,7 +152,7 @@ class RevolverTransport {
|
|
|
146
152
|
);
|
|
147
153
|
}
|
|
148
154
|
if (transports.length === 0) {
|
|
149
|
-
throw new NoAvailableTransportsError();
|
|
155
|
+
throw new NoAvailableTransportsError([]);
|
|
150
156
|
}
|
|
151
157
|
this.#isSingle = transports.length === 1;
|
|
152
158
|
const selectionStrategy = config.selectionStrategy ?? "simple";
|
|
@@ -197,7 +203,7 @@ class RevolverTransport {
|
|
|
197
203
|
}
|
|
198
204
|
} while (this.#selector.canRotate());
|
|
199
205
|
this.#requests.delete(r);
|
|
200
|
-
throw new NoAvailableTransportsError(error);
|
|
206
|
+
throw new NoAvailableTransportsError(this.#selector.statuses(), error);
|
|
201
207
|
};
|
|
202
208
|
get config() {
|
|
203
209
|
return {
|
|
@@ -43,7 +43,9 @@ const RANGE_ERROR_PATTERNS = [
|
|
|
43
43
|
/eth_getLogs is limited to/i,
|
|
44
44
|
/eth_getLogs requests with up to/i,
|
|
45
45
|
/range is too large/i,
|
|
46
|
-
/exceeded max allowed range/i
|
|
46
|
+
/exceeded max allowed range/i,
|
|
47
|
+
// Encountered on DRPC: "query exceeds max results 20000, retry with the range …"
|
|
48
|
+
/exceeds max results/i
|
|
47
49
|
];
|
|
48
50
|
function isRangeError(error) {
|
|
49
51
|
const msg = errorMessage(error);
|
|
@@ -51,10 +53,17 @@ function isRangeError(error) {
|
|
|
51
53
|
}
|
|
52
54
|
const GENERIC_BLOCKS_RE = /(\d+)\s*block/i;
|
|
53
55
|
const ALCHEMY_RANGE_RE = /this block range should work: \[(0x[0-9a-fA-F]+),\s*(0x[0-9a-fA-F]+)\]/;
|
|
56
|
+
const DRPC_RANGE_RE = /retry with the range (\d+)-(\d+)/;
|
|
54
57
|
function parsePageSizeHint(error) {
|
|
55
58
|
const alchemy = tryAlchemyHint(error);
|
|
56
59
|
if (alchemy != null) return alchemy;
|
|
57
60
|
const msg = errorMessage(error);
|
|
61
|
+
const drpc = msg.match(DRPC_RANGE_RE);
|
|
62
|
+
if (drpc) {
|
|
63
|
+
const from = Number(drpc[1]);
|
|
64
|
+
const to = Number(drpc[2]);
|
|
65
|
+
return to - from + 1;
|
|
66
|
+
}
|
|
58
67
|
const m = msg.match(GENERIC_BLOCKS_RE);
|
|
59
68
|
return m ? Number(m[1]) : null;
|
|
60
69
|
}
|
|
@@ -817,13 +817,12 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
817
817
|
/**
|
|
818
818
|
* {@inheritDoc ICreditAccountsService.getOpenAccountRequirements}
|
|
819
819
|
*/
|
|
820
|
-
async getOpenAccountRequirements(borrower, props) {
|
|
821
|
-
const { creditManager } = props;
|
|
820
|
+
async getOpenAccountRequirements(borrower, creditManager, props) {
|
|
822
821
|
const { kycFactory } = this.sdk.marketRegister.findByCreditManager(creditManager);
|
|
823
822
|
if (!kycFactory) {
|
|
824
823
|
return void 0;
|
|
825
824
|
}
|
|
826
|
-
return kycFactory.getOpenAccountRequirements(borrower);
|
|
825
|
+
return kycFactory.getOpenAccountRequirements(borrower, props);
|
|
827
826
|
}
|
|
828
827
|
/**
|
|
829
828
|
* {@inheritDoc ICreditAccountsService.openCA}
|
|
@@ -173,19 +173,10 @@ class TokensMeta extends import_utils.AddressMap {
|
|
|
173
173
|
batchSize: 0
|
|
174
174
|
});
|
|
175
175
|
this.#logger?.debug(`loaded ${resp.length} contract types`);
|
|
176
|
-
const kycFactories = new import_utils.AddressSet();
|
|
177
176
|
for (let i = 0; i < tokensToLoad.length; i++) {
|
|
178
|
-
|
|
179
|
-
tokensToLoad[i],
|
|
180
|
-
resp[2 * i],
|
|
181
|
-
resp[2 * i + 1]
|
|
182
|
-
);
|
|
177
|
+
this.#overrideTokenMeta(tokensToLoad[i], resp[2 * i], resp[2 * i + 1]);
|
|
183
178
|
this.#tokenDataLoaded.add(tokensToLoad[i]);
|
|
184
|
-
if (this.isKYCUnderlying(meta)) {
|
|
185
|
-
kycFactories.add(meta.kycFactory);
|
|
186
|
-
}
|
|
187
179
|
}
|
|
188
|
-
this.#logger?.debug(`found ${kycFactories.size} KYC factories`);
|
|
189
180
|
}
|
|
190
181
|
#overrideTokenMeta(token, contractTypeResp, _serializeResp) {
|
|
191
182
|
const meta = this.mustGet(token);
|
|
@@ -150,12 +150,11 @@ class SecuritizeKYCFactory extends import_base.BaseContract {
|
|
|
150
150
|
/**
|
|
151
151
|
* {@inheritDoc IKYCFactory.getOpenAccountRequirements}
|
|
152
152
|
*/
|
|
153
|
-
async getOpenAccountRequirements(investor) {
|
|
153
|
+
async getOpenAccountRequirements(investor, props) {
|
|
154
154
|
const [investorData] = await this.#sdk.kyc.getInvestorData(investor, [
|
|
155
155
|
this.address
|
|
156
156
|
]);
|
|
157
|
-
const
|
|
158
|
-
const desiredTokens = dsTokens;
|
|
157
|
+
const desiredTokens = new import_utils.AddressSet([props.tokenOutAddress]);
|
|
159
158
|
const registredTokens = new import_utils.AddressSet(investorData.registeredTokens);
|
|
160
159
|
const signedTokens = new import_utils.AddressSet(
|
|
161
160
|
investorData.cachedSignatures.map((s) => s.token)
|
|
@@ -70,8 +70,14 @@ const revolverTransportConfigSchema = z.union([
|
|
|
70
70
|
})
|
|
71
71
|
]);
|
|
72
72
|
class NoAvailableTransportsError extends BaseError {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
statuses;
|
|
74
|
+
constructor(statuses, cause) {
|
|
75
|
+
super("No available transports", {
|
|
76
|
+
cause,
|
|
77
|
+
metaMessages: statuses.length > 0 ? statuses.map((s) => `- ${s.id}: ${s.status}`) : ["No transports configured"],
|
|
78
|
+
name: "NoAvailableTransportsError"
|
|
79
|
+
});
|
|
80
|
+
this.statuses = statuses;
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
class RevolverTransport {
|
|
@@ -129,7 +135,7 @@ class RevolverTransport {
|
|
|
129
135
|
);
|
|
130
136
|
}
|
|
131
137
|
if (transports.length === 0) {
|
|
132
|
-
throw new NoAvailableTransportsError();
|
|
138
|
+
throw new NoAvailableTransportsError([]);
|
|
133
139
|
}
|
|
134
140
|
this.#isSingle = transports.length === 1;
|
|
135
141
|
const selectionStrategy = config.selectionStrategy ?? "simple";
|
|
@@ -180,7 +186,7 @@ class RevolverTransport {
|
|
|
180
186
|
}
|
|
181
187
|
} while (this.#selector.canRotate());
|
|
182
188
|
this.#requests.delete(r);
|
|
183
|
-
throw new NoAvailableTransportsError(error);
|
|
189
|
+
throw new NoAvailableTransportsError(this.#selector.statuses(), error);
|
|
184
190
|
};
|
|
185
191
|
get config() {
|
|
186
192
|
return {
|
|
@@ -21,7 +21,9 @@ const RANGE_ERROR_PATTERNS = [
|
|
|
21
21
|
/eth_getLogs is limited to/i,
|
|
22
22
|
/eth_getLogs requests with up to/i,
|
|
23
23
|
/range is too large/i,
|
|
24
|
-
/exceeded max allowed range/i
|
|
24
|
+
/exceeded max allowed range/i,
|
|
25
|
+
// Encountered on DRPC: "query exceeds max results 20000, retry with the range …"
|
|
26
|
+
/exceeds max results/i
|
|
25
27
|
];
|
|
26
28
|
function isRangeError(error) {
|
|
27
29
|
const msg = errorMessage(error);
|
|
@@ -29,10 +31,17 @@ function isRangeError(error) {
|
|
|
29
31
|
}
|
|
30
32
|
const GENERIC_BLOCKS_RE = /(\d+)\s*block/i;
|
|
31
33
|
const ALCHEMY_RANGE_RE = /this block range should work: \[(0x[0-9a-fA-F]+),\s*(0x[0-9a-fA-F]+)\]/;
|
|
34
|
+
const DRPC_RANGE_RE = /retry with the range (\d+)-(\d+)/;
|
|
32
35
|
function parsePageSizeHint(error) {
|
|
33
36
|
const alchemy = tryAlchemyHint(error);
|
|
34
37
|
if (alchemy != null) return alchemy;
|
|
35
38
|
const msg = errorMessage(error);
|
|
39
|
+
const drpc = msg.match(DRPC_RANGE_RE);
|
|
40
|
+
if (drpc) {
|
|
41
|
+
const from = Number(drpc[1]);
|
|
42
|
+
const to = Number(drpc[2]);
|
|
43
|
+
return to - from + 1;
|
|
44
|
+
}
|
|
36
45
|
const m = msg.match(GENERIC_BLOCKS_RE);
|
|
37
46
|
return m ? Number(m[1]) : null;
|
|
38
47
|
}
|
|
@@ -815,13 +815,12 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
815
815
|
/**
|
|
816
816
|
* {@inheritDoc ICreditAccountsService.getOpenAccountRequirements}
|
|
817
817
|
*/
|
|
818
|
-
async getOpenAccountRequirements(borrower, props) {
|
|
819
|
-
const { creditManager } = props;
|
|
818
|
+
async getOpenAccountRequirements(borrower, creditManager, props) {
|
|
820
819
|
const { kycFactory } = this.sdk.marketRegister.findByCreditManager(creditManager);
|
|
821
820
|
if (!kycFactory) {
|
|
822
821
|
return void 0;
|
|
823
822
|
}
|
|
824
|
-
return kycFactory.getOpenAccountRequirements(borrower);
|
|
823
|
+
return kycFactory.getOpenAccountRequirements(borrower, props);
|
|
825
824
|
}
|
|
826
825
|
/**
|
|
827
826
|
* {@inheritDoc ICreditAccountsService.openCA}
|
|
@@ -155,19 +155,10 @@ class TokensMeta extends AddressMap {
|
|
|
155
155
|
batchSize: 0
|
|
156
156
|
});
|
|
157
157
|
this.#logger?.debug(`loaded ${resp.length} contract types`);
|
|
158
|
-
const kycFactories = new AddressSet();
|
|
159
158
|
for (let i = 0; i < tokensToLoad.length; i++) {
|
|
160
|
-
|
|
161
|
-
tokensToLoad[i],
|
|
162
|
-
resp[2 * i],
|
|
163
|
-
resp[2 * i + 1]
|
|
164
|
-
);
|
|
159
|
+
this.#overrideTokenMeta(tokensToLoad[i], resp[2 * i], resp[2 * i + 1]);
|
|
165
160
|
this.#tokenDataLoaded.add(tokensToLoad[i]);
|
|
166
|
-
if (this.isKYCUnderlying(meta)) {
|
|
167
|
-
kycFactories.add(meta.kycFactory);
|
|
168
|
-
}
|
|
169
161
|
}
|
|
170
|
-
this.#logger?.debug(`found ${kycFactories.size} KYC factories`);
|
|
171
162
|
}
|
|
172
163
|
#overrideTokenMeta(token, contractTypeResp, _serializeResp) {
|
|
173
164
|
const meta = this.mustGet(token);
|
|
@@ -127,12 +127,11 @@ class SecuritizeKYCFactory extends BaseContract {
|
|
|
127
127
|
/**
|
|
128
128
|
* {@inheritDoc IKYCFactory.getOpenAccountRequirements}
|
|
129
129
|
*/
|
|
130
|
-
async getOpenAccountRequirements(investor) {
|
|
130
|
+
async getOpenAccountRequirements(investor, props) {
|
|
131
131
|
const [investorData] = await this.#sdk.kyc.getInvestorData(investor, [
|
|
132
132
|
this.address
|
|
133
133
|
]);
|
|
134
|
-
const
|
|
135
|
-
const desiredTokens = dsTokens;
|
|
134
|
+
const desiredTokens = new AddressSet([props.tokenOutAddress]);
|
|
136
135
|
const registredTokens = new AddressSet(investorData.registeredTokens);
|
|
137
136
|
const signedTokens = new AddressSet(
|
|
138
137
|
investorData.cachedSignatures.map((s) => s.token)
|
|
@@ -167,7 +167,8 @@ export type RevolverTransportConfig = {
|
|
|
167
167
|
onRotateFailed?: (oldTransportName: string, reason?: BaseError) => void | Promise<void>;
|
|
168
168
|
} & z.infer<typeof revolverTransportConfigSchema>;
|
|
169
169
|
export declare class NoAvailableTransportsError extends BaseError {
|
|
170
|
-
|
|
170
|
+
statuses: ProviderStatus[];
|
|
171
|
+
constructor(statuses: ProviderStatus[], cause?: Error);
|
|
171
172
|
}
|
|
172
173
|
export interface RevolverTransportValue {
|
|
173
174
|
/**
|
|
@@ -56,7 +56,9 @@ export declare function isRangeError(error: unknown): boolean;
|
|
|
56
56
|
* 1. **Alchemy JSON details** — parses the `details` field of a
|
|
57
57
|
* {@link HttpRequestError} for a suggested `[fromHex, toHex]` range and
|
|
58
58
|
* computes the span as `toHex - fromHex + 1`.
|
|
59
|
-
* 2. **
|
|
59
|
+
* 2. **DRPC decimal range** — matches `retry with the range <from>-<to>` and
|
|
60
|
+
* computes the span as `to - from + 1`.
|
|
61
|
+
* 3. **Generic N-blocks pattern** — matches `/<number> block(s)/i` in the
|
|
60
62
|
* error message.
|
|
61
63
|
*
|
|
62
64
|
* @param error - Any thrown value.
|
|
@@ -7,7 +7,7 @@ import { type PriceUpdate, type UpdatePriceFeedsResult } from "../market/index.j
|
|
|
7
7
|
import { type OpenAccountRequirements } from "../market/kyc/index.js";
|
|
8
8
|
import { type Asset, type RouterCASlice } from "../router/index.js";
|
|
9
9
|
import type { MultiCall, RawTx } from "../types/index.js";
|
|
10
|
-
import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, CreditAccountOperationResult, CreditAccountTokensSlice, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsOptions, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, OpenCAProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewDelayedWithdrawalResult, Rewards, StartDelayedWithdrawalProps, UpdateQuotasProps } from "./types.js";
|
|
10
|
+
import type { AccountToCheck, AddCollateralProps, ChangeDeptProps, ClaimDelayedProps, CloseCreditAccountProps, CloseCreditAccountResult, CloseOptions, CreditAccountOperationResult, CreditAccountTokensSlice, ExecuteSwapProps, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsOptions, GetOpenAccountRequirementsProps, GetPendingWithdrawalsProps, GetPendingWithdrawalsResult, OpenCAProps, PermitResult, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewDelayedWithdrawalResult, Rewards, StartDelayedWithdrawalProps, UpdateQuotasProps } from "./types.js";
|
|
11
11
|
/**
|
|
12
12
|
* Options for configuring the credit account service.
|
|
13
13
|
**/
|
|
@@ -101,7 +101,7 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
101
101
|
/**
|
|
102
102
|
* {@inheritDoc ICreditAccountsService.getOpenAccountRequirements}
|
|
103
103
|
*/
|
|
104
|
-
getOpenAccountRequirements(borrower: Address,
|
|
104
|
+
getOpenAccountRequirements(borrower: Address, creditManager: Address, props: GetOpenAccountRequirementsProps): Promise<OpenAccountRequirements | undefined>;
|
|
105
105
|
/**
|
|
106
106
|
* {@inheritDoc ICreditAccountsService.openCA}
|
|
107
107
|
**/
|
|
@@ -541,6 +541,16 @@ export interface Rewards {
|
|
|
541
541
|
**/
|
|
542
542
|
rewards: Array<Asset>;
|
|
543
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* Options to get open account requirements
|
|
546
|
+
* Compatible with StrategyConfigPayload
|
|
547
|
+
*/
|
|
548
|
+
export interface GetOpenAccountRequirementsProps {
|
|
549
|
+
/**
|
|
550
|
+
* Token address of the strategy
|
|
551
|
+
*/
|
|
552
|
+
tokenOutAddress: Address;
|
|
553
|
+
}
|
|
544
554
|
interface CMSlice {
|
|
545
555
|
creditManager: Address;
|
|
546
556
|
creditFacade: Address;
|
|
@@ -734,10 +744,11 @@ export interface ICreditAccountsService extends Construct {
|
|
|
734
744
|
/**
|
|
735
745
|
* Returns open account requirements for a borrower
|
|
736
746
|
* @param borrower - Borrower address
|
|
737
|
-
* @param
|
|
747
|
+
* @param creditManager - Credit manager address
|
|
748
|
+
* @param props - {@link GetOpenAccountRequirementsProps} you can pass StrategyConfigPayload here
|
|
738
749
|
* @returns Open account requirements or undefined if the user can open a credit account without any further actions
|
|
739
750
|
*/
|
|
740
|
-
getOpenAccountRequirements(borrower: Address,
|
|
751
|
+
getOpenAccountRequirements(borrower: Address, creditManager: Address, props: GetOpenAccountRequirementsProps): Promise<OpenAccountRequirements | undefined>;
|
|
741
752
|
/**
|
|
742
753
|
* Executes swap specified by given calls, update quotas of affected tokens
|
|
743
754
|
* - Open credit account is executed in the following order: price update -> increase debt -> add collateral ->
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Address } from "viem";
|
|
2
|
+
import type { GetOpenAccountRequirementsProps } from "../../../accounts/types.js";
|
|
2
3
|
import { BaseContract } from "../../../base/index.js";
|
|
3
4
|
import type { GearboxSDK } from "../../../GearboxSDK.js";
|
|
4
5
|
import type { MultiCall, RawTx } from "../../../types/index.js";
|
|
@@ -418,7 +419,7 @@ export declare class SecuritizeKYCFactory extends BaseContract<abi> implements I
|
|
|
418
419
|
/**
|
|
419
420
|
* {@inheritDoc IKYCFactory.getOpenAccountRequirements}
|
|
420
421
|
*/
|
|
421
|
-
getOpenAccountRequirements(investor: Address): Promise<SecuritizeOpenAccountRequirements | undefined>;
|
|
422
|
+
getOpenAccountRequirements(investor: Address, props: GetOpenAccountRequirementsProps): Promise<SecuritizeOpenAccountRequirements | undefined>;
|
|
422
423
|
/**
|
|
423
424
|
* {@inheritDoc IKYCFactory.openCreditAccount}
|
|
424
425
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
2
2
|
import type { Address, ContractFunctionParameters } from "viem";
|
|
3
3
|
import type { iKYCCompressorAbi } from "../../../abi/kyc/iKYCCompressor.js";
|
|
4
|
+
import type { GetOpenAccountRequirementsProps } from "../../accounts/types.js";
|
|
4
5
|
import type { IBaseContract, Unarray } from "../../base/index.js";
|
|
5
6
|
import type { MultiCall, RawTx } from "../../types/index.js";
|
|
6
7
|
import type { SecuritizeInvestorData, SecuritizeKYCFactoryStateHuman, SecuritizeMulticallParams, SecuritizeOpenAccountRequirements } from "./securitize/index.js";
|
|
@@ -143,10 +144,11 @@ export interface IKYCFactory<T extends KYCFactoryType = KYCFactoryType> extends
|
|
|
143
144
|
/**
|
|
144
145
|
* Checks if the user can open a credit account with this factory.
|
|
145
146
|
* @param investor - investor address
|
|
147
|
+
* @param props - {@link GetOpenAccountRequirementsProps}
|
|
146
148
|
* @returns open account requirements for the investor, or `undefined` if the
|
|
147
149
|
* user can open a credit account without any further actions
|
|
148
150
|
**/
|
|
149
|
-
getOpenAccountRequirements(investor: Address): Promise<KYCOpenAccountReqFor<T> | undefined>;
|
|
151
|
+
getOpenAccountRequirements(investor: Address, props: GetOpenAccountRequirementsProps): Promise<KYCOpenAccountReqFor<T> | undefined>;
|
|
150
152
|
/**
|
|
151
153
|
* Creates a raw transaction to open a credit account.
|
|
152
154
|
* Similar to {@link CreditFacadeV310Contract.openCreditAccount}.
|
package/package.json
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var utils_exports = {};
|
|
20
|
-
__export(utils_exports, {
|
|
21
|
-
stringifyGetCreditAccountsArgs: () => stringifyGetCreditAccountsArgs
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(utils_exports);
|
|
24
|
-
function stringifyGetCreditAccountsArgs(args) {
|
|
25
|
-
const s = JSON.stringify(args, replacer);
|
|
26
|
-
return JSON.parse(s);
|
|
27
|
-
}
|
|
28
|
-
function replacer(_key, value) {
|
|
29
|
-
if (typeof value === "bigint") {
|
|
30
|
-
return value.toString();
|
|
31
|
-
} else {
|
|
32
|
-
return value;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
stringifyGetCreditAccountsArgs
|
|
38
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function stringifyGetCreditAccountsArgs(args) {
|
|
2
|
-
const s = JSON.stringify(args, replacer);
|
|
3
|
-
return JSON.parse(s);
|
|
4
|
-
}
|
|
5
|
-
function replacer(_key, value) {
|
|
6
|
-
if (typeof value === "bigint") {
|
|
7
|
-
return value.toString();
|
|
8
|
-
} else {
|
|
9
|
-
return value;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
stringifyGetCreditAccountsArgs
|
|
14
|
-
};
|