@morpho-org/blue-sdk 1.0.0-integ-650.0
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 +106 -0
- package/lib/addresses.d.ts +113 -0
- package/lib/addresses.js +162 -0
- package/lib/chain.d.ts +29 -0
- package/lib/chain.js +289 -0
- package/lib/chain.test.d.ts +1 -0
- package/lib/chain.test.js +21 -0
- package/lib/constants.d.ts +29 -0
- package/lib/constants.js +33 -0
- package/lib/errors.d.ts +58 -0
- package/lib/errors.js +119 -0
- package/lib/helpers/format/format.d.ts +122 -0
- package/lib/helpers/format/format.js +286 -0
- package/lib/helpers/format/format.test.d.ts +1 -0
- package/lib/helpers/format/format.test.js +255 -0
- package/lib/helpers/format/index.d.ts +1 -0
- package/lib/helpers/format/index.js +17 -0
- package/lib/helpers/index.d.ts +2 -0
- package/lib/helpers/index.js +18 -0
- package/lib/helpers/locale.d.ts +46 -0
- package/lib/helpers/locale.js +96 -0
- package/lib/holding/AssetBalances.d.ts +48 -0
- package/lib/holding/AssetBalances.js +42 -0
- package/lib/holding/Holding.d.ts +59 -0
- package/lib/holding/Holding.js +59 -0
- package/lib/holding/index.d.ts +2 -0
- package/lib/holding/index.js +18 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +54 -0
- package/lib/market/Market.d.ts +329 -0
- package/lib/market/Market.js +460 -0
- package/lib/market/MarketConfig.d.ts +52 -0
- package/lib/market/MarketConfig.js +76 -0
- package/lib/market/MarketUtils.d.ts +232 -0
- package/lib/market/MarketUtils.js +263 -0
- package/lib/market/MarketUtils.test.d.ts +1 -0
- package/lib/market/MarketUtils.test.js +38 -0
- package/lib/market/index.d.ts +3 -0
- package/lib/market/index.js +19 -0
- package/lib/maths/AdaptiveCurveIrmLib.d.ts +39 -0
- package/lib/maths/AdaptiveCurveIrmLib.js +134 -0
- package/lib/maths/MathLib.d.ts +114 -0
- package/lib/maths/MathLib.js +175 -0
- package/lib/maths/SharesMath.d.ts +12 -0
- package/lib/maths/SharesMath.js +21 -0
- package/lib/maths/index.d.ts +3 -0
- package/lib/maths/index.js +19 -0
- package/lib/position/Position.d.ts +126 -0
- package/lib/position/Position.js +203 -0
- package/lib/position/index.d.ts +1 -0
- package/lib/position/index.js +17 -0
- package/lib/tests/mocks/markets.d.ts +19 -0
- package/lib/tests/mocks/markets.js +121 -0
- package/lib/token/ConstantWrappedToken.d.ts +18 -0
- package/lib/token/ConstantWrappedToken.js +36 -0
- package/lib/token/ExchangeRateWrappedToken.d.ts +11 -0
- package/lib/token/ExchangeRateWrappedToken.js +21 -0
- package/lib/token/Token.d.ts +46 -0
- package/lib/token/Token.js +64 -0
- package/lib/token/VaultToken.d.ts +14 -0
- package/lib/token/VaultToken.js +23 -0
- package/lib/token/WrappedToken.d.ts +17 -0
- package/lib/token/WrappedToken.js +33 -0
- package/lib/token/index.d.ts +5 -0
- package/lib/token/index.js +21 -0
- package/lib/types.d.ts +30 -0
- package/lib/types.js +22 -0
- package/lib/user/User.d.ts +20 -0
- package/lib/user/User.js +23 -0
- package/lib/user/index.d.ts +1 -0
- package/lib/user/index.js +17 -0
- package/lib/vault/Vault.d.ts +166 -0
- package/lib/vault/Vault.js +234 -0
- package/lib/vault/VaultConfig.d.ts +22 -0
- package/lib/vault/VaultConfig.js +32 -0
- package/lib/vault/VaultMarketAllocation.d.ts +20 -0
- package/lib/vault/VaultMarketAllocation.js +30 -0
- package/lib/vault/VaultMarketConfig.d.ts +43 -0
- package/lib/vault/VaultMarketConfig.js +43 -0
- package/lib/vault/VaultMarketPublicAllocatorConfig.d.ts +29 -0
- package/lib/vault/VaultMarketPublicAllocatorConfig.js +28 -0
- package/lib/vault/VaultUtils.d.ts +18 -0
- package/lib/vault/VaultUtils.js +20 -0
- package/lib/vault/index.d.ts +6 -0
- package/lib/vault/index.js +22 -0
- package/package.json +53 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEnUSNumberToLocalParts = exports.convertNumStrFromEffectiveTo = exports.convertNumStrToLocal = exports.getEffectiveLocale = exports.getLocaleSymbols = void 0;
|
|
4
|
+
const _convertEnNumStrToLocale = (numStr, localSymbols) => {
|
|
5
|
+
return numStr
|
|
6
|
+
.replaceAll(",", "#TEMP#")
|
|
7
|
+
.replaceAll(".", localSymbols.decimalSymbol)
|
|
8
|
+
.replaceAll("#TEMP#", localSymbols.groupSymbol);
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @returns the locale symbols for the given locale defaulting to en-US
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Import from `@morpho-org/morpho-ts`
|
|
14
|
+
*/
|
|
15
|
+
const getLocaleSymbols = (locale) => {
|
|
16
|
+
let formatter;
|
|
17
|
+
const formatterOptions = {
|
|
18
|
+
useGrouping: true,
|
|
19
|
+
maximumFractionDigits: 1,
|
|
20
|
+
minimumFractionDigits: 1,
|
|
21
|
+
};
|
|
22
|
+
try {
|
|
23
|
+
formatter = new Intl.NumberFormat(locale, formatterOptions);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
formatter = new Intl.NumberFormat("en-US", formatterOptions);
|
|
27
|
+
}
|
|
28
|
+
const parts = formatter.formatToParts(12345.6);
|
|
29
|
+
const decimalSymbol = parts.find((part) => part.type === "decimal").value;
|
|
30
|
+
const groupSymbol = parts.find((part) => part.type === "group").value;
|
|
31
|
+
return { decimalSymbol, groupSymbol, locale };
|
|
32
|
+
};
|
|
33
|
+
exports.getLocaleSymbols = getLocaleSymbols;
|
|
34
|
+
/**
|
|
35
|
+
* @returns the effective browser locale
|
|
36
|
+
*
|
|
37
|
+
* @deprecated Import from `@morpho-org/morpho-ts`
|
|
38
|
+
*/
|
|
39
|
+
const getEffectiveLocale = () => {
|
|
40
|
+
if (typeof window !== "undefined") {
|
|
41
|
+
try {
|
|
42
|
+
const locale = navigator?.language || document?.documentElement?.lang || "en-US";
|
|
43
|
+
new Intl.NumberFormat(locale);
|
|
44
|
+
return locale;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return "en-US";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return "en-US";
|
|
51
|
+
};
|
|
52
|
+
exports.getEffectiveLocale = getEffectiveLocale;
|
|
53
|
+
/**
|
|
54
|
+
* @returns the value as a string with the given locale symbols
|
|
55
|
+
* @param numStr the number as a string in the "from" locale (e.g. "1,2345.6" for en-US)
|
|
56
|
+
* @param from the locale the numStr is in (e.g. "en-US")
|
|
57
|
+
* @param to the locale to convert to (e.g. "fr-FR")
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Import from `@morpho-org/morpho-ts`
|
|
60
|
+
*/
|
|
61
|
+
const convertNumStrToLocal = (numStr, from, to) => {
|
|
62
|
+
const fromSymbols = (0, exports.getLocaleSymbols)(from);
|
|
63
|
+
const toSymbols = (0, exports.getLocaleSymbols)(to);
|
|
64
|
+
return numStr
|
|
65
|
+
.replaceAll(fromSymbols.groupSymbol, "#GROUP#")
|
|
66
|
+
.replaceAll(fromSymbols.decimalSymbol, "#DECIMAL#")
|
|
67
|
+
.replaceAll("#GROUP#", toSymbols.groupSymbol)
|
|
68
|
+
.replaceAll("#DECIMAL#", toSymbols.decimalSymbol);
|
|
69
|
+
};
|
|
70
|
+
exports.convertNumStrToLocal = convertNumStrToLocal;
|
|
71
|
+
/**
|
|
72
|
+
* @returns the value as a string in the effective browser locale
|
|
73
|
+
* @param numStr the number as a string in the effective browser locale (e.g. "1,2345.6" for en-US)
|
|
74
|
+
* @param to the locale to use (e.g. "fr-FR")
|
|
75
|
+
*
|
|
76
|
+
* @deprecated Import from `@morpho-org/morpho-ts`
|
|
77
|
+
*/
|
|
78
|
+
const convertNumStrFromEffectiveTo = (numStr, to) => {
|
|
79
|
+
const from = (0, exports.getEffectiveLocale)();
|
|
80
|
+
return (0, exports.convertNumStrToLocal)(numStr, from, to);
|
|
81
|
+
};
|
|
82
|
+
exports.convertNumStrFromEffectiveTo = convertNumStrFromEffectiveTo;
|
|
83
|
+
/**
|
|
84
|
+
* @returns the value as a string with the given locale symbols either from the given locale or the effective browser locale
|
|
85
|
+
* @param numStr the number as a string in english format (e.g. "1,2345.6")
|
|
86
|
+
* @param locale optional - the locale to use (e.g. "fr-FR")
|
|
87
|
+
*
|
|
88
|
+
* @deprecated Import from `@morpho-org/morpho-ts`
|
|
89
|
+
*/
|
|
90
|
+
const getEnUSNumberToLocalParts = (numStr, locale) => {
|
|
91
|
+
const _locale = locale || (0, exports.getEffectiveLocale)();
|
|
92
|
+
const localSymbols = (0, exports.getLocaleSymbols)(_locale);
|
|
93
|
+
const value = _convertEnNumStrToLocale(numStr, localSymbols);
|
|
94
|
+
return { ...localSymbols, value };
|
|
95
|
+
};
|
|
96
|
+
exports.getEnUSNumberToLocalParts = getEnUSNumberToLocalParts;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Token } from "../token/Token";
|
|
2
|
+
export type PeripheralBalanceType = "base" | "wrapped" | "staked-wrapped" | "vault" | "wrapped-vault" | "unwrapped-staked-wrapped";
|
|
3
|
+
/**
|
|
4
|
+
* Represents the balance of a requested token and the balance quoted in the corresponding source token:
|
|
5
|
+
* ```{
|
|
6
|
+
* type: "staked-wrapped",
|
|
7
|
+
* srcToken: ETH,
|
|
8
|
+
* srcAmount: 1 ETH,
|
|
9
|
+
* dstAmount: 1.2 wstETH
|
|
10
|
+
* }```
|
|
11
|
+
*/
|
|
12
|
+
export interface PeripheralBalance {
|
|
13
|
+
/**
|
|
14
|
+
* The type of balance conversion.
|
|
15
|
+
*/
|
|
16
|
+
type: PeripheralBalanceType;
|
|
17
|
+
/**
|
|
18
|
+
* The source token held corresponding to the type of balance conversion.
|
|
19
|
+
*/
|
|
20
|
+
srcToken: Token;
|
|
21
|
+
/**
|
|
22
|
+
* The source amount of source token held.
|
|
23
|
+
*/
|
|
24
|
+
srcAmount: bigint;
|
|
25
|
+
/**
|
|
26
|
+
* The corresponding amount of token held after conversion of the whole balance `srcAmount`.
|
|
27
|
+
*/
|
|
28
|
+
dstAmount: bigint;
|
|
29
|
+
}
|
|
30
|
+
export interface InputAssetBalances extends Omit<PeripheralBalance, "type"> {
|
|
31
|
+
}
|
|
32
|
+
export declare class AssetBalances {
|
|
33
|
+
/**
|
|
34
|
+
* The total balance of all types of related tokens.
|
|
35
|
+
*/
|
|
36
|
+
total: bigint;
|
|
37
|
+
/**
|
|
38
|
+
* The balance of each type of related tokens and the corresponding underlying balance.
|
|
39
|
+
*/
|
|
40
|
+
allocations: {
|
|
41
|
+
base: PeripheralBalance;
|
|
42
|
+
} & {
|
|
43
|
+
[T in Exclude<PeripheralBalanceType, "base">]?: PeripheralBalance;
|
|
44
|
+
};
|
|
45
|
+
constructor(balance: InputAssetBalances);
|
|
46
|
+
add(balance: PeripheralBalance): this;
|
|
47
|
+
sub(balance: PeripheralBalance): this;
|
|
48
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssetBalances = void 0;
|
|
4
|
+
class AssetBalances {
|
|
5
|
+
/**
|
|
6
|
+
* The total balance of all types of related tokens.
|
|
7
|
+
*/
|
|
8
|
+
total;
|
|
9
|
+
/**
|
|
10
|
+
* The balance of each type of related tokens and the corresponding underlying balance.
|
|
11
|
+
*/
|
|
12
|
+
allocations;
|
|
13
|
+
constructor(balance) {
|
|
14
|
+
this.total = balance.dstAmount;
|
|
15
|
+
this.allocations = {
|
|
16
|
+
base: { ...balance, type: "base" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
add(balance) {
|
|
20
|
+
this.total += balance.dstAmount;
|
|
21
|
+
const allocation = (this.allocations[balance.type] ??= {
|
|
22
|
+
...balance,
|
|
23
|
+
srcAmount: 0n,
|
|
24
|
+
dstAmount: 0n,
|
|
25
|
+
});
|
|
26
|
+
allocation.srcAmount += balance.srcAmount;
|
|
27
|
+
allocation.dstAmount += balance.dstAmount;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
sub(balance) {
|
|
31
|
+
this.total -= balance.dstAmount;
|
|
32
|
+
const allocation = (this.allocations[balance.type] ??= {
|
|
33
|
+
...balance,
|
|
34
|
+
srcAmount: 0n,
|
|
35
|
+
dstAmount: 0n,
|
|
36
|
+
});
|
|
37
|
+
allocation.srcAmount -= balance.srcAmount;
|
|
38
|
+
allocation.dstAmount -= balance.dstAmount;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.AssetBalances = AssetBalances;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Address } from "../types";
|
|
2
|
+
export declare const ERC20_ALLOWANCE_RECIPIENTS: readonly ["morpho", "permit2", "bundler"];
|
|
3
|
+
export declare const PERMIT2_ALLOWANCE_RECIPIENTS: readonly ["morpho", "bundler"];
|
|
4
|
+
export type Erc20AllowanceRecipient = (typeof ERC20_ALLOWANCE_RECIPIENTS)[number];
|
|
5
|
+
export type Permit2AllowanceRecipient = (typeof PERMIT2_ALLOWANCE_RECIPIENTS)[number];
|
|
6
|
+
export interface Permit2Allowance {
|
|
7
|
+
amount: bigint;
|
|
8
|
+
expiration: bigint;
|
|
9
|
+
nonce: bigint;
|
|
10
|
+
}
|
|
11
|
+
export interface InputHolding {
|
|
12
|
+
user: Address;
|
|
13
|
+
token: Address;
|
|
14
|
+
erc20Allowances: {
|
|
15
|
+
[key in Erc20AllowanceRecipient]: bigint;
|
|
16
|
+
};
|
|
17
|
+
permit2Allowances: {
|
|
18
|
+
[key in Permit2AllowanceRecipient]: Permit2Allowance;
|
|
19
|
+
};
|
|
20
|
+
erc2612Nonce?: bigint;
|
|
21
|
+
canTransfer?: boolean;
|
|
22
|
+
balance: bigint;
|
|
23
|
+
}
|
|
24
|
+
export declare class Holding implements InputHolding {
|
|
25
|
+
/**
|
|
26
|
+
* The user of this holding.
|
|
27
|
+
*/
|
|
28
|
+
readonly user: Address;
|
|
29
|
+
/**
|
|
30
|
+
* The token in which this holding is denominated.
|
|
31
|
+
*/
|
|
32
|
+
readonly token: Address;
|
|
33
|
+
/**
|
|
34
|
+
* The balance of the user for this token.
|
|
35
|
+
*/
|
|
36
|
+
balance: bigint;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the user is allowed to transfer this holding's balance.
|
|
39
|
+
*/
|
|
40
|
+
canTransfer?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* ERC20 allowance for this token from the user to the allowance recipient.
|
|
43
|
+
*/
|
|
44
|
+
readonly erc20Allowances: {
|
|
45
|
+
[key in Erc20AllowanceRecipient]: bigint;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Permit2 allowance for this token from the user to the allowance recipient.
|
|
49
|
+
*/
|
|
50
|
+
readonly permit2Allowances: {
|
|
51
|
+
[key in Permit2AllowanceRecipient]: Permit2Allowance;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* ERC-2612 Permit nonce of the user for this token.
|
|
55
|
+
* `undefined` if the token does not support ERC-2612.
|
|
56
|
+
*/
|
|
57
|
+
erc2612Nonce?: bigint;
|
|
58
|
+
constructor({ user, token, erc20Allowances, permit2Allowances, balance, erc2612Nonce, canTransfer, }: InputHolding);
|
|
59
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Holding = exports.PERMIT2_ALLOWANCE_RECIPIENTS = exports.ERC20_ALLOWANCE_RECIPIENTS = void 0;
|
|
4
|
+
const morpho_ts_1 = require("@morpho-org/morpho-ts");
|
|
5
|
+
const addresses_1 = require("../addresses");
|
|
6
|
+
exports.ERC20_ALLOWANCE_RECIPIENTS = [
|
|
7
|
+
"morpho",
|
|
8
|
+
"permit2",
|
|
9
|
+
"bundler",
|
|
10
|
+
];
|
|
11
|
+
exports.PERMIT2_ALLOWANCE_RECIPIENTS = [
|
|
12
|
+
"morpho",
|
|
13
|
+
"bundler",
|
|
14
|
+
];
|
|
15
|
+
class Holding {
|
|
16
|
+
/**
|
|
17
|
+
* The user of this holding.
|
|
18
|
+
*/
|
|
19
|
+
user;
|
|
20
|
+
/**
|
|
21
|
+
* The token in which this holding is denominated.
|
|
22
|
+
*/
|
|
23
|
+
token;
|
|
24
|
+
/**
|
|
25
|
+
* The balance of the user for this token.
|
|
26
|
+
*/
|
|
27
|
+
balance;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the user is allowed to transfer this holding's balance.
|
|
30
|
+
*/
|
|
31
|
+
canTransfer;
|
|
32
|
+
/**
|
|
33
|
+
* ERC20 allowance for this token from the user to the allowance recipient.
|
|
34
|
+
*/
|
|
35
|
+
erc20Allowances;
|
|
36
|
+
/**
|
|
37
|
+
* Permit2 allowance for this token from the user to the allowance recipient.
|
|
38
|
+
*/
|
|
39
|
+
permit2Allowances;
|
|
40
|
+
/**
|
|
41
|
+
* ERC-2612 Permit nonce of the user for this token.
|
|
42
|
+
* `undefined` if the token does not support ERC-2612.
|
|
43
|
+
*/
|
|
44
|
+
erc2612Nonce;
|
|
45
|
+
constructor({ user, token, erc20Allowances, permit2Allowances, balance, erc2612Nonce, canTransfer = true, }) {
|
|
46
|
+
this.user = user;
|
|
47
|
+
this.token = token;
|
|
48
|
+
this.balance = balance;
|
|
49
|
+
this.canTransfer = token === addresses_1.NATIVE_ADDRESS || canTransfer;
|
|
50
|
+
this.erc20Allowances = (0, morpho_ts_1.fromEntries)((0, morpho_ts_1.entries)(erc20Allowances).map(([address, allowance]) => [
|
|
51
|
+
address,
|
|
52
|
+
allowance,
|
|
53
|
+
]));
|
|
54
|
+
this.permit2Allowances = permit2Allowances;
|
|
55
|
+
if (erc2612Nonce != null)
|
|
56
|
+
this.erc2612Nonce = erc2612Nonce;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.Holding = Holding;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./Holding"), exports);
|
|
18
|
+
__exportStar(require("./AssetBalances"), exports);
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from "./addresses";
|
|
2
|
+
export * from "./constants";
|
|
3
|
+
export * from "./errors";
|
|
4
|
+
export * from "./market";
|
|
5
|
+
export * from "./chain";
|
|
6
|
+
export * from "./token";
|
|
7
|
+
export * from "./types";
|
|
8
|
+
export * from "./maths";
|
|
9
|
+
export * from "./user";
|
|
10
|
+
export * from "./holding";
|
|
11
|
+
export * from "./position";
|
|
12
|
+
export * from "./helpers";
|
|
13
|
+
export * from "./vault";
|
|
14
|
+
export * as constants from "./constants";
|
|
15
|
+
export * as errors from "./errors";
|
|
16
|
+
export * as market from "./market";
|
|
17
|
+
export * as chain from "./chain";
|
|
18
|
+
export * as token from "./token";
|
|
19
|
+
export * as position from "./position";
|
|
20
|
+
export * as holding from "./holding";
|
|
21
|
+
export * as types from "./types";
|
|
22
|
+
export * as maths from "./maths";
|
|
23
|
+
export * as user from "./user";
|
|
24
|
+
export * as helpers from "./helpers";
|
|
25
|
+
export * as vault from "./vault";
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.vault = exports.helpers = exports.user = exports.maths = exports.types = exports.holding = exports.position = exports.token = exports.chain = exports.market = exports.errors = exports.constants = void 0;
|
|
30
|
+
__exportStar(require("./addresses"), exports);
|
|
31
|
+
__exportStar(require("./constants"), exports);
|
|
32
|
+
__exportStar(require("./errors"), exports);
|
|
33
|
+
__exportStar(require("./market"), exports);
|
|
34
|
+
__exportStar(require("./chain"), exports);
|
|
35
|
+
__exportStar(require("./token"), exports);
|
|
36
|
+
__exportStar(require("./types"), exports);
|
|
37
|
+
__exportStar(require("./maths"), exports);
|
|
38
|
+
__exportStar(require("./user"), exports);
|
|
39
|
+
__exportStar(require("./holding"), exports);
|
|
40
|
+
__exportStar(require("./position"), exports);
|
|
41
|
+
__exportStar(require("./helpers"), exports);
|
|
42
|
+
__exportStar(require("./vault"), exports);
|
|
43
|
+
exports.constants = __importStar(require("./constants"));
|
|
44
|
+
exports.errors = __importStar(require("./errors"));
|
|
45
|
+
exports.market = __importStar(require("./market"));
|
|
46
|
+
exports.chain = __importStar(require("./chain"));
|
|
47
|
+
exports.token = __importStar(require("./token"));
|
|
48
|
+
exports.position = __importStar(require("./position"));
|
|
49
|
+
exports.holding = __importStar(require("./holding"));
|
|
50
|
+
exports.types = __importStar(require("./types"));
|
|
51
|
+
exports.maths = __importStar(require("./maths"));
|
|
52
|
+
exports.user = __importStar(require("./user"));
|
|
53
|
+
exports.helpers = __importStar(require("./helpers"));
|
|
54
|
+
exports.vault = __importStar(require("./vault"));
|