@dripfi/drip-sdk 1.4.34 → 1.4.35-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/package.json +11 -12
- package/dist/PerqApi.d.ts +0 -49
- package/dist/PerqApi.js +0 -475
- package/dist/PerqSdk.d.ts +0 -40
- package/dist/PerqSdk.js +0 -75
- package/dist/abi/ERC20.json +0 -222
- package/dist/abi/SlotBurnTokenAbi.json +0 -130
- package/dist/abi/WethTokenAbi.json +0 -25
- package/dist/abi/index.d.ts +0 -411
- package/dist/abi/index.js +0 -23
- package/dist/abi/perq/BridgeMainnetPerqToSonicAbi.json +0 -598
- package/dist/abi/perq/BridgeSonicPerqToMainnetAbi.json +0 -733
- package/dist/abi/perq/PerqSwapAndRecyclerAbi.json +0 -95
- package/dist/abi/perq/PerqTokenAbi.json +0 -48
- package/dist/abi/perq/PerqVestingAbi.json +0 -126
- package/dist/abi/perq/TokenRecyclerAbi.json +0 -41
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -5
- package/dist/contracts/BaseContract.d.ts +0 -7
- package/dist/contracts/BaseContract.js +0 -16
- package/dist/contracts/BridgeMainnetPerqToSonicContract.d.ts +0 -9
- package/dist/contracts/BridgeMainnetPerqToSonicContract.js +0 -48
- package/dist/contracts/BridgeSonicPerqToMainnetContract.d.ts +0 -9
- package/dist/contracts/BridgeSonicPerqToMainnetContract.js +0 -47
- package/dist/contracts/ERC20TokenContract.d.ts +0 -10
- package/dist/contracts/ERC20TokenContract.js +0 -34
- package/dist/contracts/SlotBurnTokenContract.d.ts +0 -8
- package/dist/contracts/SlotBurnTokenContract.js +0 -26
- package/dist/contracts/index.d.ts +0 -9
- package/dist/contracts/index.js +0 -22
- package/dist/contracts/perq/PerqSwapAndRecyclerContract.d.ts +0 -8
- package/dist/contracts/perq/PerqSwapAndRecyclerContract.js +0 -28
- package/dist/contracts/perq/PerqTokenContract.d.ts +0 -7
- package/dist/contracts/perq/PerqTokenContract.js +0 -26
- package/dist/contracts/perq/PerqTokenRecyclerContract.d.ts +0 -7
- package/dist/contracts/perq/PerqTokenRecyclerContract.js +0 -20
- package/dist/contracts/perq/PerqVestingContract.d.ts +0 -13
- package/dist/contracts/perq/PerqVestingContract.js +0 -56
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -28
- package/dist/subpackages/BridgePerqPackage.d.ts +0 -36
- package/dist/subpackages/BridgePerqPackage.js +0 -205
- package/dist/subpackages/LitePackage.d.ts +0 -19
- package/dist/subpackages/LitePackage.js +0 -106
- package/dist/subpackages/LoyaltyCardsPackage.d.ts +0 -21
- package/dist/subpackages/LoyaltyCardsPackage.js +0 -123
- package/dist/subpackages/PoolsPackage.d.ts +0 -21
- package/dist/subpackages/PoolsPackage.js +0 -58
- package/dist/subpackages/RecyclerPackage.d.ts +0 -13
- package/dist/subpackages/RecyclerPackage.js +0 -87
- package/dist/subpackages/SignHandlerPackage.d.ts +0 -8
- package/dist/subpackages/SignHandlerPackage.js +0 -33
- package/dist/subpackages/SiloPackage.d.ts +0 -18
- package/dist/subpackages/SiloPackage.js +0 -112
- package/dist/subpackages/SiloVaultOperations.d.ts +0 -31
- package/dist/subpackages/SiloVaultOperations.js +0 -119
- package/dist/subpackages/TokenUtilsPackage.d.ts +0 -27
- package/dist/subpackages/TokenUtilsPackage.js +0 -93
- package/dist/subpackages/UserPackage.d.ts +0 -11
- package/dist/subpackages/UserPackage.js +0 -43
- package/dist/subpackages/VaultHandlerPackage.d.ts +0 -54
- package/dist/subpackages/VaultHandlerPackage.js +0 -107
- package/dist/subpackages/VestingPackage.d.ts +0 -14
- package/dist/subpackages/VestingPackage.js +0 -112
- package/dist/subpackages/YelayVaultOperations.d.ts +0 -13
- package/dist/subpackages/YelayVaultOperations.js +0 -107
- package/dist/types/Asset.d.ts +0 -5
- package/dist/types/Asset.js +0 -2
- package/dist/types/BeanEntry.d.ts +0 -12
- package/dist/types/BeanEntry.js +0 -2
- package/dist/types/BeansBalance.d.ts +0 -5
- package/dist/types/BeansBalance.js +0 -2
- package/dist/types/BridgePerq.d.ts +0 -14
- package/dist/types/BridgePerq.js +0 -2
- package/dist/types/ChainId.d.ts +0 -7
- package/dist/types/ChainId.js +0 -9
- package/dist/types/ClaimSpecialEditionLoyaltyCardPayload.d.ts +0 -4
- package/dist/types/ClaimSpecialEditionLoyaltyCardPayload.js +0 -2
- package/dist/types/DeployedProject.d.ts +0 -55
- package/dist/types/DeployedProject.js +0 -2
- package/dist/types/DeployedVault.d.ts +0 -14
- package/dist/types/DeployedVault.js +0 -2
- package/dist/types/DepositToken.d.ts +0 -8
- package/dist/types/DepositToken.js +0 -2
- package/dist/types/DetailedProjectData.d.ts +0 -34
- package/dist/types/DetailedProjectData.js +0 -2
- package/dist/types/DistributionToken.d.ts +0 -6
- package/dist/types/DistributionToken.js +0 -2
- package/dist/types/ELoyaltyCardTier.d.ts +0 -10
- package/dist/types/ELoyaltyCardTier.js +0 -13
- package/dist/types/Earnings.d.ts +0 -11
- package/dist/types/Earnings.js +0 -2
- package/dist/types/LinkWalletPayload.d.ts +0 -9
- package/dist/types/LinkWalletPayload.js +0 -2
- package/dist/types/LinkedPodWallets.d.ts +0 -6
- package/dist/types/LinkedPodWallets.js +0 -2
- package/dist/types/LoyaltyCard.d.ts +0 -11
- package/dist/types/LoyaltyCard.js +0 -2
- package/dist/types/MigrationOption.d.ts +0 -6
- package/dist/types/MigrationOption.js +0 -2
- package/dist/types/MyPerqData.d.ts +0 -19
- package/dist/types/MyPerqData.js +0 -2
- package/dist/types/NFTBoost.d.ts +0 -10
- package/dist/types/NFTBoost.js +0 -2
- package/dist/types/OverallStats.d.ts +0 -7
- package/dist/types/OverallStats.js +0 -2
- package/dist/types/PerqConfig.d.ts +0 -18
- package/dist/types/PerqConfig.js +0 -37
- package/dist/types/PerqToBeansSwapInfo.d.ts +0 -8
- package/dist/types/PerqToBeansSwapInfo.js +0 -2
- package/dist/types/ProjectHistoricalTvl.d.ts +0 -4
- package/dist/types/ProjectHistoricalTvl.js +0 -2
- package/dist/types/QLFastRedeem.d.ts +0 -16
- package/dist/types/QLFastRedeem.js +0 -2
- package/dist/types/ReducedProjectData.d.ts +0 -21
- package/dist/types/ReducedProjectData.js +0 -2
- package/dist/types/SdkType.d.ts +0 -2
- package/dist/types/SdkType.js +0 -2
- package/dist/types/SignedPayload.d.ts +0 -12
- package/dist/types/SignedPayload.js +0 -2
- package/dist/types/SlotMachineSpinCost.d.ts +0 -7
- package/dist/types/SlotMachineSpinCost.js +0 -2
- package/dist/types/SpecialEditionLoyaltyCard.d.ts +0 -9
- package/dist/types/SpecialEditionLoyaltyCard.js +0 -2
- package/dist/types/Strategy.d.ts +0 -9
- package/dist/types/Strategy.js +0 -2
- package/dist/types/StretchGoal.d.ts +0 -5
- package/dist/types/StretchGoal.js +0 -2
- package/dist/types/SwapInfo.d.ts +0 -6
- package/dist/types/SwapInfo.js +0 -2
- package/dist/types/UpgradeLoyaltyCardPayload.d.ts +0 -4
- package/dist/types/UpgradeLoyaltyCardPayload.js +0 -2
- package/dist/types/UserRewards.d.ts +0 -6
- package/dist/types/UserRewards.js +0 -2
- package/dist/types/VaultData.d.ts +0 -32
- package/dist/types/VaultData.js +0 -2
- package/dist/types/VaultOperationParams.d.ts +0 -12
- package/dist/types/VaultOperationParams.js +0 -2
- package/dist/types/VaultReward.d.ts +0 -16
- package/dist/types/VaultReward.js +0 -4
- package/dist/types/VaultStats.d.ts +0 -6
- package/dist/types/VaultStats.js +0 -2
- package/dist/types/VaultType.d.ts +0 -3
- package/dist/types/VaultType.js +0 -4
- package/dist/types/VestingInfo.d.ts +0 -8
- package/dist/types/VestingInfo.js +0 -2
- package/dist/types/YelayVersion.d.ts +0 -2
- package/dist/types/YelayVersion.js +0 -2
- package/dist/types/index.d.ts +0 -34
- package/dist/types/index.js +0 -8
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{
|
|
5
|
-
"internalType": "address",
|
|
6
|
-
"name": "rewardBeneficiary_",
|
|
7
|
-
"type": "address"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"internalType": "address[]",
|
|
11
|
-
"name": "path_",
|
|
12
|
-
"type": "address[]"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"internalType": "uint256",
|
|
16
|
-
"name": "amountIn_",
|
|
17
|
-
"type": "uint256"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"internalType": "uint256",
|
|
21
|
-
"name": "minAmountOut_",
|
|
22
|
-
"type": "uint256"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"internalType": "uint256",
|
|
26
|
-
"name": "price_",
|
|
27
|
-
"type": "uint256"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"internalType": "uint256",
|
|
31
|
-
"name": "deadline_",
|
|
32
|
-
"type": "uint256"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"internalType": "bytes",
|
|
36
|
-
"name": "signature_",
|
|
37
|
-
"type": "bytes"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"name": "swapAndRecycle",
|
|
41
|
-
"outputs": [
|
|
42
|
-
{
|
|
43
|
-
"internalType": "uint256",
|
|
44
|
-
"name": "",
|
|
45
|
-
"type": "uint256"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"stateMutability": "nonpayable",
|
|
49
|
-
"type": "function"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"inputs": [
|
|
53
|
-
{
|
|
54
|
-
"internalType": "address",
|
|
55
|
-
"name": "rewardBeneficiary_",
|
|
56
|
-
"type": "address"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"internalType": "address[]",
|
|
60
|
-
"name": "path_",
|
|
61
|
-
"type": "address[]"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"internalType": "uint256",
|
|
65
|
-
"name": "minAmountOut_",
|
|
66
|
-
"type": "uint256"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"internalType": "uint256",
|
|
70
|
-
"name": "price_",
|
|
71
|
-
"type": "uint256"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"internalType": "uint256",
|
|
75
|
-
"name": "deadline_",
|
|
76
|
-
"type": "uint256"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"internalType": "bytes",
|
|
80
|
-
"name": "signature_",
|
|
81
|
-
"type": "bytes"
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
"name": "swapETHAndRecycle",
|
|
85
|
-
"outputs": [
|
|
86
|
-
{
|
|
87
|
-
"internalType": "uint256",
|
|
88
|
-
"name": "",
|
|
89
|
-
"type": "uint256"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"stateMutability": "payable",
|
|
93
|
-
"type": "function"
|
|
94
|
-
}
|
|
95
|
-
]
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"constant": true,
|
|
4
|
-
"inputs": [
|
|
5
|
-
{
|
|
6
|
-
"name": "owner",
|
|
7
|
-
"type": "address"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"name": "spender",
|
|
11
|
-
"type": "address"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"name": "allowance",
|
|
15
|
-
"outputs": [
|
|
16
|
-
{
|
|
17
|
-
"name": "",
|
|
18
|
-
"type": "uint256"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"payable": false,
|
|
22
|
-
"stateMutability": "view",
|
|
23
|
-
"type": "function"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"constant": false,
|
|
27
|
-
"inputs": [
|
|
28
|
-
{
|
|
29
|
-
"name": "spender",
|
|
30
|
-
"type": "address"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "value",
|
|
34
|
-
"type": "uint256"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"name": "approve",
|
|
38
|
-
"outputs": [
|
|
39
|
-
{
|
|
40
|
-
"name": "",
|
|
41
|
-
"type": "bool"
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"payable": false,
|
|
45
|
-
"stateMutability": "nonpayable",
|
|
46
|
-
"type": "function"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [],
|
|
4
|
-
"name": "start",
|
|
5
|
-
"outputs": [
|
|
6
|
-
{
|
|
7
|
-
"internalType": "uint64",
|
|
8
|
-
"name": "",
|
|
9
|
-
"type": "uint64"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"stateMutability": "view",
|
|
13
|
-
"type": "function"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"inputs": [],
|
|
17
|
-
"name": "end",
|
|
18
|
-
"outputs": [
|
|
19
|
-
{
|
|
20
|
-
"internalType": "uint64",
|
|
21
|
-
"name": "",
|
|
22
|
-
"type": "uint64"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"stateMutability": "view",
|
|
26
|
-
"type": "function"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"inputs": [
|
|
30
|
-
{
|
|
31
|
-
"internalType": "address",
|
|
32
|
-
"name": "beneficiary_",
|
|
33
|
-
"type": "address"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"name": "vested",
|
|
37
|
-
"outputs": [
|
|
38
|
-
{
|
|
39
|
-
"internalType": "uint256",
|
|
40
|
-
"name": "",
|
|
41
|
-
"type": "uint256"
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"stateMutability": "view",
|
|
45
|
-
"type": "function"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"inputs": [
|
|
49
|
-
{
|
|
50
|
-
"internalType": "address",
|
|
51
|
-
"name": "beneficiary_",
|
|
52
|
-
"type": "address"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"name": "releasable",
|
|
56
|
-
"outputs": [
|
|
57
|
-
{
|
|
58
|
-
"internalType": "uint256",
|
|
59
|
-
"name": "",
|
|
60
|
-
"type": "uint256"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"stateMutability": "view",
|
|
64
|
-
"type": "function"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"inputs": [
|
|
68
|
-
{
|
|
69
|
-
"internalType": "uint256",
|
|
70
|
-
"name": "amount_",
|
|
71
|
-
"type": "uint256"
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
"name": "claim",
|
|
75
|
-
"outputs": [],
|
|
76
|
-
"stateMutability": "nonpayable",
|
|
77
|
-
"type": "function"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"inputs": [
|
|
81
|
-
{
|
|
82
|
-
"internalType": "uint256",
|
|
83
|
-
"name": "amount_",
|
|
84
|
-
"type": "uint256"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"internalType": "uint256",
|
|
88
|
-
"name": "price",
|
|
89
|
-
"type": "uint256"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"internalType": "uint256",
|
|
93
|
-
"name": "deadline",
|
|
94
|
-
"type": "uint256"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"internalType": "bytes",
|
|
98
|
-
"name": "signature",
|
|
99
|
-
"type": "bytes"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"name": "burn",
|
|
103
|
-
"outputs": [],
|
|
104
|
-
"stateMutability": "nonpayable",
|
|
105
|
-
"type": "function"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"inputs": [
|
|
109
|
-
{
|
|
110
|
-
"internalType": "address",
|
|
111
|
-
"name": "beneficiary_",
|
|
112
|
-
"type": "address"
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"name": "releasableTotal",
|
|
116
|
-
"outputs": [
|
|
117
|
-
{
|
|
118
|
-
"internalType": "uint256",
|
|
119
|
-
"name": "",
|
|
120
|
-
"type": "uint256"
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
"stateMutability": "view",
|
|
124
|
-
"type": "function"
|
|
125
|
-
}
|
|
126
|
-
]
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"inputs": [
|
|
4
|
-
{
|
|
5
|
-
"internalType": "uint256",
|
|
6
|
-
"name": "amount",
|
|
7
|
-
"type": "uint256"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"internalType": "address",
|
|
11
|
-
"name": "rewardBeneficiary",
|
|
12
|
-
"type": "address"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"internalType": "uint256",
|
|
16
|
-
"name": "price",
|
|
17
|
-
"type": "uint256"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"internalType": "uint256",
|
|
21
|
-
"name": "deadline",
|
|
22
|
-
"type": "uint256"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"internalType": "bytes",
|
|
26
|
-
"name": "signature",
|
|
27
|
-
"type": "bytes"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
"name": "recycle",
|
|
31
|
-
"outputs": [
|
|
32
|
-
{
|
|
33
|
-
"internalType": "uint256",
|
|
34
|
-
"name": "",
|
|
35
|
-
"type": "uint256"
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
"stateMutability": "nonpayable",
|
|
39
|
-
"type": "function"
|
|
40
|
-
}
|
|
41
|
-
]
|
package/dist/constants.d.ts
DELETED
package/dist/constants.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SONIC_WS_TOKEN_ADDRESS = exports.SONIC_PERQ_TOKEN_ADDRESS = void 0;
|
|
4
|
-
exports.SONIC_PERQ_TOKEN_ADDRESS = '0x26c352304909cc7e59eeed39242eb7afbc706ad3';
|
|
5
|
-
exports.SONIC_WS_TOKEN_ADDRESS = '0x039e2fb66102314ce7b64ce5ce3e5183bc94ad38';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
export default abstract class BaseContract {
|
|
3
|
-
protected contract: ethers.Contract;
|
|
4
|
-
constructor(address: string, abi: ethers.ContractInterface, signer?: ethers.Signer);
|
|
5
|
-
updateSigner(newSigner: ethers.Signer): void;
|
|
6
|
-
getContractAddress(): string;
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ethers_1 = require("ethers");
|
|
4
|
-
class BaseContract {
|
|
5
|
-
contract;
|
|
6
|
-
constructor(address, abi, signer) {
|
|
7
|
-
this.contract = new ethers_1.ethers.Contract(address, abi, signer);
|
|
8
|
-
}
|
|
9
|
-
updateSigner(newSigner) {
|
|
10
|
-
this.contract = this.contract.connect(newSigner);
|
|
11
|
-
}
|
|
12
|
-
getContractAddress() {
|
|
13
|
-
return this.contract.address;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.default = BaseContract;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ContractTransaction, ethers } from 'ethers';
|
|
2
|
-
import BaseContract from './BaseContract';
|
|
3
|
-
import PerqSdk from '../PerqSdk';
|
|
4
|
-
import { MessagingFee, SendParam } from '../types/BridgePerq';
|
|
5
|
-
export default class BridgeMainnetPerqToSonicContract extends BaseContract {
|
|
6
|
-
constructor(perqSdk: PerqSdk);
|
|
7
|
-
send(sendParam: SendParam, fee: MessagingFee, refundAddress: string, overrides?: ethers.PayableOverrides): Promise<ContractTransaction>;
|
|
8
|
-
quoteSend(sendParam: SendParam, payInLzToken: boolean): Promise<MessagingFee>;
|
|
9
|
-
}
|
|
@@ -1,48 +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
|
-
const ethers_1 = require("ethers");
|
|
7
|
-
const BridgeMainnetPerqToSonicAbi_json_1 = __importDefault(require("../abi/perq/BridgeMainnetPerqToSonicAbi.json"));
|
|
8
|
-
const BaseContract_1 = __importDefault(require("./BaseContract"));
|
|
9
|
-
class BridgeMainnetPerqToSonicContract extends BaseContract_1.default {
|
|
10
|
-
constructor(perqSdk) {
|
|
11
|
-
super(perqSdk.perqConfig.bridgeMainnetPerqToSonicAddress, new ethers_1.ethers.utils.Interface(BridgeMainnetPerqToSonicAbi_json_1.default), perqSdk.signer);
|
|
12
|
-
}
|
|
13
|
-
async send(sendParam, fee, refundAddress, overrides) {
|
|
14
|
-
if (!this.contract.signer) {
|
|
15
|
-
throw Error('No signer provided');
|
|
16
|
-
}
|
|
17
|
-
// Convert the parameters to the format expected by the contract
|
|
18
|
-
const sendParamTuple = [
|
|
19
|
-
sendParam.dstEid,
|
|
20
|
-
sendParam.to,
|
|
21
|
-
sendParam.amountLD,
|
|
22
|
-
sendParam.minAmountLD,
|
|
23
|
-
sendParam.extraOptions,
|
|
24
|
-
sendParam.composeMsg,
|
|
25
|
-
sendParam.oftCmd,
|
|
26
|
-
];
|
|
27
|
-
const feeTuple = [fee.nativeFee, fee.lzTokenFee];
|
|
28
|
-
return await this.contract.send(sendParamTuple, feeTuple, refundAddress, overrides);
|
|
29
|
-
}
|
|
30
|
-
// Used for getting the fee estimation for the send operation
|
|
31
|
-
async quoteSend(sendParam, payInLzToken) {
|
|
32
|
-
const sendParamTuple = [
|
|
33
|
-
sendParam.dstEid,
|
|
34
|
-
sendParam.to,
|
|
35
|
-
sendParam.amountLD,
|
|
36
|
-
sendParam.minAmountLD,
|
|
37
|
-
sendParam.extraOptions,
|
|
38
|
-
sendParam.composeMsg,
|
|
39
|
-
sendParam.oftCmd,
|
|
40
|
-
];
|
|
41
|
-
const result = await this.contract.quoteSend(sendParamTuple, payInLzToken);
|
|
42
|
-
return {
|
|
43
|
-
nativeFee: result.nativeFee,
|
|
44
|
-
lzTokenFee: result.lzTokenFee,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.default = BridgeMainnetPerqToSonicContract;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ContractTransaction, ethers } from 'ethers';
|
|
2
|
-
import BaseContract from './BaseContract';
|
|
3
|
-
import PerqSdk from '../PerqSdk';
|
|
4
|
-
import { MessagingFee, SendParam } from '../types/BridgePerq';
|
|
5
|
-
export default class BridgeSonicPerqToMainnetContract extends BaseContract {
|
|
6
|
-
constructor(perqSdk: PerqSdk);
|
|
7
|
-
send(sendParam: SendParam, fee: MessagingFee, refundAddress: string, overrides?: ethers.PayableOverrides): Promise<ContractTransaction>;
|
|
8
|
-
quoteSend(sendParam: SendParam, payInLzToken: boolean): Promise<MessagingFee>;
|
|
9
|
-
}
|
|
@@ -1,47 +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
|
-
const ethers_1 = require("ethers");
|
|
7
|
-
const BridgeSonicPerqToMainnetAbi_json_1 = __importDefault(require("../abi/perq/BridgeSonicPerqToMainnetAbi.json"));
|
|
8
|
-
const BaseContract_1 = __importDefault(require("./BaseContract"));
|
|
9
|
-
class BridgeSonicPerqToMainnetContract extends BaseContract_1.default {
|
|
10
|
-
constructor(perqSdk) {
|
|
11
|
-
super(perqSdk.perqConfig.bridgeSonicPerqToMainnetAddress, new ethers_1.ethers.utils.Interface(BridgeSonicPerqToMainnetAbi_json_1.default), perqSdk.signer);
|
|
12
|
-
}
|
|
13
|
-
async send(sendParam, fee, refundAddress, overrides) {
|
|
14
|
-
if (!this.contract.signer) {
|
|
15
|
-
throw Error('No signer provided');
|
|
16
|
-
}
|
|
17
|
-
const sendParamTuple = [
|
|
18
|
-
sendParam.dstEid,
|
|
19
|
-
sendParam.to,
|
|
20
|
-
sendParam.amountLD,
|
|
21
|
-
sendParam.minAmountLD,
|
|
22
|
-
sendParam.extraOptions,
|
|
23
|
-
sendParam.composeMsg,
|
|
24
|
-
sendParam.oftCmd,
|
|
25
|
-
];
|
|
26
|
-
const feeTuple = [fee.nativeFee, fee.lzTokenFee];
|
|
27
|
-
return await this.contract.send(sendParamTuple, feeTuple, refundAddress, overrides);
|
|
28
|
-
}
|
|
29
|
-
// Used for getting the fee estimation for the send operation
|
|
30
|
-
async quoteSend(sendParam, payInLzToken) {
|
|
31
|
-
const sendParamTuple = [
|
|
32
|
-
sendParam.dstEid,
|
|
33
|
-
sendParam.to,
|
|
34
|
-
sendParam.amountLD,
|
|
35
|
-
sendParam.minAmountLD,
|
|
36
|
-
sendParam.extraOptions,
|
|
37
|
-
sendParam.composeMsg,
|
|
38
|
-
sendParam.oftCmd,
|
|
39
|
-
];
|
|
40
|
-
const result = await this.contract.quoteSend(sendParamTuple, payInLzToken);
|
|
41
|
-
return {
|
|
42
|
-
nativeFee: result.nativeFee,
|
|
43
|
-
lzTokenFee: result.lzTokenFee,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.default = BridgeSonicPerqToMainnetContract;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BigNumber, BigNumberish, ethers, Signer } from 'ethers';
|
|
2
|
-
export default class ERC20TokenContract {
|
|
3
|
-
address: string;
|
|
4
|
-
contract: ethers.Contract;
|
|
5
|
-
constructor(address: string, signer: Signer);
|
|
6
|
-
getPrecission(): Promise<number>;
|
|
7
|
-
getAllowance(owner: string, spender: string): Promise<BigNumber>;
|
|
8
|
-
approveToken(spender: string, parsedAmount: BigNumberish): Promise<string>;
|
|
9
|
-
transfer(receiver: string, parsedAmount: string): Promise<string>;
|
|
10
|
-
}
|
|
@@ -1,34 +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
|
-
const ethers_1 = require("ethers");
|
|
7
|
-
const ERC20_json_1 = __importDefault(require("../abi/ERC20.json"));
|
|
8
|
-
class ERC20TokenContract {
|
|
9
|
-
address;
|
|
10
|
-
contract;
|
|
11
|
-
constructor(address, signer) {
|
|
12
|
-
this.address = address;
|
|
13
|
-
this.contract = new ethers_1.ethers.Contract(address, ERC20_json_1.default, signer);
|
|
14
|
-
}
|
|
15
|
-
async getPrecission() {
|
|
16
|
-
const decimals = await this.contract.decimals();
|
|
17
|
-
return decimals;
|
|
18
|
-
}
|
|
19
|
-
async getAllowance(owner, spender) {
|
|
20
|
-
const allowance = await this.contract.allowance(owner, spender);
|
|
21
|
-
return allowance;
|
|
22
|
-
}
|
|
23
|
-
async approveToken(spender, parsedAmount) {
|
|
24
|
-
const tx = await this.contract.approve(spender, parsedAmount);
|
|
25
|
-
const txHash = (await tx.wait()).hash;
|
|
26
|
-
return txHash;
|
|
27
|
-
}
|
|
28
|
-
async transfer(receiver, parsedAmount) {
|
|
29
|
-
const tx = await this.contract.transfer(receiver, parsedAmount);
|
|
30
|
-
const txHash = (await tx.wait()).hash;
|
|
31
|
-
return txHash;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.default = ERC20TokenContract;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ContractTransaction } from 'ethers';
|
|
2
|
-
import BaseContract from './BaseContract';
|
|
3
|
-
import PerqSdk from '../PerqSdk';
|
|
4
|
-
export default class SlotBurnTokenContract extends BaseContract {
|
|
5
|
-
constructor(perqSdk: PerqSdk);
|
|
6
|
-
deposit(tokenAddress: string, amount: string): Promise<ContractTransaction>;
|
|
7
|
-
depositNative(amount: string): Promise<ContractTransaction>;
|
|
8
|
-
}
|
|
@@ -1,26 +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
|
-
const ethers_1 = require("ethers");
|
|
7
|
-
const SlotBurnTokenAbi_json_1 = __importDefault(require("../abi/SlotBurnTokenAbi.json"));
|
|
8
|
-
const BaseContract_1 = __importDefault(require("./BaseContract"));
|
|
9
|
-
class SlotBurnTokenContract extends BaseContract_1.default {
|
|
10
|
-
constructor(perqSdk) {
|
|
11
|
-
super(perqSdk.perqConfig.slotBurnTokenAddress, new ethers_1.ethers.utils.Interface(SlotBurnTokenAbi_json_1.default), perqSdk.signer);
|
|
12
|
-
}
|
|
13
|
-
async deposit(tokenAddress, amount) {
|
|
14
|
-
if (!this.contract.signer) {
|
|
15
|
-
throw Error('No signer provided');
|
|
16
|
-
}
|
|
17
|
-
return await this.contract.deposit(tokenAddress, amount.toString());
|
|
18
|
-
}
|
|
19
|
-
async depositNative(amount) {
|
|
20
|
-
if (!this.contract.signer) {
|
|
21
|
-
throw Error('No signer provided');
|
|
22
|
-
}
|
|
23
|
-
return await this.contract.depositNative({ value: amount.toString() });
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.default = SlotBurnTokenContract;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import BaseContract from './BaseContract';
|
|
2
|
-
import BridgeMainnetPerqToSonicContract from './BridgeMainnetPerqToSonicContract';
|
|
3
|
-
import BridgeSonicPerqToMainnetContract from './BridgeSonicPerqToMainnetContract';
|
|
4
|
-
import SlotBurnTokenContract from './SlotBurnTokenContract';
|
|
5
|
-
import PerqSwapAndRecyclerContract from './perq/PerqSwapAndRecyclerContract';
|
|
6
|
-
import PerqTokenRecyclerContract from './perq/PerqTokenRecyclerContract';
|
|
7
|
-
import PerqTokenContract from './perq/PerqTokenContract';
|
|
8
|
-
import PerqVestingContract from './perq/PerqVestingContract';
|
|
9
|
-
export { BaseContract, BridgeMainnetPerqToSonicContract, BridgeSonicPerqToMainnetContract, PerqSwapAndRecyclerContract, PerqTokenRecyclerContract, PerqTokenContract, PerqVestingContract, SlotBurnTokenContract, };
|
package/dist/contracts/index.js
DELETED
|
@@ -1,22 +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.SlotBurnTokenContract = exports.PerqVestingContract = exports.PerqTokenContract = exports.PerqTokenRecyclerContract = exports.PerqSwapAndRecyclerContract = exports.BridgeSonicPerqToMainnetContract = exports.BridgeMainnetPerqToSonicContract = exports.BaseContract = void 0;
|
|
7
|
-
const BaseContract_1 = __importDefault(require("./BaseContract"));
|
|
8
|
-
exports.BaseContract = BaseContract_1.default;
|
|
9
|
-
const BridgeMainnetPerqToSonicContract_1 = __importDefault(require("./BridgeMainnetPerqToSonicContract"));
|
|
10
|
-
exports.BridgeMainnetPerqToSonicContract = BridgeMainnetPerqToSonicContract_1.default;
|
|
11
|
-
const BridgeSonicPerqToMainnetContract_1 = __importDefault(require("./BridgeSonicPerqToMainnetContract"));
|
|
12
|
-
exports.BridgeSonicPerqToMainnetContract = BridgeSonicPerqToMainnetContract_1.default;
|
|
13
|
-
const SlotBurnTokenContract_1 = __importDefault(require("./SlotBurnTokenContract"));
|
|
14
|
-
exports.SlotBurnTokenContract = SlotBurnTokenContract_1.default;
|
|
15
|
-
const PerqSwapAndRecyclerContract_1 = __importDefault(require("./perq/PerqSwapAndRecyclerContract"));
|
|
16
|
-
exports.PerqSwapAndRecyclerContract = PerqSwapAndRecyclerContract_1.default;
|
|
17
|
-
const PerqTokenRecyclerContract_1 = __importDefault(require("./perq/PerqTokenRecyclerContract"));
|
|
18
|
-
exports.PerqTokenRecyclerContract = PerqTokenRecyclerContract_1.default;
|
|
19
|
-
const PerqTokenContract_1 = __importDefault(require("./perq/PerqTokenContract"));
|
|
20
|
-
exports.PerqTokenContract = PerqTokenContract_1.default;
|
|
21
|
-
const PerqVestingContract_1 = __importDefault(require("./perq/PerqVestingContract"));
|
|
22
|
-
exports.PerqVestingContract = PerqVestingContract_1.default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ContractTransaction } from 'ethers';
|
|
2
|
-
import BaseContract from '../BaseContract';
|
|
3
|
-
import PerqSdk from '../../PerqSdk';
|
|
4
|
-
export default class PerqSwapAndRecyclerContract extends BaseContract {
|
|
5
|
-
constructor(perqSdk: PerqSdk);
|
|
6
|
-
swapAndRecycle(beneficiary: string | undefined, path: string[], amountInWithDecimals: string, minAmountOutWithDecimals: string, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
|
7
|
-
swapETHAndRecycle(beneficiary: string | undefined, path: string[], minAmountOutWithDecimals: string, amountInEth: string, price: string, deadline: string, signature: string): Promise<ContractTransaction>;
|
|
8
|
-
}
|
|
@@ -1,28 +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
|
-
const ethers_1 = require("ethers");
|
|
7
|
-
const PerqSwapAndRecyclerAbi_json_1 = __importDefault(require("../../abi/perq/PerqSwapAndRecyclerAbi.json"));
|
|
8
|
-
const BaseContract_1 = __importDefault(require("../BaseContract"));
|
|
9
|
-
class PerqSwapAndRecyclerContract extends BaseContract_1.default {
|
|
10
|
-
constructor(perqSdk) {
|
|
11
|
-
super(perqSdk.perqConfig.perqSwapAndRecyclerAddress, new ethers_1.ethers.utils.Interface(PerqSwapAndRecyclerAbi_json_1.default), perqSdk.signer);
|
|
12
|
-
}
|
|
13
|
-
async swapAndRecycle(beneficiary = ethers_1.ethers.constants.AddressZero, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature) {
|
|
14
|
-
if (!this.contract.signer) {
|
|
15
|
-
throw Error('No signer provided');
|
|
16
|
-
}
|
|
17
|
-
return await this.contract.swapAndRecycle(beneficiary, path, amountInWithDecimals, minAmountOutWithDecimals, price, deadline, signature);
|
|
18
|
-
}
|
|
19
|
-
async swapETHAndRecycle(beneficiary = ethers_1.ethers.constants.AddressZero, path, minAmountOutWithDecimals, amountInEth, price, deadline, signature) {
|
|
20
|
-
if (!this.contract.signer) {
|
|
21
|
-
throw Error('No signer provided');
|
|
22
|
-
}
|
|
23
|
-
return await this.contract.swapETHAndRecycle(beneficiary, path, minAmountOutWithDecimals, price, deadline, signature, {
|
|
24
|
-
value: amountInEth,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.default = PerqSwapAndRecyclerContract;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BigNumber, ContractTransaction, ethers } from 'ethers';
|
|
2
|
-
import BaseContract from '../BaseContract';
|
|
3
|
-
export default class PerqTokenContract extends BaseContract {
|
|
4
|
-
constructor(address: string, signer?: ethers.Signer);
|
|
5
|
-
getAllowance(spender: string): Promise<BigNumber>;
|
|
6
|
-
approve(spender: string, amount: BigNumber): Promise<ContractTransaction>;
|
|
7
|
-
}
|
|
@@ -1,26 +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
|
-
const ethers_1 = require("ethers");
|
|
7
|
-
const PerqTokenAbi_json_1 = __importDefault(require("../../abi/perq/PerqTokenAbi.json"));
|
|
8
|
-
const BaseContract_1 = __importDefault(require("../BaseContract"));
|
|
9
|
-
class PerqTokenContract extends BaseContract_1.default {
|
|
10
|
-
constructor(address, signer) {
|
|
11
|
-
super(address, new ethers_1.ethers.utils.Interface(PerqTokenAbi_json_1.default), signer);
|
|
12
|
-
}
|
|
13
|
-
async getAllowance(spender) {
|
|
14
|
-
if (!this.contract.signer) {
|
|
15
|
-
throw Error('No signer provided');
|
|
16
|
-
}
|
|
17
|
-
return await this.contract.allowance(await this.contract.signer.getAddress(), spender);
|
|
18
|
-
}
|
|
19
|
-
async approve(spender, amount) {
|
|
20
|
-
if (!this.contract.signer) {
|
|
21
|
-
throw Error('No signer provided');
|
|
22
|
-
}
|
|
23
|
-
return await this.contract.approve(spender, amount.toString());
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.default = PerqTokenContract;
|