hedge-web3 0.1.23 → 0.1.27
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/declarations/Constants.d.ts +3 -3
- package/declarations/idl/vault.d.ts +889 -752
- package/declarations/instructions/closeLiquidationPoolPosition.d.ts +1 -1
- package/declarations/instructions/createVault.d.ts +1 -1
- package/declarations/instructions/depositLiquidationPool.d.ts +1 -1
- package/declarations/instructions/depositVault.d.ts +1 -1
- package/declarations/instructions/liquidateVault.d.ts +1 -1
- package/declarations/instructions/loanVault.d.ts +1 -1
- package/declarations/instructions/redeemVault.d.ts +1 -1
- package/declarations/instructions/repayVault.d.ts +1 -1
- package/declarations/instructions/withdrawVault.d.ts +1 -1
- package/declarations/state/LiquidationPosition.d.ts +2 -2
- package/declarations/state/StakingPool.d.ts +1 -1
- package/declarations/state/StakingPoolPosition.d.ts +2 -2
- package/declarations/state/VaultAccount.d.ts +3 -3
- package/declarations/state/VaultHistoryEvent.d.ts +2 -2
- package/lib/Constants.js +10 -10
- package/lib/idl/vault.js +922 -785
- package/lib/instructions/closeLiquidationPoolPosition.js +9 -9
- package/lib/instructions/createStakingPool.js +4 -4
- package/lib/instructions/createVault.js +11 -11
- package/lib/instructions/depositLiquidationPool.js +9 -9
- package/lib/instructions/depositVault.js +8 -8
- package/lib/instructions/initHedgeFoundation.js +4 -4
- package/lib/instructions/liquidateVault.js +9 -9
- package/lib/instructions/loanVault.js +9 -9
- package/lib/instructions/redeemVault.js +10 -10
- package/lib/instructions/repayVault.js +10 -10
- package/lib/instructions/withdrawStakingPool.js +6 -6
- package/lib/instructions/withdrawVault.js +8 -8
- package/lib/state/LiquidationPosition.js +2 -2
- package/lib/state/StakingPool.js +1 -1
- package/lib/state/StakingPoolPosition.js +3 -3
- package/lib/state/VaultAccount.js +2 -2
- package/lib/state/VaultHistoryEvent.js +2 -2
- package/lib/utils/Errors.js +2 -2
- package/package.json +8 -9
- package/src/Constants.ts +73 -31
- package/src/idl/vault.ts +1848 -1574
- package/src/instructions/closeLiquidationPoolPosition.ts +10 -10
- package/src/instructions/createStakingPool.ts +5 -5
- package/src/instructions/createVault.ts +17 -17
- package/src/instructions/depositLiquidationPool.ts +10 -10
- package/src/instructions/depositVault.ts +12 -12
- package/src/instructions/initHedgeFoundation.ts +5 -5
- package/src/instructions/initHedgeFoundationTokens.ts +1 -1
- package/src/instructions/liquidateVault.ts +10 -10
- package/src/instructions/loanVault.ts +11 -11
- package/src/instructions/redeemVault.ts +12 -12
- package/src/instructions/repayVault.ts +12 -12
- package/src/instructions/setHalted.ts +1 -1
- package/src/instructions/withdrawStakingPool.ts +7 -7
- package/src/instructions/withdrawVault.ts +12 -12
- package/src/state/LiquidationPosition.ts +3 -3
- package/src/state/StakingPool.ts +2 -6
- package/src/state/StakingPoolPosition.ts +4 -4
- package/src/state/VaultAccount.ts +3 -3
- package/src/state/VaultHistoryEvent.ts +4 -4
- package/src/utils/Errors.ts +2 -2
- package/declarations/idl/idl.d.ts +0 -2
- package/lib/idl/idl.js +0 -1475
- package/src/idl/idl.ts +0 -1474
@@ -1,7 +1,7 @@
|
|
1
1
|
import { BN, Program, Provider } from '@project-serum/anchor'
|
2
2
|
import { getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token'
|
3
3
|
import { Keypair, PublicKey, sendAndConfirmTransaction, Signer, SystemProgram, Transaction, TransactionInstruction } from '@solana/web3.js'
|
4
|
-
import { findAssociatedTokenAddress, getHedgeMintPublicKey, getPoolPublicKeyForMint, getVaultTypeAccountPublicKey,
|
4
|
+
import { findAssociatedTokenAddress, getHedgeMintPublicKey, getPoolPublicKeyForMint, getVaultTypeAccountPublicKey, getUshMintPublicKey, getVaultSystemStatePublicKey } from '../Constants'
|
5
5
|
|
6
6
|
export async function repayVault (
|
7
7
|
program: Program,
|
@@ -11,10 +11,10 @@ export async function repayVault (
|
|
11
11
|
repayAmount: number,
|
12
12
|
overrideTime?: number
|
13
13
|
): Promise<PublicKey> {
|
14
|
-
const
|
14
|
+
const ushMintPublickey = await getUshMintPublicKey()
|
15
15
|
|
16
|
-
// Prep the user to get
|
17
|
-
const
|
16
|
+
// Prep the user to get USH back out at some point
|
17
|
+
const payerUshAccount = await getOrCreateAssociatedTokenAccount(provider.connection, payer, ushMintPublickey, payer.publicKey)
|
18
18
|
const vaultAccount = await program.account.vault.fetch(vaultPublicKey)
|
19
19
|
|
20
20
|
const vaultTypeAccountPublicKey = await getVaultTypeAccountPublicKey(vaultAccount.collateralType)
|
@@ -27,7 +27,7 @@ export async function repayVault (
|
|
27
27
|
await repayVaultInstruction(
|
28
28
|
program,
|
29
29
|
payer.publicKey,
|
30
|
-
|
30
|
+
payerUshAccount.address,
|
31
31
|
vaultPublicKey,
|
32
32
|
vaultAssociatedTokenAccount,
|
33
33
|
history.publicKey,
|
@@ -44,7 +44,7 @@ export async function repayVault (
|
|
44
44
|
export async function repayVaultInstruction (
|
45
45
|
program: Program,
|
46
46
|
payerPublicKey: PublicKey,
|
47
|
-
|
47
|
+
ownerUshAccount: PublicKey,
|
48
48
|
vaultPublickey: PublicKey,
|
49
49
|
vaultAssociatedTokenAccount: PublicKey,
|
50
50
|
historyPublicKey: PublicKey,
|
@@ -54,12 +54,12 @@ export async function repayVaultInstruction (
|
|
54
54
|
overrideTime?: number
|
55
55
|
): Promise<TransactionInstruction> {
|
56
56
|
const vaultSystemStatePublicKey = await getVaultSystemStatePublicKey()
|
57
|
-
const
|
57
|
+
const ushMintPublickey = await getUshMintPublicKey()
|
58
58
|
const hedgeMintPublickey = await getHedgeMintPublicKey()
|
59
59
|
const [hedgeStakingPoolPublicKey] = await getPoolPublicKeyForMint(hedgeMintPublickey)
|
60
|
-
const
|
60
|
+
const hedgeStakingPoolAssociatedUshTokenAccount = await findAssociatedTokenAddress(
|
61
61
|
hedgeStakingPoolPublicKey,
|
62
|
-
|
62
|
+
ushMintPublickey
|
63
63
|
)
|
64
64
|
|
65
65
|
return program.instruction.repayVault(
|
@@ -74,10 +74,10 @@ export async function repayVaultInstruction (
|
|
74
74
|
vaultAssociatedTokenAccount: vaultAssociatedTokenAccount,
|
75
75
|
history: historyPublicKey,
|
76
76
|
feePool: hedgeStakingPoolPublicKey,
|
77
|
-
|
78
|
-
|
77
|
+
feePoolAssociatedUshTokenAccount: hedgeStakingPoolAssociatedUshTokenAccount,
|
78
|
+
ushMint: ushMintPublickey,
|
79
79
|
vaultOwner: payerPublicKey,
|
80
|
-
|
80
|
+
ownerUshAccount: ownerUshAccount,
|
81
81
|
tokenProgram: TOKEN_PROGRAM_ID,
|
82
82
|
systemProgram: SystemProgram.programId
|
83
83
|
},
|
@@ -2,7 +2,7 @@ import { BN, Program, Provider } from '@project-serum/anchor'
|
|
2
2
|
import { TokenInstructions } from '@project-serum/serum'
|
3
3
|
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, getOrCreateAssociatedTokenAccount } from '@solana/spl-token'
|
4
4
|
import { Keypair, PublicKey, sendAndConfirmTransaction, Signer, SystemProgram, SYSVAR_RENT_PUBKEY, Transaction, TransactionInstruction } from '@solana/web3.js'
|
5
|
-
import { findAssociatedTokenAddress, findVaultAddress, getVaultTypeAccountPublicKey,
|
5
|
+
import { findAssociatedTokenAddress, findVaultAddress, getVaultTypeAccountPublicKey, getUshMintPublicKey, getVaultSystemStatePublicKey, getPoolPublicKeyForMint, getHedgeMintPublicKey } from '../Constants'
|
6
6
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid'
|
8
8
|
import { parseAnchorErrors } from '../utils/Errors'
|
@@ -2,7 +2,7 @@ import { BN, Program, Provider } from '@project-serum/anchor'
|
|
2
2
|
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token'
|
3
3
|
import { Keypair, PublicKey, sendAndConfirmTransaction, Signer, SystemProgram, SYSVAR_RENT_PUBKEY, Transaction, TransactionInstruction } from '@solana/web3.js'
|
4
4
|
import { parseAnchorErrors } from '../utils/Errors'
|
5
|
-
import { findAssociatedTokenAddress, getHedgeMintPublicKey, getPoolPublicKeyForMint,
|
5
|
+
import { findAssociatedTokenAddress, getHedgeMintPublicKey, getPoolPublicKeyForMint, getUshMintPublicKey, getVaultSystemStatePublicKey } from '../Constants'
|
6
6
|
|
7
7
|
export async function withdrawStakingPool (
|
8
8
|
program: Program,
|
@@ -34,14 +34,14 @@ export async function withdrawStakingPoolInstruction (
|
|
34
34
|
overrideStartTime?: number
|
35
35
|
): Promise<TransactionInstruction> {
|
36
36
|
const vaultSystemStatePublicKey = await getVaultSystemStatePublicKey()
|
37
|
-
const
|
37
|
+
const ushMintPublickey = await getUshMintPublicKey()
|
38
38
|
const hedgeMintPublickey = await getHedgeMintPublicKey()
|
39
39
|
const [poolPublickey] = await getPoolPublicKeyForMint(stakedTokenMintPublicKey)
|
40
40
|
const poolAssociatedStakedTokenAccount = await findAssociatedTokenAddress(poolPublickey, stakedTokenMintPublicKey)
|
41
|
-
const
|
41
|
+
const poolAssociatedUshTokenAccount = await findAssociatedTokenAddress(poolPublickey, ushMintPublickey)
|
42
42
|
const payerAssociatedStakedTokenAccount = await findAssociatedTokenAddress(payerPublicKey, stakedTokenMintPublicKey)
|
43
43
|
const payerAssociatedHedgeAccount = await findAssociatedTokenAddress(payerPublicKey, hedgeMintPublickey)
|
44
|
-
const
|
44
|
+
const payerAssociatedUshAccount = await findAssociatedTokenAddress(payerPublicKey, ushMintPublickey)
|
45
45
|
const communityHedgeTokenAccount = await findAssociatedTokenAddress(vaultSystemStatePublicKey, hedgeMintPublickey)
|
46
46
|
|
47
47
|
return program.instruction.withdrawStakingPool(
|
@@ -53,14 +53,14 @@ export async function withdrawStakingPoolInstruction (
|
|
53
53
|
pool: poolPublickey,
|
54
54
|
poolPosition: poolPositionPublicKey,
|
55
55
|
poolAssociatedStakedTokenAccount: poolAssociatedStakedTokenAccount,
|
56
|
-
|
56
|
+
poolAssociatedUshTokenAccount: poolAssociatedUshTokenAccount,
|
57
57
|
payerAssociatedStakedTokenAccount: payerAssociatedStakedTokenAccount,
|
58
58
|
payerAssociatedHedgeAccount: payerAssociatedHedgeAccount,
|
59
|
-
|
59
|
+
payerAssociatedUshAccount: payerAssociatedUshAccount,
|
60
60
|
communityAssociatedHedgeTokenAccount: communityHedgeTokenAccount,
|
61
61
|
hedgeMint: hedgeMintPublickey,
|
62
62
|
stakedTokenMint: stakedTokenMintPublicKey,
|
63
|
-
|
63
|
+
ushMint: ushMintPublickey,
|
64
64
|
rent: SYSVAR_RENT_PUBKEY,
|
65
65
|
tokenProgram: TOKEN_PROGRAM_ID,
|
66
66
|
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
|
@@ -2,7 +2,7 @@ import { BN, Program, Provider } from '@project-serum/anchor'
|
|
2
2
|
import { getOrCreateAssociatedTokenAccount, TOKEN_PROGRAM_ID } from '@solana/spl-token'
|
3
3
|
import { TokenInstructions } from '@project-serum/serum'
|
4
4
|
import { Keypair, PublicKey, sendAndConfirmTransaction, Signer, SystemProgram, Transaction, TransactionInstruction } from '@solana/web3.js'
|
5
|
-
import { findAssociatedTokenAddress, getVaultTypeAccountPublicKey,
|
5
|
+
import { findAssociatedTokenAddress, getVaultTypeAccountPublicKey, getUshMintPublicKey, getVaultSystemStatePublicKey, getPoolPublicKeyForMint, getHedgeMintPublicKey } from '../Constants'
|
6
6
|
|
7
7
|
export async function withdrawVault (
|
8
8
|
program: Program,
|
@@ -12,10 +12,10 @@ export async function withdrawVault (
|
|
12
12
|
withdrawAmount: number,
|
13
13
|
overrideTime?: number
|
14
14
|
): Promise<PublicKey> {
|
15
|
-
const
|
15
|
+
const ushMintPublickey = await getUshMintPublicKey()
|
16
16
|
|
17
|
-
// Prep the user to get
|
18
|
-
await getOrCreateAssociatedTokenAccount(provider.connection, payer,
|
17
|
+
// Prep the user to get USH back out at some point
|
18
|
+
await getOrCreateAssociatedTokenAccount(provider.connection, payer, ushMintPublickey, payer.publicKey)
|
19
19
|
|
20
20
|
const history = Keypair.generate()
|
21
21
|
const vaultSystemStatePublicKey = await getVaultSystemStatePublicKey()
|
@@ -28,9 +28,9 @@ export async function withdrawVault (
|
|
28
28
|
|
29
29
|
const destinationTokenAccount = await getOrCreateAssociatedTokenAccount(provider.connection, payer, vaultTypeAccountInfo.collateralMint, payer.publicKey)
|
30
30
|
const [hedgeStakingPoolPublicKey] = await getPoolPublicKeyForMint(await getHedgeMintPublicKey())
|
31
|
-
const
|
31
|
+
const hedgeStakingPoolAssociatedUshTokenAccount = await findAssociatedTokenAddress(
|
32
32
|
hedgeStakingPoolPublicKey,
|
33
|
-
|
33
|
+
ushMintPublickey
|
34
34
|
)
|
35
35
|
|
36
36
|
const transaction = new Transaction().add(
|
@@ -44,8 +44,8 @@ export async function withdrawVault (
|
|
44
44
|
vaultTypeAccount,
|
45
45
|
vaultTypeAssociatedTokenAccount.address,
|
46
46
|
hedgeStakingPoolPublicKey,
|
47
|
-
|
48
|
-
|
47
|
+
hedgeStakingPoolAssociatedUshTokenAccount,
|
48
|
+
ushMintPublickey,
|
49
49
|
history.publicKey,
|
50
50
|
withdrawAmount,
|
51
51
|
overrideTime
|
@@ -65,8 +65,8 @@ export async function withdrawVaultInstruction (
|
|
65
65
|
vaultTypeAccount: PublicKey,
|
66
66
|
vaultTypeAssociatedTokenAccount: PublicKey,
|
67
67
|
hedgeStakingPoolPublicKey: PublicKey,
|
68
|
-
|
69
|
-
|
68
|
+
hedgeStakingPoolAssociatedUshTokenAccount: PublicKey,
|
69
|
+
ushMint: PublicKey,
|
70
70
|
historyPublicKey: PublicKey,
|
71
71
|
withdrawAmount: number,
|
72
72
|
overrideTime?: number
|
@@ -82,8 +82,8 @@ export async function withdrawVaultInstruction (
|
|
82
82
|
vault: vaultPublickey,
|
83
83
|
vaultAssociatedTokenAccount: vaultAssociatedCollateralPublicKey,
|
84
84
|
feePool: hedgeStakingPoolPublicKey,
|
85
|
-
|
86
|
-
|
85
|
+
feePoolAssociatedUshTokenAccount: hedgeStakingPoolAssociatedUshTokenAccount,
|
86
|
+
ushMint: ushMint,
|
87
87
|
history: historyPublicKey,
|
88
88
|
vaultOwner: payerPublicKey,
|
89
89
|
destinationTokenAccount: destinationTokenAccount,
|
@@ -11,7 +11,7 @@ export class LiquidationPosition {
|
|
11
11
|
|
12
12
|
public ownerAccount: PublicKey
|
13
13
|
public deposit: number
|
14
|
-
public
|
14
|
+
public closedUsh: number
|
15
15
|
public timestampOpened: Date
|
16
16
|
public timestampClosed: Date
|
17
17
|
|
@@ -27,7 +27,7 @@ export class LiquidationPosition {
|
|
27
27
|
this.eraPublicKey = poolPositionInfo.era
|
28
28
|
this.ownerAccount = poolPositionInfo.ownerAccount
|
29
29
|
this.deposit = poolPositionInfo.deposit.toNumber()
|
30
|
-
this.
|
30
|
+
this.closedUsh = poolPositionInfo.closedUsh.toNumber()
|
31
31
|
this.timestampOpened = poolPositionInfo.timestampOpened.toNumber()
|
32
32
|
this.timestampClosed = poolPositionInfo.timestampClosed.toNumber()
|
33
33
|
|
@@ -40,7 +40,7 @@ export class LiquidationPosition {
|
|
40
40
|
console.log("poolPositionInfo.state, poolPositionInfo.state")
|
41
41
|
}
|
42
42
|
|
43
|
-
public
|
43
|
+
public getUshAvailable (era: LiquidationPoolEra): Decimal {
|
44
44
|
return (era.product.div(this.productSnapshotEntry)).mul(new Decimal(this.deposit))
|
45
45
|
}
|
46
46
|
|
package/src/state/StakingPool.ts
CHANGED
@@ -12,7 +12,7 @@ export class StakingPool {
|
|
12
12
|
totalHedgeReward: number
|
13
13
|
|
14
14
|
hedgeRewardAccumulator: Decimal
|
15
|
-
|
15
|
+
ushFeeAccumulator: Decimal
|
16
16
|
collateralFeeAccumulator: [Decimal]
|
17
17
|
|
18
18
|
constructor (public poolInfo: any, publicKey: PublicKey) {
|
@@ -26,13 +26,9 @@ export class StakingPool {
|
|
26
26
|
this.totalHedgeReward = poolInfo.totalHedgeReward.toNumber()
|
27
27
|
|
28
28
|
this.hedgeRewardAccumulator = DecimalFromU128(poolInfo.hedgeRewardAccumulator)
|
29
|
-
this.
|
29
|
+
this.ushFeeAccumulator = DecimalFromU128(poolInfo.ushFeeAccumulator)
|
30
30
|
this.collateralFeeAccumulator = poolInfo.collateralFeeAccumulator.map((sum: any) => { return DecimalFromU128(sum) })
|
31
31
|
// this.currentRewardsPerDay = DecimalFromU128(poolInfo.currentRewardsPerDay)
|
32
32
|
}
|
33
33
|
|
34
|
-
// updateFeeAccumulator () {
|
35
|
-
// this.feeAccumulator = (this.totalFeesNow - this.totalFeesPrevious) / this.deposits
|
36
|
-
// this.totalFeesPrevious = this.totalFeesNow
|
37
|
-
// }
|
38
34
|
}
|
@@ -13,7 +13,7 @@ export class StakingPoolPosition {
|
|
13
13
|
public timestampClosed: number
|
14
14
|
public closedRewardedTokens: number
|
15
15
|
public startHedgeRewardAccumulator: Decimal
|
16
|
-
public
|
16
|
+
public startUshFeeAccumulator: Decimal
|
17
17
|
public startSolFeeAccumulator: Decimal
|
18
18
|
public open: boolean
|
19
19
|
|
@@ -27,13 +27,13 @@ export class StakingPoolPosition {
|
|
27
27
|
this.closedRewardedTokens = poolPositionInfo.closedRewardedTokens.toNumber()
|
28
28
|
|
29
29
|
this.startHedgeRewardAccumulator = DecimalFromU128(poolPositionInfo.startHedgeRewardAccumulator)
|
30
|
-
this.
|
30
|
+
this.startUshFeeAccumulator = DecimalFromU128(poolPositionInfo.startUshFeeAccumulator)
|
31
31
|
this.startSolFeeAccumulator = DecimalFromU128(poolPositionInfo.startSolFeeAccumulator)
|
32
32
|
|
33
33
|
this.open = poolPositionInfo.state.open !== undefined
|
34
34
|
}
|
35
35
|
|
36
|
-
public
|
37
|
-
return this.pool.
|
36
|
+
public getCurrentUshFeeReward (): Decimal {
|
37
|
+
return this.pool.ushFeeAccumulator.minus(this.startUshFeeAccumulator).times(new Decimal(this.deposited))
|
38
38
|
}
|
39
39
|
}
|
@@ -18,7 +18,7 @@ export class VaultAccount {
|
|
18
18
|
/** The deposited collateral of the vault (in SOL Lamports). */
|
19
19
|
deposited: number
|
20
20
|
|
21
|
-
/** The outstanding debt of the vault (in
|
21
|
+
/** The outstanding debt of the vault (in USH Lamports). Denormalized to time 0. */
|
22
22
|
denormalizedDebt: number
|
23
23
|
|
24
24
|
debtProductSnapshotBytes: Decimal
|
@@ -64,9 +64,9 @@ export class VaultAccount {
|
|
64
64
|
}
|
65
65
|
|
66
66
|
/**
|
67
|
-
* Get the debt value in
|
67
|
+
* Get the debt value in USH
|
68
68
|
*
|
69
|
-
* @returns debt value in
|
69
|
+
* @returns debt value in USH
|
70
70
|
*/
|
71
71
|
public inUsd (): number {
|
72
72
|
return this.denormalizedDebt / LAMPORTS_PER_SOL
|
@@ -7,8 +7,8 @@ export class VaultHistoryEvent {
|
|
7
7
|
publicKey: PublicKey
|
8
8
|
actorAccount: PublicKey
|
9
9
|
usdSolPrice: Decimal
|
10
|
-
|
11
|
-
|
10
|
+
ushDebtBefore: number
|
11
|
+
ushDebtAfter: number
|
12
12
|
collateralBalanceBefore: number
|
13
13
|
collateralBalanceAfter: number
|
14
14
|
minCollateralRatioBefore: Decimal
|
@@ -24,8 +24,8 @@ export class VaultHistoryEvent {
|
|
24
24
|
|
25
25
|
this.usdSolPrice = DecimalFromU128(account.usdSolPrice.toString())
|
26
26
|
|
27
|
-
this.
|
28
|
-
this.
|
27
|
+
this.ushDebtBefore = account.ushDebtBefore.toNumber()
|
28
|
+
this.ushDebtAfter = account.ushDebtAfter.toNumber()
|
29
29
|
this.collateralBalanceBefore = account.collateralBalanceBefore.toNumber()
|
30
30
|
this.collateralBalanceAfter = account.collateralBalanceAfter.toNumber()
|
31
31
|
this.minCollateralRatioBefore = DecimalFromU128(account.minCollateralRatioBefore)
|
package/src/utils/Errors.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { parseIdlErrors, ProgramError } from '@project-serum/anchor'
|
2
|
-
import {
|
2
|
+
import { IDL } from '../idl/vault'
|
3
3
|
|
4
4
|
export function parseAnchorErrors (error: any): void {
|
5
|
-
const idlErrors = parseIdlErrors(
|
5
|
+
const idlErrors = parseIdlErrors(IDL)
|
6
6
|
const parsedError = ProgramError.parse(error, idlErrors)
|
7
7
|
if (parsedError !== null) {
|
8
8
|
throw parsedError
|