Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update balancerPoolDataQueries to latest contract code #73

Merged
merged 15 commits into from
Jul 21, 2023
5 changes: 5 additions & 0 deletions .changeset/smooth-points-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@balancer/sdk": minor
---

The onChainPoolDataEnricher now also queries the pool rate, linearTargets as well as status of inRecoveryMode and isPaused
195 changes: 186 additions & 9 deletions src/abi/sorQueries.ts → src/abi/balancerPoolDataQueries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const sorQueriesAbi = [
export const balancerPoolDataQueriesAbi = [
{
inputs: [
{
Expand All @@ -19,7 +19,70 @@ export const sorQueriesAbi = [
},
],
name: 'getAmpForPools',
outputs: [{ internalType: 'uint256[]', name: '', type: 'uint256[]' }],
outputs: [
{
internalType: 'uint256[]',
name: '',
type: 'uint256[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address[]',
name: 'poolAddresses',
type: 'address[]',
},
],
name: 'getInRecoveryModeForPools',
outputs: [
{
internalType: 'bool[]',
name: '',
type: 'bool[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address[]',
name: 'poolAddresses',
type: 'address[]',
},
],
name: 'getIsPausedForPools',
outputs: [
{
internalType: 'bool[]',
name: '',
type: 'bool[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address[]',
name: 'poolAddresses',
type: 'address[]',
},
],
name: 'getLinearTargetsForPools',
outputs: [
{
internalType: 'uint256[][]',
name: '',
type: 'uint256[][]',
},
],
stateMutability: 'view',
type: 'function',
},
Expand Down Expand Up @@ -63,6 +126,11 @@ export const sorQueriesAbi = [
name: 'loadLinearWrappedTokenRates',
type: 'bool',
},
{
internalType: 'bool',
name: 'loadLinearTargets',
type: 'bool',
},
{
internalType: 'bool',
name: 'loadNormalizedWeights',
Expand All @@ -73,7 +141,16 @@ export const sorQueriesAbi = [
name: 'loadScalingFactors',
type: 'bool',
},
{ internalType: 'bool', name: 'loadAmps', type: 'bool' },
{
internalType: 'bool',
name: 'loadAmps',
type: 'bool',
},
{
internalType: 'bool',
name: 'loadRates',
type: 'bool',
},
{
internalType: 'uint256',
name: 'blockNumber',
Expand Down Expand Up @@ -109,8 +186,13 @@ export const sorQueriesAbi = [
name: 'ampPoolIdxs',
type: 'uint256[]',
},
{
internalType: 'uint256[]',
name: 'ratePoolIdxs',
type: 'uint256[]',
},
],
internalType: 'struct SorPoolDataQueryConfig',
internalType: 'struct PoolDataQueryConfig',
name: 'config',
type: 'tuple',
},
Expand All @@ -127,12 +209,21 @@ export const sorQueriesAbi = [
name: 'totalSupplies',
type: 'uint256[]',
},
{ internalType: 'uint256[]', name: 'swapFees', type: 'uint256[]' },
{
internalType: 'uint256[]',
name: 'swapFees',
type: 'uint256[]',
},
{
internalType: 'uint256[]',
name: 'linearWrappedTokenRates',
type: 'uint256[]',
},
{
internalType: 'uint256[][]',
name: 'linearTargets',
type: 'uint256[][]',
},
{
internalType: 'uint256[][]',
name: 'weights',
Expand All @@ -143,19 +234,105 @@ export const sorQueriesAbi = [
name: 'scalingFactors',
type: 'uint256[][]',
},
{ internalType: 'uint256[]', name: 'amps', type: 'uint256[]' },
{
internalType: 'uint256[]',
name: 'amps',
type: 'uint256[]',
},
{
internalType: 'uint256[]',
name: 'rates',
type: 'uint256[]',
},
{
internalType: 'uint256[]',
name: 'ignoreIdxs',
type: 'uint256[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{ internalType: 'bytes32[]', name: 'poolIds', type: 'bytes32[]' },
{ internalType: 'uint256', name: 'blockNumber', type: 'uint256' },
{
internalType: 'bytes32[]',
name: 'poolIds',
type: 'bytes32[]',
},
{
components: [
{
internalType: 'bool',
name: 'loadInRecoveryMode',
type: 'bool',
},
{
internalType: 'bool',
name: 'loadIsPaused',
type: 'bool',
},
],
internalType: 'struct PoolStatusQueryConfig',
name: 'config',
type: 'tuple',
},
],
name: 'getPoolStatus',
outputs: [
{
internalType: 'bool[]',
name: 'isPaused',
type: 'bool[]',
},
{
internalType: 'bool[]',
name: 'inRecoveryMode',
type: 'bool[]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes32[]',
name: 'poolIds',
type: 'bytes32[]',
},
{
internalType: 'uint256',
name: 'blockNumber',
type: 'uint256',
},
],
name: 'getPoolTokenBalancesWithUpdatesAfterBlock',
outputs: [
{ internalType: 'uint256[][]', name: '', type: 'uint256[][]' },
{
internalType: 'uint256[][]',
name: '',
type: 'uint256[][]',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address[]',
name: 'poolAddresses',
type: 'address[]',
},
],
name: 'getRateForPools',
outputs: [
{
internalType: 'uint256[]',
name: '',
type: 'uint256[]',
},
],
stateMutability: 'view',
type: 'function',
Expand Down
2 changes: 1 addition & 1 deletion src/abi/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './vault';
export * from './balancerQueries';
export * from './sorQueries';
export * from './balancerPoolDataQueries';
export * from './erc20';
export * from './tokenRates';
Loading
Loading