@dripfi/drip-sdk 1.3.8 → 1.3.10
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/.vscode/extensions.json +3 -0
- package/CHANGELOG.md +13 -1
- package/dist/DripApi.d.ts +11 -11
- package/dist/DripConfig.d.ts +1 -4
- package/dist/DripConfig.js +4 -8
- package/dist/DripSdk.d.ts +11 -11
- package/dist/DripSdk.js +1 -1
- package/dist/abi/index.d.ts +75 -0
- package/dist/abi/index.js +17 -0
- package/dist/contracts/DripSwapAndRecyclerContract.js +1 -1
- package/dist/contracts/DripTokenContract.js +1 -1
- package/dist/contracts/DripTokenRecyclerContract.js +1 -1
- package/dist/contracts/PerqVestingContract.js +1 -1
- package/dist/index.d.ts +14 -21
- package/dist/index.js +46 -10
- package/dist/perq/PerqApi.d.ts +4 -0
- package/dist/perq/PerqApi.js +9 -0
- package/dist/perq/PerqConfig.d.ts +5 -0
- package/dist/perq/PerqConfig.js +20 -0
- package/dist/perq/PerqSdk.d.ts +9 -0
- package/dist/perq/PerqSdk.js +26 -0
- package/dist/types/BeansBalance.d.ts +2 -1
- package/dist/types/CacheVaultRewards.d.ts +2 -1
- package/dist/types/Chain.d.ts +4 -0
- package/dist/types/Chain.js +8 -0
- package/dist/types/DeployedProject.d.ts +5 -2
- package/dist/types/DeployedVault.d.ts +5 -4
- package/dist/types/LoyaltyCard.d.ts +2 -1
- package/dist/types/MyPerqData.d.ts +1 -1
- package/dist/types/NFTBoost.d.ts +2 -1
- package/dist/types/PerqToBeansSwapInfo.d.ts +2 -1
- package/dist/types/QLFastRedeem.d.ts +3 -2
- package/dist/types/Strategy.d.ts +2 -1
- package/dist/types/StretchGoal.d.ts +2 -1
- package/dist/types/SwapInfo.d.ts +2 -1
- package/dist/types/UpgradeLoyaltyCardPayload.d.ts +2 -1
- package/dist/types/UserBalance.d.ts +2 -1
- package/dist/types/UserRewards.d.ts +2 -1
- package/dist/types/UserVaultBalance.d.ts +2 -1
- package/dist/types/Vault.d.ts +8 -7
- package/dist/types/VaultClaimData.d.ts +2 -1
- package/dist/types/VaultDepositToken.d.ts +2 -1
- package/dist/types/VaultReward.d.ts +2 -1
- package/dist/types/VaultStats.d.ts +2 -1
- package/dist/types/VaultType.d.ts +2 -1
- package/dist/types/VestingInfo.d.ts +2 -1
- package/dist/types/YelayVersion.d.ts +1 -0
- package/dist/types/YelayVersion.js +2 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/index.js +8 -0
- package/package.json +4 -3
- package/dist/test.d.ts +0 -2
- package/dist/test.js +0 -81
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -13
- /package/dist/{contracts/abi → abi}/DripSwapAndRecyclerAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/DripTokenAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/PerqVestingAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/TokenRecyclerAbi.json +0 -0
- /package/dist/{contracts/abi → abi}/WethTokenAbi.json +0 -0
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,24 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
2
3
|
All notable changes to the Drip SDK will be documented in this file.
|
3
4
|
|
4
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
7
|
|
7
8
|
## [1.3.7] - 2025-01-15
|
9
|
+
|
8
10
|
### Added
|
11
|
+
|
9
12
|
- Changelog was added
|
10
13
|
|
11
14
|
### Changed
|
12
|
-
|
15
|
+
|
16
|
+
- renamed the property `withdrawableBalance` to `claimableBalance` in the type `UserVaultBalance`
|
17
|
+
|
18
|
+
## [1.3.8] - 2025-01-22
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- updated `MyPerqData` type structure to inherit from `Vault` type
|
23
|
+
- adjusted method return type of `getMyPerqBalance` in the `DripSdk` to return `MyPerqData[]` instead of `MyPerqData`
|
24
|
+
- adjusted method return types of `fetchMyPerqData` in the `DripApi` to return `MyPerqData[]` instead of `MyPerqData`
|
package/dist/DripApi.d.ts
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
import { BigNumber } from 'ethers';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
2
|
+
import Vault from './types/Vault';
|
3
|
+
import SwapInfo from './types/SwapInfo';
|
4
|
+
import QLFastRedeem from './types/QLFastRedeem';
|
5
|
+
import UserRewards from './types/UserRewards';
|
6
|
+
import VaultStats from './types/VaultStats';
|
7
|
+
import UserBalance from './types/UserBalance';
|
8
|
+
import VaultClaimData from './types/VaultClaimData';
|
9
9
|
import MyPerqData from './types/MyPerqData';
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
10
|
+
import LoyaltyCard from './types/LoyaltyCard';
|
11
|
+
import BeansBalance from './types/BeansBalance';
|
12
|
+
import PerqToBeansSwapInfo from './types/PerqToBeansSwapInfo';
|
13
13
|
import BeanEntry from './types/BeanEntry';
|
14
14
|
import { NonceEnrichedSignedPayload, NonceEnrichedPayload } from './types/SignedPayload';
|
15
|
-
import
|
15
|
+
import UpgradeLoyaltyCardPayload from './types/UpgradeLoyaltyCardPayload';
|
16
16
|
export default class DripApi {
|
17
17
|
route: string;
|
18
18
|
constructor(route: string);
|
package/dist/DripConfig.d.ts
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
import { SDKConfig } from '@spool.fi/spool-v2-sdk';
|
2
2
|
import { Signer } from 'ethers';
|
3
|
+
import { Chain } from './types/Chain';
|
3
4
|
export declare const NULL_ADDRESS = "0x0000000000000000000000000000000000000000";
|
4
5
|
export declare const PERQ_TOKEN_DECIMALS = 18;
|
5
|
-
export declare enum Chain {
|
6
|
-
MAINNET = "mainnet",
|
7
|
-
SEPOLIA = "sepolia"
|
8
|
-
}
|
9
6
|
export declare class DripConfig {
|
10
7
|
internalConfig: SDKConfig;
|
11
8
|
dripRoute: string;
|
package/dist/DripConfig.js
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.DripConfig = exports.
|
3
|
+
exports.DripConfig = exports.PERQ_TOKEN_DECIMALS = exports.NULL_ADDRESS = void 0;
|
4
4
|
const spool_v2_sdk_1 = require("@spool.fi/spool-v2-sdk");
|
5
|
+
const Chain_1 = require("./types/Chain");
|
5
6
|
exports.NULL_ADDRESS = '0x0000000000000000000000000000000000000000';
|
6
7
|
exports.PERQ_TOKEN_DECIMALS = 18;
|
7
|
-
var Chain;
|
8
|
-
(function (Chain) {
|
9
|
-
Chain["MAINNET"] = "mainnet";
|
10
|
-
Chain["SEPOLIA"] = "sepolia";
|
11
|
-
})(Chain || (exports.Chain = Chain = {}));
|
12
8
|
const SUBGRAPH_URL_SEPOLIA = 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api';
|
13
9
|
const RECYCLER_ADDRESS_SEPOLIA = '0x07F2264E199D62afe07E8288eC9D36d155fc3f24';
|
14
10
|
const SWAP_AND_RECYCLER_ADDRESS_SEPOLIA = '0xA4ed357FF233731860Ec8D0446FD95756d564014';
|
@@ -32,7 +28,7 @@ class DripConfig {
|
|
32
28
|
perqVestingAddress;
|
33
29
|
constructor(chain, dripRoute) {
|
34
30
|
switch (chain) {
|
35
|
-
case Chain.MAINNET:
|
31
|
+
case Chain_1.Chain.MAINNET:
|
36
32
|
this.internalConfig = (0, spool_v2_sdk_1.getMainnetConfig)(SUBGRAPH_URL_MAINNET);
|
37
33
|
this.dripRoute = dripRoute !== undefined ? dripRoute : PROD_BACKEND_ROUTE;
|
38
34
|
this.dripTokenAddress = DRIP_TOKEN_ADDRESS_MAINNET;
|
@@ -40,7 +36,7 @@ class DripConfig {
|
|
40
36
|
this.dripSwapAndRecyclerAddress = SWAP_AND_RECYCLER_ADDRESS_MAINNET;
|
41
37
|
this.perqVestingAddress = VESTING_ADDRESS_MAINNET;
|
42
38
|
break;
|
43
|
-
case Chain.SEPOLIA:
|
39
|
+
case Chain_1.Chain.SEPOLIA:
|
44
40
|
this.internalConfig = (0, spool_v2_sdk_1.getSepoliaConfig)(SUBGRAPH_URL_SEPOLIA);
|
45
41
|
this.dripRoute = dripRoute !== undefined ? dripRoute : DEV_BACKEND_ROUTE;
|
46
42
|
this.dripTokenAddress = DRIP_TOKEN_ADDRESS_SEPOLIA;
|
package/dist/DripSdk.d.ts
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
import { BigNumber, Signer } from 'ethers';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
2
|
+
import UserRewards from './types/UserRewards';
|
3
|
+
import VaultStats from './types/VaultStats';
|
4
|
+
import UserBalance from './types/UserBalance';
|
5
|
+
import UserVaultBalance from './types/UserVaultBalance';
|
6
|
+
import VaultClaimData from './types/VaultClaimData';
|
7
|
+
import Vault from './types/Vault';
|
8
|
+
import LoyaltyCard from './types/LoyaltyCard';
|
9
9
|
import MyPerqData from './types/MyPerqData';
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { PerqToBeansSwapInfo } from './types/PerqToBeansSwapInfo';
|
10
|
+
import BeansBalance from './types/BeansBalance';
|
11
|
+
import PerqToBeansSwapInfo from './types/PerqToBeansSwapInfo';
|
13
12
|
import BeanEntry from './types/BeanEntry';
|
14
|
-
import
|
13
|
+
import VestingInfo from './types/VestingInfo';
|
15
14
|
import { NonceEnrichedSignedPayload } from './types/SignedPayload';
|
15
|
+
import { Chain } from './types/Chain';
|
16
16
|
export default class DripSdk {
|
17
17
|
private dripApi;
|
18
18
|
private dripTokenContract;
|
package/dist/DripSdk.js
CHANGED
@@ -12,7 +12,7 @@ const DripTokenRecyclerContract_1 = __importDefault(require("./contracts/DripTok
|
|
12
12
|
const DripSwapAndRecyclerContract_1 = __importDefault(require("./contracts/DripSwapAndRecyclerContract"));
|
13
13
|
const PerqVestingContract_1 = __importDefault(require("./contracts/PerqVestingContract"));
|
14
14
|
const utils_1 = require("ethers/lib/utils");
|
15
|
-
const WethTokenAbi_json_1 = __importDefault(require("./
|
15
|
+
const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json"));
|
16
16
|
class DripSdk {
|
17
17
|
dripApi;
|
18
18
|
dripTokenContract;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
declare const _default: {
|
2
|
+
readonly DRIP_SWAP_AND_RECYCLER_ABI: {
|
3
|
+
inputs: {
|
4
|
+
internalType: string;
|
5
|
+
name: string;
|
6
|
+
type: string;
|
7
|
+
}[];
|
8
|
+
name: string;
|
9
|
+
outputs: {
|
10
|
+
internalType: string;
|
11
|
+
name: string;
|
12
|
+
type: string;
|
13
|
+
}[];
|
14
|
+
stateMutability: string;
|
15
|
+
type: string;
|
16
|
+
}[];
|
17
|
+
readonly WETH_TOKEN_ABI: {
|
18
|
+
constant: boolean;
|
19
|
+
inputs: never[];
|
20
|
+
name: string;
|
21
|
+
outputs: {
|
22
|
+
name: string;
|
23
|
+
type: string;
|
24
|
+
}[];
|
25
|
+
payable: boolean;
|
26
|
+
stateMutability: string;
|
27
|
+
type: string;
|
28
|
+
}[];
|
29
|
+
readonly DRIP_TOKEN_ABI: {
|
30
|
+
constant: boolean;
|
31
|
+
inputs: {
|
32
|
+
name: string;
|
33
|
+
type: string;
|
34
|
+
}[];
|
35
|
+
name: string;
|
36
|
+
outputs: {
|
37
|
+
name: string;
|
38
|
+
type: string;
|
39
|
+
}[];
|
40
|
+
payable: boolean;
|
41
|
+
stateMutability: string;
|
42
|
+
type: string;
|
43
|
+
}[];
|
44
|
+
readonly TOKEN_RECYCLER_ABI: {
|
45
|
+
inputs: {
|
46
|
+
internalType: string;
|
47
|
+
name: string;
|
48
|
+
type: string;
|
49
|
+
}[];
|
50
|
+
name: string;
|
51
|
+
outputs: {
|
52
|
+
internalType: string;
|
53
|
+
name: string;
|
54
|
+
type: string;
|
55
|
+
}[];
|
56
|
+
stateMutability: string;
|
57
|
+
type: string;
|
58
|
+
}[];
|
59
|
+
readonly PERQ_VESTING_ABI: {
|
60
|
+
inputs: {
|
61
|
+
internalType: string;
|
62
|
+
name: string;
|
63
|
+
type: string;
|
64
|
+
}[];
|
65
|
+
name: string;
|
66
|
+
outputs: {
|
67
|
+
internalType: string;
|
68
|
+
name: string;
|
69
|
+
type: string;
|
70
|
+
}[];
|
71
|
+
stateMutability: string;
|
72
|
+
type: string;
|
73
|
+
}[];
|
74
|
+
};
|
75
|
+
export default _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./DripSwapAndRecyclerAbi.json"));
|
7
|
+
const WethTokenAbi_json_1 = __importDefault(require("./WethTokenAbi.json"));
|
8
|
+
const DripTokenAbi_json_1 = __importDefault(require("./DripTokenAbi.json"));
|
9
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("./TokenRecyclerAbi.json"));
|
10
|
+
const PerqVestingAbi_json_1 = __importDefault(require("./PerqVestingAbi.json"));
|
11
|
+
exports.default = {
|
12
|
+
DRIP_SWAP_AND_RECYCLER_ABI: DripSwapAndRecyclerAbi_json_1.default,
|
13
|
+
WETH_TOKEN_ABI: WethTokenAbi_json_1.default,
|
14
|
+
DRIP_TOKEN_ABI: DripTokenAbi_json_1.default,
|
15
|
+
TOKEN_RECYCLER_ABI: TokenRecyclerAbi_json_1.default,
|
16
|
+
PERQ_VESTING_ABI: PerqVestingAbi_json_1.default,
|
17
|
+
};
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("
|
7
|
+
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("../abi/DripSwapAndRecyclerAbi.json"));
|
8
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
9
9
|
const DripConfig_1 = require("../DripConfig");
|
10
10
|
class DripSwapAndRecyclerContract extends BaseDripContract_1.default {
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const DripTokenAbi_json_1 = __importDefault(require("
|
7
|
+
const DripTokenAbi_json_1 = __importDefault(require("../abi/DripTokenAbi.json"));
|
8
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
9
9
|
class DripTokenContract extends BaseDripContract_1.default {
|
10
10
|
constructor(address, signer) {
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const TokenRecyclerAbi_json_1 = __importDefault(require("
|
7
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("../abi/TokenRecyclerAbi.json"));
|
8
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
9
9
|
const DripConfig_1 = require("../DripConfig");
|
10
10
|
class DripTokenRecyclerContract extends BaseDripContract_1.default {
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const ethers_1 = require("ethers");
|
7
|
-
const PerqVestingAbi_json_1 = __importDefault(require("
|
7
|
+
const PerqVestingAbi_json_1 = __importDefault(require("../abi/PerqVestingAbi.json"));
|
8
8
|
const BaseDripContract_1 = __importDefault(require("./BaseDripContract"));
|
9
9
|
class PerqVestingContract extends BaseDripContract_1.default {
|
10
10
|
constructor(address, signer) {
|
package/dist/index.d.ts
CHANGED
@@ -1,22 +1,15 @@
|
|
1
1
|
import DripSdk from './DripSdk';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
import BeanEntry from './types/BeanEntry';
|
17
|
-
import DRIP_SWAP_AND_RECYCLER_ABI from './contracts/abi/DripSwapAndRecyclerAbi.json';
|
18
|
-
import WETH_TOKEN_ABI from './contracts/abi/WethTokenAbi.json';
|
19
|
-
import DRIP_TOKEN_ABI from './contracts/abi/DripTokenAbi.json';
|
20
|
-
import TOKEN_RECYCLER_ABI from './contracts/abi/TokenRecyclerAbi.json';
|
21
|
-
import PERQ_VESTING_ABI from './contracts/abi/PerqVestingAbi.json';
|
22
|
-
export { DRIP_SWAP_AND_RECYCLER_ABI, WETH_TOKEN_ABI, DRIP_TOKEN_ABI, TOKEN_RECYCLER_ABI, PERQ_VESTING_ABI, Vault, VaultReward, DripSdk, UserVaultBalance, UserBalance, VaultStats, NFTBoost, Strategy, StretchGoal, SwapInfo, VaultDepositToken, VaultType, MyPerqData, Chain, ELoyaltyCardTier, BeanEntry, };
|
2
|
+
import DRIP_SWAP_AND_RECYCLER_ABI from './abi/DripSwapAndRecyclerAbi.json';
|
3
|
+
import WETH_TOKEN_ABI from './abi/WethTokenAbi.json';
|
4
|
+
import DRIP_TOKEN_ABI from './abi/DripTokenAbi.json';
|
5
|
+
import TOKEN_RECYCLER_ABI from './abi/TokenRecyclerAbi.json';
|
6
|
+
import PERQ_VESTING_ABI from './abi/PerqVestingAbi.json';
|
7
|
+
import abi from './abi';
|
8
|
+
import * as types from './types';
|
9
|
+
import { Chain } from './types/Chain';
|
10
|
+
export { DRIP_SWAP_AND_RECYCLER_ABI, // TODO REMOVE THIS LINE
|
11
|
+
WETH_TOKEN_ABI, // TODO REMOVE THIS LINE
|
12
|
+
DRIP_TOKEN_ABI, // TODO REMOVE THIS LINE
|
13
|
+
TOKEN_RECYCLER_ABI, // TODO REMOVE THIS LINE
|
14
|
+
PERQ_VESTING_ABI, // TODO REMOVE THIS LINE
|
15
|
+
DripSdk, Chain, abi, types, };
|
package/dist/index.js
CHANGED
@@ -1,22 +1,58 @@
|
|
1
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 __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
37
|
};
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
39
|
+
exports.types = exports.abi = exports.Chain = exports.DripSdk = exports.PERQ_VESTING_ABI = exports.TOKEN_RECYCLER_ABI = exports.DRIP_TOKEN_ABI = exports.WETH_TOKEN_ABI = exports.DRIP_SWAP_AND_RECYCLER_ABI = void 0;
|
7
40
|
const DripSdk_1 = __importDefault(require("./DripSdk"));
|
8
41
|
exports.DripSdk = DripSdk_1.default;
|
9
|
-
const
|
10
|
-
Object.defineProperty(exports, "Chain", { enumerable: true, get: function () { return DripConfig_1.Chain; } });
|
11
|
-
const ELoyaltyCardTier_1 = __importDefault(require("./types/ELoyaltyCardTier"));
|
12
|
-
exports.ELoyaltyCardTier = ELoyaltyCardTier_1.default;
|
13
|
-
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./contracts/abi/DripSwapAndRecyclerAbi.json"));
|
42
|
+
const DripSwapAndRecyclerAbi_json_1 = __importDefault(require("./abi/DripSwapAndRecyclerAbi.json")); // TODO REMOVE THIS LINE
|
14
43
|
exports.DRIP_SWAP_AND_RECYCLER_ABI = DripSwapAndRecyclerAbi_json_1.default;
|
15
|
-
const WethTokenAbi_json_1 = __importDefault(require("./
|
44
|
+
const WethTokenAbi_json_1 = __importDefault(require("./abi/WethTokenAbi.json")); // TODO REMOVE THIS LINE
|
16
45
|
exports.WETH_TOKEN_ABI = WethTokenAbi_json_1.default;
|
17
|
-
const DripTokenAbi_json_1 = __importDefault(require("./
|
46
|
+
const DripTokenAbi_json_1 = __importDefault(require("./abi/DripTokenAbi.json")); // TODO REMOVE THIS LINE
|
18
47
|
exports.DRIP_TOKEN_ABI = DripTokenAbi_json_1.default;
|
19
|
-
const TokenRecyclerAbi_json_1 = __importDefault(require("./
|
48
|
+
const TokenRecyclerAbi_json_1 = __importDefault(require("./abi/TokenRecyclerAbi.json")); // TODO REMOVE THIS LINE
|
20
49
|
exports.TOKEN_RECYCLER_ABI = TokenRecyclerAbi_json_1.default;
|
21
|
-
const PerqVestingAbi_json_1 = __importDefault(require("./
|
50
|
+
const PerqVestingAbi_json_1 = __importDefault(require("./abi/PerqVestingAbi.json")); // TODO REMOVE THIS LINE
|
22
51
|
exports.PERQ_VESTING_ABI = PerqVestingAbi_json_1.default;
|
52
|
+
// FROM NOW ON, THIS IS THE NEW STRUCTURE:
|
53
|
+
const abi_1 = __importDefault(require("./abi"));
|
54
|
+
exports.abi = abi_1.default;
|
55
|
+
const types = __importStar(require("./types"));
|
56
|
+
exports.types = types;
|
57
|
+
const Chain_1 = require("./types/Chain");
|
58
|
+
Object.defineProperty(exports, "Chain", { enumerable: true, get: function () { return Chain_1.Chain; } });
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.PerqConfig = void 0;
|
4
|
+
const Chain_1 = require("../types/Chain");
|
5
|
+
const PROD_BACKEND_ROUTE = 'https://perq.finance';
|
6
|
+
const DEV_BACKEND_ROUTE = 'https://dev.perq.finance';
|
7
|
+
class PerqConfig {
|
8
|
+
perqRoute;
|
9
|
+
constructor(chain, perqRoute) {
|
10
|
+
switch (chain) {
|
11
|
+
case Chain_1.Chain.MAINNET:
|
12
|
+
this.perqRoute = perqRoute !== undefined ? perqRoute : PROD_BACKEND_ROUTE;
|
13
|
+
break;
|
14
|
+
case Chain_1.Chain.SEPOLIA:
|
15
|
+
this.perqRoute = perqRoute !== undefined ? perqRoute : DEV_BACKEND_ROUTE;
|
16
|
+
break;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.PerqConfig = PerqConfig;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const sdk_1 = require("@yelay-lite/sdk");
|
7
|
+
const PerqApi_1 = __importDefault(require("./PerqApi"));
|
8
|
+
const PerqConfig_1 = require("./PerqConfig");
|
9
|
+
const YELAY_LITE_BACKEND_URL = 'http://134.209.255.15:3000';
|
10
|
+
const BASE_RPC_URL = 'https://sly-virulent-pallet.base-mainnet.quiknode.pro/22e8158f3fe6a39562769d29f885d4102f08715a/';
|
11
|
+
class PerqSdk {
|
12
|
+
perqApi;
|
13
|
+
perqConfig;
|
14
|
+
signer;
|
15
|
+
yelayLiteSdk;
|
16
|
+
constructor(chain, signer, perqRoute) {
|
17
|
+
this.signer = signer;
|
18
|
+
this.perqConfig = new PerqConfig_1.PerqConfig(chain, perqRoute);
|
19
|
+
this.perqApi = new PerqApi_1.default(this.perqConfig.perqRoute);
|
20
|
+
this.yelayLiteSdk = new sdk_1.YelayLiteSdk({
|
21
|
+
backendUrl: YELAY_LITE_BACKEND_URL,
|
22
|
+
rpcUrl: BASE_RPC_URL,
|
23
|
+
});
|
24
|
+
}
|
25
|
+
}
|
26
|
+
exports.default = PerqSdk;
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import
|
2
|
-
|
1
|
+
import StretchGoal from './StretchGoal';
|
2
|
+
import { YelayVersion } from './YelayVersion';
|
3
|
+
type DeployedProject = {
|
3
4
|
id: number | undefined;
|
4
5
|
projectName: string;
|
5
6
|
owners: string[];
|
@@ -35,7 +36,9 @@ export type DeployedProject = {
|
|
35
36
|
coingeckoId?: string;
|
36
37
|
projectType: string;
|
37
38
|
isFeatured: boolean;
|
39
|
+
yelayVersion: YelayVersion;
|
38
40
|
};
|
41
|
+
export default DeployedProject;
|
39
42
|
export type ProjectBacker = {
|
40
43
|
name: string;
|
41
44
|
image: string;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
|
1
|
+
import DeployedProject from './DeployedProject';
|
2
|
+
import VaultReward from './VaultReward';
|
3
|
+
import VaultType from './VaultType';
|
4
|
+
type DeployedVault = {
|
5
5
|
projectId: number;
|
6
6
|
vaultAddress: string;
|
7
7
|
liveUntil: string;
|
@@ -13,3 +13,4 @@ export type DeployedVault = {
|
|
13
13
|
coingeckoId?: string;
|
14
14
|
expectedTge?: string;
|
15
15
|
};
|
16
|
+
export default DeployedVault;
|
package/dist/types/NFTBoost.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
type QLFastRedeem = {
|
2
2
|
assetsWithdrawn: {
|
3
3
|
asset: {
|
4
4
|
decimals: number;
|
@@ -12,4 +12,5 @@ export interface QLFastRedeem {
|
|
12
12
|
blockNumber: number;
|
13
13
|
id: string;
|
14
14
|
svtWithdrawn: string;
|
15
|
-
}
|
15
|
+
};
|
16
|
+
export default QLFastRedeem;
|
package/dist/types/Strategy.d.ts
CHANGED
package/dist/types/SwapInfo.d.ts
CHANGED
package/dist/types/Vault.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { RewardType
|
6
|
-
import
|
7
|
-
|
1
|
+
import DeployedProject from './DeployedProject';
|
2
|
+
import NFTBoost from './NFTBoost';
|
3
|
+
import Strategy from './Strategy';
|
4
|
+
import VaultDepositToken from './VaultDepositToken';
|
5
|
+
import VaultReward, { RewardType } from './VaultReward';
|
6
|
+
import VaultType from './VaultType';
|
7
|
+
type Vault = {
|
8
8
|
vaultName: string;
|
9
9
|
vaultAddress: string;
|
10
10
|
apy: number;
|
@@ -37,3 +37,4 @@ export type Vault = {
|
|
37
37
|
boostedTvl: number;
|
38
38
|
projectVAPY?: number;
|
39
39
|
};
|
40
|
+
export default Vault;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
type VaultReward = {
|
2
2
|
id: number | undefined;
|
3
3
|
type: RewardType;
|
4
4
|
name: string;
|
@@ -11,5 +11,6 @@ export type VaultReward = {
|
|
11
11
|
timestamp: number;
|
12
12
|
endTime: number;
|
13
13
|
};
|
14
|
+
export default VaultReward;
|
14
15
|
export declare const REWARD_TYPES: readonly ["token", "points", "pnode shards"];
|
15
16
|
export type RewardType = (typeof REWARD_TYPES)[number];
|
@@ -0,0 +1 @@
|
|
1
|
+
export type YelayVersion = "v2" | "lite";
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import Asset from './Asset';
|
2
|
+
import BeanEntry from './BeanEntry';
|
3
|
+
import BeansBalance from './BeansBalance';
|
4
|
+
import DepositToken from './DepositToken';
|
5
|
+
import DeployedProject from './DeployedProject';
|
6
|
+
import DeployedVault from './DeployedVault';
|
7
|
+
import ELoyaltyCardTier from './ELoyaltyCardTier';
|
8
|
+
import LoyaltyCard from './LoyaltyCard';
|
9
|
+
import MyPerqData from './MyPerqData';
|
10
|
+
import NFTBoost from './NFTBoost';
|
11
|
+
import PerqToBeansSwapInfo from './PerqToBeansSwapInfo';
|
12
|
+
import QLFastRedeem from './QLFastRedeem';
|
13
|
+
import { BasePayload, NonceEnrichedPayload, NonceEnrichedSignedPayload } from './SignedPayload';
|
14
|
+
import Strategy from './Strategy';
|
15
|
+
import StretchGoal from './StretchGoal';
|
16
|
+
import SwapInfo from './SwapInfo';
|
17
|
+
import Vault from './Vault';
|
18
|
+
import VaultDepositToken from './VaultDepositToken';
|
19
|
+
import VaultReward from './VaultReward';
|
20
|
+
import VaultStats from './VaultStats';
|
21
|
+
import UserBalance from './UserBalance';
|
22
|
+
import UserVaultBalance from './UserVaultBalance';
|
23
|
+
import UpgradeLoyaltyCardPayload from './UpgradeLoyaltyCardPayload';
|
24
|
+
import UserRewards from './UserRewards';
|
25
|
+
import VestingInfo from './VestingInfo';
|
26
|
+
import VaultClaimData from './VaultClaimData';
|
27
|
+
import VaultType from './VaultType';
|
28
|
+
export { Asset, BeanEntry, DeployedProject, DeployedVault, ELoyaltyCardTier, BeansBalance, DepositToken, LoyaltyCard, MyPerqData, NFTBoost, PerqToBeansSwapInfo, QLFastRedeem, Strategy, StretchGoal, SwapInfo, Vault, VaultDepositToken, VaultReward, VaultStats, UserBalance, UserVaultBalance, BasePayload, NonceEnrichedPayload, NonceEnrichedSignedPayload, UpgradeLoyaltyCardPayload, UserRewards, VestingInfo, VaultClaimData, VaultType, };
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.ELoyaltyCardTier = void 0;
|
7
|
+
const ELoyaltyCardTier_1 = __importDefault(require("./ELoyaltyCardTier"));
|
8
|
+
exports.ELoyaltyCardTier = ELoyaltyCardTier_1.default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dripfi/drip-sdk",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.10",
|
4
4
|
"description": "Drip SDK",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -9,18 +9,19 @@
|
|
9
9
|
"build": "tsc",
|
10
10
|
"publish": "npm publish --access public",
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
12
|
-
"lint": "eslint src
|
12
|
+
"lint": "eslint src",
|
13
13
|
"pretty": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json}\""
|
14
14
|
},
|
15
15
|
"dependencies": {
|
16
16
|
"@spool.fi/spool-v2-sdk": "2.0.44",
|
17
|
+
"@yelay-lite/sdk": "0.0.11",
|
17
18
|
"ethers": "^5.7.2"
|
18
19
|
},
|
19
20
|
"author": "",
|
20
21
|
"license": "ISC",
|
21
22
|
"devDependencies": {
|
22
23
|
"typescript-eslint": "^8.19.1",
|
23
|
-
"eslint": "^
|
24
|
+
"eslint": "^9.17.0",
|
24
25
|
"typescript": "^5.4.5",
|
25
26
|
"prettier-eslint": "^16.3.0",
|
26
27
|
"prettier": "^3.4.2",
|
package/dist/test.d.ts
DELETED
package/dist/test.js
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.signer = void 0;
|
7
|
-
const ethers_1 = require("ethers");
|
8
|
-
const DripConfig_1 = require("./DripConfig");
|
9
|
-
const DripSdk_1 = __importDefault(require("./DripSdk"));
|
10
|
-
// This is script to test locally the drip sdk methods
|
11
|
-
const account2 = '0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848'; // privKey 92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787
|
12
|
-
// const privKey: string = '6ffc226f7b7769e27124317372c9dbb579a324e67e97bf07131bf2f59ec0f4fe';
|
13
|
-
const privKey = '92eb90257aa76cc56ead18dd52dd3433689712ebe7356a70308b760bfcbdd787';
|
14
|
-
const testConfigParams = {
|
15
|
-
subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
|
16
|
-
priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
|
17
|
-
rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
|
18
|
-
fastRedeemApi: 'https://fastwithdraw.dev.spool.fi/sepolia',
|
19
|
-
spoolContracts: {
|
20
|
-
11155111: {
|
21
|
-
ISmartVaultManager: '0x2638d6c0b4EF6Dee04050fA0B07CA62500435747',
|
22
|
-
IDepositSwap: '0x5FB08e00DE169f041711206A0995410884080177',
|
23
|
-
ISmartVaultFactory: '0x86BB0376929218ba1cb825cE2ebE801bFCcD8149',
|
24
|
-
IDepositManager: '0xfA37dd47F3596681C39D3a1b55474595BB591dc9',
|
25
|
-
IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
|
26
|
-
IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
|
27
|
-
ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
|
28
|
-
},
|
29
|
-
},
|
30
|
-
dripContracts: {
|
31
|
-
DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
|
32
|
-
DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78', // Sepolia contract address
|
33
|
-
},
|
34
|
-
};
|
35
|
-
const configParams = {
|
36
|
-
subgraphUrl: 'https://subgraph.satsuma-prod.com/49eb322da234/solidant/spool-v2-sepolia/api',
|
37
|
-
priceFeedApiUrl: 'https://pricefeed.dev.spool.fi/',
|
38
|
-
rewardsUrl: 'https://rewards.dev.spool.fi/sepolia',
|
39
|
-
fastRedeemApi: 'https://fastwithdraw.dev.spool.fi/sepolia',
|
40
|
-
contracts: {
|
41
|
-
11155111: {
|
42
|
-
ISmartVaultManager: '0x2638d6c0b4EF6Dee04050fA0B07CA62500435747',
|
43
|
-
IDepositSwap: '0x5FB08e00DE169f041711206A0995410884080177',
|
44
|
-
ISmartVaultFactory: '0x86BB0376929218ba1cb825cE2ebE801bFCcD8149',
|
45
|
-
IDepositManager: '0xfA37dd47F3596681C39D3a1b55474595BB591dc9',
|
46
|
-
IRewardManager: '0xcE7F66BD505a80129Ef25b06207Ac49620A55522',
|
47
|
-
IStrategyRegistry: '0xf978853Db777d00b1130Ea21d8d98E8710b0Bc56',
|
48
|
-
ISpoolLens: '0x33Df6cf08Fbb10047e318989fE687294CD45A7B4',
|
49
|
-
},
|
50
|
-
},
|
51
|
-
dripContracts: {
|
52
|
-
DripTokenAddress: '0x707B4Cc05645713d8Ea04FBC7192A0f2c1503d6E', // Sepolia contract address
|
53
|
-
DripTokenRecyclerAddress: '0xe943A1320402fcf41cDc04275e842654165dAB78', // Sepolia contract address
|
54
|
-
},
|
55
|
-
};
|
56
|
-
const provider = new ethers_1.ethers.providers.StaticJsonRpcProvider('https://rpc.ankr.com/eth_sepolia', 11155111);
|
57
|
-
exports.signer = new ethers_1.ethers.Wallet(privKey, provider);
|
58
|
-
// const random_address = '0x25dFcFB061956c6f33B1ee032cc33837d0b83257';
|
59
|
-
const vaultAddress = '0x457d29df2449439a86521a1cea1561d24cc67a93'; // USDC AUKI
|
60
|
-
const daiVaultPerq = '0x1977efe478ba17da8be6e93fdfadbd3055d30111'; // DAI PERQ SEPOLIA
|
61
|
-
const usdcVaultPerq = '0xf9795bfbf7c40981c372d0fb25a87e0b694c4fcd'; // USDC PERQ SEPOLIA
|
62
|
-
const daiTokenAddress = '0x2a3a3872c242c35093a8fc48dac838c4b2d24a03'; // DAI TOKEN
|
63
|
-
const usdcTokenAddress = '0xa6b92fcd4ee124353c8a6acf1edb574f46f3f8df'; // USDC TOKEN
|
64
|
-
const dripSdk = new DripSdk_1.default(DripConfig_1.Chain.SEPOLIA, exports.signer, 'https://localhost:3000');
|
65
|
-
// 0x689Baa4821865Cb328F5E847fB6133DEB315A832
|
66
|
-
// 0x9E9B6899Ea314dD553A99f4F49440d2CeD2b2848
|
67
|
-
async function main() {
|
68
|
-
try {
|
69
|
-
// const res = await dripSdk.deposit(usdcTokenAddress,usdcVaultPerq, '1000');
|
70
|
-
// const res = await dripSdk.withdraw(usdcVaultPerq, '1');
|
71
|
-
// const res = await dripSdk.getDripTokenBalance(account2)
|
72
|
-
// const res = await dripSdk.getOwnedLoyaltyCard()
|
73
|
-
// const res = await dripSdk.getBeansBalance()
|
74
|
-
// const res = await dripSdk.recycleTokens()
|
75
|
-
// const res = await dripSdk.upgradeLoyaltyCard()
|
76
|
-
}
|
77
|
-
catch (error) {
|
78
|
-
console.log(`Main error: ${error}`);
|
79
|
-
}
|
80
|
-
}
|
81
|
-
main();
|
package/dist/utils.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare function insertDot(numberString: string, decimals: number): string;
|
package/dist/utils.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.insertDot = insertDot;
|
4
|
-
function insertDot(numberString, decimals) {
|
5
|
-
if (numberString.length < decimals + 1) {
|
6
|
-
numberString = '0'.repeat(decimals + 1 - numberString.length) + numberString;
|
7
|
-
}
|
8
|
-
const indexToInsertDot = numberString.length - decimals;
|
9
|
-
// Ensure there is a part before the dot, even if it's 0
|
10
|
-
const beforeDecimal = indexToInsertDot > 0 ? numberString.slice(0, indexToInsertDot) : '0';
|
11
|
-
const afterDecimal = numberString.slice(indexToInsertDot);
|
12
|
-
return `${beforeDecimal}.${afterDecimal}`;
|
13
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|