boing-sdk 0.3.0
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/CHANGELOG.md +26 -0
- package/README.md +191 -0
- package/dist/accessList.d.ts +22 -0
- package/dist/accessList.d.ts.map +1 -0
- package/dist/accessList.js +45 -0
- package/dist/bincode.d.ts +92 -0
- package/dist/bincode.d.ts.map +1 -0
- package/dist/bincode.js +154 -0
- package/dist/callAbi.d.ts +119 -0
- package/dist/callAbi.d.ts.map +1 -0
- package/dist/callAbi.js +156 -0
- package/dist/calldata.d.ts +35 -0
- package/dist/calldata.d.ts.map +1 -0
- package/dist/calldata.js +93 -0
- package/dist/canonicalDeployArtifacts.d.ts +154 -0
- package/dist/canonicalDeployArtifacts.d.ts.map +1 -0
- package/dist/canonicalDeployArtifacts.js +271 -0
- package/dist/canonicalTestnet.d.ts +15 -0
- package/dist/canonicalTestnet.d.ts.map +1 -0
- package/dist/canonicalTestnet.js +15 -0
- package/dist/canonicalTestnetDex.d.ts +17 -0
- package/dist/canonicalTestnetDex.d.ts.map +1 -0
- package/dist/canonicalTestnetDex.js +17 -0
- package/dist/chainIds.d.ts +18 -0
- package/dist/chainIds.d.ts.map +1 -0
- package/dist/chainIds.js +56 -0
- package/dist/client.d.ts +223 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +659 -0
- package/dist/connectionMonitor.d.ts +47 -0
- package/dist/connectionMonitor.d.ts.map +1 -0
- package/dist/connectionMonitor.js +93 -0
- package/dist/create2.d.ts +94 -0
- package/dist/create2.d.ts.map +1 -0
- package/dist/create2.js +225 -0
- package/dist/dappDeploy.d.ts +100 -0
- package/dist/dappDeploy.d.ts.map +1 -0
- package/dist/dappDeploy.js +140 -0
- package/dist/dappUiHelpers.d.ts +28 -0
- package/dist/dappUiHelpers.d.ts.map +1 -0
- package/dist/dappUiHelpers.js +69 -0
- package/dist/defaultReferenceFungibleSecuredRuntimeBytecodeHex.d.ts +6 -0
- package/dist/defaultReferenceFungibleSecuredRuntimeBytecodeHex.d.ts.map +1 -0
- package/dist/defaultReferenceFungibleSecuredRuntimeBytecodeHex.js +5 -0
- package/dist/defaultReferenceFungibleSecuredTemplateBytecodeHex.d.ts +6 -0
- package/dist/defaultReferenceFungibleSecuredTemplateBytecodeHex.d.ts.map +1 -0
- package/dist/defaultReferenceFungibleSecuredTemplateBytecodeHex.js +5 -0
- package/dist/defaultReferenceFungibleTemplateBytecodeHex.d.ts +6 -0
- package/dist/defaultReferenceFungibleTemplateBytecodeHex.d.ts.map +1 -0
- package/dist/defaultReferenceFungibleTemplateBytecodeHex.js +5 -0
- package/dist/defaultReferenceNftCollectionTemplateBytecodeHex.d.ts +7 -0
- package/dist/defaultReferenceNftCollectionTemplateBytecodeHex.d.ts.map +1 -0
- package/dist/defaultReferenceNftCollectionTemplateBytecodeHex.js +6 -0
- package/dist/dexIntegration.d.ts +61 -0
- package/dist/dexIntegration.d.ts.map +1 -0
- package/dist/dexIntegration.js +193 -0
- package/dist/erc721Logs.d.ts +21 -0
- package/dist/erc721Logs.d.ts.map +1 -0
- package/dist/erc721Logs.js +69 -0
- package/dist/errors.d.ts +60 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +153 -0
- package/dist/hex.d.ts +27 -0
- package/dist/hex.d.ts.map +1 -0
- package/dist/hex.js +82 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/indexerBatch.d.ts +111 -0
- package/dist/indexerBatch.d.ts.map +1 -0
- package/dist/indexerBatch.js +253 -0
- package/dist/indexerGaps.d.ts +50 -0
- package/dist/indexerGaps.d.ts.map +1 -0
- package/dist/indexerGaps.js +117 -0
- package/dist/indexerSync.d.ts +61 -0
- package/dist/indexerSync.d.ts.map +1 -0
- package/dist/indexerSync.js +100 -0
- package/dist/nativeAmm.d.ts +64 -0
- package/dist/nativeAmm.d.ts.map +1 -0
- package/dist/nativeAmm.js +174 -0
- package/dist/nativeAmmLogs.d.ts +48 -0
- package/dist/nativeAmmLogs.d.ts.map +1 -0
- package/dist/nativeAmmLogs.js +114 -0
- package/dist/nativeAmmLpVault.d.ts +94 -0
- package/dist/nativeAmmLpVault.d.ts.map +1 -0
- package/dist/nativeAmmLpVault.js +205 -0
- package/dist/nativeAmmPool.d.ts +124 -0
- package/dist/nativeAmmPool.d.ts.map +1 -0
- package/dist/nativeAmmPool.js +245 -0
- package/dist/nativeContractSubmit.d.ts +26 -0
- package/dist/nativeContractSubmit.d.ts.map +1 -0
- package/dist/nativeContractSubmit.js +23 -0
- package/dist/nativeDexDirectory.d.ts +83 -0
- package/dist/nativeDexDirectory.d.ts.map +1 -0
- package/dist/nativeDexDirectory.js +147 -0
- package/dist/nativeDexDirectoryApi.d.ts +121 -0
- package/dist/nativeDexDirectoryApi.d.ts.map +1 -0
- package/dist/nativeDexDirectoryApi.js +408 -0
- package/dist/nativeDexFactory.d.ts +25 -0
- package/dist/nativeDexFactory.d.ts.map +1 -0
- package/dist/nativeDexFactory.js +72 -0
- package/dist/nativeDexFactoryLogs.d.ts +19 -0
- package/dist/nativeDexFactoryLogs.d.ts.map +1 -0
- package/dist/nativeDexFactoryLogs.js +61 -0
- package/dist/nativeDexFactoryPool.d.ts +61 -0
- package/dist/nativeDexFactoryPool.d.ts.map +1 -0
- package/dist/nativeDexFactoryPool.js +120 -0
- package/dist/nativeDexIndexerStats.d.ts +96 -0
- package/dist/nativeDexIndexerStats.d.ts.map +1 -0
- package/dist/nativeDexIndexerStats.js +448 -0
- package/dist/nativeDexLedgerRouter.d.ts +67 -0
- package/dist/nativeDexLedgerRouter.d.ts.map +1 -0
- package/dist/nativeDexLedgerRouter.js +108 -0
- package/dist/nativeDexLpPositions.d.ts +39 -0
- package/dist/nativeDexLpPositions.d.ts.map +1 -0
- package/dist/nativeDexLpPositions.js +69 -0
- package/dist/nativeDexNftIndexer.d.ts +26 -0
- package/dist/nativeDexNftIndexer.d.ts.map +1 -0
- package/dist/nativeDexNftIndexer.js +50 -0
- package/dist/nativeDexPoolHistory.d.ts +40 -0
- package/dist/nativeDexPoolHistory.d.ts.map +1 -0
- package/dist/nativeDexPoolHistory.js +110 -0
- package/dist/nativeDexReceiptArchive.d.ts +25 -0
- package/dist/nativeDexReceiptArchive.d.ts.map +1 -0
- package/dist/nativeDexReceiptArchive.js +47 -0
- package/dist/nativeDexRouting.d.ts +160 -0
- package/dist/nativeDexRouting.d.ts.map +1 -0
- package/dist/nativeDexRouting.js +345 -0
- package/dist/nativeDexSeamless.d.ts +86 -0
- package/dist/nativeDexSeamless.d.ts.map +1 -0
- package/dist/nativeDexSeamless.js +131 -0
- package/dist/nativeDexSwap2Router.d.ts +45 -0
- package/dist/nativeDexSwap2Router.d.ts.map +1 -0
- package/dist/nativeDexSwap2Router.js +276 -0
- package/dist/nativeLpShareToken.d.ts +54 -0
- package/dist/nativeLpShareToken.d.ts.map +1 -0
- package/dist/nativeLpShareToken.js +135 -0
- package/dist/nativeTokenSecurity.d.ts +59 -0
- package/dist/nativeTokenSecurity.d.ts.map +1 -0
- package/dist/nativeTokenSecurity.js +59 -0
- package/dist/networkProfile.d.ts +8 -0
- package/dist/networkProfile.d.ts.map +1 -0
- package/dist/networkProfile.js +29 -0
- package/dist/newHeadsWs.d.ts +43 -0
- package/dist/newHeadsWs.d.ts.map +1 -0
- package/dist/newHeadsWs.js +139 -0
- package/dist/preflightGate.d.ts +16 -0
- package/dist/preflightGate.d.ts.map +1 -0
- package/dist/preflightGate.js +29 -0
- package/dist/receiptLogs.d.ts +29 -0
- package/dist/receiptLogs.d.ts.map +1 -0
- package/dist/receiptLogs.js +66 -0
- package/dist/referenceFungibleSecuredDeployBytecode.d.ts +54 -0
- package/dist/referenceFungibleSecuredDeployBytecode.d.ts.map +1 -0
- package/dist/referenceFungibleSecuredDeployBytecode.js +274 -0
- package/dist/referenceNft.d.ts +14 -0
- package/dist/referenceNft.d.ts.map +1 -0
- package/dist/referenceNft.js +34 -0
- package/dist/referenceToken.d.ts +14 -0
- package/dist/referenceToken.d.ts.map +1 -0
- package/dist/referenceToken.js +29 -0
- package/dist/retryAfter.d.ts +6 -0
- package/dist/retryAfter.d.ts.map +1 -0
- package/dist/retryAfter.js +24 -0
- package/dist/rpcCapabilities.d.ts +43 -0
- package/dist/rpcCapabilities.d.ts.map +1 -0
- package/dist/rpcCapabilities.js +159 -0
- package/dist/rpcDoctor.d.ts +27 -0
- package/dist/rpcDoctor.d.ts.map +1 -0
- package/dist/rpcDoctor.js +66 -0
- package/dist/rpcSurfaceUi.d.ts +32 -0
- package/dist/rpcSurfaceUi.d.ts.map +1 -0
- package/dist/rpcSurfaceUi.js +49 -0
- package/dist/submitFlow.d.ts +70 -0
- package/dist/submitFlow.d.ts.map +1 -0
- package/dist/submitFlow.js +121 -0
- package/dist/transactionBuilder.d.ts +55 -0
- package/dist/transactionBuilder.d.ts.map +1 -0
- package/dist/transactionBuilder.js +100 -0
- package/dist/types.d.ts +436 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/walletProvider.d.ts +46 -0
- package/dist/walletProvider.d.ts.map +1 -0
- package/dist/walletProvider.js +126 -0
- package/package.json +44 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boing SDK — TypeScript/JavaScript client for Boing Network.
|
|
3
|
+
*
|
|
4
|
+
* Provides a typed RPC client for all node methods (chain height, balance, account,
|
|
5
|
+
* blocks, proofs, simulation, submit, QA check, faucet, etc.) and hex utilities.
|
|
6
|
+
*
|
|
7
|
+
* Submit txs with `client.submitTransaction(hexSignedTx)` where `hexSignedTx` is
|
|
8
|
+
* 0x + bincode(`SignedTransaction`). Build and sign in JS via `signTransactionInput` /
|
|
9
|
+
* `buildTransferTransaction` (see `transactionBuilder.ts`), or use Boing Express
|
|
10
|
+
* `boing_sendTransaction`, or the Rust CLI.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SDK_VERSION = "0.1.0";
|
|
13
|
+
export { CANONICAL_BOING_TESTNET_NATIVE_CP_POOL_HEX } from './canonicalTestnet.js';
|
|
14
|
+
export { CANONICAL_BOING_TESTNET_NATIVE_DEX_DEPLOYER_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_FACTORY_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_LEDGER_ROUTER_V1_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_LEDGER_ROUTER_V2_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_LEDGER_ROUTER_V3_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_MULTIHOP_SWAP_ROUTER_HEX, CANONICAL_BOING_TESTNET_NATIVE_AMM_LP_VAULT_HEX, CANONICAL_BOING_TESTNET_NATIVE_LP_SHARE_TOKEN_HEX, } from './canonicalTestnetDex.js';
|
|
15
|
+
import { BoingClient } from './client.js';
|
|
16
|
+
export { BoingClient } from './client.js';
|
|
17
|
+
export type { BoingClientConfig } from './client.js';
|
|
18
|
+
export { BoingRpcError, explainBoingRpcError, isBoingRpcMethodNotFound, isRetriableBoingRpcError, } from './errors.js';
|
|
19
|
+
export { parseRetryAfterMs } from './retryAfter.js';
|
|
20
|
+
export { probeBoingRpcCapabilities, countAvailableBoingRpcMethods, explainBoingRpcProbeGaps, type BoingRpcCapabilities, type BoingRpcMethodProbe, type BoingRpcProbeBundle, } from './rpcCapabilities.js';
|
|
21
|
+
export { doctorBoingRpcEnvironment, formatBoingRpcDoctorReport, doctorErrorMessage, type BoingRpcDoctorOptions, type BoingRpcDoctorResult, } from './rpcDoctor.js';
|
|
22
|
+
export { BoingRpcPreflightError, assertBoingRpcEnvironment, isBoingRpcPreflightError, } from './preflightGate.js';
|
|
23
|
+
export { displayChainTitle, explorerBaseUrl, faucetUrl, explorerTxUrl, explorerAccountUrl, formatSupportHint, } from './dappUiHelpers.js';
|
|
24
|
+
export { mergeRpcSurface, clampGetLogsBlockSpan, suggestedReadSpacingMs, describeGetLogsLimits, websocketHasConnectionCap, } from './rpcSurfaceUi.js';
|
|
25
|
+
export { BoingConnectionMonitor, type BoingConnectionSnapshot, type BoingConnectionMonitorOptions, } from './connectionMonitor.js';
|
|
26
|
+
export { boingRpcWebSocketUrl, BoingNewHeadsWs, type BoingNewHeadsWsState, type BoingNewHeadsWsOptions, } from './newHeadsWs.js';
|
|
27
|
+
export { captureBoingNetworkProfile } from './networkProfile.js';
|
|
28
|
+
export { ensureHex, bytesToHex, hexToBytes, accountIdToHex, hexToAccountId, validateHex32, isBoingNativeAccountIdHex, } from './hex.js';
|
|
29
|
+
export type { AccountBalance, AccountState, AccountProof, Block, BlockHeader, ExecutionLog, ExecutionReceipt, VerifyProofResult, SimulateResult, SubmitTransactionResult, RegisterDappResult, SubmitIntentResult, QaCheckResult, QaCheckResponse, QaPoolConfigResult, QaPoolItemSummary, QaPoolListResult, QaPoolVoteResult, OperatorApplyQaPolicyResult, QaRegistryResult, FaucetResult, JsonRpcResponse, SyncState, NetworkInfo, BoingHealth, BoingHealthRpcSurface, BoingRpcMetrics, ChainNativeAggregates, NetworkDeveloperHints, NetworkEndUserHints, BoingNetworkProfile, JsonRpcBatchResponseItem, RpcMethodCatalog, RpcOpenApiDocument, BoingRpcPreflightResult, AccessListJson, ContractStorageWord, DexPoolListPage, DexPoolListRow, DexDiscoveryPoolDiagnostics, DexDiscoveryTokenDiagnostics, DexTokenListPage, DexTokenListRow, GetLogsFilter, RpcLogEntry, } from './types.js';
|
|
30
|
+
export { type BoingCalldataWord, assertBoingCalldataWord, boingWordSelector, boingWordU128, boingWordAccount, boingWordFixed, encodeBoingCall, calldataSelectorLastByte, calldataU128BeWord, calldataAccountIdWord, calldataFixedWord32, concatCalldata, } from './calldata.js';
|
|
31
|
+
export { type BoingAbiParamKind, type BoingAbiArg, type BoingCallDescriptor, abiArgU128, abiArgAccount, abiArgBytes32, abiArgBool, encodeBoingAbiArgToWord, encodeBoingCallFromAbiArgs, encodeBoingCallTyped, encodeBoingCallFromDescriptor, BoingReferenceCallDescriptors, } from './callAbi.js';
|
|
32
|
+
export { SELECTOR_TRANSFER, SELECTOR_MINT_FIRST, encodeReferenceTransferCalldata, encodeReferenceMintFirstCalldata, encodeReferenceTransferCalldataHex, } from './referenceToken.js';
|
|
33
|
+
export { SELECTOR_NATIVE_AMM_SWAP, SELECTOR_NATIVE_AMM_ADD_LIQUIDITY, SELECTOR_NATIVE_AMM_REMOVE_LIQUIDITY, SELECTOR_NATIVE_AMM_SET_TOKENS, SELECTOR_NATIVE_AMM_SET_SWAP_FEE_BPS, SELECTOR_NATIVE_AMM_SWAP_TO, SELECTOR_NATIVE_AMM_REMOVE_LIQUIDITY_TO, NATIVE_CP_SWAP_FEE_BPS, NATIVE_AMM_TOPIC_SWAP_HEX, NATIVE_AMM_TOPIC_ADD_LIQUIDITY_HEX, NATIVE_AMM_TOPIC_REMOVE_LIQUIDITY_HEX, nativeAmmLogTopic0Utf8, encodeNativeAmmSwapCalldata, encodeNativeAmmSwapToCalldata, encodeNativeAmmAddLiquidityCalldata, encodeNativeAmmRemoveLiquidityCalldata, encodeNativeAmmRemoveLiquidityToCalldata, encodeNativeAmmSetTokensCalldata, encodeNativeAmmSetSwapFeeBpsCalldata, encodeNativeAmmSwapCalldataHex, encodeNativeAmmSwapToCalldataHex, encodeNativeAmmAddLiquidityCalldataHex, encodeNativeAmmRemoveLiquidityCalldataHex, encodeNativeAmmRemoveLiquidityToCalldataHex, encodeNativeAmmSetTokensCalldataHex, encodeNativeAmmSetSwapFeeBpsCalldataHex, constantProductAmountOut, constantProductAmountOutNoFee, constantProductAmountOutWithFeeBps, } from './nativeAmm.js';
|
|
34
|
+
export { SELECTOR_NATIVE_DEX_REGISTER_PAIR, SELECTOR_NATIVE_DEX_PAIRS_COUNT, SELECTOR_NATIVE_DEX_GET_PAIR_AT, NATIVE_DEX_FACTORY_MAX_PAIRS, NATIVE_DEX_FACTORY_TOPIC_REGISTER_HEX, NATIVE_DEX_FACTORY_CREATE2_SALT_V1_HEX, encodeNativeDexRegisterPairCalldata, encodeNativeDexRegisterPairCalldataHex, encodeNativeDexPairsCountCalldata, encodeNativeDexPairsCountCalldataHex, encodeNativeDexGetPairAtCalldata, encodeNativeDexGetPairAtCalldataHex, } from './nativeDexFactory.js';
|
|
35
|
+
export { NATIVE_DEX_FACTORY_COUNT_KEY_HEX, buildNativeDexFactoryAccessList, buildNativeDexFactoryContractCallTx, mergeNativeDexFactoryAccessListWithSimulation, decodeNativeDexFactoryPairsCountReturnData, decodeNativeDexFactoryGetPairAtReturnData, fetchNativeDexFactoryPairsCount, findNativeDexFactoryPoolByTokens, type FindNativeDexFactoryPoolOptions, } from './nativeDexFactoryPool.js';
|
|
36
|
+
export { type NativeDexFactoryRegisterEvent, type NativeDexFactoryRegisterRpcParsed, isNativeDexFactoryRegisterTopic0, isNativeDexFactoryRegisterLog3Shape, tryParseNativeDexFactoryRegisterLog3, tryParseNativeDexFactoryRegisterRpcLogEntry, collectNativeDexFactoryRegisterLogsFromReceipt, } from './nativeDexFactoryLogs.js';
|
|
37
|
+
export { SELECTOR_NATIVE_DEX_LEDGER_ROUTER_FORWARD, SELECTOR_NATIVE_DEX_LEDGER_ROUTER_FORWARD_V2, SELECTOR_NATIVE_DEX_LEDGER_ROUTER_FORWARD_V3, encodeNativeDexLedgerRouterForwardCalldata, encodeNativeDexLedgerRouterForwardCalldataHex, encodeNativeDexLedgerRouterForwardCalldataV2, encodeNativeDexLedgerRouterForwardCalldataV2Hex, encodeNativeDexLedgerRouterForwardCalldataV3, encodeNativeDexLedgerRouterForwardCalldataV3Hex, buildNativeDexLedgerRouterAccessList, buildNativeDexLedgerRouterContractCallTx, buildNativeDexLedgerRouterV2ContractCallTx, buildNativeDexLedgerRouterV3ContractCallTx, mergeNativeDexLedgerRouterAccessListWithSimulation, } from './nativeDexLedgerRouter.js';
|
|
38
|
+
export { SELECTOR_NATIVE_DEX_SWAP2_ROUTER_128, SELECTOR_NATIVE_DEX_SWAP2_ROUTER_160, SELECTOR_NATIVE_DEX_SWAP3_ROUTER_128, SELECTOR_NATIVE_DEX_SWAP3_ROUTER_160, SELECTOR_NATIVE_DEX_SWAP4_ROUTER_128, SELECTOR_NATIVE_DEX_SWAP4_ROUTER_160, encodeNativeDexSwap2RouterCalldata128, encodeNativeDexSwap2RouterCalldata128Hex, encodeNativeDexSwap2RouterCalldata160, encodeNativeDexSwap2RouterCalldata160Hex, encodeNativeDexSwap3RouterCalldata128, encodeNativeDexSwap3RouterCalldata128Hex, encodeNativeDexSwap3RouterCalldata160, encodeNativeDexSwap3RouterCalldata160Hex, encodeNativeDexSwap4RouterCalldata128, encodeNativeDexSwap4RouterCalldata128Hex, encodeNativeDexSwap4RouterCalldata160, encodeNativeDexSwap4RouterCalldata160Hex, } from './nativeDexSwap2Router.js';
|
|
39
|
+
export { SELECTOR_LP_SHARE_TRANSFER, SELECTOR_LP_SHARE_MINT, SELECTOR_LP_SHARE_SET_MINTER_ONCE, LP_SHARE_MINTER_KEY_U8, buildLpShareTokenAccessList, buildLpShareTokenContractCallTx, encodeLpShareTransferCalldata, encodeLpShareTransferCalldataHex, encodeLpShareMintCalldata, encodeLpShareMintCalldataHex, encodeLpShareSetMinterOnceCalldata, encodeLpShareSetMinterOnceCalldataHex, mergeLpShareTokenAccessListWithSimulation, lpShareTokenBalanceStorageKeyHex, fetchLpShareTokenBalanceRaw, } from './nativeLpShareToken.js';
|
|
40
|
+
export { SELECTOR_NATIVE_AMM_LP_VAULT_CONFIGURE, SELECTOR_NATIVE_AMM_LP_VAULT_DEPOSIT_ADD, buildNativeAmmLpVaultConfigureAccessList, buildNativeAmmLpVaultConfigureContractCallTx, buildNativeAmmLpVaultDepositAddAccessList, buildNativeAmmLpVaultDepositAddContractCallTx, encodeNativeAmmLpVaultConfigureCalldata, encodeNativeAmmLpVaultConfigureCalldataHex, encodeNativeAmmLpVaultDepositAddCalldata, encodeNativeAmmLpVaultDepositAddCalldataHex, mergeNativeAmmLpVaultConfigureAccessListWithSimulation, mergeNativeAmmLpVaultDepositAddAccessListWithSimulation, } from './nativeAmmLpVault.js';
|
|
41
|
+
export { buildNativeConstantProductPoolAccessList, buildNativeConstantProductContractCallTx, mergeNativePoolAccessListWithSimulation, type NativePoolAccessListOptions, NATIVE_CONSTANT_PRODUCT_RESERVE_A_KEY_HEX, NATIVE_CONSTANT_PRODUCT_RESERVE_B_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOTAL_LP_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOKEN_A_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOKEN_B_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOKENS_CONFIGURED_KEY_HEX, NATIVE_CONSTANT_PRODUCT_SWAP_FEE_BPS_KEY_HEX, nativeAmmLpBalanceStorageKeyHex, decodeBoingStorageWordU128, decodeNativeAmmAddLiquidityReturnLpMinted, decodeNativeAmmLogDataU128Triple, fetchNativeConstantProductReserves, fetchNativeConstantProductTotalLpSupply, fetchNativeConstantProductSwapFeeBps, fetchNativeAmmSignerLpBalance, fetchNativeConstantProductPoolSnapshot, type NativeConstantProductPoolSnapshot, } from './nativeAmmPool.js';
|
|
42
|
+
export { type NativeAmmLog2Kind, type NativeAmmLog2Event, type NativeAmmRpcLogParsed, isNativeAmmLog2Topic0, isNativeAmmLog2Shape, tryParseNativeAmmLog2, tryParseNativeAmmRpcLogEntry, filterMapNativeAmmRpcLogs, collectNativeAmmLog2FromReceipt, } from './nativeAmmLogs.js';
|
|
43
|
+
export { type NativeAmmVaultPoolResolution, type NativeDexLpVaultSharePositionForOwner, resolveNativeAmmVaultPoolMapping, resolveNativeAmmVaultPoolMappings, fetchNativeDexLpVaultSharePositionForOwner, } from './nativeDexLpPositions.js';
|
|
44
|
+
export { type NativeDexMaterializedPoolEvent, type CollectNativeDexPoolEventsOptions, materializeNativeAmmPoolEvent, collectNativeDexPoolEventsForPools, hydrateNativeDexPoolEventsWithBlockHashes, } from './nativeDexPoolHistory.js';
|
|
45
|
+
export { ERC721_TRANSFER_TOPIC0_HEX, tryParseErc721TransferRpcLog, filterMapErc721TransferRpcLogs, type Erc721TransferParsed, } from './erc721Logs.js';
|
|
46
|
+
export { type NativeDexIndexedNftOwnerRow, type CollectNftOwnersFromErc721TransfersOptions, collectNftOwnersFromErc721Transfers, } from './nativeDexNftIndexer.js';
|
|
47
|
+
export { type NativeDexArchivedReceiptLogRow, type CollectArchivedReceiptLogRowsOptions, collectArchivedReceiptLogRows, } from './nativeDexReceiptArchive.js';
|
|
48
|
+
export { SELECTOR_OWNER_OF, SELECTOR_TRANSFER_NFT, SELECTOR_SET_METADATA_HASH, encodeReferenceOwnerOfCalldata, encodeReferenceTransferNftCalldata, encodeReferenceSetMetadataHashCalldata, encodeReferenceOwnerOfCalldataHex, } from './referenceNft.js';
|
|
49
|
+
export { accountsFromSuggestedAccessList, mergeAccessListWithSimulation, accessListFromSimulation, simulationCoversSuggestedAccessList, } from './accessList.js';
|
|
50
|
+
export { normalizeTopicWord, normalizeExecutionLog, logTopic0, iterReceiptLogs, logMatchesTopicFilter, filterReceiptLogsByTopic0, iterBlockReceiptLogs, } from './receiptLogs.js';
|
|
51
|
+
export type { ReceiptLogRef } from './receiptLogs.js';
|
|
52
|
+
export { PayloadVariant, concatBytes, writeU32Le, writeU64Le, writeU128Le, encodeAccessList, encodeByteVec, encodeBincodeString, encodeOptionFixed32, encodeOptionByteVec, encodeOptionString, encodeTransactionPayload, encodeTransaction, encodeSignature, encodeSignedTransaction, signableTransactionHash, transactionIdFromSignedTransactionHex, } from './bincode.js';
|
|
53
|
+
export type { TransactionInput, TransactionPayloadInput } from './bincode.js';
|
|
54
|
+
export { buildTransferTransaction, buildContractCallTransaction, buildDeployWithPurposeTransaction, fetchNextNonce, senderHexFromSecretKey, signTransactionInput, signTransactionInputWithSigner, } from './transactionBuilder.js';
|
|
55
|
+
export type { BuildTransferInput, BuildContractCallInput, BuildDeployWithPurposeInput, Ed25519SecretKey32 } from './transactionBuilder.js';
|
|
56
|
+
export { predictCreate2ContractAddress, predictNonceDerivedContractAddress, predictNativeCpPoolCreate2Address, predictNativeCpPoolV2Create2Address, predictNativeCpPoolV3Create2Address, predictNativeCpPoolV4Create2Address, predictNativeCpPoolV5Create2Address, predictNativeDexFactoryCreate2Address, predictNativeDexLedgerRouterCreate2Address, predictNativeDexLedgerRouterV2Create2Address, predictNativeDexLedgerRouterV3Create2Address, predictNativeDexMultihopSwapRouterCreate2Address, predictNativeDexSwap2RouterCreate2Address, predictNativeLpShareTokenCreate2Address, predictNativeAmmLpVaultCreate2Address, nativeCpPoolCreate2SaltV1Hex, nativeCpPoolCreate2SaltV2Hex, nativeCpPoolCreate2SaltV3Hex, nativeCpPoolCreate2SaltV4Hex, nativeCpPoolCreate2SaltV5Hex, nativeDexFactoryCreate2SaltV1Hex, nativeDexLedgerRouterCreate2SaltV1Hex, nativeDexLedgerRouterCreate2SaltV2Hex, nativeDexLedgerRouterCreate2SaltV3Hex, nativeDexMultihopSwapRouterCreate2SaltV1Hex, nativeDexSwap2RouterCreate2SaltV1Hex, nativeLpShareTokenCreate2SaltV1Hex, nativeAmmLpVaultCreate2SaltV1Hex, NATIVE_CP_POOL_CREATE2_SALT_V1, NATIVE_CP_POOL_CREATE2_SALT_V2, NATIVE_CP_POOL_CREATE2_SALT_V3, NATIVE_CP_POOL_CREATE2_SALT_V4, NATIVE_CP_POOL_CREATE2_SALT_V5, NATIVE_DEX_FACTORY_CREATE2_SALT_V1, NATIVE_DEX_LEDGER_ROUTER_CREATE2_SALT_V1, NATIVE_DEX_LEDGER_ROUTER_CREATE2_SALT_V2, NATIVE_DEX_LEDGER_ROUTER_CREATE2_SALT_V3, NATIVE_DEX_MULTIHOP_SWAP_ROUTER_CREATE2_SALT_V1, NATIVE_DEX_SWAP2_ROUTER_CREATE2_SALT_V1, NATIVE_LP_SHARE_TOKEN_CREATE2_SALT_V1, NATIVE_AMM_LP_VAULT_CREATE2_SALT_V1, } from './create2.js';
|
|
57
|
+
export { submitTransferWithSimulationRetry, submitContractCallWithSimulationRetry, submitDeployWithPurposeFlow, SimulationFailedError, } from './submitFlow.js';
|
|
58
|
+
export type { SubmitTransferWithSimulationOptions, SubmitContractCallWithSimulationOptions, SubmitFlowResult, } from './submitFlow.js';
|
|
59
|
+
export { createNativeContractSubmitter, type NativeContractSubmitterConfig, } from './nativeContractSubmit.js';
|
|
60
|
+
export { DEFAULT_GET_LOGS_MAX_BLOCK_SPAN, mapWithConcurrencyLimit, flattenReceiptsFromBundles, planLogBlockChunks, getLogsChunked, fetchReceiptsForBlockHeight, fetchReceiptsForHeightRange, fetchBlocksWithReceiptsForHeightRange, type LogChunkFilter, type BlockReceiptsBundle, type BlockWithReceiptsBundle, type FetchReceiptsHeightRangeMissing, type FetchReceiptsForHeightRangeOptions, type FetchBlocksWithReceiptsForHeightRangeOptions, type GetLogsChunkedOptions, type MapWithConcurrencyLimitOptions, summarizeIndexerFetchGaps, type IndexerFetchGapSummary, } from './indexerBatch.js';
|
|
61
|
+
export { getIndexerChainTips, clampIndexerHeightRange, planIndexerChainTipsWithFallback, planIndexerCatchUp, type IndexerChainTips, type IndexerTipsSource, type IndexerCatchUpPlan, type PlanIndexerCatchUpOptions, } from './indexerSync.js';
|
|
62
|
+
export { mergeInclusiveHeightRanges, unionInclusiveHeightRanges, subtractInclusiveRangeFromRanges, blockHeightGapRowsForInsert, nextContiguousIndexedHeightAfterOmittedFetch, type InclusiveHeightRange, type BlockHeightGapInsertRow, } from './indexerGaps.js';
|
|
63
|
+
export { DEFAULT_REFERENCE_FUNGIBLE_TEMPLATE_BYTECODE_HEX } from './defaultReferenceFungibleTemplateBytecodeHex.js';
|
|
64
|
+
export { DEFAULT_REFERENCE_FUNGIBLE_SECURED_TEMPLATE_BYTECODE_HEX } from './defaultReferenceFungibleSecuredTemplateBytecodeHex.js';
|
|
65
|
+
export { DEFAULT_REFERENCE_NFT_COLLECTION_TEMPLATE_BYTECODE_HEX } from './defaultReferenceNftCollectionTemplateBytecodeHex.js';
|
|
66
|
+
export { REFERENCE_FUNGIBLE_TEMPLATE_ARTIFACT_ID, REFERENCE_FUNGIBLE_TEMPLATE_VERSION, REFERENCE_FUNGIBLE_SECURED_TEMPLATE_ARTIFACT_ID, REFERENCE_FUNGIBLE_SECURED_TEMPLATE_VERSION, REFERENCE_NFT_COLLECTION_TEMPLATE_ARTIFACT_ID, REFERENCE_NFT_COLLECTION_TEMPLATE_VERSION, ensure0xHex, resolveReferenceFungibleTemplateBytecodeHex, resolveReferenceFungibleSecuredTemplateBytecodeHex, resolveReferenceNftCollectionTemplateBytecodeHex, buildContractDeployMetaTx, buildReferenceFungibleDeployMetaTx, buildReferenceFungibleSecuredDeployMetaTx, buildReferenceNftCollectionDeployMetaTx, resolveNativeConstantProductPoolBytecodeHex, buildNativeConstantProductPoolDeployMetaTx, type ContractDeployMetaTxObject, type BuildReferenceFungibleDeployMetaTxInput, type BuildReferenceFungibleSecuredDeployMetaTxInput, type BuildReferenceNftCollectionDeployMetaTxInput, type BuildNativeConstantProductPoolDeployMetaTxInput, } from './canonicalDeployArtifacts.js';
|
|
67
|
+
export { normalizeNativeTokenSecurity, descriptionHashHexFromNativeTokenSecurity, type NativeTokenSecurityFeaturesInput, type NativeTokenSecurityFeaturesNormalized, } from './nativeTokenSecurity.js';
|
|
68
|
+
export { FLAG_ANTI_BOT, FLAG_COOLDOWN, FLAG_DENYLIST, FLAG_MAX_TX, FLAG_MAX_WALLET, FLAG_NO_MINT, FLAG_TRANSFER_UNLOCK, buildReferenceFungibleSecuredDeployBytecodeHexFromNativeTokenSecurity, referenceFungibleSecuredConfigFromNativeTokenSecurity, referenceFungibleSecuredDeployBytecodeHex, type ReferenceFungibleSecuredConfigBytes, type SecuredWizardBuildContext, } from './referenceFungibleSecuredDeployBytecode.js';
|
|
69
|
+
export { BOING_TESTNET_CHAIN_ID_DECIMAL, BOING_TESTNET_CHAIN_ID_HEX, normalizeBoingChainIdHex, isBoingTestnetChainId, } from './chainIds.js';
|
|
70
|
+
export { BOING_QA_PLACEHOLDER_DESCRIPTION_HASH_HEX, preflightContractDeployMetaQa, describeContractDeployMetaQaResponse, preflightContractDeployMetaWithUi, buildAndPreflightReferenceFungibleDeploy, buildAndPreflightReferenceNftCollectionDeployMeta, buildAndPreflightNativeConstantProductPoolDeploy, buildAndPreflightBoingIntegrationDeploy, type BoingDeployIntegrationKind, defaultPurposeCategoryForBoingDeployKind, buildBoingIntegrationDeployMetaTx, preflightBoingIntegrationDeploy, type DeployMetaQaUiOutcome, type PreflightContractDeployMetaWithUiResult, type BuildAndPreflightReferenceFungibleResult, type BuildAndPreflightReferenceNftCollectionResult, type BoingIntegrationDeployInput, type PreflightBoingIntegrationDeployResult, type BuildAndPreflightNativeConstantProductPoolResult, } from './dappDeploy.js';
|
|
71
|
+
export { mergeNativeDexIntegrationDefaults, fetchNativeDexIntegrationDefaults, fetchNativeDexFactoryRegisterLogs, buildNativeDexIntegrationOverridesFromProcessEnv, type NativeDexIntegrationDefaults, type NativeDexIntegrationOverrides, type NativeDexDefaultSource, } from './dexIntegration.js';
|
|
72
|
+
export { nativeDexPairKey, buildNativeDexRegisterLogPoolIndex, pickNativeDexPoolFromRegisterLogs, fetchNativeDexDirectorySnapshot, resolveNativeDexPoolForTokens, suggestNativeDexRegisterLogCatchUpRange, type NativeDexDirectorySnapshot, type FetchNativeDexDirectorySnapshotOptions, type ResolveNativeDexPoolForTokensResult, type ResolveNativeDexPoolForTokensOptions, } from './nativeDexDirectory.js';
|
|
73
|
+
export { BOING_NATIVE_DEX_NOT_EVM_TAGLINE, BOING_NATIVE_DEX_NOT_EVM_BULLETS, BOING_NATIVE_DEX_TOOLKIT_RPC_METHODS, formatBoingNativeDexNotEvmDisclaimer, describeNativeDexDefaultGaps, assertBoingNativeDexToolkitRpc, formatNativeDexToolkitPreflightForUi, buildNativeCpPoolSwapExpressTx, } from './nativeDexSeamless.js';
|
|
74
|
+
export { quoteCpPoolSwap, rankDirectCpPools, findBestCpRoutes, findBestCpRoute, quoteCpEvenSplitAcrossDirectPools, hydrateCpPoolVenuesFromRpc, fetchCpRoutingFromDirectoryLogs, type CpPoolVenue, type CpQuoteResult, type RouteHop, type CpSwapRoute, type PoolTokenRow, type FetchCpRoutingFromDirectoryLogsOptions, } from './nativeDexRouting.js';
|
|
75
|
+
export { type NativeDexIndexerHistoryPoint, type NativeDexIndexerPersistedDoc, type NativeDexIndexerHistoryStore, type NativeDexIndexerTokenMeta, type NativeDexIndexerStatsOptions, type NativeDexIndexerPoolRow, type NativeDexIndexerStatsPayload, parseNativeDexIndexerPersistedDoc, appendVenuesToHistoryDoc, buildDexOverridesFromPlainEnv, buildNativeDexIndexerStatsForClient, } from './nativeDexIndexerStats.js';
|
|
76
|
+
export { NATIVE_DEX_DIRECTORY_API_ID, NATIVE_DEX_DIRECTORY_SCHEMA_VERSION, NativeDexDirectoryHttpError, normalizeNativeDexDirectoryWorkerBaseUrl, parseNativeDexDirectoryMetaResponse, parseNativeDexDirectoryPoolsPageResponse, parseNativeDexDirectoryPoolEventsPageResponse, parseNativeDexDirectoryUserEventsPageResponse, fetchNativeDexDirectoryMeta, fetchNativeDexDirectoryPoolsPage, fetchNativeDexDirectoryPoolEventsPage, fetchNativeDexDirectoryUserEventsPage, collectAllNativeDexDirectoryPools, type NativeDexDirectoryMetaResponse, type NativeDexDirectoryPoolsPageResponse, type NativeDexDirectoryPoolEventsPageResponse, type NativeDexDirectoryUserEventsPageResponse, type FetchNativeDexDirectoryPoolsPageQuery, type FetchNativeDexDirectoryPoolEventsPageQuery, type FetchNativeDexDirectoryUserEventsPageQuery, type CollectNativeDexDirectoryPoolsOptions, } from './nativeDexDirectoryApi.js';
|
|
77
|
+
export { getInjectedEip1193Provider, providerSupportsBoingNativeRpc, boingSendTransaction, requestAccounts, readChainIdHex, connectInjectedBoingWallet, mapInjectedProviderErrorToUiMessage, BOING_WALLET_RPC_METHODS_NATIVE_DAPP, explainEthSendTransactionInsufficientForBoingNativeCall, type Eip1193Requester, type BoingInjectedWalletConnectResult, } from './walletProvider.js';
|
|
78
|
+
/**
|
|
79
|
+
* Create a Boing RPC client.
|
|
80
|
+
* @param config - Node URL string (e.g. "http://localhost:8545") or config object (baseUrl, fetch?, timeoutMs?, maxRetries?, …).
|
|
81
|
+
*/
|
|
82
|
+
export declare function createClient(config: string | import('./client.js').BoingClientConfig): BoingClient;
|
|
83
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,OAAO,EAAE,0CAA0C,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EACL,+CAA+C,EAC/C,8CAA8C,EAC9C,uDAAuD,EACvD,uDAAuD,EACvD,uDAAuD,EACvD,2DAA2D,EAC3D,+CAA+C,EAC/C,iDAAiD,GAClD,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,GACzB,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mC,EACnC,wCAAwC,EACxC,6CAA6C,EAC7C,6CAA6C,EAC7C,2BAA2B,EAC3B,gCAAgC,EAChC,qCAAqC,EACrC,qCAAqC,EACrC,iCAAiC,EACjC,KAAK,8BAA8B,EACnC,KAAK,mCAAmC,EACxC,KAAK,wCAAwC,EAC7C,KAAK,wCAAwC,EAC7C,KAAK,qCAAqC,EAC1C,KAAK,0CAA0C,EAC/C,KAAK,0CAA0C,EAC/C,KAAK,qCAAqC,GAC3C,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,0BAA0B,EAC1B,mCAAmC,EACnC,oCAAoC,EACpC,uDAAuD,EACvD,KAAK,gBAAgB,EACrB,KAAK,gCAAgC,GACtC,MAAM,qBAAqB,CAAC;AAE7B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,aAAa,EAAE,iBAAiB,GAAG,WAAW,CAElG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boing SDK — TypeScript/JavaScript client for Boing Network.
|
|
3
|
+
*
|
|
4
|
+
* Provides a typed RPC client for all node methods (chain height, balance, account,
|
|
5
|
+
* blocks, proofs, simulation, submit, QA check, faucet, etc.) and hex utilities.
|
|
6
|
+
*
|
|
7
|
+
* Submit txs with `client.submitTransaction(hexSignedTx)` where `hexSignedTx` is
|
|
8
|
+
* 0x + bincode(`SignedTransaction`). Build and sign in JS via `signTransactionInput` /
|
|
9
|
+
* `buildTransferTransaction` (see `transactionBuilder.ts`), or use Boing Express
|
|
10
|
+
* `boing_sendTransaction`, or the Rust CLI.
|
|
11
|
+
*/
|
|
12
|
+
export const SDK_VERSION = '0.1.0';
|
|
13
|
+
export { CANONICAL_BOING_TESTNET_NATIVE_CP_POOL_HEX } from './canonicalTestnet.js';
|
|
14
|
+
export { CANONICAL_BOING_TESTNET_NATIVE_DEX_DEPLOYER_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_FACTORY_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_LEDGER_ROUTER_V1_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_LEDGER_ROUTER_V2_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_LEDGER_ROUTER_V3_HEX, CANONICAL_BOING_TESTNET_NATIVE_DEX_MULTIHOP_SWAP_ROUTER_HEX, CANONICAL_BOING_TESTNET_NATIVE_AMM_LP_VAULT_HEX, CANONICAL_BOING_TESTNET_NATIVE_LP_SHARE_TOKEN_HEX, } from './canonicalTestnetDex.js';
|
|
15
|
+
import { BoingClient } from './client.js';
|
|
16
|
+
export { BoingClient } from './client.js';
|
|
17
|
+
export { BoingRpcError, explainBoingRpcError, isBoingRpcMethodNotFound, isRetriableBoingRpcError, } from './errors.js';
|
|
18
|
+
export { parseRetryAfterMs } from './retryAfter.js';
|
|
19
|
+
export { probeBoingRpcCapabilities, countAvailableBoingRpcMethods, explainBoingRpcProbeGaps, } from './rpcCapabilities.js';
|
|
20
|
+
export { doctorBoingRpcEnvironment, formatBoingRpcDoctorReport, doctorErrorMessage, } from './rpcDoctor.js';
|
|
21
|
+
export { BoingRpcPreflightError, assertBoingRpcEnvironment, isBoingRpcPreflightError, } from './preflightGate.js';
|
|
22
|
+
export { displayChainTitle, explorerBaseUrl, faucetUrl, explorerTxUrl, explorerAccountUrl, formatSupportHint, } from './dappUiHelpers.js';
|
|
23
|
+
export { mergeRpcSurface, clampGetLogsBlockSpan, suggestedReadSpacingMs, describeGetLogsLimits, websocketHasConnectionCap, } from './rpcSurfaceUi.js';
|
|
24
|
+
export { BoingConnectionMonitor, } from './connectionMonitor.js';
|
|
25
|
+
export { boingRpcWebSocketUrl, BoingNewHeadsWs, } from './newHeadsWs.js';
|
|
26
|
+
export { captureBoingNetworkProfile } from './networkProfile.js';
|
|
27
|
+
export { ensureHex, bytesToHex, hexToBytes, accountIdToHex, hexToAccountId, validateHex32, isBoingNativeAccountIdHex, } from './hex.js';
|
|
28
|
+
export { assertBoingCalldataWord, boingWordSelector, boingWordU128, boingWordAccount, boingWordFixed, encodeBoingCall, calldataSelectorLastByte, calldataU128BeWord, calldataAccountIdWord, calldataFixedWord32, concatCalldata, } from './calldata.js';
|
|
29
|
+
export { abiArgU128, abiArgAccount, abiArgBytes32, abiArgBool, encodeBoingAbiArgToWord, encodeBoingCallFromAbiArgs, encodeBoingCallTyped, encodeBoingCallFromDescriptor, BoingReferenceCallDescriptors, } from './callAbi.js';
|
|
30
|
+
export { SELECTOR_TRANSFER, SELECTOR_MINT_FIRST, encodeReferenceTransferCalldata, encodeReferenceMintFirstCalldata, encodeReferenceTransferCalldataHex, } from './referenceToken.js';
|
|
31
|
+
export { SELECTOR_NATIVE_AMM_SWAP, SELECTOR_NATIVE_AMM_ADD_LIQUIDITY, SELECTOR_NATIVE_AMM_REMOVE_LIQUIDITY, SELECTOR_NATIVE_AMM_SET_TOKENS, SELECTOR_NATIVE_AMM_SET_SWAP_FEE_BPS, SELECTOR_NATIVE_AMM_SWAP_TO, SELECTOR_NATIVE_AMM_REMOVE_LIQUIDITY_TO, NATIVE_CP_SWAP_FEE_BPS, NATIVE_AMM_TOPIC_SWAP_HEX, NATIVE_AMM_TOPIC_ADD_LIQUIDITY_HEX, NATIVE_AMM_TOPIC_REMOVE_LIQUIDITY_HEX, nativeAmmLogTopic0Utf8, encodeNativeAmmSwapCalldata, encodeNativeAmmSwapToCalldata, encodeNativeAmmAddLiquidityCalldata, encodeNativeAmmRemoveLiquidityCalldata, encodeNativeAmmRemoveLiquidityToCalldata, encodeNativeAmmSetTokensCalldata, encodeNativeAmmSetSwapFeeBpsCalldata, encodeNativeAmmSwapCalldataHex, encodeNativeAmmSwapToCalldataHex, encodeNativeAmmAddLiquidityCalldataHex, encodeNativeAmmRemoveLiquidityCalldataHex, encodeNativeAmmRemoveLiquidityToCalldataHex, encodeNativeAmmSetTokensCalldataHex, encodeNativeAmmSetSwapFeeBpsCalldataHex, constantProductAmountOut, constantProductAmountOutNoFee, constantProductAmountOutWithFeeBps, } from './nativeAmm.js';
|
|
32
|
+
export { SELECTOR_NATIVE_DEX_REGISTER_PAIR, SELECTOR_NATIVE_DEX_PAIRS_COUNT, SELECTOR_NATIVE_DEX_GET_PAIR_AT, NATIVE_DEX_FACTORY_MAX_PAIRS, NATIVE_DEX_FACTORY_TOPIC_REGISTER_HEX, NATIVE_DEX_FACTORY_CREATE2_SALT_V1_HEX, encodeNativeDexRegisterPairCalldata, encodeNativeDexRegisterPairCalldataHex, encodeNativeDexPairsCountCalldata, encodeNativeDexPairsCountCalldataHex, encodeNativeDexGetPairAtCalldata, encodeNativeDexGetPairAtCalldataHex, } from './nativeDexFactory.js';
|
|
33
|
+
export { NATIVE_DEX_FACTORY_COUNT_KEY_HEX, buildNativeDexFactoryAccessList, buildNativeDexFactoryContractCallTx, mergeNativeDexFactoryAccessListWithSimulation, decodeNativeDexFactoryPairsCountReturnData, decodeNativeDexFactoryGetPairAtReturnData, fetchNativeDexFactoryPairsCount, findNativeDexFactoryPoolByTokens, } from './nativeDexFactoryPool.js';
|
|
34
|
+
export { isNativeDexFactoryRegisterTopic0, isNativeDexFactoryRegisterLog3Shape, tryParseNativeDexFactoryRegisterLog3, tryParseNativeDexFactoryRegisterRpcLogEntry, collectNativeDexFactoryRegisterLogsFromReceipt, } from './nativeDexFactoryLogs.js';
|
|
35
|
+
export { SELECTOR_NATIVE_DEX_LEDGER_ROUTER_FORWARD, SELECTOR_NATIVE_DEX_LEDGER_ROUTER_FORWARD_V2, SELECTOR_NATIVE_DEX_LEDGER_ROUTER_FORWARD_V3, encodeNativeDexLedgerRouterForwardCalldata, encodeNativeDexLedgerRouterForwardCalldataHex, encodeNativeDexLedgerRouterForwardCalldataV2, encodeNativeDexLedgerRouterForwardCalldataV2Hex, encodeNativeDexLedgerRouterForwardCalldataV3, encodeNativeDexLedgerRouterForwardCalldataV3Hex, buildNativeDexLedgerRouterAccessList, buildNativeDexLedgerRouterContractCallTx, buildNativeDexLedgerRouterV2ContractCallTx, buildNativeDexLedgerRouterV3ContractCallTx, mergeNativeDexLedgerRouterAccessListWithSimulation, } from './nativeDexLedgerRouter.js';
|
|
36
|
+
export { SELECTOR_NATIVE_DEX_SWAP2_ROUTER_128, SELECTOR_NATIVE_DEX_SWAP2_ROUTER_160, SELECTOR_NATIVE_DEX_SWAP3_ROUTER_128, SELECTOR_NATIVE_DEX_SWAP3_ROUTER_160, SELECTOR_NATIVE_DEX_SWAP4_ROUTER_128, SELECTOR_NATIVE_DEX_SWAP4_ROUTER_160, encodeNativeDexSwap2RouterCalldata128, encodeNativeDexSwap2RouterCalldata128Hex, encodeNativeDexSwap2RouterCalldata160, encodeNativeDexSwap2RouterCalldata160Hex, encodeNativeDexSwap3RouterCalldata128, encodeNativeDexSwap3RouterCalldata128Hex, encodeNativeDexSwap3RouterCalldata160, encodeNativeDexSwap3RouterCalldata160Hex, encodeNativeDexSwap4RouterCalldata128, encodeNativeDexSwap4RouterCalldata128Hex, encodeNativeDexSwap4RouterCalldata160, encodeNativeDexSwap4RouterCalldata160Hex, } from './nativeDexSwap2Router.js';
|
|
37
|
+
export { SELECTOR_LP_SHARE_TRANSFER, SELECTOR_LP_SHARE_MINT, SELECTOR_LP_SHARE_SET_MINTER_ONCE, LP_SHARE_MINTER_KEY_U8, buildLpShareTokenAccessList, buildLpShareTokenContractCallTx, encodeLpShareTransferCalldata, encodeLpShareTransferCalldataHex, encodeLpShareMintCalldata, encodeLpShareMintCalldataHex, encodeLpShareSetMinterOnceCalldata, encodeLpShareSetMinterOnceCalldataHex, mergeLpShareTokenAccessListWithSimulation, lpShareTokenBalanceStorageKeyHex, fetchLpShareTokenBalanceRaw, } from './nativeLpShareToken.js';
|
|
38
|
+
export { SELECTOR_NATIVE_AMM_LP_VAULT_CONFIGURE, SELECTOR_NATIVE_AMM_LP_VAULT_DEPOSIT_ADD, buildNativeAmmLpVaultConfigureAccessList, buildNativeAmmLpVaultConfigureContractCallTx, buildNativeAmmLpVaultDepositAddAccessList, buildNativeAmmLpVaultDepositAddContractCallTx, encodeNativeAmmLpVaultConfigureCalldata, encodeNativeAmmLpVaultConfigureCalldataHex, encodeNativeAmmLpVaultDepositAddCalldata, encodeNativeAmmLpVaultDepositAddCalldataHex, mergeNativeAmmLpVaultConfigureAccessListWithSimulation, mergeNativeAmmLpVaultDepositAddAccessListWithSimulation, } from './nativeAmmLpVault.js';
|
|
39
|
+
export { buildNativeConstantProductPoolAccessList, buildNativeConstantProductContractCallTx, mergeNativePoolAccessListWithSimulation, NATIVE_CONSTANT_PRODUCT_RESERVE_A_KEY_HEX, NATIVE_CONSTANT_PRODUCT_RESERVE_B_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOTAL_LP_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOKEN_A_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOKEN_B_KEY_HEX, NATIVE_CONSTANT_PRODUCT_TOKENS_CONFIGURED_KEY_HEX, NATIVE_CONSTANT_PRODUCT_SWAP_FEE_BPS_KEY_HEX, nativeAmmLpBalanceStorageKeyHex, decodeBoingStorageWordU128, decodeNativeAmmAddLiquidityReturnLpMinted, decodeNativeAmmLogDataU128Triple, fetchNativeConstantProductReserves, fetchNativeConstantProductTotalLpSupply, fetchNativeConstantProductSwapFeeBps, fetchNativeAmmSignerLpBalance, fetchNativeConstantProductPoolSnapshot, } from './nativeAmmPool.js';
|
|
40
|
+
export { isNativeAmmLog2Topic0, isNativeAmmLog2Shape, tryParseNativeAmmLog2, tryParseNativeAmmRpcLogEntry, filterMapNativeAmmRpcLogs, collectNativeAmmLog2FromReceipt, } from './nativeAmmLogs.js';
|
|
41
|
+
export { resolveNativeAmmVaultPoolMapping, resolveNativeAmmVaultPoolMappings, fetchNativeDexLpVaultSharePositionForOwner, } from './nativeDexLpPositions.js';
|
|
42
|
+
export { materializeNativeAmmPoolEvent, collectNativeDexPoolEventsForPools, hydrateNativeDexPoolEventsWithBlockHashes, } from './nativeDexPoolHistory.js';
|
|
43
|
+
export { ERC721_TRANSFER_TOPIC0_HEX, tryParseErc721TransferRpcLog, filterMapErc721TransferRpcLogs, } from './erc721Logs.js';
|
|
44
|
+
export { collectNftOwnersFromErc721Transfers, } from './nativeDexNftIndexer.js';
|
|
45
|
+
export { collectArchivedReceiptLogRows, } from './nativeDexReceiptArchive.js';
|
|
46
|
+
export { SELECTOR_OWNER_OF, SELECTOR_TRANSFER_NFT, SELECTOR_SET_METADATA_HASH, encodeReferenceOwnerOfCalldata, encodeReferenceTransferNftCalldata, encodeReferenceSetMetadataHashCalldata, encodeReferenceOwnerOfCalldataHex, } from './referenceNft.js';
|
|
47
|
+
export { accountsFromSuggestedAccessList, mergeAccessListWithSimulation, accessListFromSimulation, simulationCoversSuggestedAccessList, } from './accessList.js';
|
|
48
|
+
export { normalizeTopicWord, normalizeExecutionLog, logTopic0, iterReceiptLogs, logMatchesTopicFilter, filterReceiptLogsByTopic0, iterBlockReceiptLogs, } from './receiptLogs.js';
|
|
49
|
+
export { PayloadVariant, concatBytes, writeU32Le, writeU64Le, writeU128Le, encodeAccessList, encodeByteVec, encodeBincodeString, encodeOptionFixed32, encodeOptionByteVec, encodeOptionString, encodeTransactionPayload, encodeTransaction, encodeSignature, encodeSignedTransaction, signableTransactionHash, transactionIdFromSignedTransactionHex, } from './bincode.js';
|
|
50
|
+
export { buildTransferTransaction, buildContractCallTransaction, buildDeployWithPurposeTransaction, fetchNextNonce, senderHexFromSecretKey, signTransactionInput, signTransactionInputWithSigner, } from './transactionBuilder.js';
|
|
51
|
+
export { predictCreate2ContractAddress, predictNonceDerivedContractAddress, predictNativeCpPoolCreate2Address, predictNativeCpPoolV2Create2Address, predictNativeCpPoolV3Create2Address, predictNativeCpPoolV4Create2Address, predictNativeCpPoolV5Create2Address, predictNativeDexFactoryCreate2Address, predictNativeDexLedgerRouterCreate2Address, predictNativeDexLedgerRouterV2Create2Address, predictNativeDexLedgerRouterV3Create2Address, predictNativeDexMultihopSwapRouterCreate2Address, predictNativeDexSwap2RouterCreate2Address, predictNativeLpShareTokenCreate2Address, predictNativeAmmLpVaultCreate2Address, nativeCpPoolCreate2SaltV1Hex, nativeCpPoolCreate2SaltV2Hex, nativeCpPoolCreate2SaltV3Hex, nativeCpPoolCreate2SaltV4Hex, nativeCpPoolCreate2SaltV5Hex, nativeDexFactoryCreate2SaltV1Hex, nativeDexLedgerRouterCreate2SaltV1Hex, nativeDexLedgerRouterCreate2SaltV2Hex, nativeDexLedgerRouterCreate2SaltV3Hex, nativeDexMultihopSwapRouterCreate2SaltV1Hex, nativeDexSwap2RouterCreate2SaltV1Hex, nativeLpShareTokenCreate2SaltV1Hex, nativeAmmLpVaultCreate2SaltV1Hex, NATIVE_CP_POOL_CREATE2_SALT_V1, NATIVE_CP_POOL_CREATE2_SALT_V2, NATIVE_CP_POOL_CREATE2_SALT_V3, NATIVE_CP_POOL_CREATE2_SALT_V4, NATIVE_CP_POOL_CREATE2_SALT_V5, NATIVE_DEX_FACTORY_CREATE2_SALT_V1, NATIVE_DEX_LEDGER_ROUTER_CREATE2_SALT_V1, NATIVE_DEX_LEDGER_ROUTER_CREATE2_SALT_V2, NATIVE_DEX_LEDGER_ROUTER_CREATE2_SALT_V3, NATIVE_DEX_MULTIHOP_SWAP_ROUTER_CREATE2_SALT_V1, NATIVE_DEX_SWAP2_ROUTER_CREATE2_SALT_V1, NATIVE_LP_SHARE_TOKEN_CREATE2_SALT_V1, NATIVE_AMM_LP_VAULT_CREATE2_SALT_V1, } from './create2.js';
|
|
52
|
+
export { submitTransferWithSimulationRetry, submitContractCallWithSimulationRetry, submitDeployWithPurposeFlow, SimulationFailedError, } from './submitFlow.js';
|
|
53
|
+
export { createNativeContractSubmitter, } from './nativeContractSubmit.js';
|
|
54
|
+
export { DEFAULT_GET_LOGS_MAX_BLOCK_SPAN, mapWithConcurrencyLimit, flattenReceiptsFromBundles, planLogBlockChunks, getLogsChunked, fetchReceiptsForBlockHeight, fetchReceiptsForHeightRange, fetchBlocksWithReceiptsForHeightRange, summarizeIndexerFetchGaps, } from './indexerBatch.js';
|
|
55
|
+
export { getIndexerChainTips, clampIndexerHeightRange, planIndexerChainTipsWithFallback, planIndexerCatchUp, } from './indexerSync.js';
|
|
56
|
+
export { mergeInclusiveHeightRanges, unionInclusiveHeightRanges, subtractInclusiveRangeFromRanges, blockHeightGapRowsForInsert, nextContiguousIndexedHeightAfterOmittedFetch, } from './indexerGaps.js';
|
|
57
|
+
export { DEFAULT_REFERENCE_FUNGIBLE_TEMPLATE_BYTECODE_HEX } from './defaultReferenceFungibleTemplateBytecodeHex.js';
|
|
58
|
+
export { DEFAULT_REFERENCE_FUNGIBLE_SECURED_TEMPLATE_BYTECODE_HEX } from './defaultReferenceFungibleSecuredTemplateBytecodeHex.js';
|
|
59
|
+
export { DEFAULT_REFERENCE_NFT_COLLECTION_TEMPLATE_BYTECODE_HEX } from './defaultReferenceNftCollectionTemplateBytecodeHex.js';
|
|
60
|
+
export { REFERENCE_FUNGIBLE_TEMPLATE_ARTIFACT_ID, REFERENCE_FUNGIBLE_TEMPLATE_VERSION, REFERENCE_FUNGIBLE_SECURED_TEMPLATE_ARTIFACT_ID, REFERENCE_FUNGIBLE_SECURED_TEMPLATE_VERSION, REFERENCE_NFT_COLLECTION_TEMPLATE_ARTIFACT_ID, REFERENCE_NFT_COLLECTION_TEMPLATE_VERSION, ensure0xHex, resolveReferenceFungibleTemplateBytecodeHex, resolveReferenceFungibleSecuredTemplateBytecodeHex, resolveReferenceNftCollectionTemplateBytecodeHex, buildContractDeployMetaTx, buildReferenceFungibleDeployMetaTx, buildReferenceFungibleSecuredDeployMetaTx, buildReferenceNftCollectionDeployMetaTx, resolveNativeConstantProductPoolBytecodeHex, buildNativeConstantProductPoolDeployMetaTx, } from './canonicalDeployArtifacts.js';
|
|
61
|
+
export { normalizeNativeTokenSecurity, descriptionHashHexFromNativeTokenSecurity, } from './nativeTokenSecurity.js';
|
|
62
|
+
export { FLAG_ANTI_BOT, FLAG_COOLDOWN, FLAG_DENYLIST, FLAG_MAX_TX, FLAG_MAX_WALLET, FLAG_NO_MINT, FLAG_TRANSFER_UNLOCK, buildReferenceFungibleSecuredDeployBytecodeHexFromNativeTokenSecurity, referenceFungibleSecuredConfigFromNativeTokenSecurity, referenceFungibleSecuredDeployBytecodeHex, } from './referenceFungibleSecuredDeployBytecode.js';
|
|
63
|
+
export { BOING_TESTNET_CHAIN_ID_DECIMAL, BOING_TESTNET_CHAIN_ID_HEX, normalizeBoingChainIdHex, isBoingTestnetChainId, } from './chainIds.js';
|
|
64
|
+
export { BOING_QA_PLACEHOLDER_DESCRIPTION_HASH_HEX, preflightContractDeployMetaQa, describeContractDeployMetaQaResponse, preflightContractDeployMetaWithUi, buildAndPreflightReferenceFungibleDeploy, buildAndPreflightReferenceNftCollectionDeployMeta, buildAndPreflightNativeConstantProductPoolDeploy, buildAndPreflightBoingIntegrationDeploy, defaultPurposeCategoryForBoingDeployKind, buildBoingIntegrationDeployMetaTx, preflightBoingIntegrationDeploy, } from './dappDeploy.js';
|
|
65
|
+
export { mergeNativeDexIntegrationDefaults, fetchNativeDexIntegrationDefaults, fetchNativeDexFactoryRegisterLogs, buildNativeDexIntegrationOverridesFromProcessEnv, } from './dexIntegration.js';
|
|
66
|
+
export { nativeDexPairKey, buildNativeDexRegisterLogPoolIndex, pickNativeDexPoolFromRegisterLogs, fetchNativeDexDirectorySnapshot, resolveNativeDexPoolForTokens, suggestNativeDexRegisterLogCatchUpRange, } from './nativeDexDirectory.js';
|
|
67
|
+
export { BOING_NATIVE_DEX_NOT_EVM_TAGLINE, BOING_NATIVE_DEX_NOT_EVM_BULLETS, BOING_NATIVE_DEX_TOOLKIT_RPC_METHODS, formatBoingNativeDexNotEvmDisclaimer, describeNativeDexDefaultGaps, assertBoingNativeDexToolkitRpc, formatNativeDexToolkitPreflightForUi, buildNativeCpPoolSwapExpressTx, } from './nativeDexSeamless.js';
|
|
68
|
+
export { quoteCpPoolSwap, rankDirectCpPools, findBestCpRoutes, findBestCpRoute, quoteCpEvenSplitAcrossDirectPools, hydrateCpPoolVenuesFromRpc, fetchCpRoutingFromDirectoryLogs, } from './nativeDexRouting.js';
|
|
69
|
+
export { parseNativeDexIndexerPersistedDoc, appendVenuesToHistoryDoc, buildDexOverridesFromPlainEnv, buildNativeDexIndexerStatsForClient, } from './nativeDexIndexerStats.js';
|
|
70
|
+
export { NATIVE_DEX_DIRECTORY_API_ID, NATIVE_DEX_DIRECTORY_SCHEMA_VERSION, NativeDexDirectoryHttpError, normalizeNativeDexDirectoryWorkerBaseUrl, parseNativeDexDirectoryMetaResponse, parseNativeDexDirectoryPoolsPageResponse, parseNativeDexDirectoryPoolEventsPageResponse, parseNativeDexDirectoryUserEventsPageResponse, fetchNativeDexDirectoryMeta, fetchNativeDexDirectoryPoolsPage, fetchNativeDexDirectoryPoolEventsPage, fetchNativeDexDirectoryUserEventsPage, collectAllNativeDexDirectoryPools, } from './nativeDexDirectoryApi.js';
|
|
71
|
+
export { getInjectedEip1193Provider, providerSupportsBoingNativeRpc, boingSendTransaction, requestAccounts, readChainIdHex, connectInjectedBoingWallet, mapInjectedProviderErrorToUiMessage, BOING_WALLET_RPC_METHODS_NATIVE_DAPP, explainEthSendTransactionInsufficientForBoingNativeCall, } from './walletProvider.js';
|
|
72
|
+
/**
|
|
73
|
+
* Create a Boing RPC client.
|
|
74
|
+
* @param config - Node URL string (e.g. "http://localhost:8545") or config object (baseUrl, fetch?, timeoutMs?, maxRetries?, …).
|
|
75
|
+
*/
|
|
76
|
+
export function createClient(config) {
|
|
77
|
+
return new BoingClient(config);
|
|
78
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indexer-oriented RPC batching: `boing_getLogs` has a max inclusive block span per call (default 128 on the node).
|
|
3
|
+
* This module chunks wide ranges into compliant requests and merges results.
|
|
4
|
+
*/
|
|
5
|
+
import type { BoingClient } from './client.js';
|
|
6
|
+
import type { Block, ExecutionReceipt, GetLogsFilter, RpcLogEntry } from './types.js';
|
|
7
|
+
/** Default max inclusive block span per `boing_getLogs` (see `docs/RPC-API-SPEC.md`). */
|
|
8
|
+
export declare const DEFAULT_GET_LOGS_MAX_BLOCK_SPAN = 128;
|
|
9
|
+
export interface LogChunkFilter extends Omit<GetLogsFilter, 'fromBlock' | 'toBlock'> {
|
|
10
|
+
fromBlock: number;
|
|
11
|
+
toBlock: number;
|
|
12
|
+
}
|
|
13
|
+
export interface MapWithConcurrencyLimitOptions {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Map `items` with at most `limit` concurrent in-flight `fn` calls (default pattern for indexer backfill).
|
|
18
|
+
* Results are in the **same order** as `items`. Throws if `signal` is aborted between tasks.
|
|
19
|
+
*/
|
|
20
|
+
export declare function mapWithConcurrencyLimit<T, R>(items: readonly T[], limit: number, fn: (item: T, index: number) => Promise<R>, options?: MapWithConcurrencyLimitOptions): Promise<R[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Plan inclusive `[from, to]` ranges each spanning at most `maxSpan` blocks.
|
|
23
|
+
*/
|
|
24
|
+
export declare function planLogBlockChunks(fromBlock: number, toBlock: number, maxSpan?: number): Array<{
|
|
25
|
+
fromBlock: number;
|
|
26
|
+
toBlock: number;
|
|
27
|
+
}>;
|
|
28
|
+
export interface GetLogsChunkedOptions {
|
|
29
|
+
maxBlockSpan?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Max concurrent `boing_getLogs` RPCs (default **1**). Increase only when your RPC operator allows it.
|
|
32
|
+
*/
|
|
33
|
+
maxConcurrent?: number;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Run `boing_getLogs` over `[filter.fromBlock, filter.toBlock]` in chunks of at most `maxBlockSpan` blocks.
|
|
38
|
+
* Results are merged and sorted by `(block_height, tx_index, log_index)`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getLogsChunked(client: BoingClient, filter: LogChunkFilter, options?: GetLogsChunkedOptions): Promise<RpcLogEntry[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Receipts for one block when the node returns them on `boing_getBlockByHeight(..., true)`.
|
|
43
|
+
* Drops `null` slots (if any). Returns `[]` if the block is missing or has no `receipts` array.
|
|
44
|
+
*/
|
|
45
|
+
export declare function fetchReceiptsForBlockHeight(client: BoingClient, height: number): Promise<ExecutionReceipt[]>;
|
|
46
|
+
/** One block’s non-null receipts (same order as txs in the block when the node fills `receipts`). */
|
|
47
|
+
export interface BlockReceiptsBundle {
|
|
48
|
+
height: number;
|
|
49
|
+
receipts: ExecutionReceipt[];
|
|
50
|
+
}
|
|
51
|
+
export type FetchReceiptsHeightRangeMissing = 'throw' | 'omit';
|
|
52
|
+
export interface FetchReceiptsForHeightRangeOptions {
|
|
53
|
+
/**
|
|
54
|
+
* When `boing_getBlockByHeight` returns `null` (pruned / unknown height).
|
|
55
|
+
* - `throw` (default): stop with an error naming the height.
|
|
56
|
+
* - `omit`: skip that height (output heights may have gaps vs the requested range).
|
|
57
|
+
*/
|
|
58
|
+
onMissingBlock?: FetchReceiptsHeightRangeMissing;
|
|
59
|
+
/** When set, checked between tasks; throws if aborted. */
|
|
60
|
+
signal?: AbortSignal;
|
|
61
|
+
/**
|
|
62
|
+
* Max concurrent block fetches (default **1**). Results are still returned **sorted by height**.
|
|
63
|
+
*/
|
|
64
|
+
maxConcurrent?: number;
|
|
65
|
+
}
|
|
66
|
+
/** Same options as {@link fetchReceiptsForHeightRange} — shared height-range fetch semantics. */
|
|
67
|
+
export type FetchBlocksWithReceiptsForHeightRangeOptions = FetchReceiptsForHeightRangeOptions;
|
|
68
|
+
/** Full block payload + height for replay-style ingestion (`transactions` + `receipts`). */
|
|
69
|
+
export interface BlockWithReceiptsBundle {
|
|
70
|
+
height: number;
|
|
71
|
+
block: Block;
|
|
72
|
+
}
|
|
73
|
+
/** Concatenate receipts from ordered bundles (e.g. after `fetchReceiptsForHeightRange`). */
|
|
74
|
+
export declare function flattenReceiptsFromBundles(bundles: readonly BlockReceiptsBundle[]): ExecutionReceipt[];
|
|
75
|
+
/**
|
|
76
|
+
* Summary of which heights were missing after a ranged fetch with **`onMissingBlock: 'omit'`**.
|
|
77
|
+
* Persist **`missingHeightRangesInclusive`** (or **`omittedHeights`**) so indexers do not claim completeness across pruned gaps.
|
|
78
|
+
*/
|
|
79
|
+
export interface IndexerFetchGapSummary {
|
|
80
|
+
requestedFromHeight: number;
|
|
81
|
+
requestedToHeight: number;
|
|
82
|
+
/** Sorted heights in `[requestedFromHeight, requestedToHeight]` with no block returned. */
|
|
83
|
+
omittedHeights: number[];
|
|
84
|
+
/** Merged inclusive ranges of {@link omittedHeights}. */
|
|
85
|
+
missingHeightRangesInclusive: Array<{
|
|
86
|
+
fromHeight: number;
|
|
87
|
+
toHeight: number;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Highest **H** such that every height in `[requestedFromHeight, H]` appears in **`fetchedHeights`**.
|
|
91
|
+
* **`null`** when **`requestedFromHeight`** itself was omitted (no contiguous prefix).
|
|
92
|
+
*/
|
|
93
|
+
lastContiguousFromStart: number | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Given an inclusive requested range and the heights actually returned (e.g. from **`fetchBlocksWithReceiptsForHeightRange`**
|
|
97
|
+
* or **`fetchReceiptsForHeightRange`** with **`onMissingBlock: 'omit'`**), compute omitted heights and a contiguous prefix watermark.
|
|
98
|
+
* Duplicate entries in **`fetchedHeights`** are ignored.
|
|
99
|
+
*/
|
|
100
|
+
export declare function summarizeIndexerFetchGaps(requestedFromHeight: number, requestedToHeight: number, fetchedHeights: readonly number[]): IndexerFetchGapSummary;
|
|
101
|
+
/**
|
|
102
|
+
* Fetch `include_receipts` blocks for each height in `[fromHeight, toHeight]` (inclusive).
|
|
103
|
+
* Default **sequential** (`maxConcurrent` 1); set `maxConcurrent` > 1 to parallelize (respect RPC limits).
|
|
104
|
+
*/
|
|
105
|
+
export declare function fetchReceiptsForHeightRange(client: BoingClient, fromHeight: number, toHeight: number, options?: FetchReceiptsForHeightRangeOptions): Promise<BlockReceiptsBundle[]>;
|
|
106
|
+
/**
|
|
107
|
+
* Fetch `boing_getBlockByHeight(h, true)` for each `h` in `[fromHeight, toHeight]` (inclusive).
|
|
108
|
+
* Use this for the **canonical** indexer replay path (txs + receipts in one snapshot per height).
|
|
109
|
+
*/
|
|
110
|
+
export declare function fetchBlocksWithReceiptsForHeightRange(client: BoingClient, fromHeight: number, toHeight: number, options?: FetchBlocksWithReceiptsForHeightRangeOptions): Promise<BlockWithReceiptsBundle[]>;
|
|
111
|
+
//# sourceMappingURL=indexerBatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexerBatch.d.ts","sourceRoot":"","sources":["../src/indexerBatch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtF,yFAAyF;AACzF,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,8BAA8B;IAC7C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,EAAE,CAAC,EAChD,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,C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K,EAAE,KAAK,CAAC;CACd;AAED,4FAA4F;AAC5F,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,mBAAmB,EAAE,GACtC,gBAAgB,EAAE,CAMpB;AAWD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2FAA2F;IAC3F,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,yDAAyD;IACzD,4BAA4B,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9E;;;OAGG;IACH,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAqBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,mBAAmB,EAAE,MAAM,EAC3B,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,sBAAsB,CA2CxB;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,kCAAkC,GAC3C,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAwChC;AAED;;;GAGG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,4CAA4C,GACrD,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAkCpC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indexer-oriented RPC batching: `boing_getLogs` has a max inclusive block span per call (default 128 on the node).
|
|
3
|
+
* This module chunks wide ranges into compliant requests and merges results.
|
|
4
|
+
*/
|
|
5
|
+
/** Default max inclusive block span per `boing_getLogs` (see `docs/RPC-API-SPEC.md`). */
|
|
6
|
+
export const DEFAULT_GET_LOGS_MAX_BLOCK_SPAN = 128;
|
|
7
|
+
/**
|
|
8
|
+
* Map `items` with at most `limit` concurrent in-flight `fn` calls (default pattern for indexer backfill).
|
|
9
|
+
* Results are in the **same order** as `items`. Throws if `signal` is aborted between tasks.
|
|
10
|
+
*/
|
|
11
|
+
export async function mapWithConcurrencyLimit(items, limit, fn, options) {
|
|
12
|
+
if (limit < 1)
|
|
13
|
+
throw new RangeError('limit must be >= 1');
|
|
14
|
+
if (!Number.isInteger(limit))
|
|
15
|
+
throw new TypeError('limit must be an integer');
|
|
16
|
+
if (items.length === 0)
|
|
17
|
+
return [];
|
|
18
|
+
const results = new Array(items.length);
|
|
19
|
+
let next = 0;
|
|
20
|
+
const signal = options?.signal;
|
|
21
|
+
async function worker() {
|
|
22
|
+
while (true) {
|
|
23
|
+
if (signal?.aborted) {
|
|
24
|
+
throw new Error('mapWithConcurrencyLimit aborted');
|
|
25
|
+
}
|
|
26
|
+
const idx = next++;
|
|
27
|
+
if (idx >= items.length)
|
|
28
|
+
return;
|
|
29
|
+
results[idx] = await fn(items[idx], idx);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const workers = Math.min(limit, items.length);
|
|
33
|
+
await Promise.all(Array.from({ length: workers }, () => worker()));
|
|
34
|
+
return results;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Plan inclusive `[from, to]` ranges each spanning at most `maxSpan` blocks.
|
|
38
|
+
*/
|
|
39
|
+
export function planLogBlockChunks(fromBlock, toBlock, maxSpan = DEFAULT_GET_LOGS_MAX_BLOCK_SPAN) {
|
|
40
|
+
if (!Number.isInteger(fromBlock) || !Number.isInteger(toBlock)) {
|
|
41
|
+
throw new TypeError('fromBlock and toBlock must be integers');
|
|
42
|
+
}
|
|
43
|
+
if (maxSpan < 1)
|
|
44
|
+
throw new RangeError('maxSpan must be >= 1');
|
|
45
|
+
if (fromBlock > toBlock)
|
|
46
|
+
return [];
|
|
47
|
+
const chunks = [];
|
|
48
|
+
let start = fromBlock;
|
|
49
|
+
while (start <= toBlock) {
|
|
50
|
+
const end = Math.min(start + maxSpan - 1, toBlock);
|
|
51
|
+
chunks.push({ fromBlock: start, toBlock: end });
|
|
52
|
+
start = end + 1;
|
|
53
|
+
}
|
|
54
|
+
return chunks;
|
|
55
|
+
}
|
|
56
|
+
function compareLogEntries(a, b) {
|
|
57
|
+
if (a.block_height !== b.block_height)
|
|
58
|
+
return a.block_height - b.block_height;
|
|
59
|
+
if (a.tx_index !== b.tx_index)
|
|
60
|
+
return a.tx_index - b.tx_index;
|
|
61
|
+
return a.log_index - b.log_index;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Run `boing_getLogs` over `[filter.fromBlock, filter.toBlock]` in chunks of at most `maxBlockSpan` blocks.
|
|
65
|
+
* Results are merged and sorted by `(block_height, tx_index, log_index)`.
|
|
66
|
+
*/
|
|
67
|
+
export async function getLogsChunked(client, filter, options) {
|
|
68
|
+
const maxSpan = options?.maxBlockSpan ?? DEFAULT_GET_LOGS_MAX_BLOCK_SPAN;
|
|
69
|
+
const concurrent = options?.maxConcurrent ?? 1;
|
|
70
|
+
const { fromBlock, toBlock, ...rest } = filter;
|
|
71
|
+
const chunks = planLogBlockChunks(fromBlock, toBlock, maxSpan);
|
|
72
|
+
const parts = await mapWithConcurrencyLimit(chunks, concurrent, async (c) => client.getLogs({
|
|
73
|
+
...rest,
|
|
74
|
+
fromBlock: c.fromBlock,
|
|
75
|
+
toBlock: c.toBlock,
|
|
76
|
+
}), { signal: options?.signal });
|
|
77
|
+
const rows = [];
|
|
78
|
+
for (const part of parts) {
|
|
79
|
+
rows.push(...part);
|
|
80
|
+
}
|
|
81
|
+
rows.sort(compareLogEntries);
|
|
82
|
+
return rows;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Receipts for one block when the node returns them on `boing_getBlockByHeight(..., true)`.
|
|
86
|
+
* Drops `null` slots (if any). Returns `[]` if the block is missing or has no `receipts` array.
|
|
87
|
+
*/
|
|
88
|
+
export async function fetchReceiptsForBlockHeight(client, height) {
|
|
89
|
+
const block = await client.getBlockByHeight(height, true);
|
|
90
|
+
if (!block?.receipts?.length)
|
|
91
|
+
return [];
|
|
92
|
+
const out = [];
|
|
93
|
+
for (const r of block.receipts) {
|
|
94
|
+
if (r != null)
|
|
95
|
+
out.push(r);
|
|
96
|
+
}
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
/** Concatenate receipts from ordered bundles (e.g. after `fetchReceiptsForHeightRange`). */
|
|
100
|
+
export function flattenReceiptsFromBundles(bundles) {
|
|
101
|
+
const out = [];
|
|
102
|
+
for (const b of bundles) {
|
|
103
|
+
out.push(...b.receipts);
|
|
104
|
+
}
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
107
|
+
function assertIntHeight(name, h) {
|
|
108
|
+
if (!Number.isInteger(h)) {
|
|
109
|
+
throw new TypeError(`${name} must be an integer`);
|
|
110
|
+
}
|
|
111
|
+
if (h < 0) {
|
|
112
|
+
throw new RangeError(`${name} must be >= 0`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function mergeOmittedIntoRanges(sortedOmitted) {
|
|
116
|
+
if (sortedOmitted.length === 0)
|
|
117
|
+
return [];
|
|
118
|
+
const out = [];
|
|
119
|
+
let start = sortedOmitted[0];
|
|
120
|
+
let prev = start;
|
|
121
|
+
for (let i = 1; i < sortedOmitted.length; i++) {
|
|
122
|
+
const h = sortedOmitted[i];
|
|
123
|
+
if (h === prev + 1) {
|
|
124
|
+
prev = h;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
out.push({ fromHeight: start, toHeight: prev });
|
|
128
|
+
start = h;
|
|
129
|
+
prev = h;
|
|
130
|
+
}
|
|
131
|
+
out.push({ fromHeight: start, toHeight: prev });
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Given an inclusive requested range and the heights actually returned (e.g. from **`fetchBlocksWithReceiptsForHeightRange`**
|
|
136
|
+
* or **`fetchReceiptsForHeightRange`** with **`onMissingBlock: 'omit'`**), compute omitted heights and a contiguous prefix watermark.
|
|
137
|
+
* Duplicate entries in **`fetchedHeights`** are ignored.
|
|
138
|
+
*/
|
|
139
|
+
export function summarizeIndexerFetchGaps(requestedFromHeight, requestedToHeight, fetchedHeights) {
|
|
140
|
+
assertIntHeight('requestedFromHeight', requestedFromHeight);
|
|
141
|
+
assertIntHeight('requestedToHeight', requestedToHeight);
|
|
142
|
+
if (requestedFromHeight > requestedToHeight) {
|
|
143
|
+
return {
|
|
144
|
+
requestedFromHeight,
|
|
145
|
+
requestedToHeight,
|
|
146
|
+
omittedHeights: [],
|
|
147
|
+
missingHeightRangesInclusive: [],
|
|
148
|
+
lastContiguousFromStart: null,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
const present = new Set();
|
|
152
|
+
for (const h of fetchedHeights) {
|
|
153
|
+
if (!Number.isInteger(h)) {
|
|
154
|
+
throw new TypeError('each fetched height must be an integer');
|
|
155
|
+
}
|
|
156
|
+
if (h < 0)
|
|
157
|
+
throw new RangeError('each fetched height must be >= 0');
|
|
158
|
+
present.add(h);
|
|
159
|
+
}
|
|
160
|
+
const omittedHeights = [];
|
|
161
|
+
for (let h = requestedFromHeight; h <= requestedToHeight; h++) {
|
|
162
|
+
if (!present.has(h))
|
|
163
|
+
omittedHeights.push(h);
|
|
164
|
+
}
|
|
165
|
+
let lastContiguousFromStart = null;
|
|
166
|
+
if (present.has(requestedFromHeight)) {
|
|
167
|
+
let h = requestedFromHeight;
|
|
168
|
+
while (h <= requestedToHeight && present.has(h)) {
|
|
169
|
+
h += 1;
|
|
170
|
+
}
|
|
171
|
+
lastContiguousFromStart = h - 1;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
requestedFromHeight,
|
|
175
|
+
requestedToHeight,
|
|
176
|
+
omittedHeights,
|
|
177
|
+
missingHeightRangesInclusive: mergeOmittedIntoRanges(omittedHeights),
|
|
178
|
+
lastContiguousFromStart,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Fetch `include_receipts` blocks for each height in `[fromHeight, toHeight]` (inclusive).
|
|
183
|
+
* Default **sequential** (`maxConcurrent` 1); set `maxConcurrent` > 1 to parallelize (respect RPC limits).
|
|
184
|
+
*/
|
|
185
|
+
export async function fetchReceiptsForHeightRange(client, fromHeight, toHeight, options) {
|
|
186
|
+
assertIntHeight('fromHeight', fromHeight);
|
|
187
|
+
assertIntHeight('toHeight', toHeight);
|
|
188
|
+
if (fromHeight > toHeight)
|
|
189
|
+
return [];
|
|
190
|
+
const onMissing = options?.onMissingBlock ?? 'throw';
|
|
191
|
+
const signal = options?.signal;
|
|
192
|
+
const concurrent = options?.maxConcurrent ?? 1;
|
|
193
|
+
const heights = [];
|
|
194
|
+
for (let h = fromHeight; h <= toHeight; h++) {
|
|
195
|
+
heights.push(h);
|
|
196
|
+
}
|
|
197
|
+
const bundles = await mapWithConcurrencyLimit(heights, concurrent, async (h) => {
|
|
198
|
+
const block = await client.getBlockByHeight(h, true);
|
|
199
|
+
if (block == null) {
|
|
200
|
+
if (onMissing === 'omit')
|
|
201
|
+
return null;
|
|
202
|
+
throw new Error(`missing block at height ${h}`);
|
|
203
|
+
}
|
|
204
|
+
const receipts = [];
|
|
205
|
+
if (block.receipts?.length) {
|
|
206
|
+
for (const r of block.receipts) {
|
|
207
|
+
if (r != null)
|
|
208
|
+
receipts.push(r);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return { height: h, receipts };
|
|
212
|
+
}, { signal });
|
|
213
|
+
const out = [];
|
|
214
|
+
for (const b of bundles) {
|
|
215
|
+
if (b != null)
|
|
216
|
+
out.push(b);
|
|
217
|
+
}
|
|
218
|
+
out.sort((a, b) => a.height - b.height);
|
|
219
|
+
return out;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Fetch `boing_getBlockByHeight(h, true)` for each `h` in `[fromHeight, toHeight]` (inclusive).
|
|
223
|
+
* Use this for the **canonical** indexer replay path (txs + receipts in one snapshot per height).
|
|
224
|
+
*/
|
|
225
|
+
export async function fetchBlocksWithReceiptsForHeightRange(client, fromHeight, toHeight, options) {
|
|
226
|
+
assertIntHeight('fromHeight', fromHeight);
|
|
227
|
+
assertIntHeight('toHeight', toHeight);
|
|
228
|
+
if (fromHeight > toHeight)
|
|
229
|
+
return [];
|
|
230
|
+
const onMissing = options?.onMissingBlock ?? 'throw';
|
|
231
|
+
const signal = options?.signal;
|
|
232
|
+
const concurrent = options?.maxConcurrent ?? 1;
|
|
233
|
+
const heights = [];
|
|
234
|
+
for (let h = fromHeight; h <= toHeight; h++) {
|
|
235
|
+
heights.push(h);
|
|
236
|
+
}
|
|
237
|
+
const raw = await mapWithConcurrencyLimit(heights, concurrent, async (h) => {
|
|
238
|
+
const block = await client.getBlockByHeight(h, true);
|
|
239
|
+
if (block == null) {
|
|
240
|
+
if (onMissing === 'omit')
|
|
241
|
+
return null;
|
|
242
|
+
throw new Error(`missing block at height ${h}`);
|
|
243
|
+
}
|
|
244
|
+
return { height: h, block };
|
|
245
|
+
}, { signal });
|
|
246
|
+
const out = [];
|
|
247
|
+
for (const b of raw) {
|
|
248
|
+
if (b != null)
|
|
249
|
+
out.push(b);
|
|
250
|
+
}
|
|
251
|
+
out.sort((a, b) => a.height - b.height);
|
|
252
|
+
return out;
|
|
253
|
+
}
|