@evergonlabs/tmi-protocol-api 0.1.3 → 0.1.5
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/dist/app.d.ts +31 -3
- package/dist/app.d.ts.map +1 -1
- package/dist/client.d.ts +41 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/common/abis/erc20Whitelisted.d.ts +14 -7
- package/dist/common/abis/erc20Whitelisted.d.ts.map +1 -1
- package/dist/common/abis/erc20Whitelisted.js +8 -3
- package/dist/common/indexer/client.d.ts +140 -0
- package/dist/common/indexer/client.d.ts.map +1 -1
- package/dist/common/indexer/index.d.ts +140 -0
- package/dist/common/indexer/index.d.ts.map +1 -1
- package/dist/common/indexer/schemas.d.ts +70 -0
- package/dist/common/indexer/schemas.d.ts.map +1 -1
- package/dist/fractions/activity/searchActivity.route.d.ts +45 -9
- package/dist/fractions/activity/searchActivity.route.d.ts.map +1 -1
- package/dist/fractions/activity/searchActivity.route.js +1 -3
- package/dist/fractions/activity/utils.d.ts +91 -15
- package/dist/fractions/activity/utils.d.ts.map +1 -1
- package/dist/fractions/activity/utils.js +12 -3
- package/dist/fractions/index.d.ts +31 -3
- package/dist/fractions/index.d.ts.map +1 -1
- package/dist/fractions/index.js +2 -0
- package/dist/fractions/sales/searchActivity.route.js +2 -2
- package/dist/{src/staking/stakes/searchStakeEvents/v0/searchStakeEvents.d.ts → fractions/sales/searchClaim.route.d.ts} +14 -15
- package/dist/fractions/sales/searchClaim.route.d.ts.map +1 -0
- package/dist/fractions/sales/searchClaim.route.js +47 -0
- package/dist/fractions/sales/searchPurchase.route.d.ts +120 -0
- package/dist/fractions/sales/searchPurchase.route.d.ts.map +1 -0
- package/dist/fractions/sales/searchPurchase.route.js +70 -0
- package/dist/fractions/sales/searchSaleEvents/v0/searchSaleEvents.js +6 -6
- package/dist/fractions/sales/vesting/v0/claimStatistics.route.d.ts +92 -0
- package/dist/fractions/sales/vesting/v0/claimStatistics.route.d.ts.map +1 -0
- package/dist/fractions/sales/vesting/v0/claimStatistics.route.js +89 -0
- package/dist/general/balanceClient.d.ts +21 -5
- package/dist/general/balanceClient.d.ts.map +1 -1
- package/dist/general/balanceClient.js +7 -1
- package/dist/general/utils/tokenBalance/tokenBalance.d.ts +19 -3
- package/dist/general/utils/tokenBalance/tokenBalance.d.ts.map +1 -1
- package/dist/general/utils/tokenBalance/tokenBalance.js +8 -3
- package/package.json +7 -7
- package/dist/package.json +0 -78
- package/dist/src/app.d.ts +0 -2194
- package/dist/src/app.d.ts.map +0 -1
- package/dist/src/app.js +0 -18
- package/dist/src/client.d.ts +0 -2690
- package/dist/src/client.d.ts.map +0 -1
- package/dist/src/client.js +0 -4
- package/dist/src/common/abis/erc20Whitelisted.d.ts +0 -4
- package/dist/src/common/abis/erc20Whitelisted.d.ts.map +0 -1
- package/dist/src/common/abis/erc20Whitelisted.js +0 -4
- package/dist/src/common/app.d.ts +0 -9
- package/dist/src/common/app.d.ts.map +0 -1
- package/dist/src/common/app.js +0 -3
- package/dist/src/common/blockchain.d.ts +0 -9528
- package/dist/src/common/blockchain.d.ts.map +0 -1
- package/dist/src/common/blockchain.js +0 -40
- package/dist/src/common/config.d.ts +0 -21
- package/dist/src/common/config.d.ts.map +0 -1
- package/dist/src/common/config.js +0 -33
- package/dist/src/common/http-error.d.ts +0 -7
- package/dist/src/common/http-error.d.ts.map +0 -1
- package/dist/src/common/http-error.js +0 -7
- package/dist/src/common/index.d.ts +0 -2
- package/dist/src/common/index.d.ts.map +0 -1
- package/dist/src/common/index.js +0 -1
- package/dist/src/common/indexer/client.d.ts +0 -1191
- package/dist/src/common/indexer/client.d.ts.map +0 -1
- package/dist/src/common/indexer/client.js +0 -7
- package/dist/src/common/indexer/index.d.ts +0 -1191
- package/dist/src/common/indexer/index.d.ts.map +0 -1
- package/dist/src/common/indexer/index.js +0 -3
- package/dist/src/common/indexer/schemas.d.ts +0 -1191
- package/dist/src/common/indexer/schemas.d.ts.map +0 -1
- package/dist/src/common/indexer/schemas.js +0 -14
- package/dist/src/common/models/chainId.d.ts +0 -5
- package/dist/src/common/models/chainId.d.ts.map +0 -1
- package/dist/src/common/models/chainId.js +0 -23
- package/dist/src/common/models/date.d.ts +0 -3
- package/dist/src/common/models/date.d.ts.map +0 -1
- package/dist/src/common/models/date.js +0 -5
- package/dist/src/common/models/erc721.d.ts +0 -15
- package/dist/src/common/models/erc721.d.ts.map +0 -1
- package/dist/src/common/models/erc721.js +0 -21
- package/dist/src/common/models/index.d.ts +0 -7
- package/dist/src/common/models/index.d.ts.map +0 -1
- package/dist/src/common/models/index.js +0 -6
- package/dist/src/common/models/page.d.ts +0 -12
- package/dist/src/common/models/page.d.ts.map +0 -1
- package/dist/src/common/models/page.js +0 -15
- package/dist/src/common/models/percent.d.ts +0 -3
- package/dist/src/common/models/percent.d.ts.map +0 -1
- package/dist/src/common/models/percent.js +0 -6
- package/dist/src/common/models/platform.d.ts +0 -4
- package/dist/src/common/models/platform.d.ts.map +0 -1
- package/dist/src/common/models/platform.js +0 -13
- package/dist/src/common/models/routes.d.ts +0 -16
- package/dist/src/common/models/routes.d.ts.map +0 -1
- package/dist/src/common/models/routes.js +0 -13
- package/dist/src/common/models/saleId.d.ts +0 -12
- package/dist/src/common/models/saleId.d.ts.map +0 -1
- package/dist/src/common/models/saleId.js +0 -6
- package/dist/src/common/models/transaction.d.ts +0 -90
- package/dist/src/common/models/transaction.d.ts.map +0 -1
- package/dist/src/common/models/transaction.js +0 -57
- package/dist/src/common/models/viem.d.ts +0 -4
- package/dist/src/common/models/viem.d.ts.map +0 -1
- package/dist/src/common/models/viem.js +0 -15
- package/dist/src/common/openapi.d.ts +0 -4
- package/dist/src/common/openapi.d.ts.map +0 -1
- package/dist/src/common/openapi.js +0 -40
- package/dist/src/common/tag.d.ts +0 -7
- package/dist/src/common/tag.d.ts.map +0 -1
- package/dist/src/common/tag.js +0 -5
- package/dist/src/common/version.d.ts +0 -2
- package/dist/src/common/version.d.ts.map +0 -1
- package/dist/src/common/version.js +0 -2
- package/dist/src/common/zod.d.ts +0 -3
- package/dist/src/common/zod.d.ts.map +0 -1
- package/dist/src/common/zod.js +0 -2
- package/dist/src/error.d.ts +0 -3
- package/dist/src/error.d.ts.map +0 -1
- package/dist/src/error.js +0 -16
- package/dist/src/fractions/approveSale/v0/approveSale.route.d.ts +0 -68
- package/dist/src/fractions/approveSale/v0/approveSale.route.d.ts.map +0 -1
- package/dist/src/fractions/approveSale/v0/approveSale.route.js +0 -31
- package/dist/src/fractions/approveWrapper/v0/approveWrapper.route.d.ts +0 -203
- package/dist/src/fractions/approveWrapper/v0/approveWrapper.route.d.ts.map +0 -1
- package/dist/src/fractions/approveWrapper/v0/approveWrapper.route.js +0 -84
- package/dist/src/fractions/completeSale/v0/completeSale.route.d.ts +0 -68
- package/dist/src/fractions/completeSale/v0/completeSale.route.d.ts.map +0 -1
- package/dist/src/fractions/completeSale/v0/completeSale.route.js +0 -31
- package/dist/src/fractions/createFractions/v0/createFractions.route.d.ts +0 -305
- package/dist/src/fractions/createFractions/v0/createFractions.route.d.ts.map +0 -1
- package/dist/src/fractions/createFractions/v0/createFractions.route.js +0 -61
- package/dist/src/fractions/createFractions/v0/createFractions.schema.d.ts +0 -416
- package/dist/src/fractions/createFractions/v0/createFractions.schema.d.ts.map +0 -1
- package/dist/src/fractions/createFractions/v0/createFractions.schema.js +0 -67
- package/dist/src/fractions/createFractions/v0/parseFractionsCreatedEvent.d.ts +0 -51
- package/dist/src/fractions/createFractions/v0/parseFractionsCreatedEvent.d.ts.map +0 -1
- package/dist/src/fractions/createFractions/v0/parseFractionsCreatedEvent.js +0 -59
- package/dist/src/fractions/deployMarket/v0/deployMarket.routes.d.ts +0 -297
- package/dist/src/fractions/deployMarket/v0/deployMarket.routes.d.ts.map +0 -1
- package/dist/src/fractions/deployMarket/v0/deployMarket.routes.js +0 -98
- package/dist/src/fractions/deployMarket/v0/deployMarket.schema.d.ts +0 -96
- package/dist/src/fractions/deployMarket/v0/deployMarket.schema.d.ts.map +0 -1
- package/dist/src/fractions/deployMarket/v0/deployMarket.schema.js +0 -21
- package/dist/src/fractions/gating/index.d.ts +0 -2
- package/dist/src/fractions/gating/index.d.ts.map +0 -1
- package/dist/src/fractions/gating/index.js +0 -0
- package/dist/src/fractions/gating/v0/getAuthData.d.ts +0 -86
- package/dist/src/fractions/gating/v0/getAuthData.d.ts.map +0 -1
- package/dist/src/fractions/gating/v0/getAuthData.js +0 -48
- package/dist/src/fractions/gating/v0/getNonce.route.d.ts +0 -54
- package/dist/src/fractions/gating/v0/getNonce.route.d.ts.map +0 -1
- package/dist/src/fractions/gating/v0/getNonce.route.js +0 -40
- package/dist/src/fractions/grantRole/v0/grantRole.route.d.ts +0 -65
- package/dist/src/fractions/grantRole/v0/grantRole.route.d.ts.map +0 -1
- package/dist/src/fractions/grantRole/v0/grantRole.route.js +0 -31
- package/dist/src/fractions/grantRole/v0/grantRole.schema.d.ts +0 -26
- package/dist/src/fractions/grantRole/v0/grantRole.schema.d.ts.map +0 -1
- package/dist/src/fractions/grantRole/v0/grantRole.schema.js +0 -14
- package/dist/src/fractions/index.d.ts +0 -968
- package/dist/src/fractions/index.d.ts.map +0 -1
- package/dist/src/fractions/index.js +0 -91
- package/dist/src/fractions/markets/common/platform.d.ts +0 -26
- package/dist/src/fractions/markets/common/platform.d.ts.map +0 -1
- package/dist/src/fractions/markets/common/platform.js +0 -26
- package/dist/src/fractions/markets/getDeployEvent.d.ts +0 -42
- package/dist/src/fractions/markets/getDeployEvent.d.ts.map +0 -1
- package/dist/src/fractions/markets/getDeployEvent.js +0 -47
- package/dist/src/fractions/markets/getMarket/index.d.ts +0 -40
- package/dist/src/fractions/markets/getMarket/index.d.ts.map +0 -1
- package/dist/src/fractions/markets/getMarket/index.js +0 -4
- package/dist/src/fractions/markets/getMarket/v0/getMarket.d.ts +0 -64
- package/dist/src/fractions/markets/getMarket/v0/getMarket.d.ts.map +0 -1
- package/dist/src/fractions/markets/getMarket/v0/getMarket.js +0 -63
- package/dist/src/fractions/markets/index.d.ts +0 -84
- package/dist/src/fractions/markets/index.d.ts.map +0 -1
- package/dist/src/fractions/markets/index.js +0 -12
- package/dist/src/fractions/markets/searchMarkets/index.d.ts +0 -32
- package/dist/src/fractions/markets/searchMarkets/index.d.ts.map +0 -1
- package/dist/src/fractions/markets/searchMarkets/index.js +0 -4
- package/dist/src/fractions/markets/searchMarkets/v0/searchMarkets.d.ts +0 -76
- package/dist/src/fractions/markets/searchMarkets/v0/searchMarkets.d.ts.map +0 -1
- package/dist/src/fractions/markets/searchMarkets/v0/searchMarkets.js +0 -42
- package/dist/src/fractions/purchase/v0/purchase.route.d.ts +0 -89
- package/dist/src/fractions/purchase/v0/purchase.route.d.ts.map +0 -1
- package/dist/src/fractions/purchase/v0/purchase.route.js +0 -41
- package/dist/src/fractions/roles/getRoles/v0/getRoles.d.ts +0 -28
- package/dist/src/fractions/roles/getRoles/v0/getRoles.d.ts.map +0 -1
- package/dist/src/fractions/roles/getRoles/v0/getRoles.js +0 -41
- package/dist/src/fractions/sales/getVaultAddress.d.ts +0 -52
- package/dist/src/fractions/sales/getVaultAddress.d.ts.map +0 -1
- package/dist/src/fractions/sales/getVaultAddress.js +0 -61
- package/dist/src/fractions/sales/getWithdrawEvent.d.ts +0 -42
- package/dist/src/fractions/sales/getWithdrawEvent.d.ts.map +0 -1
- package/dist/src/fractions/sales/getWithdrawEvent.js +0 -52
- package/dist/src/fractions/sales/index.d.ts +0 -10
- package/dist/src/fractions/sales/index.d.ts.map +0 -1
- package/dist/src/fractions/sales/index.js +0 -10
- package/dist/src/fractions/sales/receiveFundsAfterNonFunded.route.d.ts +0 -144
- package/dist/src/fractions/sales/receiveFundsAfterNonFunded.route.d.ts.map +0 -1
- package/dist/src/fractions/sales/receiveFundsAfterNonFunded.route.js +0 -59
- package/dist/src/fractions/sales/receiveNonPurchasedWrappedAssets.route.d.ts +0 -57
- package/dist/src/fractions/sales/receiveNonPurchasedWrappedAssets.route.d.ts.map +0 -1
- package/dist/src/fractions/sales/receiveNonPurchasedWrappedAssets.route.js +0 -27
- package/dist/src/fractions/sales/recoverFractions.d.ts +0 -108
- package/dist/src/fractions/sales/recoverFractions.d.ts.map +0 -1
- package/dist/src/fractions/sales/recoverFractions.js +0 -45
- package/dist/src/fractions/sales/rejectFractions.d.ts +0 -80
- package/dist/src/fractions/sales/rejectFractions.d.ts.map +0 -1
- package/dist/src/fractions/sales/rejectFractions.js +0 -39
- package/dist/src/fractions/sales/searchSaleEvents/index.d.ts +0 -2
- package/dist/src/fractions/sales/searchSaleEvents/index.d.ts.map +0 -1
- package/dist/src/fractions/sales/searchSaleEvents/index.js +0 -0
- package/dist/src/fractions/sales/searchSaleEvents/v0/searchSaleEvents.d.ts +0 -89
- package/dist/src/fractions/sales/searchSaleEvents/v0/searchSaleEvents.d.ts.map +0 -1
- package/dist/src/fractions/sales/searchSaleEvents/v0/searchSaleEvents.js +0 -82
- package/dist/src/fractions/sales/setFeeCapLimit.d.ts +0 -75
- package/dist/src/fractions/sales/setFeeCapLimit.d.ts.map +0 -1
- package/dist/src/fractions/sales/setFeeCapLimit.js +0 -32
- package/dist/src/fractions/sales/unlockWrappedAssets.route.d.ts +0 -68
- package/dist/src/fractions/sales/unlockWrappedAssets.route.d.ts.map +0 -1
- package/dist/src/fractions/sales/unlockWrappedAssets.route.js +0 -31
- package/dist/src/fractions/sales/vesting/index.d.ts +0 -2
- package/dist/src/fractions/sales/vesting/index.d.ts.map +0 -1
- package/dist/src/fractions/sales/vesting/index.js +0 -0
- package/dist/src/fractions/sales/vesting/v0/claimVestedTokens.route.d.ts +0 -94
- package/dist/src/fractions/sales/vesting/v0/claimVestedTokens.route.d.ts.map +0 -1
- package/dist/src/fractions/sales/vesting/v0/claimVestedTokens.route.js +0 -41
- package/dist/src/fractions/sales/vesting/v0/editCliff.route.d.ts +0 -87
- package/dist/src/fractions/sales/vesting/v0/editCliff.route.d.ts.map +0 -1
- package/dist/src/fractions/sales/vesting/v0/editCliff.route.js +0 -40
- package/dist/src/fractions/sales/vesting/v0/parseClaimVestedTokensEvent.d.ts +0 -48
- package/dist/src/fractions/sales/vesting/v0/parseClaimVestedTokensEvent.d.ts.map +0 -1
- package/dist/src/fractions/sales/vesting/v0/parseClaimVestedTokensEvent.js +0 -58
- package/dist/src/fractions/withdraw/v0/withdraw.route.d.ts +0 -68
- package/dist/src/fractions/withdraw/v0/withdraw.route.d.ts.map +0 -1
- package/dist/src/fractions/withdraw/v0/withdraw.route.js +0 -31
- package/dist/src/general/balance-client.d.ts +0 -13
- package/dist/src/general/balance-client.d.ts.map +0 -1
- package/dist/src/general/balance-client.js +0 -26
- package/dist/src/general/common.d.ts +0 -94
- package/dist/src/general/common.d.ts.map +0 -1
- package/dist/src/general/common.js +0 -35
- package/dist/src/general/estimateGas.d.ts +0 -52
- package/dist/src/general/estimateGas.d.ts.map +0 -1
- package/dist/src/general/estimateGas.js +0 -64
- package/dist/src/general/getBalance.d.ts +0 -44
- package/dist/src/general/getBalance.d.ts.map +0 -1
- package/dist/src/general/getBalance.js +0 -43
- package/dist/src/general/getBalancesBatch.d.ts +0 -59
- package/dist/src/general/getBalancesBatch.d.ts.map +0 -1
- package/dist/src/general/getBalancesBatch.js +0 -34
- package/dist/src/general/index.d.ts +0 -100
- package/dist/src/general/index.d.ts.map +0 -1
- package/dist/src/general/index.js +0 -20
- package/dist/src/general/searchBalances.d.ts +0 -78
- package/dist/src/general/searchBalances.d.ts.map +0 -1
- package/dist/src/general/searchBalances.js +0 -49
- package/dist/src/issuance/approve.d.ts +0 -75
- package/dist/src/issuance/approve.d.ts.map +0 -1
- package/dist/src/issuance/approve.js +0 -36
- package/dist/src/issuance/burn.d.ts +0 -75
- package/dist/src/issuance/burn.d.ts.map +0 -1
- package/dist/src/issuance/burn.js +0 -36
- package/dist/src/issuance/deploy.d.ts +0 -88
- package/dist/src/issuance/deploy.d.ts.map +0 -1
- package/dist/src/issuance/deploy.js +0 -91
- package/dist/src/issuance/grantRole.d.ts +0 -78
- package/dist/src/issuance/grantRole.d.ts.map +0 -1
- package/dist/src/issuance/grantRole.js +0 -50
- package/dist/src/issuance/index.d.ts +0 -165
- package/dist/src/issuance/index.d.ts.map +0 -1
- package/dist/src/issuance/index.js +0 -23
- package/dist/src/issuance/mint.d.ts +0 -75
- package/dist/src/issuance/mint.d.ts.map +0 -1
- package/dist/src/issuance/mint.js +0 -36
- package/dist/src/issuance/transfer.d.ts +0 -75
- package/dist/src/issuance/transfer.d.ts.map +0 -1
- package/dist/src/issuance/transfer.js +0 -36
- package/dist/src/serve.d.ts +0 -2
- package/dist/src/serve.d.ts.map +0 -1
- package/dist/src/serve.js +0 -33
- package/dist/src/staking/index.d.ts +0 -242
- package/dist/src/staking/index.d.ts.map +0 -1
- package/dist/src/staking/index.js +0 -20
- package/dist/src/staking/platforms/common/platform.d.ts +0 -26
- package/dist/src/staking/platforms/common/platform.d.ts.map +0 -1
- package/dist/src/staking/platforms/common/platform.js +0 -26
- package/dist/src/staking/platforms/common/platformNotFound.d.ts +0 -9
- package/dist/src/staking/platforms/common/platformNotFound.d.ts.map +0 -1
- package/dist/src/staking/platforms/common/platformNotFound.js +0 -13
- package/dist/src/staking/platforms/getPlatform/index.d.ts +0 -26
- package/dist/src/staking/platforms/getPlatform/index.d.ts.map +0 -1
- package/dist/src/staking/platforms/getPlatform/index.js +0 -4
- package/dist/src/staking/platforms/getPlatform/v0/getPlatform.d.ts +0 -52
- package/dist/src/staking/platforms/getPlatform/v0/getPlatform.d.ts.map +0 -1
- package/dist/src/staking/platforms/getPlatform/v0/getPlatform.js +0 -58
- package/dist/src/staking/platforms/index.d.ts +0 -52
- package/dist/src/staking/platforms/index.d.ts.map +0 -1
- package/dist/src/staking/platforms/index.js +0 -10
- package/dist/src/staking/platforms/searchPlatforms/index.d.ts +0 -32
- package/dist/src/staking/platforms/searchPlatforms/index.d.ts.map +0 -1
- package/dist/src/staking/platforms/searchPlatforms/index.js +0 -4
- package/dist/src/staking/platforms/searchPlatforms/v0/searchPlatforms.d.ts +0 -76
- package/dist/src/staking/platforms/searchPlatforms/v0/searchPlatforms.d.ts.map +0 -1
- package/dist/src/staking/platforms/searchPlatforms/v0/searchPlatforms.js +0 -42
- package/dist/src/staking/pools/common/pool.d.ts +0 -29
- package/dist/src/staking/pools/common/pool.d.ts.map +0 -1
- package/dist/src/staking/pools/common/pool.js +0 -28
- package/dist/src/staking/pools/common/poolNotFound.d.ts +0 -10
- package/dist/src/staking/pools/common/poolNotFound.d.ts.map +0 -1
- package/dist/src/staking/pools/common/poolNotFound.js +0 -14
- package/dist/src/staking/pools/getPool/index.d.ts +0 -20
- package/dist/src/staking/pools/getPool/index.d.ts.map +0 -1
- package/dist/src/staking/pools/getPool/index.js +0 -4
- package/dist/src/staking/pools/getPool/v0/getPool.d.ts +0 -35
- package/dist/src/staking/pools/getPool/v0/getPool.d.ts.map +0 -1
- package/dist/src/staking/pools/getPool/v0/getPool.js +0 -64
- package/dist/src/staking/pools/index.d.ts +0 -39
- package/dist/src/staking/pools/index.d.ts.map +0 -1
- package/dist/src/staking/pools/index.js +0 -10
- package/dist/src/staking/pools/searchPools/index.d.ts +0 -25
- package/dist/src/staking/pools/searchPools/index.d.ts.map +0 -1
- package/dist/src/staking/pools/searchPools/index.js +0 -4
- package/dist/src/staking/pools/searchPools/v0/searchPools.d.ts +0 -55
- package/dist/src/staking/pools/searchPools/v0/searchPools.d.ts.map +0 -1
- package/dist/src/staking/pools/searchPools/v0/searchPools.js +0 -42
- package/dist/src/staking/roles/common/role.d.ts +0 -13
- package/dist/src/staking/roles/common/role.d.ts.map +0 -1
- package/dist/src/staking/roles/common/role.js +0 -18
- package/dist/src/staking/roles/common/roleAssignment.d.ts +0 -27
- package/dist/src/staking/roles/common/roleAssignment.d.ts.map +0 -1
- package/dist/src/staking/roles/common/roleAssignment.js +0 -21
- package/dist/src/staking/roles/common/roleEvent.d.ts +0 -30
- package/dist/src/staking/roles/common/roleEvent.d.ts.map +0 -1
- package/dist/src/staking/roles/common/roleEvent.js +0 -23
- package/dist/src/staking/roles/getRoles/index.d.ts +0 -26
- package/dist/src/staking/roles/getRoles/index.d.ts.map +0 -1
- package/dist/src/staking/roles/getRoles/index.js +0 -4
- package/dist/src/staking/roles/getRoles/v0/getRoles.d.ts +0 -29
- package/dist/src/staking/roles/getRoles/v0/getRoles.d.ts.map +0 -1
- package/dist/src/staking/roles/getRoles/v0/getRoles.js +0 -41
- package/dist/src/staking/roles/grantRole/index.d.ts +0 -29
- package/dist/src/staking/roles/grantRole/index.d.ts.map +0 -1
- package/dist/src/staking/roles/grantRole/index.js +0 -4
- package/dist/src/staking/roles/grantRole/v0/grantRole.d.ts +0 -63
- package/dist/src/staking/roles/grantRole/v0/grantRole.d.ts.map +0 -1
- package/dist/src/staking/roles/grantRole/v0/grantRole.js +0 -40
- package/dist/src/staking/roles/index.d.ts +0 -93
- package/dist/src/staking/roles/index.d.ts.map +0 -1
- package/dist/src/staking/roles/index.js +0 -14
- package/dist/src/staking/roles/searchRoleEvents/index.d.ts +0 -27
- package/dist/src/staking/roles/searchRoleEvents/index.d.ts.map +0 -1
- package/dist/src/staking/roles/searchRoleEvents/index.js +0 -4
- package/dist/src/staking/roles/searchRoleEvents/v0/searchRoleEvents.d.ts +0 -63
- package/dist/src/staking/roles/searchRoleEvents/v0/searchRoleEvents.d.ts.map +0 -1
- package/dist/src/staking/roles/searchRoleEvents/v0/searchRoleEvents.js +0 -58
- package/dist/src/staking/roles/searchRoles/index.d.ts +0 -27
- package/dist/src/staking/roles/searchRoles/index.d.ts.map +0 -1
- package/dist/src/staking/roles/searchRoles/index.js +0 -4
- package/dist/src/staking/roles/searchRoles/v0/searchRoles.d.ts +0 -63
- package/dist/src/staking/roles/searchRoles/v0/searchRoles.d.ts.map +0 -1
- package/dist/src/staking/roles/searchRoles/v0/searchRoles.js +0 -56
- package/dist/src/staking/stakes/common/stake.d.ts +0 -44
- package/dist/src/staking/stakes/common/stake.d.ts.map +0 -1
- package/dist/src/staking/stakes/common/stake.js +0 -45
- package/dist/src/staking/stakes/common/stakeEvent.d.ts +0 -30
- package/dist/src/staking/stakes/common/stakeEvent.d.ts.map +0 -1
- package/dist/src/staking/stakes/common/stakeEvent.js +0 -24
- package/dist/src/staking/stakes/common/stakeNotFound.d.ts +0 -9
- package/dist/src/staking/stakes/common/stakeNotFound.d.ts.map +0 -1
- package/dist/src/staking/stakes/common/stakeNotFound.js +0 -13
- package/dist/src/staking/stakes/getStake/index.d.ts +0 -20
- package/dist/src/staking/stakes/getStake/index.d.ts.map +0 -1
- package/dist/src/staking/stakes/getStake/index.js +0 -4
- package/dist/src/staking/stakes/getStake/v0/getStake.d.ts +0 -35
- package/dist/src/staking/stakes/getStake/v0/getStake.d.ts.map +0 -1
- package/dist/src/staking/stakes/getStake/v0/getStake.js +0 -64
- package/dist/src/staking/stakes/index.d.ts +0 -63
- package/dist/src/staking/stakes/index.d.ts.map +0 -1
- package/dist/src/staking/stakes/index.js +0 -12
- package/dist/src/staking/stakes/searchStakeEvents/index.d.ts +0 -27
- package/dist/src/staking/stakes/searchStakeEvents/index.d.ts.map +0 -1
- package/dist/src/staking/stakes/searchStakeEvents/index.js +0 -4
- package/dist/src/staking/stakes/searchStakeEvents/v0/searchStakeEvents.d.ts.map +0 -1
- package/dist/src/staking/stakes/searchStakeEvents/v0/searchStakeEvents.js +0 -59
- package/dist/src/staking/stakes/searchStakes/index.d.ts +0 -27
- package/dist/src/staking/stakes/searchStakes/index.d.ts.map +0 -1
- package/dist/src/staking/stakes/searchStakes/index.js +0 -4
- package/dist/src/staking/stakes/searchStakes/v0/searchStakes.d.ts +0 -63
- package/dist/src/staking/stakes/searchStakes/v0/searchStakes.d.ts.map +0 -1
- package/dist/src/staking/stakes/searchStakes/v0/searchStakes.js +0 -61
- package/dist/src/staking-templates/index.d.ts +0 -732
- package/dist/src/staking-templates/index.d.ts.map +0 -1
- package/dist/src/staking-templates/index.js +0 -18
- package/dist/src/staking-templates/templates/common/amount.d.ts +0 -13
- package/dist/src/staking-templates/templates/common/amount.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/amount.js +0 -17
- package/dist/src/staking-templates/templates/common/amountMult.d.ts +0 -3
- package/dist/src/staking-templates/templates/common/amountMult.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/amountMult.js +0 -23
- package/dist/src/staking-templates/templates/common/erc20Input.d.ts +0 -12
- package/dist/src/staking-templates/templates/common/erc20Input.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/erc20Input.js +0 -16
- package/dist/src/staking-templates/templates/common/erc20Reward.d.ts +0 -12
- package/dist/src/staking-templates/templates/common/erc20Reward.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/erc20Reward.js +0 -16
- package/dist/src/staking-templates/templates/common/getCreatePoolEvent.d.ts +0 -31
- package/dist/src/staking-templates/templates/common/getCreatePoolEvent.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/getCreatePoolEvent.js +0 -47
- package/dist/src/staking-templates/templates/common/getPlatformDeployEvent.d.ts +0 -40
- package/dist/src/staking-templates/templates/common/getPlatformDeployEvent.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/getPlatformDeployEvent.js +0 -46
- package/dist/src/staking-templates/templates/common/getReward.d.ts +0 -58
- package/dist/src/staking-templates/templates/common/getReward.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/getReward.js +0 -34
- package/dist/src/staking-templates/templates/common/getStakeEvent.d.ts +0 -31
- package/dist/src/staking-templates/templates/common/getStakeEvent.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/getStakeEvent.js +0 -51
- package/dist/src/staking-templates/templates/common/lock.d.ts +0 -12
- package/dist/src/staking-templates/templates/common/lock.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/lock.js +0 -20
- package/dist/src/staking-templates/templates/common/lockMult.d.ts +0 -3
- package/dist/src/staking-templates/templates/common/lockMult.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/lockMult.js +0 -15
- package/dist/src/staking-templates/templates/common/partialUnstake.d.ts +0 -62
- package/dist/src/staking-templates/templates/common/partialUnstake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/partialUnstake.js +0 -39
- package/dist/src/staking-templates/templates/common/rewardDistribution.d.ts +0 -13
- package/dist/src/staking-templates/templates/common/rewardDistribution.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/rewardDistribution.js +0 -19
- package/dist/src/staking-templates/templates/common/templates.d.ts +0 -61
- package/dist/src/staking-templates/templates/common/templates.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/templates.js +0 -8
- package/dist/src/staking-templates/templates/common/time.d.ts +0 -2
- package/dist/src/staking-templates/templates/common/time.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/time.js +0 -4
- package/dist/src/staking-templates/templates/common/unstake.d.ts +0 -58
- package/dist/src/staking-templates/templates/common/unstake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/common/unstake.js +0 -34
- package/dist/src/staking-templates/templates/reputation/common.d.ts +0 -23
- package/dist/src/staking-templates/templates/reputation/common.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/common.js +0 -3
- package/dist/src/staking-templates/templates/reputation/index.d.ts +0 -233
- package/dist/src/staking-templates/templates/reputation/index.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/index.js +0 -4
- package/dist/src/staking-templates/templates/reputation/v0/createPlatform.d.ts +0 -81
- package/dist/src/staking-templates/templates/reputation/v0/createPlatform.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/v0/createPlatform.js +0 -56
- package/dist/src/staking-templates/templates/reputation/v0/createPool.d.ts +0 -113
- package/dist/src/staking-templates/templates/reputation/v0/createPool.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/v0/createPool.js +0 -85
- package/dist/src/staking-templates/templates/reputation/v0/index.d.ts +0 -233
- package/dist/src/staking-templates/templates/reputation/v0/index.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/v0/index.js +0 -25
- package/dist/src/staking-templates/templates/reputation/v0/restake.d.ts +0 -61
- package/dist/src/staking-templates/templates/reputation/v0/restake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/v0/restake.js +0 -40
- package/dist/src/staking-templates/templates/reputation/v0/stake.d.ts +0 -61
- package/dist/src/staking-templates/templates/reputation/v0/stake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputation/v0/stake.js +0 -45
- package/dist/src/staking-templates/templates/reputationLock/common.d.ts +0 -23
- package/dist/src/staking-templates/templates/reputationLock/common.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/common.js +0 -3
- package/dist/src/staking-templates/templates/reputationLock/index.d.ts +0 -244
- package/dist/src/staking-templates/templates/reputationLock/index.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/index.js +0 -4
- package/dist/src/staking-templates/templates/reputationLock/v0/createPlatform.d.ts +0 -81
- package/dist/src/staking-templates/templates/reputationLock/v0/createPlatform.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/v0/createPlatform.js +0 -56
- package/dist/src/staking-templates/templates/reputationLock/v0/createPool.d.ts +0 -149
- package/dist/src/staking-templates/templates/reputationLock/v0/createPool.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/v0/createPool.js +0 -99
- package/dist/src/staking-templates/templates/reputationLock/v0/index.d.ts +0 -244
- package/dist/src/staking-templates/templates/reputationLock/v0/index.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/v0/index.js +0 -25
- package/dist/src/staking-templates/templates/reputationLock/v0/restake.d.ts +0 -65
- package/dist/src/staking-templates/templates/reputationLock/v0/restake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/v0/restake.js +0 -44
- package/dist/src/staking-templates/templates/reputationLock/v0/stake.d.ts +0 -65
- package/dist/src/staking-templates/templates/reputationLock/v0/stake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/reputationLock/v0/stake.js +0 -46
- package/dist/src/staking-templates/templates/rwa/common.d.ts +0 -23
- package/dist/src/staking-templates/templates/rwa/common.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/common.js +0 -3
- package/dist/src/staking-templates/templates/rwa/index.d.ts +0 -256
- package/dist/src/staking-templates/templates/rwa/index.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/index.js +0 -4
- package/dist/src/staking-templates/templates/rwa/v0/createPlatform.d.ts +0 -81
- package/dist/src/staking-templates/templates/rwa/v0/createPlatform.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/v0/createPlatform.js +0 -56
- package/dist/src/staking-templates/templates/rwa/v0/createPool.d.ts +0 -109
- package/dist/src/staking-templates/templates/rwa/v0/createPool.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/v0/createPool.js +0 -79
- package/dist/src/staking-templates/templates/rwa/v0/index.d.ts +0 -256
- package/dist/src/staking-templates/templates/rwa/v0/index.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/v0/index.js +0 -27
- package/dist/src/staking-templates/templates/rwa/v0/notifyRewards.d.ts +0 -61
- package/dist/src/staking-templates/templates/rwa/v0/notifyRewards.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/v0/notifyRewards.js +0 -41
- package/dist/src/staking-templates/templates/rwa/v0/restake.d.ts +0 -61
- package/dist/src/staking-templates/templates/rwa/v0/restake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/v0/restake.js +0 -40
- package/dist/src/staking-templates/templates/rwa/v0/stake.d.ts +0 -61
- package/dist/src/staking-templates/templates/rwa/v0/stake.d.ts.map +0 -1
- package/dist/src/staking-templates/templates/rwa/v0/stake.js +0 -45
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
import { ITag } from "../../../../common/tag.js";
|
|
4
|
-
export declare function createSearchRolesV0App<E extends Env>(factory: Factory<E>, tag: ITag): [import("hono/types").H<any, string, {}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>, import("hono/types").H<Env, string, {
|
|
5
|
-
in: {
|
|
6
|
-
json: {
|
|
7
|
-
filter: {
|
|
8
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
9
|
-
platform?: `0x${string}` | undefined;
|
|
10
|
-
poolId?: string | number | bigint | undefined;
|
|
11
|
-
owner?: `0x${string}` | undefined;
|
|
12
|
-
};
|
|
13
|
-
page: {
|
|
14
|
-
skip: number;
|
|
15
|
-
limit: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
out: {
|
|
20
|
-
json: {
|
|
21
|
-
filter: {
|
|
22
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
23
|
-
platform?: `0x${string}` | undefined;
|
|
24
|
-
poolId?: bigint | undefined;
|
|
25
|
-
owner?: `0x${string}` | undefined;
|
|
26
|
-
};
|
|
27
|
-
page: {
|
|
28
|
-
skip: number;
|
|
29
|
-
limit: number;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>, import("hono/types").H<import("hono/utils/types").IfAnyThenEmptyObject<E extends Env ? Env extends E ? {} : E : E> & {}, string, {
|
|
34
|
-
in: {
|
|
35
|
-
json: {
|
|
36
|
-
filter: {
|
|
37
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
38
|
-
platform?: `0x${string}` | undefined;
|
|
39
|
-
poolId?: string | number | bigint | undefined;
|
|
40
|
-
owner?: `0x${string}` | undefined;
|
|
41
|
-
};
|
|
42
|
-
page: {
|
|
43
|
-
skip: number;
|
|
44
|
-
limit: number;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
out: {
|
|
49
|
-
json: {
|
|
50
|
-
filter: {
|
|
51
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
52
|
-
platform?: `0x${string}` | undefined;
|
|
53
|
-
poolId?: bigint | undefined;
|
|
54
|
-
owner?: `0x${string}` | undefined;
|
|
55
|
-
};
|
|
56
|
-
page: {
|
|
57
|
-
skip: number;
|
|
58
|
-
limit: number;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>];
|
|
63
|
-
//# sourceMappingURL=searchRoles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchRoles.d.ts","sourceRoot":"","sources":["../../../../../../src/staking/roles/searchRoles/v0/searchRoles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAQjD,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAoDnF"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { describeRoute } from "hono-openapi";
|
|
2
|
-
import { resolver, validator } from "hono-openapi/zod";
|
|
3
|
-
import { unixToDate } from "@evergonlabs/tmi-protocol-utils/date";
|
|
4
|
-
import { and, eq } from "@ponder/client";
|
|
5
|
-
import { z } from "../../../../common/zod.js";
|
|
6
|
-
import { indexerClient } from "../../../../common/indexer/index.js";
|
|
7
|
-
import { indexerSchemas } from "../../../../common/indexer/schemas.js";
|
|
8
|
-
import { PageSchema } from "../../../../common/models/page.js";
|
|
9
|
-
import { AddressSchema, PlatformContractAddress, PoolIdSchema, StakingChainId } from "../../../../common/index.js";
|
|
10
|
-
import { RoleAssignmentSchema } from "../../common/roleAssignment.js";
|
|
11
|
-
export function createSearchRolesV0App(factory, tag) {
|
|
12
|
-
return factory.createHandlers(describeRoute({
|
|
13
|
-
summary: "Search roles",
|
|
14
|
-
description: "Search roles by users, platforms and pools",
|
|
15
|
-
tags: [tag.tag],
|
|
16
|
-
responses: {
|
|
17
|
-
200: {
|
|
18
|
-
description: "Returns list of assignments within specified platforms and pools",
|
|
19
|
-
content: {
|
|
20
|
-
"application/json": {
|
|
21
|
-
schema: resolver(z.array(RoleAssignmentSchema)),
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
}), validator("json", z.object({
|
|
27
|
-
page: PageSchema,
|
|
28
|
-
filter: z.object({
|
|
29
|
-
chainId: StakingChainId.optional(),
|
|
30
|
-
owner: AddressSchema.optional(),
|
|
31
|
-
platform: PlatformContractAddress.optional(),
|
|
32
|
-
poolId: PoolIdSchema.optional(),
|
|
33
|
-
}),
|
|
34
|
-
})), async (c) => {
|
|
35
|
-
const { page, filter } = c.req.valid("json");
|
|
36
|
-
const result = await indexerClient.db
|
|
37
|
-
.select()
|
|
38
|
-
.from(indexerSchemas.roles)
|
|
39
|
-
.limit(page.limit)
|
|
40
|
-
.offset(page.skip)
|
|
41
|
-
.orderBy(indexerSchemas.roles.createdAt)
|
|
42
|
-
.where(and(filter.chainId ? eq(indexerSchemas.roles.chainId, Number(filter.chainId)) : undefined, filter.owner ? eq(indexerSchemas.roles.walletAddress, filter.owner) : undefined, filter.platform ? eq(indexerSchemas.roles.diamondAddress, filter.platform) : undefined, typeof filter.poolId === "number" ? eq(indexerSchemas.roles.campaignId, BigInt(filter.poolId)) : undefined));
|
|
43
|
-
return c.json(result.map((x) => toRoleAssignment(x)), 200);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function toRoleAssignment(raw) {
|
|
47
|
-
return {
|
|
48
|
-
chainId: StakingChainId.parse(raw.chainId),
|
|
49
|
-
platform: raw.diamondAddress,
|
|
50
|
-
owner: raw.walletAddress,
|
|
51
|
-
roleId: raw.roleId,
|
|
52
|
-
poolId: raw.campaignId ? PoolIdSchema.parse(raw.campaignId) : undefined,
|
|
53
|
-
createdAt: unixToDate(raw.createdAt).toISOString(),
|
|
54
|
-
updatedAt: unixToDate(raw.updatedAt).toISOString(),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { indexerSchemas } from "../../../common/indexer/schemas.js";
|
|
2
|
-
import { z } from "../../../common/zod.js";
|
|
3
|
-
export declare const StakeSchema: z.ZodObject<{
|
|
4
|
-
chainId: z.ZodType<"11155111" | "31337", z.ZodTypeDef, "11155111" | "31337">;
|
|
5
|
-
platform: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
6
|
-
poolId: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodBigInt>>;
|
|
7
|
-
owner: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
8
|
-
stakeId: z.ZodPipeline<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodBigInt>;
|
|
9
|
-
activePackets: z.ZodPipeline<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodBigInt>;
|
|
10
|
-
rewardsClaimed: z.ZodPipeline<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodBigInt>;
|
|
11
|
-
isActive: z.ZodBoolean;
|
|
12
|
-
unlockTimestamp: z.ZodString;
|
|
13
|
-
startTimestamp: z.ZodString;
|
|
14
|
-
createdAt: z.ZodString;
|
|
15
|
-
updatedAt: z.ZodString;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
chainId: "11155111" | "31337";
|
|
18
|
-
platform: `0x${string}`;
|
|
19
|
-
createdAt: string;
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
stakeId: bigint;
|
|
22
|
-
activePackets: bigint;
|
|
23
|
-
rewardsClaimed: bigint;
|
|
24
|
-
isActive: boolean;
|
|
25
|
-
unlockTimestamp: string;
|
|
26
|
-
startTimestamp: string;
|
|
27
|
-
owner: `0x${string}`;
|
|
28
|
-
poolId?: bigint | undefined;
|
|
29
|
-
}, {
|
|
30
|
-
chainId: "11155111" | "31337";
|
|
31
|
-
platform: `0x${string}`;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
stakeId: string | number | bigint;
|
|
35
|
-
activePackets: string | number | bigint;
|
|
36
|
-
rewardsClaimed: string | number | bigint;
|
|
37
|
-
isActive: boolean;
|
|
38
|
-
unlockTimestamp: string;
|
|
39
|
-
startTimestamp: string;
|
|
40
|
-
owner: `0x${string}`;
|
|
41
|
-
poolId?: string | number | bigint | undefined;
|
|
42
|
-
}>;
|
|
43
|
-
export declare function mapToStake(raw: typeof indexerSchemas.stakes.$inferSelect): z.output<typeof StakeSchema>;
|
|
44
|
-
//# sourceMappingURL=stake.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stake.d.ts","sourceRoot":"","sources":["../../../../../src/staking/stakes/common/stake.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBpB,CAAC;AAEL,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,cAAc,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAevG"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { unixToDate } from "@evergonlabs/tmi-protocol-utils/date";
|
|
2
|
-
import { Int256Positive } from "@evergonlabs/tmi-utils/models";
|
|
3
|
-
import { AddressSchema, PlatformContractAddress, PoolIdSchema, StakeIdSchema, StakingChainId, } from "../../../common/index.js";
|
|
4
|
-
import { ISOSchema } from "../../../common/models/date.js";
|
|
5
|
-
import { z } from "../../../common/zod.js";
|
|
6
|
-
export const StakeSchema = z
|
|
7
|
-
.object({
|
|
8
|
-
chainId: StakingChainId,
|
|
9
|
-
platform: PlatformContractAddress,
|
|
10
|
-
poolId: PoolIdSchema.optional().openapi({
|
|
11
|
-
description: "If empty or 0 then it's platform-wide",
|
|
12
|
-
}),
|
|
13
|
-
owner: AddressSchema.openapi({
|
|
14
|
-
description: "Address role assigned to",
|
|
15
|
-
}),
|
|
16
|
-
stakeId: StakeIdSchema,
|
|
17
|
-
activePackets: Int256Positive,
|
|
18
|
-
rewardsClaimed: Int256Positive,
|
|
19
|
-
isActive: z.boolean().openapi({
|
|
20
|
-
description: "Whether stake is active or withdrawn and closed",
|
|
21
|
-
}),
|
|
22
|
-
unlockTimestamp: ISOSchema,
|
|
23
|
-
startTimestamp: ISOSchema,
|
|
24
|
-
createdAt: ISOSchema,
|
|
25
|
-
updatedAt: ISOSchema,
|
|
26
|
-
})
|
|
27
|
-
.openapi({
|
|
28
|
-
ref: "Stake",
|
|
29
|
-
});
|
|
30
|
-
export function mapToStake(raw) {
|
|
31
|
-
return {
|
|
32
|
-
chainId: StakingChainId.parse(raw.chainId),
|
|
33
|
-
platform: raw.diamondAddress,
|
|
34
|
-
owner: raw.walletAddress,
|
|
35
|
-
poolId: raw.poolId ? PoolIdSchema.parse(raw.poolId) : undefined,
|
|
36
|
-
stakeId: raw.stakeId,
|
|
37
|
-
startTimestamp: unixToDate(raw.startTimestamp).toISOString(),
|
|
38
|
-
unlockTimestamp: unixToDate(raw.unlockTimestamp).toISOString(),
|
|
39
|
-
rewardsClaimed: raw.rewardsClaimed,
|
|
40
|
-
activePackets: raw.activePackets,
|
|
41
|
-
isActive: raw.isActive,
|
|
42
|
-
createdAt: unixToDate(raw.createdAt).toISOString(),
|
|
43
|
-
updatedAt: unixToDate(raw.updatedAt).toISOString(),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from "../../../common/zod.js";
|
|
2
|
-
export declare const StakeEventSchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
|
-
chainId: z.ZodType<"11155111" | "31337", z.ZodTypeDef, "11155111" | "31337">;
|
|
5
|
-
platform: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
6
|
-
poolId: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodBigInt>>;
|
|
7
|
-
owner: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
8
|
-
stakeId: z.ZodPipeline<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBigInt]>, z.ZodBigInt>;
|
|
9
|
-
createdAt: z.ZodString;
|
|
10
|
-
txHash: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
chainId: "11155111" | "31337";
|
|
13
|
-
platform: `0x${string}`;
|
|
14
|
-
id: string;
|
|
15
|
-
txHash: `0x${string}`;
|
|
16
|
-
createdAt: string;
|
|
17
|
-
stakeId: bigint;
|
|
18
|
-
owner: `0x${string}`;
|
|
19
|
-
poolId?: bigint | undefined;
|
|
20
|
-
}, {
|
|
21
|
-
chainId: "11155111" | "31337";
|
|
22
|
-
platform: `0x${string}`;
|
|
23
|
-
id: string;
|
|
24
|
-
txHash: `0x${string}`;
|
|
25
|
-
createdAt: string;
|
|
26
|
-
stakeId: string | number | bigint;
|
|
27
|
-
owner: `0x${string}`;
|
|
28
|
-
poolId?: string | number | bigint | undefined;
|
|
29
|
-
}>;
|
|
30
|
-
//# sourceMappingURL=stakeEvent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stakeEvent.d.ts","sourceRoot":"","sources":["../../../../../src/staking/stakes/common/stakeEvent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAY3C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBzB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ISOSchema } from "../../../common/models/date.js";
|
|
2
|
-
import { z } from "../../../common/zod.js";
|
|
3
|
-
import { AddressSchema, HashSchema, PlatformContractAddress, PoolIdSchema, StakeIdSchema, StakingChainId, } from "../../../common/index.js";
|
|
4
|
-
// @todo add data field
|
|
5
|
-
export const StakeEventSchema = z
|
|
6
|
-
.object({
|
|
7
|
-
id: z.string().openapi({
|
|
8
|
-
description: "Unique event id",
|
|
9
|
-
}),
|
|
10
|
-
chainId: StakingChainId,
|
|
11
|
-
platform: PlatformContractAddress,
|
|
12
|
-
poolId: PoolIdSchema.optional().openapi({
|
|
13
|
-
description: "If empty or 0 then it's platform-wide",
|
|
14
|
-
}),
|
|
15
|
-
owner: AddressSchema.openapi({
|
|
16
|
-
description: "Address role assigned to",
|
|
17
|
-
}),
|
|
18
|
-
stakeId: StakeIdSchema,
|
|
19
|
-
createdAt: ISOSchema,
|
|
20
|
-
txHash: HashSchema,
|
|
21
|
-
})
|
|
22
|
-
.openapi({
|
|
23
|
-
ref: "StakeEvent",
|
|
24
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CustomError } from "@evergonlabs/tmi-utils/errors";
|
|
2
|
-
import { Address } from "viem";
|
|
3
|
-
export declare class StakeNotFoundError extends CustomError<{
|
|
4
|
-
chainId: string;
|
|
5
|
-
contract: Address;
|
|
6
|
-
}> {
|
|
7
|
-
constructor(chainId: string, contract: Address, stakeId: string);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=stakeNotFound.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stakeNotFound.d.ts","sourceRoot":"","sources":["../../../../../src/staking/stakes/common/stakeNotFound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,qBAAa,kBAAmB,SAAQ,WAAW,CAAC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;gBACY,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;CAUhE"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CustomError } from "@evergonlabs/tmi-utils/errors";
|
|
2
|
-
export class StakeNotFoundError extends CustomError {
|
|
3
|
-
constructor(chainId, contract, stakeId) {
|
|
4
|
-
super({
|
|
5
|
-
name: "StakeNotFoundError",
|
|
6
|
-
message: `Stake with id ${stakeId} within ${contract} platform in ${chainId} network is not found`,
|
|
7
|
-
data: {
|
|
8
|
-
chainId: chainId,
|
|
9
|
-
contract: contract,
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
import { ITag } from "../../../common/tag.js";
|
|
4
|
-
export declare function createGetStakesApp<E extends Env>(factory: Factory<E>, tag: ITag): import("hono/hono-base").HonoBase<E, {
|
|
5
|
-
"/v0": {
|
|
6
|
-
$get: {
|
|
7
|
-
input: {
|
|
8
|
-
query: {
|
|
9
|
-
chainId: string | string[];
|
|
10
|
-
platform: string | string[];
|
|
11
|
-
stakeId: string | string[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
output: never;
|
|
15
|
-
outputFormat: "json";
|
|
16
|
-
status: 200;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}, "/">;
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/staking/stakes/getStake/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI;;;;;;;;;;;;;;;QAE/E"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Factory } from "hono/factory";
|
|
2
|
-
import { Env } from "hono";
|
|
3
|
-
import { ITag } from "../../../../common/tag.js";
|
|
4
|
-
export declare function createGetStakeV0App<E extends Env>(factory: Factory<E>, tag: ITag): [import("hono/types").H<any, string, {}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>, import("hono/types").H<Env, string, {
|
|
5
|
-
in: {
|
|
6
|
-
query: {
|
|
7
|
-
chainId: string | string[];
|
|
8
|
-
platform: string | string[];
|
|
9
|
-
stakeId: string | string[];
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
out: {
|
|
13
|
-
query: {
|
|
14
|
-
chainId: "11155111" | "31337";
|
|
15
|
-
platform: `0x${string}`;
|
|
16
|
-
stakeId: bigint;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>, import("hono/types").H<import("hono/utils/types").IfAnyThenEmptyObject<E extends Env ? Env extends E ? {} : E : E> & {}, string, {
|
|
20
|
-
in: {
|
|
21
|
-
query: {
|
|
22
|
-
chainId: string | string[];
|
|
23
|
-
platform: string | string[];
|
|
24
|
-
stakeId: string | string[];
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
out: {
|
|
28
|
-
query: {
|
|
29
|
-
chainId: "11155111" | "31337";
|
|
30
|
-
platform: `0x${string}`;
|
|
31
|
-
stakeId: bigint;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
}, Promise<Response & import("hono").TypedResponse<never, 200, "json">>>];
|
|
35
|
-
//# sourceMappingURL=getStake.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getStake.d.ts","sourceRoot":"","sources":["../../../../../../src/staking/stakes/getStake/v0/getStake.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAK3B,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAIjD,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAqEhF"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { and, eq } from "@ponder/client";
|
|
2
|
-
import { describeRoute } from "hono-openapi";
|
|
3
|
-
import { resolver, validator } from "hono-openapi/zod";
|
|
4
|
-
import { indexerClient } from "../../../../common/indexer/index.js";
|
|
5
|
-
import { z } from "../../../../common/zod.js";
|
|
6
|
-
import { indexerSchemas } from "../../../../common/indexer/schemas.js";
|
|
7
|
-
import { ErrorSchema, PlatformContractAddress, StakeIdSchema, StakingChainId } from "../../../../common/index.js";
|
|
8
|
-
import { mapToStake, StakeSchema } from "../../common/stake.js";
|
|
9
|
-
import { StakeNotFoundError } from "../../common/stakeNotFound.js";
|
|
10
|
-
export function createGetStakeV0App(factory, tag) {
|
|
11
|
-
return factory.createHandlers(describeRoute({
|
|
12
|
-
summary: "Get Stake",
|
|
13
|
-
description: "Retrieve details of a specified stake",
|
|
14
|
-
tags: [tag.tag],
|
|
15
|
-
responses: {
|
|
16
|
-
200: {
|
|
17
|
-
description: "Stake details",
|
|
18
|
-
content: {
|
|
19
|
-
"application/json": {
|
|
20
|
-
schema: resolver(StakeSchema),
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
404: {
|
|
25
|
-
description: "No stake found",
|
|
26
|
-
content: {
|
|
27
|
-
"application/json": {
|
|
28
|
-
schema: resolver(ErrorSchema),
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
}), validator("query", z.object({
|
|
34
|
-
chainId: StakingChainId.openapi({
|
|
35
|
-
param: {
|
|
36
|
-
name: "chainId",
|
|
37
|
-
in: "query",
|
|
38
|
-
},
|
|
39
|
-
}),
|
|
40
|
-
platform: PlatformContractAddress.openapi({
|
|
41
|
-
param: {
|
|
42
|
-
name: "platform",
|
|
43
|
-
in: "query",
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
-
stakeId: StakeIdSchema.openapi({
|
|
47
|
-
param: {
|
|
48
|
-
name: "stakeId",
|
|
49
|
-
in: "query",
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
})), async (c) => {
|
|
53
|
-
const { chainId, platform, stakeId } = c.req.valid("query");
|
|
54
|
-
const [stake] = await indexerClient.db
|
|
55
|
-
.select()
|
|
56
|
-
.from(indexerSchemas.stakes)
|
|
57
|
-
.limit(1)
|
|
58
|
-
.where(and(eq(indexerSchemas.stakes.chainId, Number(chainId)), eq(indexerSchemas.stakes.diamondAddress, platform), eq(indexerSchemas.stakes.stakeId, stakeId)));
|
|
59
|
-
if (!stake) {
|
|
60
|
-
throw new StakeNotFoundError(chainId, platform, stakeId.toString());
|
|
61
|
-
}
|
|
62
|
-
return c.json(mapToStake(stake), 200);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
export declare function createStakesApp<E extends Env>(factory: Factory<E>): import("hono/hono-base").HonoBase<E, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
4
|
-
"/v0": {
|
|
5
|
-
$post: {
|
|
6
|
-
input: {
|
|
7
|
-
json: {
|
|
8
|
-
filter: {
|
|
9
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
10
|
-
platform?: `0x${string}` | undefined;
|
|
11
|
-
poolId?: string | number | bigint | undefined;
|
|
12
|
-
owner?: `0x${string}` | undefined;
|
|
13
|
-
};
|
|
14
|
-
page: {
|
|
15
|
-
skip: number;
|
|
16
|
-
limit: number;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
output: never;
|
|
21
|
-
outputFormat: "json";
|
|
22
|
-
status: 200;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}, "/searchStakes"> | import("hono/types").MergeSchemaPath<{
|
|
26
|
-
"/v0": {
|
|
27
|
-
$post: {
|
|
28
|
-
input: {
|
|
29
|
-
json: {
|
|
30
|
-
filter: {
|
|
31
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
32
|
-
platform?: `0x${string}` | undefined;
|
|
33
|
-
poolId?: string | number | bigint | undefined;
|
|
34
|
-
owner?: `0x${string}` | undefined;
|
|
35
|
-
};
|
|
36
|
-
page: {
|
|
37
|
-
skip: number;
|
|
38
|
-
limit: number;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
output: never;
|
|
43
|
-
outputFormat: "json";
|
|
44
|
-
status: 200;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}, "/searchStakeEvents"> | import("hono/types").MergeSchemaPath<{
|
|
48
|
-
"/v0": {
|
|
49
|
-
$get: {
|
|
50
|
-
input: {
|
|
51
|
-
query: {
|
|
52
|
-
chainId: string | string[];
|
|
53
|
-
platform: string | string[];
|
|
54
|
-
stakeId: string | string[];
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
output: never;
|
|
58
|
-
outputFormat: "json";
|
|
59
|
-
status: 200;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
}, "/getStake">, "/">;
|
|
63
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/staking/stakes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAMvC,wBAAgB,eAAe,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAOjE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createSearchStakesApp } from "./searchStakes/index.js";
|
|
2
|
-
import { createSearchStakeEventsApp } from "./searchStakeEvents/index.js";
|
|
3
|
-
import { createGetStakesApp } from "./getStake/index.js";
|
|
4
|
-
import { createTag } from "../../common/tag.js";
|
|
5
|
-
export function createStakesApp(factory) {
|
|
6
|
-
const tag = createTag("Stakes");
|
|
7
|
-
return factory
|
|
8
|
-
.createApp()
|
|
9
|
-
.route("/searchStakes", createSearchStakesApp(factory, tag))
|
|
10
|
-
.route("/searchStakeEvents", createSearchStakeEventsApp(factory, tag))
|
|
11
|
-
.route("/getStake", createGetStakesApp(factory, tag));
|
|
12
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
import { ITag } from "../../../common/tag.js";
|
|
4
|
-
export declare function createSearchStakeEventsApp<E extends Env>(factory: Factory<E>, tag: ITag): import("hono/hono-base").HonoBase<E, {
|
|
5
|
-
"/v0": {
|
|
6
|
-
$post: {
|
|
7
|
-
input: {
|
|
8
|
-
json: {
|
|
9
|
-
filter: {
|
|
10
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
11
|
-
platform?: `0x${string}` | undefined;
|
|
12
|
-
poolId?: string | number | bigint | undefined;
|
|
13
|
-
owner?: `0x${string}` | undefined;
|
|
14
|
-
};
|
|
15
|
-
page: {
|
|
16
|
-
skip: number;
|
|
17
|
-
limit: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
output: never;
|
|
22
|
-
outputFormat: "json";
|
|
23
|
-
status: 200;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}, "/">;
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/staking/stakes/searchStakeEvents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;QAEvF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searchStakeEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/staking/stakes/searchStakeEvents/v0/searchStakeEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAQjD,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAsDzF"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { describeRoute } from "hono-openapi";
|
|
2
|
-
import { resolver, validator } from "hono-openapi/zod";
|
|
3
|
-
import { unixToDate } from "@evergonlabs/tmi-protocol-utils/date";
|
|
4
|
-
import { and, eq } from "@ponder/client";
|
|
5
|
-
import { z } from "../../../../common/zod.js";
|
|
6
|
-
import { indexerClient } from "../../../../common/indexer/index.js";
|
|
7
|
-
import { indexerSchemas } from "../../../../common/indexer/schemas.js";
|
|
8
|
-
import { PageSchema } from "../../../../common/models/page.js";
|
|
9
|
-
import { AddressSchema, PlatformContractAddress, PoolIdSchema, StakingChainId } from "../../../../common/index.js";
|
|
10
|
-
import { StakeEventSchema } from "../../common/stakeEvent.js";
|
|
11
|
-
export function createSearchStakeEventsV0App(factory, tag) {
|
|
12
|
-
return factory.createHandlers(describeRoute({
|
|
13
|
-
summary: "Search stake events",
|
|
14
|
-
description: "Search stake events by users, platforms and pools",
|
|
15
|
-
tags: [tag.tag],
|
|
16
|
-
responses: {
|
|
17
|
-
200: {
|
|
18
|
-
description: "Returns list of stakes events within specified platforms and pools",
|
|
19
|
-
content: {
|
|
20
|
-
"application/json": {
|
|
21
|
-
schema: resolver(z.array(StakeEventSchema)),
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
}), validator("json", z.object({
|
|
27
|
-
page: PageSchema,
|
|
28
|
-
filter: z.object({
|
|
29
|
-
chainId: StakingChainId.optional(),
|
|
30
|
-
owner: AddressSchema.optional(),
|
|
31
|
-
platform: PlatformContractAddress.optional(),
|
|
32
|
-
poolId: PoolIdSchema.optional(),
|
|
33
|
-
}),
|
|
34
|
-
})), async (c) => {
|
|
35
|
-
const { page, filter } = c.req.valid("json");
|
|
36
|
-
const result = await indexerClient.db
|
|
37
|
-
.select()
|
|
38
|
-
.from(indexerSchemas.stakeEvents)
|
|
39
|
-
.limit(page.limit)
|
|
40
|
-
.offset(page.skip)
|
|
41
|
-
.orderBy(indexerSchemas.stakeEvents.createdAt)
|
|
42
|
-
.where(and(filter.chainId ? eq(indexerSchemas.stakeEvents.chainId, Number(filter.chainId)) : undefined, filter.owner ? eq(indexerSchemas.stakeEvents.walletAddress, filter.owner) : undefined, filter.platform ? eq(indexerSchemas.stakeEvents.diamondAddress, filter.platform) : undefined, typeof filter.poolId === "number"
|
|
43
|
-
? eq(indexerSchemas.stakeEvents.poolId, BigInt(filter.poolId))
|
|
44
|
-
: undefined));
|
|
45
|
-
return c.json(result.map((x) => toStakeEvent(x)), 200);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function toStakeEvent(raw) {
|
|
49
|
-
return {
|
|
50
|
-
id: raw.id,
|
|
51
|
-
txHash: raw.txHash,
|
|
52
|
-
chainId: StakingChainId.parse(raw.chainId),
|
|
53
|
-
platform: raw.diamondAddress,
|
|
54
|
-
owner: raw.walletAddress,
|
|
55
|
-
poolId: raw.poolId ? PoolIdSchema.parse(raw.poolId) : undefined,
|
|
56
|
-
stakeId: raw.stakeId,
|
|
57
|
-
createdAt: unixToDate(raw.createdAt).toISOString(),
|
|
58
|
-
};
|
|
59
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Env } from "hono";
|
|
2
|
-
import { Factory } from "hono/factory";
|
|
3
|
-
import { ITag } from "../../../common/tag.js";
|
|
4
|
-
export declare function createSearchStakesApp<E extends Env>(factory: Factory<E>, tag: ITag): import("hono/hono-base").HonoBase<E, {
|
|
5
|
-
"/v0": {
|
|
6
|
-
$post: {
|
|
7
|
-
input: {
|
|
8
|
-
json: {
|
|
9
|
-
filter: {
|
|
10
|
-
chainId?: "11155111" | "31337" | undefined;
|
|
11
|
-
platform?: `0x${string}` | undefined;
|
|
12
|
-
poolId?: string | number | bigint | undefined;
|
|
13
|
-
owner?: `0x${string}` | undefined;
|
|
14
|
-
};
|
|
15
|
-
page: {
|
|
16
|
-
skip: number;
|
|
17
|
-
limit: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
output: never;
|
|
22
|
-
outputFormat: "json";
|
|
23
|
-
status: 200;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
}, "/">;
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|