├── .circleci └── config.yml ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .gitmodules ├── .husky └── pre-commit ├── .prettierignore ├── .prettierrc ├── Makefile ├── README.md ├── SETUP.md ├── build.mjs ├── bxsolana ├── index.browser.ts ├── index.ts ├── proto │ ├── index.ts │ ├── messages │ │ ├── api │ │ │ ├── AccountMeta.ts │ │ │ ├── Block.ts │ │ │ ├── Candle.ts │ │ │ ├── Direction.ts │ │ │ ├── GetAccountBalanceRequest.ts │ │ │ ├── GetAccountBalanceResponse.ts │ │ │ ├── GetBlockStreamRequest.ts │ │ │ ├── GetBlockStreamResponse.ts │ │ │ ├── GetBundleTipRequest.ts │ │ │ ├── GetBundleTipResponse.ts │ │ │ ├── GetJupiterPricesRequest.ts │ │ │ ├── GetJupiterPricesResponse.ts │ │ │ ├── GetJupiterQuotesRequest.ts │ │ │ ├── GetJupiterQuotesResponse.ts │ │ │ ├── GetKlineRequest.ts │ │ │ ├── GetKlineResponse.ts │ │ │ ├── GetMarketDepthRequest.ts │ │ │ ├── GetMarketDepthRequestV2.ts │ │ │ ├── GetMarketDepthResponse.ts │ │ │ ├── GetMarketDepthResponseV2.ts │ │ │ ├── GetMarketDepthsRequest.ts │ │ │ ├── GetMarketDepthsStreamResponse.ts │ │ │ ├── GetMarketsRequest.ts │ │ │ ├── GetMarketsRequestV2.ts │ │ │ ├── GetMarketsResponse.ts │ │ │ ├── GetMarketsResponseV2.ts │ │ │ ├── GetNewRaydiumPoolsByTransactionRequest.ts │ │ │ ├── GetNewRaydiumPoolsByTransactionResponse.ts │ │ │ ├── GetNewRaydiumPoolsRequest.ts │ │ │ ├── GetNewRaydiumPoolsResponse.ts │ │ │ ├── GetOpenOrdersRequest.ts │ │ │ ├── GetOpenOrdersRequestV2.ts │ │ │ ├── GetOpenOrdersResponse.ts │ │ │ ├── GetOpenOrdersResponseV2.ts │ │ │ ├── GetOrderByIDRequest.ts │ │ │ ├── GetOrderByIDResponse.ts │ │ │ ├── GetOrderStatusResponse.ts │ │ │ ├── GetOrderStatusStreamRequest.ts │ │ │ ├── GetOrderStatusStreamResponse.ts │ │ │ ├── GetOrderbookRequest.ts │ │ │ ├── GetOrderbookRequestV2.ts │ │ │ ├── GetOrderbookResponse.ts │ │ │ ├── GetOrderbookResponseV2.ts │ │ │ ├── GetOrderbooksRequest.ts │ │ │ ├── GetOrderbooksStreamResponse.ts │ │ │ ├── GetOrdersRequest.ts │ │ │ ├── GetOrdersResponse.ts │ │ │ ├── GetPoolReservesStreamRequest.ts │ │ │ ├── GetPoolReservesStreamResponse.ts │ │ │ ├── GetPoolsRequest.ts │ │ │ ├── GetPoolsResponse.ts │ │ │ ├── GetPriceRequest.ts │ │ │ ├── GetPriceResponse.ts │ │ │ ├── GetPricesStreamRequest.ts │ │ │ ├── GetPricesStreamResponse.ts │ │ │ ├── GetPriorityFeeByProgramRequest.ts │ │ │ ├── GetPriorityFeeByProgramResponse.ts │ │ │ ├── GetPriorityFeeRequest.ts │ │ │ ├── GetPriorityFeeResponse.ts │ │ │ ├── GetPumpFunAMMSwapStreamRequest.ts │ │ │ ├── GetPumpFunAMMSwapStreamResponse.ts │ │ │ ├── GetPumpFunAmmQuotesRequest.ts │ │ │ ├── GetPumpFunAmmQuotesResponse.ts │ │ │ ├── GetPumpFunNewAmmPoolStreamRequest.ts │ │ │ ├── GetPumpFunNewAmmPoolStreamResponse.ts │ │ │ ├── GetPumpFunNewTokensStreamRequest.ts │ │ │ ├── GetPumpFunNewTokensStreamResponse.ts │ │ │ ├── GetPumpFunQuotesRequest.ts │ │ │ ├── GetPumpFunQuotesResponse.ts │ │ │ ├── GetPumpFunSwapsStreamRequest.ts │ │ │ ├── GetPumpFunSwapsStreamResponse.ts │ │ │ ├── GetQuotesRequest.ts │ │ │ ├── GetQuotesResponse.ts │ │ │ ├── GetQuotesStreamRequest.ts │ │ │ ├── GetQuotesStreamResponse.ts │ │ │ ├── GetQuotesStreamUpdate.ts │ │ │ ├── GetRateLimitRequest.ts │ │ │ ├── GetRateLimitResponse.ts │ │ │ ├── GetRaydiumCLMMPoolsRequest.ts │ │ │ ├── GetRaydiumCLMMPoolsResponse.ts │ │ │ ├── GetRaydiumCLMMQuotesRequest.ts │ │ │ ├── GetRaydiumCLMMQuotesResponse.ts │ │ │ ├── GetRaydiumCPMMQuotesRequest.ts │ │ │ ├── GetRaydiumCPMMQuotesResponse.ts │ │ │ ├── GetRaydiumPoolReserveRequest.ts │ │ │ ├── GetRaydiumPoolReserveResponse.ts │ │ │ ├── GetRaydiumPoolsRequest.ts │ │ │ ├── GetRaydiumPoolsResponse.ts │ │ │ ├── GetRaydiumPricesRequest.ts │ │ │ ├── GetRaydiumPricesResponse.ts │ │ │ ├── GetRaydiumQuotesRequest.ts │ │ │ ├── GetRaydiumQuotesResponse.ts │ │ │ ├── GetRecentBlockHashRequest.ts │ │ │ ├── GetRecentBlockHashRequestV2.ts │ │ │ ├── GetRecentBlockHashResponse.ts │ │ │ ├── GetRecentBlockHashResponseV2.ts │ │ │ ├── GetServerTimeRequest.ts │ │ │ ├── GetServerTimeResponse.ts │ │ │ ├── GetSwapsStreamRequest.ts │ │ │ ├── GetSwapsStreamResponse.ts │ │ │ ├── GetSwapsStreamUpdate.ts │ │ │ ├── GetTickersRequest.ts │ │ │ ├── GetTickersRequestV2.ts │ │ │ ├── GetTickersResponse.ts │ │ │ ├── GetTickersResponseV2.ts │ │ │ ├── GetTickersStreamRequest.ts │ │ │ ├── GetTickersStreamResponse.ts │ │ │ ├── GetTokenAccountsRequest.ts │ │ │ ├── GetTokenAccountsResponse.ts │ │ │ ├── GetTradesRequest.ts │ │ │ ├── GetTradesResponse.ts │ │ │ ├── GetTradesStreamResponse.ts │ │ │ ├── GetTransactionRequest.ts │ │ │ ├── GetTransactionResponse.ts │ │ │ ├── GetUnsettledRequest.ts │ │ │ ├── GetUnsettledRequestV2.ts │ │ │ ├── GetUnsettledResponse.ts │ │ │ ├── GetZetaTransactionStreamRequest.ts │ │ │ ├── GetZetaTransactionStreamResponse.ts │ │ │ ├── Instruction.ts │ │ │ ├── InstructionJupiter.ts │ │ │ ├── InstructionRaydium.ts │ │ │ ├── InstructionRequest.ts │ │ │ ├── JupiterQuoteRoute.ts │ │ │ ├── JupiterQuoteStep.ts │ │ │ ├── JupiterRouteStep.ts │ │ │ ├── LiquidityPoolKeys.ts │ │ │ ├── Market.ts │ │ │ ├── MarketDepthItem.ts │ │ │ ├── MarketDepthItemV2.ts │ │ │ ├── MarketStatus.ts │ │ │ ├── MarketV2.ts │ │ │ ├── Order.ts │ │ │ ├── OrderStatus.ts │ │ │ ├── OrderV2.ts │ │ │ ├── OrderbookItem.ts │ │ │ ├── OrderbookItemV2.ts │ │ │ ├── PoolReserves.ts │ │ │ ├── PostCancelAllRequest.ts │ │ │ ├── PostCancelAllResponse.ts │ │ │ ├── PostCancelByClientOrderIDRequest.ts │ │ │ ├── PostCancelOrderRequest.ts │ │ │ ├── PostCancelOrderRequestV2.ts │ │ │ ├── PostCancelOrderResponse.ts │ │ │ ├── PostCancelOrderResponseV2.ts │ │ │ ├── PostJupiterRouteSwapRequest.ts │ │ │ ├── PostJupiterRouteSwapResponse.ts │ │ │ ├── PostJupiterSwapInstructionsRequest.ts │ │ │ ├── PostJupiterSwapInstructionsResponse.ts │ │ │ ├── PostJupiterSwapRequest.ts │ │ │ ├── PostJupiterSwapResponse.ts │ │ │ ├── PostOrderRequest.ts │ │ │ ├── PostOrderRequestV2.ts │ │ │ ├── PostOrderResponse.ts │ │ │ ├── PostPumpFunAmmSwapRequest.ts │ │ │ ├── PostPumpFunAmmSwapResponse.ts │ │ │ ├── PostPumpFunSwapRequest.ts │ │ │ ├── PostPumpFunSwapRequestSol.ts │ │ │ ├── PostPumpFunSwapResponse.ts │ │ │ ├── PostRaydiumCPMMSwapRequest.ts │ │ │ ├── PostRaydiumCPMMSwapResponse.ts │ │ │ ├── PostRaydiumRouteSwapRequest.ts │ │ │ ├── PostRaydiumRouteSwapResponse.ts │ │ │ ├── PostRaydiumSwapInstructionsRequest.ts │ │ │ ├── PostRaydiumSwapInstructionsResponse.ts │ │ │ ├── PostRaydiumSwapRequest.ts │ │ │ ├── PostRaydiumSwapResponse.ts │ │ │ ├── PostReplaceOrderRequest.ts │ │ │ ├── PostReplaceOrderRequestV2.ts │ │ │ ├── PostSettleRequest.ts │ │ │ ├── PostSettleRequestV2.ts │ │ │ ├── PostSettleResponse.ts │ │ │ ├── PostSubmitBatchRequest.ts │ │ │ ├── PostSubmitBatchResponse.ts │ │ │ ├── PostSubmitBatchResponseEntry.ts │ │ │ ├── PostSubmitPaladinRequest.ts │ │ │ ├── PostSubmitRequest.ts │ │ │ ├── PostSubmitRequestEntry.ts │ │ │ ├── PostSubmitResponse.ts │ │ │ ├── PostSubmitSnipeRequest.ts │ │ │ ├── PostSubmitSnipeResponse.ts │ │ │ ├── PostZetaCrossMarginAccountRequest.ts │ │ │ ├── PostZetaCrossMarginAccountResponse.ts │ │ │ ├── ProgramPriorityFee.ts │ │ │ ├── Project.ts │ │ │ ├── ProjectPool.ts │ │ │ ├── ProjectPools.ts │ │ │ ├── ProjectQuote.ts │ │ │ ├── PublicKeys.ts │ │ │ ├── QuoteRoute.ts │ │ │ ├── QuoteStep.ts │ │ │ ├── RaydiumQuoteRoute.ts │ │ │ ├── RaydiumQuoteStep.ts │ │ │ ├── RaydiumRouteStep.ts │ │ │ ├── RouteStep.ts │ │ │ ├── RouteTradeSwapRequest.ts │ │ │ ├── Settlement.ts │ │ │ ├── Side.ts │ │ │ ├── Step.ts │ │ │ ├── StepProject.ts │ │ │ ├── StreamInfo.ts │ │ │ ├── SubmitProtection.ts │ │ │ ├── SubmitStrategy.ts │ │ │ ├── Ticker.ts │ │ │ ├── TickerV2.ts │ │ │ ├── TokenAccount.ts │ │ │ ├── TokenBalance.ts │ │ │ ├── TokenPair.ts │ │ │ ├── TokenPrice.ts │ │ │ ├── TokenPriceV2.ts │ │ │ ├── Trade.ts │ │ │ ├── TradeSwapRequest.ts │ │ │ ├── TradeSwapResponse.ts │ │ │ ├── TransactionMessage.ts │ │ │ ├── TransactionMessageHeader.ts │ │ │ ├── TransactionMessageV2.ts │ │ │ ├── TransactionMessageZeta.ts │ │ │ ├── TransactionMeta.ts │ │ │ ├── TransactionMetaInnerInstruction.ts │ │ │ ├── TransactionMetaTokenBalance.ts │ │ │ ├── TransactionZeta.ts │ │ │ ├── UITokenAmount.ts │ │ │ ├── UnsettledAccount.ts │ │ │ ├── UnsettledAccountToken.ts │ │ │ └── index.ts │ │ ├── auth │ │ │ ├── GenerateAuthChallengeRequest.ts │ │ │ ├── GenerateAuthChallengeResponse.ts │ │ │ ├── GenerateAuthTokensRequest.ts │ │ │ ├── GenerateAuthTokensResponse.ts │ │ │ ├── RefreshAccessTokenRequest.ts │ │ │ ├── RefreshAccessTokenResponse.ts │ │ │ ├── Role.ts │ │ │ ├── Token.ts │ │ │ └── index.ts │ │ ├── block │ │ │ ├── CondensedBlock.ts │ │ │ └── index.ts │ │ ├── block_engine │ │ │ ├── AccountsOfInterest.ts │ │ │ ├── AccountsOfInterestRequest.ts │ │ │ ├── AccountsOfInterestUpdate.ts │ │ │ ├── BlockBuilderFeeInfoRequest.ts │ │ │ ├── BlockBuilderFeeInfoResponse.ts │ │ │ ├── ExpiringPacketBatch.ts │ │ │ ├── PacketBatchUpdate.ts │ │ │ ├── ProgramsOfInterestRequest.ts │ │ │ ├── ProgramsOfInterestUpdate.ts │ │ │ ├── StartExpiringPacketStreamResponse.ts │ │ │ ├── SubscribeBundlesRequest.ts │ │ │ ├── SubscribeBundlesResponse.ts │ │ │ ├── SubscribePacketsRequest.ts │ │ │ ├── SubscribePacketsResponse.ts │ │ │ └── index.ts │ │ ├── bundle │ │ │ ├── Accepted.ts │ │ │ ├── Bundle.ts │ │ │ ├── BundleResult.ts │ │ │ ├── BundleUuid.ts │ │ │ ├── Dropped.ts │ │ │ ├── DroppedBundle.ts │ │ │ ├── DroppedReason.ts │ │ │ ├── Finalized.ts │ │ │ ├── InternalError.ts │ │ │ ├── Processed.ts │ │ │ ├── Rejected.ts │ │ │ ├── SimulationFailure.ts │ │ │ ├── StateAuctionBidRejected.ts │ │ │ ├── WinningBatchBidRejected.ts │ │ │ └── index.ts │ │ ├── common │ │ │ ├── Fee.ts │ │ │ ├── Infinity.ts │ │ │ ├── MarginContract.ts │ │ │ ├── OrderType.ts │ │ │ ├── PerpCollateralToken.ts │ │ │ ├── PerpCollateralType.ts │ │ │ ├── PerpContract.ts │ │ │ ├── PerpOrderType.ts │ │ │ ├── PerpPositionSide.ts │ │ │ ├── PostOnlyParams.ts │ │ │ ├── PriceImpactPercent.ts │ │ │ ├── PriceImpactPercentV2.ts │ │ │ └── index.ts │ │ ├── google │ │ │ ├── api │ │ │ │ ├── CustomHttpPattern.ts │ │ │ │ ├── FieldBehavior.ts │ │ │ │ ├── Http.ts │ │ │ │ ├── HttpBody.ts │ │ │ │ ├── HttpRule.ts │ │ │ │ ├── Visibility.ts │ │ │ │ ├── VisibilityRule.ts │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── protobuf │ │ │ │ ├── (DescriptorProto) │ │ │ │ ├── ExtensionRange.ts │ │ │ │ ├── ReservedRange.ts │ │ │ │ └── index.ts │ │ │ │ ├── (EnumDescriptorProto) │ │ │ │ ├── EnumReservedRange.ts │ │ │ │ └── index.ts │ │ │ │ ├── (Field) │ │ │ │ ├── Cardinality.ts │ │ │ │ ├── Kind.ts │ │ │ │ └── index.ts │ │ │ │ ├── (FieldDescriptorProto) │ │ │ │ ├── Label.ts │ │ │ │ ├── Type.ts │ │ │ │ └── index.ts │ │ │ │ ├── (FieldOptions) │ │ │ │ ├── CType.ts │ │ │ │ ├── JSType.ts │ │ │ │ └── index.ts │ │ │ │ ├── (FileOptions) │ │ │ │ ├── OptimizeMode.ts │ │ │ │ └── index.ts │ │ │ │ ├── (GeneratedCodeInfo) │ │ │ │ ├── Annotation.ts │ │ │ │ └── index.ts │ │ │ │ ├── (MethodOptions) │ │ │ │ ├── IdempotencyLevel.ts │ │ │ │ └── index.ts │ │ │ │ ├── (SourceCodeInfo) │ │ │ │ ├── Location.ts │ │ │ │ └── index.ts │ │ │ │ ├── (UninterpretedOption) │ │ │ │ ├── NamePart.ts │ │ │ │ └── index.ts │ │ │ │ ├── Any.ts │ │ │ │ ├── Api.ts │ │ │ │ ├── BoolValue.ts │ │ │ │ ├── BytesValue.ts │ │ │ │ ├── DescriptorProto.ts │ │ │ │ ├── DoubleValue.ts │ │ │ │ ├── Duration.ts │ │ │ │ ├── Empty.ts │ │ │ │ ├── Enum.ts │ │ │ │ ├── EnumDescriptorProto.ts │ │ │ │ ├── EnumOptions.ts │ │ │ │ ├── EnumValue.ts │ │ │ │ ├── EnumValueDescriptorProto.ts │ │ │ │ ├── EnumValueOptions.ts │ │ │ │ ├── ExtensionRangeOptions.ts │ │ │ │ ├── Field.ts │ │ │ │ ├── FieldDescriptorProto.ts │ │ │ │ ├── FieldMask.ts │ │ │ │ ├── FieldOptions.ts │ │ │ │ ├── FileDescriptorProto.ts │ │ │ │ ├── FileDescriptorSet.ts │ │ │ │ ├── FileOptions.ts │ │ │ │ ├── FloatValue.ts │ │ │ │ ├── GeneratedCodeInfo.ts │ │ │ │ ├── Int32Value.ts │ │ │ │ ├── Int64Value.ts │ │ │ │ ├── ListValue.ts │ │ │ │ ├── MessageOptions.ts │ │ │ │ ├── Method.ts │ │ │ │ ├── MethodDescriptorProto.ts │ │ │ │ ├── MethodOptions.ts │ │ │ │ ├── Mixin.ts │ │ │ │ ├── NullValue.ts │ │ │ │ ├── OneofDescriptorProto.ts │ │ │ │ ├── OneofOptions.ts │ │ │ │ ├── Option.ts │ │ │ │ ├── ServiceDescriptorProto.ts │ │ │ │ ├── ServiceOptions.ts │ │ │ │ ├── SourceCodeInfo.ts │ │ │ │ ├── SourceContext.ts │ │ │ │ ├── StringValue.ts │ │ │ │ ├── Struct.ts │ │ │ │ ├── Syntax.ts │ │ │ │ ├── Timestamp.ts │ │ │ │ ├── Type.ts │ │ │ │ ├── UInt32Value.ts │ │ │ │ ├── UInt64Value.ts │ │ │ │ ├── UninterpretedOption.ts │ │ │ │ ├── Value.ts │ │ │ │ └── index.ts │ │ ├── grpc │ │ │ ├── gateway │ │ │ │ ├── index.ts │ │ │ │ └── protoc_gen_openapiv2 │ │ │ │ │ ├── index.ts │ │ │ │ │ └── options │ │ │ │ │ ├── (JSONSchema) │ │ │ │ │ ├── FieldConfiguration.ts │ │ │ │ │ ├── JSONSchemaSimpleTypes.ts │ │ │ │ │ └── index.ts │ │ │ │ │ ├── (SecurityRequirement) │ │ │ │ │ ├── SecurityRequirementValue.ts │ │ │ │ │ └── index.ts │ │ │ │ │ ├── (SecurityScheme) │ │ │ │ │ ├── Flow.ts │ │ │ │ │ ├── In.ts │ │ │ │ │ ├── Type.ts │ │ │ │ │ └── index.ts │ │ │ │ │ ├── Contact.ts │ │ │ │ │ ├── ExternalDocumentation.ts │ │ │ │ │ ├── Header.ts │ │ │ │ │ ├── Info.ts │ │ │ │ │ ├── JSONSchema.ts │ │ │ │ │ ├── License.ts │ │ │ │ │ ├── Operation.ts │ │ │ │ │ ├── Response.ts │ │ │ │ │ ├── Schema.ts │ │ │ │ │ ├── Scheme.ts │ │ │ │ │ ├── Scopes.ts │ │ │ │ │ ├── SecurityDefinitions.ts │ │ │ │ │ ├── SecurityRequirement.ts │ │ │ │ │ ├── SecurityScheme.ts │ │ │ │ │ ├── Swagger.ts │ │ │ │ │ ├── Tag.ts │ │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── packet │ │ │ ├── Meta.ts │ │ │ ├── Packet.ts │ │ │ ├── PacketBatch.ts │ │ │ ├── PacketFlags.ts │ │ │ └── index.ts │ │ ├── relayer │ │ │ ├── GetTpuConfigsRequest.ts │ │ │ ├── GetTpuConfigsResponse.ts │ │ │ ├── SubscribePacketsRequest.ts │ │ │ ├── SubscribePacketsResponse.ts │ │ │ └── index.ts │ │ ├── searcher │ │ │ ├── ConnectedLeadersRegionedRequest.ts │ │ │ ├── ConnectedLeadersRegionedResponse.ts │ │ │ ├── ConnectedLeadersRequest.ts │ │ │ ├── ConnectedLeadersResponse.ts │ │ │ ├── GetRegionsRequest.ts │ │ │ ├── GetRegionsResponse.ts │ │ │ ├── GetTipAccountsRequest.ts │ │ │ ├── GetTipAccountsResponse.ts │ │ │ ├── MempoolSubscription.ts │ │ │ ├── NextScheduledLeaderRequest.ts │ │ │ ├── NextScheduledLeaderResponse.ts │ │ │ ├── PendingTxNotification.ts │ │ │ ├── ProgramSubscriptionV0.ts │ │ │ ├── SendBundleRequest.ts │ │ │ ├── SendBundleResponse.ts │ │ │ ├── SlotList.ts │ │ │ ├── SubscribeBundleResultsRequest.ts │ │ │ ├── WriteLockedAccountSubscriptionV0.ts │ │ │ └── index.ts │ │ ├── shared │ │ │ ├── Header.ts │ │ │ ├── Heartbeat.ts │ │ │ ├── Socket.ts │ │ │ └── index.ts │ │ ├── shredstream │ │ │ ├── Heartbeat.ts │ │ │ ├── HeartbeatResponse.ts │ │ │ └── index.ts │ │ └── trace_shred │ │ │ ├── TraceShred.ts │ │ │ └── index.ts │ ├── runtime │ │ ├── Long.ts │ │ ├── array.ts │ │ ├── async │ │ │ ├── async-generator.ts │ │ │ ├── event-buffer.ts │ │ │ ├── event-emitter.ts │ │ │ ├── observer.ts │ │ │ └── wait.ts │ │ ├── base64.ts │ │ ├── client-devtools.ts │ │ ├── json │ │ │ └── scalar.ts │ │ ├── rpc.ts │ │ ├── scalar.ts │ │ └── wire │ │ │ ├── deserialize.ts │ │ │ ├── index.ts │ │ │ ├── scalar.ts │ │ │ ├── serialize.ts │ │ │ ├── varint.ts │ │ │ └── zigzag.ts │ └── services │ │ ├── api │ │ ├── Api.ts │ │ └── index.ts │ │ ├── auth │ │ ├── AuthService.ts │ │ └── index.ts │ │ ├── block_engine │ │ ├── BlockEngineRelayer.ts │ │ ├── BlockEngineValidator.ts │ │ └── index.ts │ │ ├── index.ts │ │ ├── relayer │ │ ├── Relayer.ts │ │ └── index.ts │ │ ├── searcher │ │ ├── SearcherService.ts │ │ └── index.ts │ │ └── shredstream │ │ ├── Shredstream.ts │ │ └── index.ts ├── provider │ ├── base.ts │ ├── grpc.ts │ ├── http.ts │ └── ws.ts ├── utils │ ├── blockingqueue.ts │ ├── bundletip.ts │ ├── config.ts │ ├── constants.ts │ ├── error.ts │ ├── memo.ts │ ├── timestamp.ts │ ├── transaction.ts │ └── websocket-iterator.ts └── ws │ └── rpcclient.ts ├── examples ├── examples.test.ts └── index.ts ├── jest.config.cjs ├── package-lock.json ├── package.json ├── sdk.ts ├── tests ├── integration │ ├── grpc.test.ts │ ├── http.test.ts │ └── ws.test.ts ├── speed │ ├── grpc.test.ts │ ├── http.test.ts │ └── ws.test.ts └── unit │ └── grpc.test.ts ├── trading_examples └── raydium.ts ├── tsconfig.json └── tslint.json /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | orbs: 3 | node: circleci/node@5.0.2 4 | jobs: 5 | build: 6 | executor: node/default 7 | steps: 8 | - checkout 9 | - node/install-packages: 10 | pkg-manager: npm 11 | - run: 12 | command: sudo npm install -g ts-node 13 | name: Install ts-node 14 | - run: 15 | command: npm ci 16 | name: Install NPM dependencies for fmt/lint 17 | - run: 18 | command: ts-node -v 19 | name: Check ts-node version to make sure it installed 20 | - persist_to_workspace: 21 | root: . 22 | paths: 23 | - '*' 24 | 25 | test: 26 | executor: node/default 27 | steps: 28 | - attach_workspace: 29 | at: . 30 | - checkout 31 | - run: 32 | command: npm run test:ci 33 | name: run tests 34 | 35 | format: 36 | executor: node/default 37 | steps: 38 | - attach_workspace: 39 | at: . 40 | - checkout 41 | - run: 42 | name: format 43 | command: npm run format 44 | 45 | lint: 46 | executor: node/default 47 | steps: 48 | - attach_workspace: 49 | at: . 50 | - checkout 51 | - run: 52 | name: lint 53 | command: npm run lintCI 54 | 55 | workflows: 56 | build_and_test: 57 | when: 58 | not: 59 | equal: [ scheduled_pipeline, << pipeline.trigger_source >> ] 60 | jobs: 61 | - build 62 | - lint: 63 | requires: 64 | - build 65 | - format: 66 | requires: 67 | - build 68 | - test: 69 | requires: 70 | - build 71 | 72 | nightly: 73 | when: 74 | equal: [ scheduled_pipeline, << pipeline.trigger_source >> ] 75 | jobs: 76 | - build 77 | - lint: 78 | requires: 79 | - build 80 | - format: 81 | requires: 82 | - build 83 | - test: 84 | requires: 85 | - build 86 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | bxsolana/proto 4 | solana-trader-proto/ 5 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "plugins": [ 5 | "@typescript-eslint", 6 | "prettier" 7 | ], 8 | "extends": [ 9 | "plugin:@typescript-eslint/eslint-recommended", 10 | "plugin:@typescript-eslint/recommended", 11 | "prettier" 12 | ], 13 | "rules":{ 14 | "@typescript-eslint/no-namespace": 0, 15 | "@typescript-eslint/no-var-requires": 0, 16 | "no-async-promise-executor": 0, 17 | "@typescript-eslint/no-unused-vars": 0 18 | } 19 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | # Logs 3 | logs 4 | *.log 5 | npm-debug.log* 6 | yarn-debug.log* 7 | yarn-error.log* 8 | lerna-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # TypeScript v1 declaration files 46 | typings/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Microbundle cache 58 | .rpt2_cache/ 59 | .rts2_cache_cjs/ 60 | .rts2_cache_es/ 61 | .rts2_cache_umd/ 62 | 63 | # Optional REPL history 64 | .node_repl_history 65 | 66 | # Output of 'npm pack' 67 | *.tgz 68 | 69 | # Yarn Integrity file 70 | .yarn-integrity 71 | 72 | # dotenv environment variables file 73 | examples/.env 74 | .env 75 | .env.test 76 | 77 | # parcel-bundler cache (https://parceljs.org/) 78 | .cache 79 | 80 | # Next.js build output 81 | .next 82 | 83 | # Nuxt.js build / generate output 84 | .nuxt 85 | dist 86 | 87 | # Gatsby files 88 | .cache/ 89 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 90 | # https://nextjs.org/blog/next-9-1#public-directory-support 91 | # public 92 | 93 | # vuepress build output 94 | .vuepress/dist 95 | 96 | # Serverless directories 97 | .serverless/ 98 | 99 | # FuseBox cache 100 | .fusebox/ 101 | 102 | # DynamoDB Local files 103 | .dynamodb/ 104 | 105 | # TernJS port file 106 | .tern-port 107 | 108 | #Mac OS files 109 | .DS_Store 110 | .vscode/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "solana-trader-proto"] 2 | path = solana-trader-proto 3 | url = git@github.com:bloXroute-Labs/solana-trader-proto.git 4 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npm run lint && npm run format 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | bxsolana/proto 2 | solana-trader-proto 3 | dist/ 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "singleQuote": false, 4 | "bracketSameLine": true, 5 | "bracketSpacing": true, 6 | "printWidth": 80, 7 | "semi": false, 8 | "arrowParens": "always" 9 | } -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | esbuild ./examples/index.ts --bundle --outfile=./examples/index.js --platform=node --sourcemap 3 | 4 | fmt: 5 | prettier --config .prettierrc './**/*.ts' --write -------------------------------------------------------------------------------- /SETUP.md: -------------------------------------------------------------------------------- 1 | # Running Tests 2 | 3 | This guide overviews how to run unit and integration tests for this SDK, found in `/tests`. 4 | 5 | ## Step 1: Install Required Packages 6 | 7 | ```bash 8 | # Using npm 9 | npm install --save-dev jest ts-jest @types/jest 10 | 11 | # Using yarn 12 | yarn add --dev jest ts-jest @types/jest 13 | ``` 14 | 15 | ## Step 2: Configure Jest for TypeScript 16 | 17 | Configurations are defined in `jest.config.cjs` in the root directory of this repository: 18 | 19 | ```javascript 20 | module.exports = { 21 | preset: 'ts-jest', 22 | testEnvironment: 'node', 23 | // Matches test files ending with .test.ts or .spec.ts 24 | testMatch: ['**/*.test.ts', '**/*.spec.ts'], 25 | }; 26 | ``` 27 | 28 | ## Step 3: Install VS Code Extensions 29 | 30 | Extension: **Jest Runner** (by firsttris). 31 | 32 | ## Step 4: Update package.json Scripts 33 | 34 | Tests can be run via `npm run test` being that it is defined as as script in `package.json` 35 | 36 | ```json 37 | "scripts": { 38 | "test": "jest", 39 | "test:watch": "jest --watch" 40 | } 41 | ``` 42 | 43 | ## Step 5: Writing tests 44 | 45 | Unit tests should be placed in `tests/unit/` and integration tests should be placed in `tests/integration`. 46 | 47 | Filenames should end with "*.test.ts*". 48 | 49 | The general test format is as follows: 50 | 51 | ```typescript 52 | // example.test.ts 53 | function sum(a: number, b: number): number { 54 | return a + b; 55 | } 56 | 57 | describe('Sum function', () => { 58 | test('adds 1 + 2 to equal 3', () => { 59 | expect(sum(1, 2)).toBe(3); 60 | }); 61 | 62 | test('adds 5 + 5 to equal 10', () => { 63 | expect(sum(5, 5)).toBe(10); 64 | }); 65 | }); 66 | ``` 67 | --- 68 | 69 | Refer to Jest`s official [documentation](https://jestjs.io/docs/getting-started) for more information. -------------------------------------------------------------------------------- /build.mjs: -------------------------------------------------------------------------------- 1 | import esbuild from "esbuild" 2 | import packageJson from './package.json' assert { type: 'json' }; 3 | 4 | const external = ["dotenv", "@grpc/grpc-js"] 5 | 6 | // ESM for browser 7 | esbuild.buildSync({ 8 | entryPoints: ["bxsolana/index.browser.ts"], 9 | platform: "browser", 10 | format: "esm", 11 | sourcemap: true, 12 | bundle: true, 13 | outfile: "dist/browser/index.js", 14 | external, 15 | define: { 16 | 'process.env.PACKAGE_NAME': JSON.stringify(packageJson.name), 17 | 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), 18 | }, 19 | }) 20 | 21 | // CJS for browser 22 | esbuild.buildSync({ 23 | entryPoints: ["bxsolana/index.browser.ts"], 24 | platform: "browser", 25 | format: "cjs", 26 | sourcemap: true, 27 | bundle: true, 28 | outfile: "dist/browser/index.cjs", 29 | external, 30 | define: { 31 | 'process.env.PACKAGE_NAME': JSON.stringify(packageJson.name), 32 | 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), 33 | }, 34 | }) 35 | 36 | // ESM for node 37 | esbuild.buildSync({ 38 | entryPoints: ["bxsolana/index.ts"], 39 | platform: "node", 40 | format: "esm", 41 | sourcemap: true, 42 | bundle: true, 43 | // not entirely sure what this snippet does: https://github.com/evanw/esbuild/issues/1921 44 | banner: { 45 | js: ` 46 | import { createRequire } from 'module'; 47 | import path from 'path'; 48 | import { fileURLToPath } from 'url'; 49 | const require = createRequire(import.meta.url); 50 | const __filename = fileURLToPath(import.meta.url); 51 | const __dirname = path.dirname(__filename); 52 | `, 53 | }, 54 | outfile: "dist/node/index.js", 55 | define: { 56 | 'process.env.PACKAGE_NAME': JSON.stringify(packageJson.name), 57 | 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), 58 | }, 59 | }) 60 | 61 | // CJS for node 62 | esbuild.buildSync({ 63 | entryPoints: ["bxsolana/index.ts"], 64 | platform: "node", 65 | format: "cjs", 66 | sourcemap: true, 67 | bundle: true, 68 | outfile: "dist/node/index.cjs", 69 | define: { 70 | 'process.env.PACKAGE_NAME': JSON.stringify(packageJson.name), 71 | 'process.env.PACKAGE_VERSION': JSON.stringify(packageJson.version), 72 | }, 73 | }) 74 | -------------------------------------------------------------------------------- /bxsolana/index.browser.ts: -------------------------------------------------------------------------------- 1 | export { BaseProvider } from "./provider/base" 2 | export { HttpProvider } from "./provider/http" 3 | export { WsProvider } from "./provider/ws" 4 | export { 5 | LOCAL_API_GRPC_HOST, 6 | LOCAL_API_GRPC_PORT, 7 | LOCAL_API_HTTP, 8 | LOCAL_API_WS, 9 | MAINNET_API_GRPC_PORT, 10 | MAINNET_API_NY_GRPC, 11 | MAINNET_API_NY_HTTP, 12 | MAINNET_API_NY_WS, 13 | MAINNET_API_UK_GRPC, 14 | MAINNET_API_UK_HTTP, 15 | MAINNET_API_UK_WS, 16 | MAINNET_API_PUMP_NY_WS, 17 | MAINNET_API_PUMP_NY_GRPC, 18 | MAINNET_API_PUMP_NY_HTTP, 19 | MAINNET_API_PUMP_UK_WS, 20 | MAINNET_API_PUMP_UK_GRPC, 21 | MAINNET_API_PUMP_UK_HTTP, 22 | MAINNET_API_FRANKFURT_WS, 23 | MAINNET_API_FRANKFURT_GRPC, 24 | MAINNET_API_FRANKFURT_HTTP, 25 | MAINNET_API_AMSTERDAM_WS, 26 | MAINNET_API_AMSTERDAM_GRPC, 27 | MAINNET_API_AMSTERDAM_HTTP, 28 | MAINNET_API_LA_WS, 29 | MAINNET_API_LA_GRPC, 30 | MAINNET_API_LA_HTTP, 31 | MAINNET_API_TOKYO_WS, 32 | MAINNET_API_TOKYO_GRPC, 33 | MAINNET_API_TOKYO_HTTP, 34 | TESTNET_API_GRPC_HOST, 35 | TESTNET_API_GRPC_PORT, 36 | TESTNET_API_HTTP, 37 | TESTNET_API_WS, 38 | } from "./utils/constants" 39 | 40 | export { 41 | addMemoToSerializedTxn, 42 | createTraderAPIMemoInstruction, 43 | } from "./utils/memo" 44 | 45 | export { signTx, signTxMessage } from "./utils/transaction" 46 | 47 | export * from "./proto/messages/api" 48 | -------------------------------------------------------------------------------- /bxsolana/index.ts: -------------------------------------------------------------------------------- 1 | export { GrpcProvider } from "./provider/grpc" 2 | export { Config, loadFromEnv } from "./utils/config" 3 | 4 | export * from "./index.browser" 5 | -------------------------------------------------------------------------------- /bxsolana/proto/index.ts: -------------------------------------------------------------------------------- 1 | import * as messages from "./messages/index"; 2 | import * as services from "./services/index"; 3 | export type { 4 | messages, 5 | services, 6 | }; 7 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/Direction.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type Direction = 3 | | "D_ASCENDING" 4 | | "D_DESCENDING"; 5 | } 6 | export type Type = $.api.Direction; 7 | 8 | export const num2name = { 9 | 0: "D_ASCENDING", 10 | 1: "D_DESCENDING", 11 | } as const; 12 | 13 | export const name2num = { 14 | D_ASCENDING: 0, 15 | D_DESCENDING: 1, 16 | } as const; 17 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetAccountBalanceRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetAccountBalanceRequest { 21 | ownerAddress: string; 22 | } 23 | } 24 | export type Type = $.api.GetAccountBalanceRequest; 25 | 26 | export function getDefaultValue(): $.api.GetAccountBalanceRequest { 27 | return { 28 | ownerAddress: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetAccountBalanceRequest>): $.api.GetAccountBalanceRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetAccountBalanceRequest): unknown { 40 | const result: any = {}; 41 | if (value.ownerAddress !== undefined) result.ownerAddress = tsValueToJsonValueFns.string(value.ownerAddress); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetAccountBalanceRequest { 46 | const result = getDefaultValue(); 47 | if (value.ownerAddress !== undefined) result.ownerAddress = jsonValueToTsValueFns.string(value.ownerAddress); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetAccountBalanceRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.ownerAddress !== undefined) { 54 | const tsValue = value.ownerAddress; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetAccountBalanceRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.ownerAddress = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetBlockStreamRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetBlockStreamRequest {} 13 | } 14 | export type Type = $.api.GetBlockStreamRequest; 15 | 16 | export function getDefaultValue(): $.api.GetBlockStreamRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetBlockStreamRequest>): $.api.GetBlockStreamRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetBlockStreamRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetBlockStreamRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetBlockStreamRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetBlockStreamRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetBundleTipRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetBundleTipRequest {} 13 | } 14 | export type Type = $.api.GetBundleTipRequest; 15 | 16 | export function getDefaultValue(): $.api.GetBundleTipRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetBundleTipRequest>): $.api.GetBundleTipRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetBundleTipRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetBundleTipRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetBundleTipRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetBundleTipRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetJupiterPricesRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetJupiterPricesRequest { 21 | tokens: string[]; 22 | } 23 | } 24 | export type Type = $.api.GetJupiterPricesRequest; 25 | 26 | export function getDefaultValue(): $.api.GetJupiterPricesRequest { 27 | return { 28 | tokens: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetJupiterPricesRequest>): $.api.GetJupiterPricesRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetJupiterPricesRequest): unknown { 40 | const result: any = {}; 41 | result.tokens = value.tokens.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetJupiterPricesRequest { 46 | const result = getDefaultValue(); 47 | result.tokens = value.tokens?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetJupiterPricesRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.tokens) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.api.GetJupiterPricesRequest { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.tokens = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetMarketsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetMarketsRequest {} 13 | } 14 | export type Type = $.api.GetMarketsRequest; 15 | 16 | export function getDefaultValue(): $.api.GetMarketsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetMarketsRequest>): $.api.GetMarketsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetMarketsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetMarketsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetMarketsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetMarketsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetMarketsRequestV2.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetMarketsRequestV2 {} 13 | } 14 | export type Type = $.api.GetMarketsRequestV2; 15 | 16 | export function getDefaultValue(): $.api.GetMarketsRequestV2 { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetMarketsRequestV2>): $.api.GetMarketsRequestV2 { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetMarketsRequestV2): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetMarketsRequestV2 { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetMarketsRequestV2): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetMarketsRequestV2 { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetNewRaydiumPoolsByTransactionRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetNewRaydiumPoolsByTransactionRequest {} 13 | } 14 | export type Type = $.api.GetNewRaydiumPoolsByTransactionRequest; 15 | 16 | export function getDefaultValue(): $.api.GetNewRaydiumPoolsByTransactionRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetNewRaydiumPoolsByTransactionRequest>): $.api.GetNewRaydiumPoolsByTransactionRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetNewRaydiumPoolsByTransactionRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetNewRaydiumPoolsByTransactionRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetNewRaydiumPoolsByTransactionRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetNewRaydiumPoolsByTransactionRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetNewRaydiumPoolsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetNewRaydiumPoolsRequest { 21 | includeCPMM?: boolean; 22 | } 23 | } 24 | export type Type = $.api.GetNewRaydiumPoolsRequest; 25 | 26 | export function getDefaultValue(): $.api.GetNewRaydiumPoolsRequest { 27 | return { 28 | includeCPMM: false, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetNewRaydiumPoolsRequest>): $.api.GetNewRaydiumPoolsRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetNewRaydiumPoolsRequest): unknown { 40 | const result: any = {}; 41 | if (value.includeCPMM !== undefined) result.includeCPMM = tsValueToJsonValueFns.bool(value.includeCPMM); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetNewRaydiumPoolsRequest { 46 | const result = getDefaultValue(); 47 | if (value.includeCPMM !== undefined) result.includeCPMM = jsonValueToTsValueFns.bool(value.includeCPMM); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetNewRaydiumPoolsRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.includeCPMM !== undefined) { 54 | const tsValue = value.includeCPMM; 55 | result.push( 56 | [1, tsValueToWireValueFns.bool(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetNewRaydiumPoolsRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.bool(wireValue); 70 | if (value === undefined) break field; 71 | result.includeCPMM = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetOrderByIDResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Type as Order, 3 | encodeJson as encodeJson_1, 4 | decodeJson as decodeJson_1, 5 | encodeBinary as encodeBinary_1, 6 | decodeBinary as decodeBinary_1, 7 | } from "./Order"; 8 | import { 9 | jsonValueToTsValueFns, 10 | } from "../../runtime/json/scalar"; 11 | import { 12 | WireMessage, 13 | WireType, 14 | } from "../../runtime/wire/index"; 15 | import { 16 | default as serialize, 17 | } from "../../runtime/wire/serialize"; 18 | import { 19 | default as deserialize, 20 | } from "../../runtime/wire/deserialize"; 21 | 22 | export declare namespace $.api { 23 | export interface GetOrderByIDResponse { 24 | order?: Order; 25 | } 26 | } 27 | export type Type = $.api.GetOrderByIDResponse; 28 | 29 | export function getDefaultValue(): $.api.GetOrderByIDResponse { 30 | return { 31 | order: undefined, 32 | }; 33 | } 34 | 35 | export function createValue(partialValue: Partial<$.api.GetOrderByIDResponse>): $.api.GetOrderByIDResponse { 36 | return { 37 | ...getDefaultValue(), 38 | ...partialValue, 39 | }; 40 | } 41 | 42 | export function encodeJson(value: $.api.GetOrderByIDResponse): unknown { 43 | const result: any = {}; 44 | if (value.order !== undefined) result.order = encodeJson_1(value.order); 45 | return result; 46 | } 47 | 48 | export function decodeJson(value: any): $.api.GetOrderByIDResponse { 49 | const result = getDefaultValue(); 50 | if (value.order !== undefined) result.order = decodeJson_1(value.order); 51 | return result; 52 | } 53 | 54 | export function encodeBinary(value: $.api.GetOrderByIDResponse): Uint8Array { 55 | const result: WireMessage = []; 56 | if (value.order !== undefined) { 57 | const tsValue = value.order; 58 | result.push( 59 | [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], 60 | ); 61 | } 62 | return serialize(result); 63 | } 64 | 65 | export function decodeBinary(binary: Uint8Array): $.api.GetOrderByIDResponse { 66 | const result = getDefaultValue(); 67 | const wireMessage = deserialize(binary); 68 | const wireFields = new Map(wireMessage); 69 | field: { 70 | const wireValue = wireFields.get(1); 71 | if (wireValue === undefined) break field; 72 | const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; 73 | if (value === undefined) break field; 74 | result.order = value; 75 | } 76 | return result; 77 | } 78 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetPriceRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetPriceRequest { 21 | tokens: string[]; 22 | } 23 | } 24 | export type Type = $.api.GetPriceRequest; 25 | 26 | export function getDefaultValue(): $.api.GetPriceRequest { 27 | return { 28 | tokens: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetPriceRequest>): $.api.GetPriceRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetPriceRequest): unknown { 40 | const result: any = {}; 41 | result.tokens = value.tokens.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetPriceRequest { 46 | const result = getDefaultValue(); 47 | result.tokens = value.tokens?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetPriceRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.tokens) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.api.GetPriceRequest { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.tokens = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetPumpFunAMMSwapStreamRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetPumpFunAMMSwapStreamRequest { 21 | pools: string[]; 22 | } 23 | } 24 | export type Type = $.api.GetPumpFunAMMSwapStreamRequest; 25 | 26 | export function getDefaultValue(): $.api.GetPumpFunAMMSwapStreamRequest { 27 | return { 28 | pools: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetPumpFunAMMSwapStreamRequest>): $.api.GetPumpFunAMMSwapStreamRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetPumpFunAMMSwapStreamRequest): unknown { 40 | const result: any = {}; 41 | result.pools = value.pools.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetPumpFunAMMSwapStreamRequest { 46 | const result = getDefaultValue(); 47 | result.pools = value.pools?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetPumpFunAMMSwapStreamRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.pools) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.api.GetPumpFunAMMSwapStreamRequest { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.pools = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetPumpFunNewAmmPoolStreamRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetPumpFunNewAmmPoolStreamRequest {} 13 | } 14 | export type Type = $.api.GetPumpFunNewAmmPoolStreamRequest; 15 | 16 | export function getDefaultValue(): $.api.GetPumpFunNewAmmPoolStreamRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetPumpFunNewAmmPoolStreamRequest>): $.api.GetPumpFunNewAmmPoolStreamRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetPumpFunNewAmmPoolStreamRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetPumpFunNewAmmPoolStreamRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetPumpFunNewAmmPoolStreamRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetPumpFunNewAmmPoolStreamRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetPumpFunNewTokensStreamRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetPumpFunNewTokensStreamRequest {} 13 | } 14 | export type Type = $.api.GetPumpFunNewTokensStreamRequest; 15 | 16 | export function getDefaultValue(): $.api.GetPumpFunNewTokensStreamRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetPumpFunNewTokensStreamRequest>): $.api.GetPumpFunNewTokensStreamRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetPumpFunNewTokensStreamRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetPumpFunNewTokensStreamRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetPumpFunNewTokensStreamRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetPumpFunNewTokensStreamRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetPumpFunSwapsStreamRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetPumpFunSwapsStreamRequest { 21 | tokens: string[]; 22 | } 23 | } 24 | export type Type = $.api.GetPumpFunSwapsStreamRequest; 25 | 26 | export function getDefaultValue(): $.api.GetPumpFunSwapsStreamRequest { 27 | return { 28 | tokens: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetPumpFunSwapsStreamRequest>): $.api.GetPumpFunSwapsStreamRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetPumpFunSwapsStreamRequest): unknown { 40 | const result: any = {}; 41 | result.tokens = value.tokens.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetPumpFunSwapsStreamRequest { 46 | const result = getDefaultValue(); 47 | result.tokens = value.tokens?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetPumpFunSwapsStreamRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.tokens) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.api.GetPumpFunSwapsStreamRequest { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.tokens = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetRateLimitRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetRateLimitRequest {} 13 | } 14 | export type Type = $.api.GetRateLimitRequest; 15 | 16 | export function getDefaultValue(): $.api.GetRateLimitRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetRateLimitRequest>): $.api.GetRateLimitRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetRateLimitRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetRateLimitRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetRateLimitRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetRateLimitRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetRaydiumCLMMPoolsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetRaydiumCLMMPoolsRequest { 21 | pairOrAddress: string; 22 | } 23 | } 24 | export type Type = $.api.GetRaydiumCLMMPoolsRequest; 25 | 26 | export function getDefaultValue(): $.api.GetRaydiumCLMMPoolsRequest { 27 | return { 28 | pairOrAddress: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetRaydiumCLMMPoolsRequest>): $.api.GetRaydiumCLMMPoolsRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetRaydiumCLMMPoolsRequest): unknown { 40 | const result: any = {}; 41 | if (value.pairOrAddress !== undefined) result.pairOrAddress = tsValueToJsonValueFns.string(value.pairOrAddress); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetRaydiumCLMMPoolsRequest { 46 | const result = getDefaultValue(); 47 | if (value.pairOrAddress !== undefined) result.pairOrAddress = jsonValueToTsValueFns.string(value.pairOrAddress); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetRaydiumCLMMPoolsRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.pairOrAddress !== undefined) { 54 | const tsValue = value.pairOrAddress; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetRaydiumCLMMPoolsRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.pairOrAddress = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetRaydiumPoolsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetRaydiumPoolsRequest {} 13 | } 14 | export type Type = $.api.GetRaydiumPoolsRequest; 15 | 16 | export function getDefaultValue(): $.api.GetRaydiumPoolsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetRaydiumPoolsRequest>): $.api.GetRaydiumPoolsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetRaydiumPoolsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetRaydiumPoolsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetRaydiumPoolsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetRaydiumPoolsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetRaydiumPricesRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetRaydiumPricesRequest { 21 | tokens: string[]; 22 | } 23 | } 24 | export type Type = $.api.GetRaydiumPricesRequest; 25 | 26 | export function getDefaultValue(): $.api.GetRaydiumPricesRequest { 27 | return { 28 | tokens: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetRaydiumPricesRequest>): $.api.GetRaydiumPricesRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetRaydiumPricesRequest): unknown { 40 | const result: any = {}; 41 | result.tokens = value.tokens.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetRaydiumPricesRequest { 46 | const result = getDefaultValue(); 47 | result.tokens = value.tokens?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetRaydiumPricesRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.tokens) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.api.GetRaydiumPricesRequest { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.tokens = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetRecentBlockHashRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetRecentBlockHashRequest {} 13 | } 14 | export type Type = $.api.GetRecentBlockHashRequest; 15 | 16 | export function getDefaultValue(): $.api.GetRecentBlockHashRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetRecentBlockHashRequest>): $.api.GetRecentBlockHashRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetRecentBlockHashRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetRecentBlockHashRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetRecentBlockHashRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetRecentBlockHashRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetRecentBlockHashRequestV2.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetRecentBlockHashRequestV2 { 21 | offset: string; 22 | } 23 | } 24 | export type Type = $.api.GetRecentBlockHashRequestV2; 25 | 26 | export function getDefaultValue(): $.api.GetRecentBlockHashRequestV2 { 27 | return { 28 | offset: "0", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetRecentBlockHashRequestV2>): $.api.GetRecentBlockHashRequestV2 { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetRecentBlockHashRequestV2): unknown { 40 | const result: any = {}; 41 | if (value.offset !== undefined) result.offset = tsValueToJsonValueFns.uint64(value.offset); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetRecentBlockHashRequestV2 { 46 | const result = getDefaultValue(); 47 | if (value.offset !== undefined) result.offset = jsonValueToTsValueFns.uint64(value.offset); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetRecentBlockHashRequestV2): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.offset !== undefined) { 54 | const tsValue = value.offset; 55 | result.push( 56 | [1, tsValueToWireValueFns.uint64(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetRecentBlockHashRequestV2 { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.uint64(wireValue); 70 | if (value === undefined) break field; 71 | result.offset = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetServerTimeRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.api { 12 | export interface GetServerTimeRequest {} 13 | } 14 | export type Type = $.api.GetServerTimeRequest; 15 | 16 | export function getDefaultValue(): $.api.GetServerTimeRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.api.GetServerTimeRequest>): $.api.GetServerTimeRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.api.GetServerTimeRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.api.GetServerTimeRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.api.GetServerTimeRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.api.GetServerTimeRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetServerTimeResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetServerTimeResponse { 21 | timestamp: string; 22 | } 23 | } 24 | export type Type = $.api.GetServerTimeResponse; 25 | 26 | export function getDefaultValue(): $.api.GetServerTimeResponse { 27 | return { 28 | timestamp: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetServerTimeResponse>): $.api.GetServerTimeResponse { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetServerTimeResponse): unknown { 40 | const result: any = {}; 41 | if (value.timestamp !== undefined) result.timestamp = tsValueToJsonValueFns.string(value.timestamp); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetServerTimeResponse { 46 | const result = getDefaultValue(); 47 | if (value.timestamp !== undefined) result.timestamp = jsonValueToTsValueFns.string(value.timestamp); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetServerTimeResponse): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.timestamp !== undefined) { 54 | const tsValue = value.timestamp; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetServerTimeResponse { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.timestamp = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetTickersRequestV2.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetTickersRequestV2 { 21 | market: string; 22 | } 23 | } 24 | export type Type = $.api.GetTickersRequestV2; 25 | 26 | export function getDefaultValue(): $.api.GetTickersRequestV2 { 27 | return { 28 | market: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetTickersRequestV2>): $.api.GetTickersRequestV2 { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetTickersRequestV2): unknown { 40 | const result: any = {}; 41 | if (value.market !== undefined) result.market = tsValueToJsonValueFns.string(value.market); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetTickersRequestV2 { 46 | const result = getDefaultValue(); 47 | if (value.market !== undefined) result.market = jsonValueToTsValueFns.string(value.market); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetTickersRequestV2): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.market !== undefined) { 54 | const tsValue = value.market; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetTickersRequestV2 { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.market = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetTokenAccountsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetTokenAccountsRequest { 21 | ownerAddress: string; 22 | } 23 | } 24 | export type Type = $.api.GetTokenAccountsRequest; 25 | 26 | export function getDefaultValue(): $.api.GetTokenAccountsRequest { 27 | return { 28 | ownerAddress: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetTokenAccountsRequest>): $.api.GetTokenAccountsRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetTokenAccountsRequest): unknown { 40 | const result: any = {}; 41 | if (value.ownerAddress !== undefined) result.ownerAddress = tsValueToJsonValueFns.string(value.ownerAddress); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetTokenAccountsRequest { 46 | const result = getDefaultValue(); 47 | if (value.ownerAddress !== undefined) result.ownerAddress = jsonValueToTsValueFns.string(value.ownerAddress); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetTokenAccountsRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.ownerAddress !== undefined) { 54 | const tsValue = value.ownerAddress; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetTokenAccountsRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.ownerAddress = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/GetTransactionRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface GetTransactionRequest { 21 | signature: string; 22 | } 23 | } 24 | export type Type = $.api.GetTransactionRequest; 25 | 26 | export function getDefaultValue(): $.api.GetTransactionRequest { 27 | return { 28 | signature: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.GetTransactionRequest>): $.api.GetTransactionRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.GetTransactionRequest): unknown { 40 | const result: any = {}; 41 | if (value.signature !== undefined) result.signature = tsValueToJsonValueFns.string(value.signature); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.GetTransactionRequest { 46 | const result = getDefaultValue(); 47 | if (value.signature !== undefined) result.signature = jsonValueToTsValueFns.string(value.signature); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.GetTransactionRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.signature !== undefined) { 54 | const tsValue = value.signature; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.GetTransactionRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.signature = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/InstructionRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface InstructionRequest { 21 | programIdIndex: number; 22 | } 23 | } 24 | export type Type = $.api.InstructionRequest; 25 | 26 | export function getDefaultValue(): $.api.InstructionRequest { 27 | return { 28 | programIdIndex: 0, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.InstructionRequest>): $.api.InstructionRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.InstructionRequest): unknown { 40 | const result: any = {}; 41 | if (value.programIdIndex !== undefined) result.programIdIndex = tsValueToJsonValueFns.uint32(value.programIdIndex); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.InstructionRequest { 46 | const result = getDefaultValue(); 47 | if (value.programIdIndex !== undefined) result.programIdIndex = jsonValueToTsValueFns.uint32(value.programIdIndex); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.InstructionRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.programIdIndex !== undefined) { 54 | const tsValue = value.programIdIndex; 55 | result.push( 56 | [1, tsValueToWireValueFns.uint32(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.InstructionRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.uint32(wireValue); 70 | if (value === undefined) break field; 71 | result.programIdIndex = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/MarketStatus.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type MarketStatus = 3 | | "MS_UNKNOWN" 4 | | "MS_ONLINE"; 5 | } 6 | export type Type = $.api.MarketStatus; 7 | 8 | export const num2name = { 9 | 0: "MS_UNKNOWN", 10 | 1: "MS_ONLINE", 11 | } as const; 12 | 13 | export const name2num = { 14 | MS_UNKNOWN: 0, 15 | MS_ONLINE: 1, 16 | } as const; 17 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/OrderStatus.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type OrderStatus = 3 | | "OS_UNKNOWN" 4 | | "OS_OPEN" 5 | | "OS_PARTIAL_FILL" 6 | | "OS_CANCELLED" 7 | | "OS_FILLED"; 8 | } 9 | export type Type = $.api.OrderStatus; 10 | 11 | export const num2name = { 12 | 0: "OS_UNKNOWN", 13 | 1: "OS_OPEN", 14 | 2: "OS_PARTIAL_FILL", 15 | 3: "OS_CANCELLED", 16 | 4: "OS_FILLED", 17 | } as const; 18 | 19 | export const name2num = { 20 | OS_UNKNOWN: 0, 21 | OS_OPEN: 1, 22 | OS_PARTIAL_FILL: 2, 23 | OS_CANCELLED: 3, 24 | OS_FILLED: 4, 25 | } as const; 26 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/PostSubmitResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface PostSubmitResponse { 21 | signature: string; 22 | } 23 | } 24 | export type Type = $.api.PostSubmitResponse; 25 | 26 | export function getDefaultValue(): $.api.PostSubmitResponse { 27 | return { 28 | signature: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.PostSubmitResponse>): $.api.PostSubmitResponse { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.PostSubmitResponse): unknown { 40 | const result: any = {}; 41 | if (value.signature !== undefined) result.signature = tsValueToJsonValueFns.string(value.signature); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.PostSubmitResponse { 46 | const result = getDefaultValue(); 47 | if (value.signature !== undefined) result.signature = jsonValueToTsValueFns.string(value.signature); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.PostSubmitResponse): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.signature !== undefined) { 54 | const tsValue = value.signature; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.PostSubmitResponse { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.signature = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/Project.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type Project = 3 | | "P_UNKNOWN" 4 | | "P_ALL" 5 | | "P_JUPITER" 6 | | "P_RAYDIUM" 7 | | "P_SERUM" 8 | | "P_OPENBOOK"; 9 | } 10 | export type Type = $.api.Project; 11 | 12 | export const num2name = { 13 | 0: "P_UNKNOWN", 14 | 1: "P_ALL", 15 | 2: "P_JUPITER", 16 | 3: "P_RAYDIUM", 17 | 4: "P_SERUM", 18 | 5: "P_OPENBOOK", 19 | } as const; 20 | 21 | export const name2num = { 22 | P_UNKNOWN: 0, 23 | P_ALL: 1, 24 | P_JUPITER: 2, 25 | P_RAYDIUM: 3, 26 | P_SERUM: 4, 27 | P_OPENBOOK: 5, 28 | } as const; 29 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/PublicKeys.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface PublicKeys { 21 | pks: string[]; 22 | } 23 | } 24 | export type Type = $.api.PublicKeys; 25 | 26 | export function getDefaultValue(): $.api.PublicKeys { 27 | return { 28 | pks: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.PublicKeys>): $.api.PublicKeys { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.PublicKeys): unknown { 40 | const result: any = {}; 41 | result.pks = value.pks.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.PublicKeys { 46 | const result = getDefaultValue(); 47 | result.pks = value.pks?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.PublicKeys): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.pks) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.api.PublicKeys { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.pks = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/Side.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type Side = 3 | | "S_UNKNOWN" 4 | | "S_BID" 5 | | "S_ASK"; 6 | } 7 | export type Type = $.api.Side; 8 | 9 | export const num2name = { 10 | 0: "S_UNKNOWN", 11 | 1: "S_BID", 12 | 2: "S_ASK", 13 | } as const; 14 | 15 | export const name2num = { 16 | S_UNKNOWN: 0, 17 | S_BID: 1, 18 | S_ASK: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/Step.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type Step = 3 | | "STEP0" 4 | | "STEP1" 5 | | "STEP2" 6 | | "STEP3"; 7 | } 8 | export type Type = $.api.Step; 9 | 10 | export const num2name = { 11 | 0: "STEP0", 12 | 1: "STEP1", 13 | 2: "STEP2", 14 | 3: "STEP3", 15 | } as const; 16 | 17 | export const name2num = { 18 | STEP0: 0, 19 | STEP1: 1, 20 | STEP2: 2, 21 | STEP3: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/SubmitProtection.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type SubmitProtection = 3 | | "SP_LOW" 4 | | "SP_MEDIUM" 5 | | "SP_HIGH"; 6 | } 7 | export type Type = $.api.SubmitProtection; 8 | 9 | export const num2name = { 10 | 0: "SP_LOW", 11 | 1: "SP_MEDIUM", 12 | 2: "SP_HIGH", 13 | } as const; 14 | 15 | export const name2num = { 16 | SP_LOW: 0, 17 | SP_MEDIUM: 1, 18 | SP_HIGH: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/SubmitStrategy.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.api { 2 | export type SubmitStrategy = 3 | | "P_UKNOWN" 4 | | "P_SUBMIT_ALL" 5 | | "P_ABORT_ON_FIRST_ERROR" 6 | | "P_WAIT_FOR_CONFIRMATION"; 7 | } 8 | export type Type = $.api.SubmitStrategy; 9 | 10 | export const num2name = { 11 | 0: "P_UKNOWN", 12 | 1: "P_SUBMIT_ALL", 13 | 2: "P_ABORT_ON_FIRST_ERROR", 14 | 3: "P_WAIT_FOR_CONFIRMATION", 15 | } as const; 16 | 17 | export const name2num = { 18 | P_UKNOWN: 0, 19 | P_SUBMIT_ALL: 1, 20 | P_ABORT_ON_FIRST_ERROR: 2, 21 | P_WAIT_FOR_CONFIRMATION: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/api/TransactionMessageV2.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.api { 20 | export interface TransactionMessageV2 { 21 | content: string; 22 | } 23 | } 24 | export type Type = $.api.TransactionMessageV2; 25 | 26 | export function getDefaultValue(): $.api.TransactionMessageV2 { 27 | return { 28 | content: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.api.TransactionMessageV2>): $.api.TransactionMessageV2 { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.api.TransactionMessageV2): unknown { 40 | const result: any = {}; 41 | if (value.content !== undefined) result.content = tsValueToJsonValueFns.string(value.content); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.api.TransactionMessageV2 { 46 | const result = getDefaultValue(); 47 | if (value.content !== undefined) result.content = jsonValueToTsValueFns.string(value.content); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.api.TransactionMessageV2): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.content !== undefined) { 54 | const tsValue = value.content; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.api.TransactionMessageV2 { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.content = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/auth/GenerateAuthChallengeResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.auth { 20 | export interface GenerateAuthChallengeResponse { 21 | challenge: string; 22 | } 23 | } 24 | export type Type = $.auth.GenerateAuthChallengeResponse; 25 | 26 | export function getDefaultValue(): $.auth.GenerateAuthChallengeResponse { 27 | return { 28 | challenge: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.auth.GenerateAuthChallengeResponse>): $.auth.GenerateAuthChallengeResponse { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.auth.GenerateAuthChallengeResponse): unknown { 40 | const result: any = {}; 41 | if (value.challenge !== undefined) result.challenge = tsValueToJsonValueFns.string(value.challenge); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.auth.GenerateAuthChallengeResponse { 46 | const result = getDefaultValue(); 47 | if (value.challenge !== undefined) result.challenge = jsonValueToTsValueFns.string(value.challenge); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.auth.GenerateAuthChallengeResponse): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.challenge !== undefined) { 54 | const tsValue = value.challenge; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.auth.GenerateAuthChallengeResponse { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.challenge = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/auth/RefreshAccessTokenRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.auth { 20 | export interface RefreshAccessTokenRequest { 21 | refreshToken: string; 22 | } 23 | } 24 | export type Type = $.auth.RefreshAccessTokenRequest; 25 | 26 | export function getDefaultValue(): $.auth.RefreshAccessTokenRequest { 27 | return { 28 | refreshToken: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.auth.RefreshAccessTokenRequest>): $.auth.RefreshAccessTokenRequest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.auth.RefreshAccessTokenRequest): unknown { 40 | const result: any = {}; 41 | if (value.refreshToken !== undefined) result.refreshToken = tsValueToJsonValueFns.string(value.refreshToken); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.auth.RefreshAccessTokenRequest { 46 | const result = getDefaultValue(); 47 | if (value.refreshToken !== undefined) result.refreshToken = jsonValueToTsValueFns.string(value.refreshToken); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.auth.RefreshAccessTokenRequest): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.refreshToken !== undefined) { 54 | const tsValue = value.refreshToken; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.auth.RefreshAccessTokenRequest { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.refreshToken = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/auth/Role.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.auth { 2 | export type Role = 3 | | "RELAYER" 4 | | "SEARCHER" 5 | | "VALIDATOR" 6 | | "SHREDSTREAM_SUBSCRIBER"; 7 | } 8 | export type Type = $.auth.Role; 9 | 10 | export const num2name = { 11 | 0: "RELAYER", 12 | 1: "SEARCHER", 13 | 2: "VALIDATOR", 14 | 3: "SHREDSTREAM_SUBSCRIBER", 15 | } as const; 16 | 17 | export const name2num = { 18 | RELAYER: 0, 19 | SEARCHER: 1, 20 | VALIDATOR: 2, 21 | SHREDSTREAM_SUBSCRIBER: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/auth/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Role } from "./Role"; 2 | export type { Type as GenerateAuthChallengeRequest } from "./GenerateAuthChallengeRequest"; 3 | export type { Type as GenerateAuthChallengeResponse } from "./GenerateAuthChallengeResponse"; 4 | export type { Type as GenerateAuthTokensRequest } from "./GenerateAuthTokensRequest"; 5 | export type { Type as Token } from "./Token"; 6 | export type { Type as GenerateAuthTokensResponse } from "./GenerateAuthTokensResponse"; 7 | export type { Type as RefreshAccessTokenRequest } from "./RefreshAccessTokenRequest"; 8 | export type { Type as RefreshAccessTokenResponse } from "./RefreshAccessTokenResponse"; 9 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as CondensedBlock } from "./CondensedBlock"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/AccountsOfInterest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.block_engine { 20 | export interface AccountsOfInterest { 21 | accounts: string[]; 22 | } 23 | } 24 | export type Type = $.block_engine.AccountsOfInterest; 25 | 26 | export function getDefaultValue(): $.block_engine.AccountsOfInterest { 27 | return { 28 | accounts: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.block_engine.AccountsOfInterest>): $.block_engine.AccountsOfInterest { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.block_engine.AccountsOfInterest): unknown { 40 | const result: any = {}; 41 | result.accounts = value.accounts.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.block_engine.AccountsOfInterest { 46 | const result = getDefaultValue(); 47 | result.accounts = value.accounts?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.block_engine.AccountsOfInterest): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.accounts) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.block_engine.AccountsOfInterest { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.accounts = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/AccountsOfInterestRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.block_engine { 12 | export interface AccountsOfInterestRequest {} 13 | } 14 | export type Type = $.block_engine.AccountsOfInterestRequest; 15 | 16 | export function getDefaultValue(): $.block_engine.AccountsOfInterestRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.block_engine.AccountsOfInterestRequest>): $.block_engine.AccountsOfInterestRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.block_engine.AccountsOfInterestRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.block_engine.AccountsOfInterestRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.block_engine.AccountsOfInterestRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.block_engine.AccountsOfInterestRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/BlockBuilderFeeInfoRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.block_engine { 12 | export interface BlockBuilderFeeInfoRequest {} 13 | } 14 | export type Type = $.block_engine.BlockBuilderFeeInfoRequest; 15 | 16 | export function getDefaultValue(): $.block_engine.BlockBuilderFeeInfoRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.block_engine.BlockBuilderFeeInfoRequest>): $.block_engine.BlockBuilderFeeInfoRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.block_engine.BlockBuilderFeeInfoRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.block_engine.BlockBuilderFeeInfoRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.block_engine.BlockBuilderFeeInfoRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.block_engine.BlockBuilderFeeInfoRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/ProgramsOfInterestRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.block_engine { 12 | export interface ProgramsOfInterestRequest {} 13 | } 14 | export type Type = $.block_engine.ProgramsOfInterestRequest; 15 | 16 | export function getDefaultValue(): $.block_engine.ProgramsOfInterestRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.block_engine.ProgramsOfInterestRequest>): $.block_engine.ProgramsOfInterestRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.block_engine.ProgramsOfInterestRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.block_engine.ProgramsOfInterestRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.block_engine.ProgramsOfInterestRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.block_engine.ProgramsOfInterestRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/SubscribeBundlesRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.block_engine { 12 | export interface SubscribeBundlesRequest {} 13 | } 14 | export type Type = $.block_engine.SubscribeBundlesRequest; 15 | 16 | export function getDefaultValue(): $.block_engine.SubscribeBundlesRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.block_engine.SubscribeBundlesRequest>): $.block_engine.SubscribeBundlesRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.block_engine.SubscribeBundlesRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.block_engine.SubscribeBundlesRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.block_engine.SubscribeBundlesRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.block_engine.SubscribeBundlesRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/SubscribePacketsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.block_engine { 12 | export interface SubscribePacketsRequest {} 13 | } 14 | export type Type = $.block_engine.SubscribePacketsRequest; 15 | 16 | export function getDefaultValue(): $.block_engine.SubscribePacketsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.block_engine.SubscribePacketsRequest>): $.block_engine.SubscribePacketsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.block_engine.SubscribePacketsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.block_engine.SubscribePacketsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.block_engine.SubscribePacketsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.block_engine.SubscribePacketsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/block_engine/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as SubscribePacketsRequest } from "./SubscribePacketsRequest"; 2 | export type { Type as SubscribePacketsResponse } from "./SubscribePacketsResponse"; 3 | export type { Type as SubscribeBundlesRequest } from "./SubscribeBundlesRequest"; 4 | export type { Type as SubscribeBundlesResponse } from "./SubscribeBundlesResponse"; 5 | export type { Type as BlockBuilderFeeInfoRequest } from "./BlockBuilderFeeInfoRequest"; 6 | export type { Type as BlockBuilderFeeInfoResponse } from "./BlockBuilderFeeInfoResponse"; 7 | export type { Type as AccountsOfInterest } from "./AccountsOfInterest"; 8 | export type { Type as AccountsOfInterestRequest } from "./AccountsOfInterestRequest"; 9 | export type { Type as AccountsOfInterestUpdate } from "./AccountsOfInterestUpdate"; 10 | export type { Type as ProgramsOfInterestRequest } from "./ProgramsOfInterestRequest"; 11 | export type { Type as ProgramsOfInterestUpdate } from "./ProgramsOfInterestUpdate"; 12 | export type { Type as ExpiringPacketBatch } from "./ExpiringPacketBatch"; 13 | export type { Type as PacketBatchUpdate } from "./PacketBatchUpdate"; 14 | export type { Type as StartExpiringPacketStreamResponse } from "./StartExpiringPacketStreamResponse"; 15 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/bundle/Dropped.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Type as DroppedReason, 3 | name2num, 4 | num2name, 5 | } from "./DroppedReason"; 6 | import { 7 | tsValueToJsonValueFns, 8 | jsonValueToTsValueFns, 9 | } from "../../runtime/json/scalar"; 10 | import { 11 | WireMessage, 12 | WireType, 13 | } from "../../runtime/wire/index"; 14 | import { 15 | default as serialize, 16 | } from "../../runtime/wire/serialize"; 17 | import { 18 | default as Long, 19 | } from "../../runtime/Long"; 20 | import { 21 | default as deserialize, 22 | } from "../../runtime/wire/deserialize"; 23 | 24 | export declare namespace $.bundle { 25 | export interface Dropped { 26 | reason: DroppedReason; 27 | } 28 | } 29 | export type Type = $.bundle.Dropped; 30 | 31 | export function getDefaultValue(): $.bundle.Dropped { 32 | return { 33 | reason: "BlockhashExpired", 34 | }; 35 | } 36 | 37 | export function createValue(partialValue: Partial<$.bundle.Dropped>): $.bundle.Dropped { 38 | return { 39 | ...getDefaultValue(), 40 | ...partialValue, 41 | }; 42 | } 43 | 44 | export function encodeJson(value: $.bundle.Dropped): unknown { 45 | const result: any = {}; 46 | if (value.reason !== undefined) result.reason = tsValueToJsonValueFns.enum(value.reason); 47 | return result; 48 | } 49 | 50 | export function decodeJson(value: any): $.bundle.Dropped { 51 | const result = getDefaultValue(); 52 | if (value.reason !== undefined) result.reason = jsonValueToTsValueFns.enum(value.reason) as DroppedReason; 53 | return result; 54 | } 55 | 56 | export function encodeBinary(value: $.bundle.Dropped): Uint8Array { 57 | const result: WireMessage = []; 58 | if (value.reason !== undefined) { 59 | const tsValue = value.reason; 60 | result.push( 61 | [1, { type: WireType.Varint as const, value: new Long(name2num[tsValue as keyof typeof name2num]) }], 62 | ); 63 | } 64 | return serialize(result); 65 | } 66 | 67 | export function decodeBinary(binary: Uint8Array): $.bundle.Dropped { 68 | const result = getDefaultValue(); 69 | const wireMessage = deserialize(binary); 70 | const wireFields = new Map(wireMessage); 71 | field: { 72 | const wireValue = wireFields.get(1); 73 | if (wireValue === undefined) break field; 74 | const value = wireValue.type === WireType.Varint ? num2name[wireValue.value[0] as keyof typeof num2name] : undefined; 75 | if (value === undefined) break field; 76 | result.reason = value; 77 | } 78 | return result; 79 | } 80 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/bundle/DroppedBundle.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.bundle { 20 | export interface DroppedBundle { 21 | msg: string; 22 | } 23 | } 24 | export type Type = $.bundle.DroppedBundle; 25 | 26 | export function getDefaultValue(): $.bundle.DroppedBundle { 27 | return { 28 | msg: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.bundle.DroppedBundle>): $.bundle.DroppedBundle { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.bundle.DroppedBundle): unknown { 40 | const result: any = {}; 41 | if (value.msg !== undefined) result.msg = tsValueToJsonValueFns.string(value.msg); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.bundle.DroppedBundle { 46 | const result = getDefaultValue(); 47 | if (value.msg !== undefined) result.msg = jsonValueToTsValueFns.string(value.msg); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.bundle.DroppedBundle): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.msg !== undefined) { 54 | const tsValue = value.msg; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.bundle.DroppedBundle { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.msg = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/bundle/DroppedReason.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.bundle { 2 | export type DroppedReason = 3 | | "BlockhashExpired" 4 | | "PartiallyProcessed" 5 | | "NotFinalized"; 6 | } 7 | export type Type = $.bundle.DroppedReason; 8 | 9 | export const num2name = { 10 | 0: "BlockhashExpired", 11 | 1: "PartiallyProcessed", 12 | 2: "NotFinalized", 13 | } as const; 14 | 15 | export const name2num = { 16 | BlockhashExpired: 0, 17 | PartiallyProcessed: 1, 18 | NotFinalized: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/bundle/Finalized.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.bundle { 12 | export interface Finalized {} 13 | } 14 | export type Type = $.bundle.Finalized; 15 | 16 | export function getDefaultValue(): $.bundle.Finalized { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.bundle.Finalized>): $.bundle.Finalized { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.bundle.Finalized): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.bundle.Finalized { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.bundle.Finalized): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.bundle.Finalized { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/bundle/InternalError.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.bundle { 20 | export interface InternalError { 21 | msg: string; 22 | } 23 | } 24 | export type Type = $.bundle.InternalError; 25 | 26 | export function getDefaultValue(): $.bundle.InternalError { 27 | return { 28 | msg: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.bundle.InternalError>): $.bundle.InternalError { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.bundle.InternalError): unknown { 40 | const result: any = {}; 41 | if (value.msg !== undefined) result.msg = tsValueToJsonValueFns.string(value.msg); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.bundle.InternalError { 46 | const result = getDefaultValue(); 47 | if (value.msg !== undefined) result.msg = jsonValueToTsValueFns.string(value.msg); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.bundle.InternalError): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.msg !== undefined) { 54 | const tsValue = value.msg; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.bundle.InternalError { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.msg = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/bundle/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Bundle } from "./Bundle"; 2 | export type { Type as BundleUuid } from "./BundleUuid"; 3 | export type { Type as Accepted } from "./Accepted"; 4 | export type { Type as Rejected } from "./Rejected"; 5 | export type { Type as WinningBatchBidRejected } from "./WinningBatchBidRejected"; 6 | export type { Type as StateAuctionBidRejected } from "./StateAuctionBidRejected"; 7 | export type { Type as SimulationFailure } from "./SimulationFailure"; 8 | export type { Type as InternalError } from "./InternalError"; 9 | export type { Type as DroppedBundle } from "./DroppedBundle"; 10 | export type { Type as Finalized } from "./Finalized"; 11 | export type { Type as Processed } from "./Processed"; 12 | export type { Type as Dropped } from "./Dropped"; 13 | export type { Type as DroppedReason } from "./DroppedReason"; 14 | export type { Type as BundleResult } from "./BundleResult"; 15 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/Infinity.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type Infinity = 3 | | "INF_NOT" 4 | | "INF_POSITIVE" 5 | | "INF_NEGATIVE"; 6 | } 7 | export type Type = $.common.Infinity; 8 | 9 | export const num2name = { 10 | 0: "INF_NOT", 11 | 1: "INF_POSITIVE", 12 | 2: "INF_NEGATIVE", 13 | } as const; 14 | 15 | export const name2num = { 16 | INF_NOT: 0, 17 | INF_POSITIVE: 1, 18 | INF_NEGATIVE: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/MarginContract.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type MarginContract = 3 | | "ALL_SPOTS" 4 | | "SOL_SPOT" 5 | | "USDC_SPOT" 6 | | "MSOL_SPOT" 7 | | "WBTC_SPOT" 8 | | "WETH_SPOT" 9 | | "USDT_SPOT"; 10 | } 11 | export type Type = $.common.MarginContract; 12 | 13 | export const num2name = { 14 | 0: "ALL_SPOTS", 15 | 1: "SOL_SPOT", 16 | 2: "USDC_SPOT", 17 | 3: "MSOL_SPOT", 18 | 4: "WBTC_SPOT", 19 | 5: "WETH_SPOT", 20 | 6: "USDT_SPOT", 21 | } as const; 22 | 23 | export const name2num = { 24 | ALL_SPOTS: 0, 25 | SOL_SPOT: 1, 26 | USDC_SPOT: 2, 27 | MSOL_SPOT: 3, 28 | WBTC_SPOT: 4, 29 | WETH_SPOT: 5, 30 | USDT_SPOT: 6, 31 | } as const; 32 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/OrderType.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type OrderType = 3 | | "OT_MARKET" 4 | | "OT_LIMIT" 5 | | "OT_IOC" 6 | | "OT_POST"; 7 | } 8 | export type Type = $.common.OrderType; 9 | 10 | export const num2name = { 11 | 0: "OT_MARKET", 12 | 1: "OT_LIMIT", 13 | 2: "OT_IOC", 14 | 3: "OT_POST", 15 | } as const; 16 | 17 | export const name2num = { 18 | OT_MARKET: 0, 19 | OT_LIMIT: 1, 20 | OT_IOC: 2, 21 | OT_POST: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/PerpCollateralToken.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type PerpCollateralToken = 3 | | "PCTK_USDC" 4 | | "PCTK_SOL"; 5 | } 6 | export type Type = $.common.PerpCollateralToken; 7 | 8 | export const num2name = { 9 | 0: "PCTK_USDC", 10 | 1: "PCTK_SOL", 11 | } as const; 12 | 13 | export const name2num = { 14 | PCTK_USDC: 0, 15 | PCTK_SOL: 1, 16 | } as const; 17 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/PerpCollateralType.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type PerpCollateralType = 3 | | "PCT_DEPOSIT" 4 | | "PCT_WITHDRAWAL" 5 | | "PCT_TRANSFER"; 6 | } 7 | export type Type = $.common.PerpCollateralType; 8 | 9 | export const num2name = { 10 | 0: "PCT_DEPOSIT", 11 | 1: "PCT_WITHDRAWAL", 12 | 2: "PCT_TRANSFER", 13 | } as const; 14 | 15 | export const name2num = { 16 | PCT_DEPOSIT: 0, 17 | PCT_WITHDRAWAL: 1, 18 | PCT_TRANSFER: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/PerpContract.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type PerpContract = 3 | | "ALL" 4 | | "SOL_PERP" 5 | | "ETH_PERP" 6 | | "BTC_PERP" 7 | | "APT_PERP" 8 | | "BONK_PERP" 9 | | "MATIC_PERP" 10 | | "ARB_PERP" 11 | | "DOGE_PERP" 12 | | "BNB_PERP" 13 | | "SUI_PERP" 14 | | "PEPE_PERP" 15 | | "OP_PERP" 16 | | "RNDR_PERP" 17 | | "XRP_PERP"; 18 | } 19 | export type Type = $.common.PerpContract; 20 | 21 | export const num2name = { 22 | 0: "ALL", 23 | 1: "SOL_PERP", 24 | 2: "ETH_PERP", 25 | 3: "BTC_PERP", 26 | 4: "APT_PERP", 27 | 5: "BONK_PERP", 28 | 6: "MATIC_PERP", 29 | 7: "ARB_PERP", 30 | 8: "DOGE_PERP", 31 | 9: "BNB_PERP", 32 | 10: "SUI_PERP", 33 | 11: "PEPE_PERP", 34 | 12: "OP_PERP", 35 | 13: "RNDR_PERP", 36 | 14: "XRP_PERP", 37 | } as const; 38 | 39 | export const name2num = { 40 | ALL: 0, 41 | SOL_PERP: 1, 42 | ETH_PERP: 2, 43 | BTC_PERP: 3, 44 | APT_PERP: 4, 45 | BONK_PERP: 5, 46 | MATIC_PERP: 6, 47 | ARB_PERP: 7, 48 | DOGE_PERP: 8, 49 | BNB_PERP: 9, 50 | SUI_PERP: 10, 51 | PEPE_PERP: 11, 52 | OP_PERP: 12, 53 | RNDR_PERP: 13, 54 | XRP_PERP: 14, 55 | } as const; 56 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/PerpOrderType.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type PerpOrderType = 3 | | "POT_UNKNOWN" 4 | | "POT_MARKET" 5 | | "POT_LIMIT" 6 | | "POT_TRIGGER_MARKET" 7 | | "POT_TRIGGER_LIMIT"; 8 | } 9 | export type Type = $.common.PerpOrderType; 10 | 11 | export const num2name = { 12 | 0: "POT_UNKNOWN", 13 | 1: "POT_MARKET", 14 | 2: "POT_LIMIT", 15 | 3: "POT_TRIGGER_MARKET", 16 | 4: "POT_TRIGGER_LIMIT", 17 | } as const; 18 | 19 | export const name2num = { 20 | POT_UNKNOWN: 0, 21 | POT_MARKET: 1, 22 | POT_LIMIT: 2, 23 | POT_TRIGGER_MARKET: 3, 24 | POT_TRIGGER_LIMIT: 4, 25 | } as const; 26 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/PerpPositionSide.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type PerpPositionSide = 3 | | "PS_UNKNOWN" 4 | | "PS_LONG" 5 | | "PS_SHORT"; 6 | } 7 | export type Type = $.common.PerpPositionSide; 8 | 9 | export const num2name = { 10 | 0: "PS_UNKNOWN", 11 | 1: "PS_LONG", 12 | 2: "PS_SHORT", 13 | } as const; 14 | 15 | export const name2num = { 16 | PS_UNKNOWN: 0, 17 | PS_LONG: 1, 18 | PS_SHORT: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/PostOnlyParams.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.common { 2 | export type PostOnlyParams = 3 | | "PO_NONE" 4 | | "PO_MUST_POST_ONLY" 5 | | "PO_TRY_POST_ONLY"; 6 | } 7 | export type Type = $.common.PostOnlyParams; 8 | 9 | export const num2name = { 10 | 0: "PO_NONE", 11 | 1: "PO_MUST_POST_ONLY", 12 | 2: "PO_TRY_POST_ONLY", 13 | } as const; 14 | 15 | export const name2num = { 16 | PO_NONE: 0, 17 | PO_MUST_POST_ONLY: 1, 18 | PO_TRY_POST_ONLY: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/common/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as OrderType } from "./OrderType"; 2 | export type { Type as PerpOrderType } from "./PerpOrderType"; 3 | export type { Type as PerpPositionSide } from "./PerpPositionSide"; 4 | export type { Type as PostOnlyParams } from "./PostOnlyParams"; 5 | export type { Type as MarginContract } from "./MarginContract"; 6 | export type { Type as PerpContract } from "./PerpContract"; 7 | export type { Type as PerpCollateralType } from "./PerpCollateralType"; 8 | export type { Type as PerpCollateralToken } from "./PerpCollateralToken"; 9 | export type { Type as Infinity } from "./Infinity"; 10 | export type { Type as PriceImpactPercent } from "./PriceImpactPercent"; 11 | export type { Type as PriceImpactPercentV2 } from "./PriceImpactPercentV2"; 12 | export type { Type as Fee } from "./Fee"; 13 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/api/FieldBehavior.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.api { 2 | export type FieldBehavior = 3 | | "FIELD_BEHAVIOR_UNSPECIFIED" 4 | | "OPTIONAL" 5 | | "REQUIRED" 6 | | "OUTPUT_ONLY" 7 | | "INPUT_ONLY" 8 | | "IMMUTABLE" 9 | | "UNORDERED_LIST" 10 | | "NON_EMPTY_DEFAULT"; 11 | } 12 | export type Type = $.google.api.FieldBehavior; 13 | 14 | export const num2name = { 15 | 0: "FIELD_BEHAVIOR_UNSPECIFIED", 16 | 1: "OPTIONAL", 17 | 2: "REQUIRED", 18 | 3: "OUTPUT_ONLY", 19 | 4: "INPUT_ONLY", 20 | 5: "IMMUTABLE", 21 | 6: "UNORDERED_LIST", 22 | 7: "NON_EMPTY_DEFAULT", 23 | } as const; 24 | 25 | export const name2num = { 26 | FIELD_BEHAVIOR_UNSPECIFIED: 0, 27 | OPTIONAL: 1, 28 | REQUIRED: 2, 29 | OUTPUT_ONLY: 3, 30 | INPUT_ONLY: 4, 31 | IMMUTABLE: 5, 32 | UNORDERED_LIST: 6, 33 | NON_EMPTY_DEFAULT: 7, 34 | } as const; 35 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/api/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Visibility } from "./Visibility"; 2 | export type { Type as VisibilityRule } from "./VisibilityRule"; 3 | export type { Type as FieldBehavior } from "./FieldBehavior"; 4 | export type { Type as Http } from "./Http"; 5 | export type { Type as HttpRule } from "./HttpRule"; 6 | export type { Type as CustomHttpPattern } from "./CustomHttpPattern"; 7 | export type { Type as HttpBody } from "./HttpBody"; 8 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/index.ts: -------------------------------------------------------------------------------- 1 | import * as protobuf from "./protobuf/index"; 2 | import * as api from "./api/index"; 3 | export type { 4 | protobuf, 5 | api, 6 | }; 7 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(DescriptorProto)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as ExtensionRange } from "./ExtensionRange"; 2 | export type { Type as ReservedRange } from "./ReservedRange"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(EnumDescriptorProto)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as EnumReservedRange } from "./EnumReservedRange"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(Field)/Cardinality.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.Field { 2 | export type Cardinality = 3 | | "CARDINALITY_UNKNOWN" 4 | | "CARDINALITY_OPTIONAL" 5 | | "CARDINALITY_REQUIRED" 6 | | "CARDINALITY_REPEATED"; 7 | } 8 | export type Type = $.google.protobuf.Field.Cardinality; 9 | 10 | export const num2name = { 11 | 0: "CARDINALITY_UNKNOWN", 12 | 1: "CARDINALITY_OPTIONAL", 13 | 2: "CARDINALITY_REQUIRED", 14 | 3: "CARDINALITY_REPEATED", 15 | } as const; 16 | 17 | export const name2num = { 18 | CARDINALITY_UNKNOWN: 0, 19 | CARDINALITY_OPTIONAL: 1, 20 | CARDINALITY_REQUIRED: 2, 21 | CARDINALITY_REPEATED: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(Field)/Kind.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.Field { 2 | export type Kind = 3 | | "TYPE_UNKNOWN" 4 | | "TYPE_DOUBLE" 5 | | "TYPE_FLOAT" 6 | | "TYPE_INT64" 7 | | "TYPE_UINT64" 8 | | "TYPE_INT32" 9 | | "TYPE_FIXED64" 10 | | "TYPE_FIXED32" 11 | | "TYPE_BOOL" 12 | | "TYPE_STRING" 13 | | "TYPE_GROUP" 14 | | "TYPE_MESSAGE" 15 | | "TYPE_BYTES" 16 | | "TYPE_UINT32" 17 | | "TYPE_ENUM" 18 | | "TYPE_SFIXED32" 19 | | "TYPE_SFIXED64" 20 | | "TYPE_SINT32" 21 | | "TYPE_SINT64"; 22 | } 23 | export type Type = $.google.protobuf.Field.Kind; 24 | 25 | export const num2name = { 26 | 0: "TYPE_UNKNOWN", 27 | 1: "TYPE_DOUBLE", 28 | 2: "TYPE_FLOAT", 29 | 3: "TYPE_INT64", 30 | 4: "TYPE_UINT64", 31 | 5: "TYPE_INT32", 32 | 6: "TYPE_FIXED64", 33 | 7: "TYPE_FIXED32", 34 | 8: "TYPE_BOOL", 35 | 9: "TYPE_STRING", 36 | 10: "TYPE_GROUP", 37 | 11: "TYPE_MESSAGE", 38 | 12: "TYPE_BYTES", 39 | 13: "TYPE_UINT32", 40 | 14: "TYPE_ENUM", 41 | 15: "TYPE_SFIXED32", 42 | 16: "TYPE_SFIXED64", 43 | 17: "TYPE_SINT32", 44 | 18: "TYPE_SINT64", 45 | } as const; 46 | 47 | export const name2num = { 48 | TYPE_UNKNOWN: 0, 49 | TYPE_DOUBLE: 1, 50 | TYPE_FLOAT: 2, 51 | TYPE_INT64: 3, 52 | TYPE_UINT64: 4, 53 | TYPE_INT32: 5, 54 | TYPE_FIXED64: 6, 55 | TYPE_FIXED32: 7, 56 | TYPE_BOOL: 8, 57 | TYPE_STRING: 9, 58 | TYPE_GROUP: 10, 59 | TYPE_MESSAGE: 11, 60 | TYPE_BYTES: 12, 61 | TYPE_UINT32: 13, 62 | TYPE_ENUM: 14, 63 | TYPE_SFIXED32: 15, 64 | TYPE_SFIXED64: 16, 65 | TYPE_SINT32: 17, 66 | TYPE_SINT64: 18, 67 | } as const; 68 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(Field)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Kind } from "./Kind"; 2 | export type { Type as Cardinality } from "./Cardinality"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FieldDescriptorProto)/Label.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.FieldDescriptorProto { 2 | export type Label = 3 | | "UNSPECIFIED" 4 | | "LABEL_OPTIONAL" 5 | | "LABEL_REQUIRED" 6 | | "LABEL_REPEATED"; 7 | } 8 | export type Type = $.google.protobuf.FieldDescriptorProto.Label; 9 | 10 | export const num2name = { 11 | 0: "UNSPECIFIED", 12 | 1: "LABEL_OPTIONAL", 13 | 2: "LABEL_REQUIRED", 14 | 3: "LABEL_REPEATED", 15 | } as const; 16 | 17 | export const name2num = { 18 | UNSPECIFIED: 0, 19 | LABEL_OPTIONAL: 1, 20 | LABEL_REQUIRED: 2, 21 | LABEL_REPEATED: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FieldDescriptorProto)/Type.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.FieldDescriptorProto { 2 | export type Type = 3 | | "UNSPECIFIED" 4 | | "TYPE_DOUBLE" 5 | | "TYPE_FLOAT" 6 | | "TYPE_INT64" 7 | | "TYPE_UINT64" 8 | | "TYPE_INT32" 9 | | "TYPE_FIXED64" 10 | | "TYPE_FIXED32" 11 | | "TYPE_BOOL" 12 | | "TYPE_STRING" 13 | | "TYPE_GROUP" 14 | | "TYPE_MESSAGE" 15 | | "TYPE_BYTES" 16 | | "TYPE_UINT32" 17 | | "TYPE_ENUM" 18 | | "TYPE_SFIXED32" 19 | | "TYPE_SFIXED64" 20 | | "TYPE_SINT32" 21 | | "TYPE_SINT64"; 22 | } 23 | export type Type = $.google.protobuf.FieldDescriptorProto.Type; 24 | 25 | export const num2name = { 26 | 0: "UNSPECIFIED", 27 | 1: "TYPE_DOUBLE", 28 | 2: "TYPE_FLOAT", 29 | 3: "TYPE_INT64", 30 | 4: "TYPE_UINT64", 31 | 5: "TYPE_INT32", 32 | 6: "TYPE_FIXED64", 33 | 7: "TYPE_FIXED32", 34 | 8: "TYPE_BOOL", 35 | 9: "TYPE_STRING", 36 | 10: "TYPE_GROUP", 37 | 11: "TYPE_MESSAGE", 38 | 12: "TYPE_BYTES", 39 | 13: "TYPE_UINT32", 40 | 14: "TYPE_ENUM", 41 | 15: "TYPE_SFIXED32", 42 | 16: "TYPE_SFIXED64", 43 | 17: "TYPE_SINT32", 44 | 18: "TYPE_SINT64", 45 | } as const; 46 | 47 | export const name2num = { 48 | UNSPECIFIED: 0, 49 | TYPE_DOUBLE: 1, 50 | TYPE_FLOAT: 2, 51 | TYPE_INT64: 3, 52 | TYPE_UINT64: 4, 53 | TYPE_INT32: 5, 54 | TYPE_FIXED64: 6, 55 | TYPE_FIXED32: 7, 56 | TYPE_BOOL: 8, 57 | TYPE_STRING: 9, 58 | TYPE_GROUP: 10, 59 | TYPE_MESSAGE: 11, 60 | TYPE_BYTES: 12, 61 | TYPE_UINT32: 13, 62 | TYPE_ENUM: 14, 63 | TYPE_SFIXED32: 15, 64 | TYPE_SFIXED64: 16, 65 | TYPE_SINT32: 17, 66 | TYPE_SINT64: 18, 67 | } as const; 68 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FieldDescriptorProto)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Type } from "./Type"; 2 | export type { Type as Label } from "./Label"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FieldOptions)/CType.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.FieldOptions { 2 | export type CType = 3 | | "STRING" 4 | | "CORD" 5 | | "STRING_PIECE"; 6 | } 7 | export type Type = $.google.protobuf.FieldOptions.CType; 8 | 9 | export const num2name = { 10 | 0: "STRING", 11 | 1: "CORD", 12 | 2: "STRING_PIECE", 13 | } as const; 14 | 15 | export const name2num = { 16 | STRING: 0, 17 | CORD: 1, 18 | STRING_PIECE: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FieldOptions)/JSType.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.FieldOptions { 2 | export type JSType = 3 | | "JS_NORMAL" 4 | | "JS_STRING" 5 | | "JS_NUMBER"; 6 | } 7 | export type Type = $.google.protobuf.FieldOptions.JSType; 8 | 9 | export const num2name = { 10 | 0: "JS_NORMAL", 11 | 1: "JS_STRING", 12 | 2: "JS_NUMBER", 13 | } as const; 14 | 15 | export const name2num = { 16 | JS_NORMAL: 0, 17 | JS_STRING: 1, 18 | JS_NUMBER: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FieldOptions)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as CType } from "./CType"; 2 | export type { Type as JSType } from "./JSType"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FileOptions)/OptimizeMode.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.FileOptions { 2 | export type OptimizeMode = 3 | | "UNSPECIFIED" 4 | | "SPEED" 5 | | "CODE_SIZE" 6 | | "LITE_RUNTIME"; 7 | } 8 | export type Type = $.google.protobuf.FileOptions.OptimizeMode; 9 | 10 | export const num2name = { 11 | 0: "UNSPECIFIED", 12 | 1: "SPEED", 13 | 2: "CODE_SIZE", 14 | 3: "LITE_RUNTIME", 15 | } as const; 16 | 17 | export const name2num = { 18 | UNSPECIFIED: 0, 19 | SPEED: 1, 20 | CODE_SIZE: 2, 21 | LITE_RUNTIME: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(FileOptions)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as OptimizeMode } from "./OptimizeMode"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(GeneratedCodeInfo)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Annotation } from "./Annotation"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(MethodOptions)/IdempotencyLevel.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf.MethodOptions { 2 | export type IdempotencyLevel = 3 | | "IDEMPOTENCY_UNKNOWN" 4 | | "NO_SIDE_EFFECTS" 5 | | "IDEMPOTENT"; 6 | } 7 | export type Type = $.google.protobuf.MethodOptions.IdempotencyLevel; 8 | 9 | export const num2name = { 10 | 0: "IDEMPOTENCY_UNKNOWN", 11 | 1: "NO_SIDE_EFFECTS", 12 | 2: "IDEMPOTENT", 13 | } as const; 14 | 15 | export const name2num = { 16 | IDEMPOTENCY_UNKNOWN: 0, 17 | NO_SIDE_EFFECTS: 1, 18 | IDEMPOTENT: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(MethodOptions)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as IdempotencyLevel } from "./IdempotencyLevel"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(SourceCodeInfo)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Location } from "./Location"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/(UninterpretedOption)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as NamePart } from "./NamePart"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/BoolValue.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface BoolValue { 21 | value: boolean; 22 | } 23 | } 24 | export type Type = $.google.protobuf.BoolValue; 25 | 26 | export function getDefaultValue(): $.google.protobuf.BoolValue { 27 | return { 28 | value: false, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.BoolValue>): $.google.protobuf.BoolValue { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.BoolValue): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.bool(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.BoolValue { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.bool(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.BoolValue): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.bool(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.BoolValue { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.bool(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/BytesValue.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface BytesValue { 21 | value: Uint8Array; 22 | } 23 | } 24 | export type Type = $.google.protobuf.BytesValue; 25 | 26 | export function getDefaultValue(): $.google.protobuf.BytesValue { 27 | return { 28 | value: new Uint8Array(), 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.BytesValue>): $.google.protobuf.BytesValue { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.BytesValue): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.bytes(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.BytesValue { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.bytes(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.BytesValue): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.bytes(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.BytesValue { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.bytes(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/DoubleValue.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface DoubleValue { 21 | value: number; 22 | } 23 | } 24 | export type Type = $.google.protobuf.DoubleValue; 25 | 26 | export function getDefaultValue(): $.google.protobuf.DoubleValue { 27 | return { 28 | value: 0, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.DoubleValue>): $.google.protobuf.DoubleValue { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.DoubleValue): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.double(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.DoubleValue { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.double(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.DoubleValue): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.double(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.DoubleValue { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.double(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/Empty.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.google.protobuf { 12 | export interface Empty {} 13 | } 14 | export type Type = $.google.protobuf.Empty; 15 | 16 | export function getDefaultValue(): $.google.protobuf.Empty { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.google.protobuf.Empty>): $.google.protobuf.Empty { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.google.protobuf.Empty): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.google.protobuf.Empty { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.google.protobuf.Empty): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.Empty { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/FieldMask.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface FieldMask { 21 | paths: string[]; 22 | } 23 | } 24 | export type Type = $.google.protobuf.FieldMask; 25 | 26 | export function getDefaultValue(): $.google.protobuf.FieldMask { 27 | return { 28 | paths: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.FieldMask>): $.google.protobuf.FieldMask { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.FieldMask): unknown { 40 | const result: any = {}; 41 | result.paths = value.paths.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.FieldMask { 46 | const result = getDefaultValue(); 47 | result.paths = value.paths?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.FieldMask): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.paths) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.FieldMask { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.paths = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/FloatValue.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface FloatValue { 21 | value: number; 22 | } 23 | } 24 | export type Type = $.google.protobuf.FloatValue; 25 | 26 | export function getDefaultValue(): $.google.protobuf.FloatValue { 27 | return { 28 | value: 0, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.FloatValue>): $.google.protobuf.FloatValue { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.FloatValue): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.float(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.FloatValue { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.float(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.FloatValue): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.float(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.FloatValue { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.float(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/Int32Value.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface Int32Value { 21 | value: number; 22 | } 23 | } 24 | export type Type = $.google.protobuf.Int32Value; 25 | 26 | export function getDefaultValue(): $.google.protobuf.Int32Value { 27 | return { 28 | value: 0, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.Int32Value>): $.google.protobuf.Int32Value { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.Int32Value): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.int32(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.Int32Value { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.int32(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.Int32Value): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.int32(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.Int32Value { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.int32(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/Int64Value.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface Int64Value { 21 | value: string; 22 | } 23 | } 24 | export type Type = $.google.protobuf.Int64Value; 25 | 26 | export function getDefaultValue(): $.google.protobuf.Int64Value { 27 | return { 28 | value: "0", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.Int64Value>): $.google.protobuf.Int64Value { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.Int64Value): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.int64(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.Int64Value { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.int64(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.Int64Value): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.int64(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.Int64Value { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.int64(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/NullValue.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf { 2 | export type NullValue = 3 | | "NULL_VALUE"; 4 | } 5 | export type Type = $.google.protobuf.NullValue; 6 | 7 | export const num2name = { 8 | 0: "NULL_VALUE", 9 | } as const; 10 | 11 | export const name2num = { 12 | NULL_VALUE: 0, 13 | } as const; 14 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/SourceContext.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface SourceContext { 21 | fileName: string; 22 | } 23 | } 24 | export type Type = $.google.protobuf.SourceContext; 25 | 26 | export function getDefaultValue(): $.google.protobuf.SourceContext { 27 | return { 28 | fileName: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.SourceContext>): $.google.protobuf.SourceContext { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.SourceContext): unknown { 40 | const result: any = {}; 41 | if (value.fileName !== undefined) result.fileName = tsValueToJsonValueFns.string(value.fileName); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.SourceContext { 46 | const result = getDefaultValue(); 47 | if (value.fileName !== undefined) result.fileName = jsonValueToTsValueFns.string(value.fileName); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.SourceContext): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.fileName !== undefined) { 54 | const tsValue = value.fileName; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.SourceContext { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.fileName = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/StringValue.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface StringValue { 21 | value: string; 22 | } 23 | } 24 | export type Type = $.google.protobuf.StringValue; 25 | 26 | export function getDefaultValue(): $.google.protobuf.StringValue { 27 | return { 28 | value: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.StringValue>): $.google.protobuf.StringValue { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.StringValue): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.string(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.StringValue { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.string(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.StringValue): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.StringValue { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/Syntax.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.google.protobuf { 2 | export type Syntax = 3 | | "SYNTAX_PROTO2" 4 | | "SYNTAX_PROTO3"; 5 | } 6 | export type Type = $.google.protobuf.Syntax; 7 | 8 | export const num2name = { 9 | 0: "SYNTAX_PROTO2", 10 | 1: "SYNTAX_PROTO3", 11 | } as const; 12 | 13 | export const name2num = { 14 | SYNTAX_PROTO2: 0, 15 | SYNTAX_PROTO3: 1, 16 | } as const; 17 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/UInt32Value.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface UInt32Value { 21 | value: number; 22 | } 23 | } 24 | export type Type = $.google.protobuf.UInt32Value; 25 | 26 | export function getDefaultValue(): $.google.protobuf.UInt32Value { 27 | return { 28 | value: 0, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.UInt32Value>): $.google.protobuf.UInt32Value { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.UInt32Value): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.uint32(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.UInt32Value { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.uint32(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.UInt32Value): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.uint32(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.UInt32Value { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.uint32(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/google/protobuf/UInt64Value.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.google.protobuf { 20 | export interface UInt64Value { 21 | value: string; 22 | } 23 | } 24 | export type Type = $.google.protobuf.UInt64Value; 25 | 26 | export function getDefaultValue(): $.google.protobuf.UInt64Value { 27 | return { 28 | value: "0", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.google.protobuf.UInt64Value>): $.google.protobuf.UInt64Value { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.google.protobuf.UInt64Value): unknown { 40 | const result: any = {}; 41 | if (value.value !== undefined) result.value = tsValueToJsonValueFns.uint64(value.value); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.google.protobuf.UInt64Value { 46 | const result = getDefaultValue(); 47 | if (value.value !== undefined) result.value = jsonValueToTsValueFns.uint64(value.value); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.google.protobuf.UInt64Value): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.value !== undefined) { 54 | const tsValue = value.value; 55 | result.push( 56 | [1, tsValueToWireValueFns.uint64(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.google.protobuf.UInt64Value { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.uint64(wireValue); 70 | if (value === undefined) break field; 71 | result.value = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/index.ts: -------------------------------------------------------------------------------- 1 | import * as protoc_gen_openapiv2 from "./protoc_gen_openapiv2/index"; 2 | export type { 3 | protoc_gen_openapiv2, 4 | }; 5 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/index.ts: -------------------------------------------------------------------------------- 1 | import * as options from "./options/index"; 2 | export type { 3 | options, 4 | }; 5 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(JSONSchema)/JSONSchemaSimpleTypes.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema { 2 | export type JSONSchemaSimpleTypes = 3 | | "UNKNOWN" 4 | | "ARRAY" 5 | | "BOOLEAN" 6 | | "INTEGER" 7 | | "NULL" 8 | | "NUMBER" 9 | | "OBJECT" 10 | | "STRING"; 11 | } 12 | export type Type = $.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes; 13 | 14 | export const num2name = { 15 | 0: "UNKNOWN", 16 | 1: "ARRAY", 17 | 2: "BOOLEAN", 18 | 3: "INTEGER", 19 | 4: "NULL", 20 | 5: "NUMBER", 21 | 6: "OBJECT", 22 | 7: "STRING", 23 | } as const; 24 | 25 | export const name2num = { 26 | UNKNOWN: 0, 27 | ARRAY: 1, 28 | BOOLEAN: 2, 29 | INTEGER: 3, 30 | NULL: 4, 31 | NUMBER: 5, 32 | OBJECT: 6, 33 | STRING: 7, 34 | } as const; 35 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(JSONSchema)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as JSONSchemaSimpleTypes } from "./JSONSchemaSimpleTypes"; 2 | export type { Type as FieldConfiguration } from "./FieldConfiguration"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(SecurityRequirement)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as SecurityRequirementValue } from "./SecurityRequirementValue"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(SecurityScheme)/Flow.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme { 2 | export type Flow = 3 | | "FLOW_INVALID" 4 | | "FLOW_IMPLICIT" 5 | | "FLOW_PASSWORD" 6 | | "FLOW_APPLICATION" 7 | | "FLOW_ACCESS_CODE"; 8 | } 9 | export type Type = $.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow; 10 | 11 | export const num2name = { 12 | 0: "FLOW_INVALID", 13 | 1: "FLOW_IMPLICIT", 14 | 2: "FLOW_PASSWORD", 15 | 3: "FLOW_APPLICATION", 16 | 4: "FLOW_ACCESS_CODE", 17 | } as const; 18 | 19 | export const name2num = { 20 | FLOW_INVALID: 0, 21 | FLOW_IMPLICIT: 1, 22 | FLOW_PASSWORD: 2, 23 | FLOW_APPLICATION: 3, 24 | FLOW_ACCESS_CODE: 4, 25 | } as const; 26 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(SecurityScheme)/In.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme { 2 | export type In = 3 | | "IN_INVALID" 4 | | "IN_QUERY" 5 | | "IN_HEADER"; 6 | } 7 | export type Type = $.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In; 8 | 9 | export const num2name = { 10 | 0: "IN_INVALID", 11 | 1: "IN_QUERY", 12 | 2: "IN_HEADER", 13 | } as const; 14 | 15 | export const name2num = { 16 | IN_INVALID: 0, 17 | IN_QUERY: 1, 18 | IN_HEADER: 2, 19 | } as const; 20 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(SecurityScheme)/Type.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme { 2 | export type Type = 3 | | "TYPE_INVALID" 4 | | "TYPE_BASIC" 5 | | "TYPE_API_KEY" 6 | | "TYPE_OAUTH2"; 7 | } 8 | export type Type = $.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type; 9 | 10 | export const num2name = { 11 | 0: "TYPE_INVALID", 12 | 1: "TYPE_BASIC", 13 | 2: "TYPE_API_KEY", 14 | 3: "TYPE_OAUTH2", 15 | } as const; 16 | 17 | export const name2num = { 18 | TYPE_INVALID: 0, 19 | TYPE_BASIC: 1, 20 | TYPE_API_KEY: 2, 21 | TYPE_OAUTH2: 3, 22 | } as const; 23 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/(SecurityScheme)/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Type } from "./Type"; 2 | export type { Type as In } from "./In"; 3 | export type { Type as Flow } from "./Flow"; 4 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/Scheme.ts: -------------------------------------------------------------------------------- 1 | export declare namespace $.grpc.gateway.protoc_gen_openapiv2.options { 2 | export type Scheme = 3 | | "UNKNOWN" 4 | | "HTTP" 5 | | "HTTPS" 6 | | "WS" 7 | | "WSS"; 8 | } 9 | export type Type = $.grpc.gateway.protoc_gen_openapiv2.options.Scheme; 10 | 11 | export const num2name = { 12 | 0: "UNKNOWN", 13 | 1: "HTTP", 14 | 2: "HTTPS", 15 | 3: "WS", 16 | 4: "WSS", 17 | } as const; 18 | 19 | export const name2num = { 20 | UNKNOWN: 0, 21 | HTTP: 1, 22 | HTTPS: 2, 23 | WS: 3, 24 | WSS: 4, 25 | } as const; 26 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/gateway/protoc_gen_openapiv2/options/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Scheme } from "./Scheme"; 2 | export type { Type as Swagger } from "./Swagger"; 3 | export type { Type as Operation } from "./Operation"; 4 | export type { Type as Header } from "./Header"; 5 | export type { Type as Response } from "./Response"; 6 | export type { Type as Info } from "./Info"; 7 | export type { Type as Contact } from "./Contact"; 8 | export type { Type as License } from "./License"; 9 | export type { Type as ExternalDocumentation } from "./ExternalDocumentation"; 10 | export type { Type as Schema } from "./Schema"; 11 | export type { Type as JSONSchema } from "./JSONSchema"; 12 | export type { Type as Tag } from "./Tag"; 13 | export type { Type as SecurityDefinitions } from "./SecurityDefinitions"; 14 | export type { Type as SecurityScheme } from "./SecurityScheme"; 15 | export type { Type as SecurityRequirement } from "./SecurityRequirement"; 16 | export type { Type as Scopes } from "./Scopes"; 17 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/grpc/index.ts: -------------------------------------------------------------------------------- 1 | import * as gateway from "./gateway/index"; 2 | export type { 3 | gateway, 4 | }; 5 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/index.ts: -------------------------------------------------------------------------------- 1 | import * as api from "./api/index"; 2 | import * as common from "./common/index"; 3 | import * as grpc from "./grpc/index"; 4 | import * as google from "./google/index"; 5 | import * as trace_shred from "./trace_shred/index"; 6 | import * as shredstream from "./shredstream/index"; 7 | import * as shared from "./shared/index"; 8 | import * as searcher from "./searcher/index"; 9 | import * as packet from "./packet/index"; 10 | import * as bundle from "./bundle/index"; 11 | import * as relayer from "./relayer/index"; 12 | import * as block_engine from "./block_engine/index"; 13 | import * as block from "./block/index"; 14 | import * as auth from "./auth/index"; 15 | export type { 16 | api, 17 | common, 18 | grpc, 19 | google, 20 | trace_shred, 21 | shredstream, 22 | shared, 23 | searcher, 24 | packet, 25 | bundle, 26 | relayer, 27 | block_engine, 28 | block, 29 | auth, 30 | }; 31 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/packet/PacketBatch.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Type as Packet, 3 | encodeJson as encodeJson_1, 4 | decodeJson as decodeJson_1, 5 | encodeBinary as encodeBinary_1, 6 | decodeBinary as decodeBinary_1, 7 | } from "./Packet"; 8 | import { 9 | jsonValueToTsValueFns, 10 | } from "../../runtime/json/scalar"; 11 | import { 12 | WireMessage, 13 | WireType, 14 | } from "../../runtime/wire/index"; 15 | import { 16 | default as serialize, 17 | } from "../../runtime/wire/serialize"; 18 | import { 19 | default as deserialize, 20 | } from "../../runtime/wire/deserialize"; 21 | 22 | export declare namespace $.packet { 23 | export interface PacketBatch { 24 | packets: Packet[]; 25 | } 26 | } 27 | export type Type = $.packet.PacketBatch; 28 | 29 | export function getDefaultValue(): $.packet.PacketBatch { 30 | return { 31 | packets: [], 32 | }; 33 | } 34 | 35 | export function createValue(partialValue: Partial<$.packet.PacketBatch>): $.packet.PacketBatch { 36 | return { 37 | ...getDefaultValue(), 38 | ...partialValue, 39 | }; 40 | } 41 | 42 | export function encodeJson(value: $.packet.PacketBatch): unknown { 43 | const result: any = {}; 44 | result.packets = value.packets.map(value => encodeJson_1(value)); 45 | return result; 46 | } 47 | 48 | export function decodeJson(value: any): $.packet.PacketBatch { 49 | const result = getDefaultValue(); 50 | result.packets = value.packets?.map((value: any) => decodeJson_1(value)) ?? []; 51 | return result; 52 | } 53 | 54 | export function encodeBinary(value: $.packet.PacketBatch): Uint8Array { 55 | const result: WireMessage = []; 56 | for (const tsValue of value.packets) { 57 | result.push( 58 | [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], 59 | ); 60 | } 61 | return serialize(result); 62 | } 63 | 64 | export function decodeBinary(binary: Uint8Array): $.packet.PacketBatch { 65 | const result = getDefaultValue(); 66 | const wireMessage = deserialize(binary); 67 | const wireFields = new Map(wireMessage); 68 | collection: { 69 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 70 | const value = wireValues.map((wireValue) => wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined).filter(x => x !== undefined); 71 | if (!value.length) break collection; 72 | result.packets = value as any; 73 | } 74 | return result; 75 | } 76 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/packet/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as PacketBatch } from "./PacketBatch"; 2 | export type { Type as Packet } from "./Packet"; 3 | export type { Type as Meta } from "./Meta"; 4 | export type { Type as PacketFlags } from "./PacketFlags"; 5 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/relayer/GetTpuConfigsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.relayer { 12 | export interface GetTpuConfigsRequest {} 13 | } 14 | export type Type = $.relayer.GetTpuConfigsRequest; 15 | 16 | export function getDefaultValue(): $.relayer.GetTpuConfigsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.relayer.GetTpuConfigsRequest>): $.relayer.GetTpuConfigsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.relayer.GetTpuConfigsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.relayer.GetTpuConfigsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.relayer.GetTpuConfigsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.relayer.GetTpuConfigsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/relayer/SubscribePacketsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.relayer { 12 | export interface SubscribePacketsRequest {} 13 | } 14 | export type Type = $.relayer.SubscribePacketsRequest; 15 | 16 | export function getDefaultValue(): $.relayer.SubscribePacketsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.relayer.SubscribePacketsRequest>): $.relayer.SubscribePacketsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.relayer.SubscribePacketsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.relayer.SubscribePacketsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.relayer.SubscribePacketsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.relayer.SubscribePacketsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/relayer/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as GetTpuConfigsRequest } from "./GetTpuConfigsRequest"; 2 | export type { Type as GetTpuConfigsResponse } from "./GetTpuConfigsResponse"; 3 | export type { Type as SubscribePacketsRequest } from "./SubscribePacketsRequest"; 4 | export type { Type as SubscribePacketsResponse } from "./SubscribePacketsResponse"; 5 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/ConnectedLeadersRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.searcher { 12 | export interface ConnectedLeadersRequest {} 13 | } 14 | export type Type = $.searcher.ConnectedLeadersRequest; 15 | 16 | export function getDefaultValue(): $.searcher.ConnectedLeadersRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.searcher.ConnectedLeadersRequest>): $.searcher.ConnectedLeadersRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.searcher.ConnectedLeadersRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.searcher.ConnectedLeadersRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.searcher.ConnectedLeadersRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.searcher.ConnectedLeadersRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/GetRegionsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.searcher { 12 | export interface GetRegionsRequest {} 13 | } 14 | export type Type = $.searcher.GetRegionsRequest; 15 | 16 | export function getDefaultValue(): $.searcher.GetRegionsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.searcher.GetRegionsRequest>): $.searcher.GetRegionsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.searcher.GetRegionsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.searcher.GetRegionsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.searcher.GetRegionsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.searcher.GetRegionsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/GetTipAccountsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.searcher { 12 | export interface GetTipAccountsRequest {} 13 | } 14 | export type Type = $.searcher.GetTipAccountsRequest; 15 | 16 | export function getDefaultValue(): $.searcher.GetTipAccountsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.searcher.GetTipAccountsRequest>): $.searcher.GetTipAccountsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.searcher.GetTipAccountsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.searcher.GetTipAccountsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.searcher.GetTipAccountsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.searcher.GetTipAccountsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/GetTipAccountsResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.searcher { 20 | export interface GetTipAccountsResponse { 21 | accounts: string[]; 22 | } 23 | } 24 | export type Type = $.searcher.GetTipAccountsResponse; 25 | 26 | export function getDefaultValue(): $.searcher.GetTipAccountsResponse { 27 | return { 28 | accounts: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.searcher.GetTipAccountsResponse>): $.searcher.GetTipAccountsResponse { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.searcher.GetTipAccountsResponse): unknown { 40 | const result: any = {}; 41 | result.accounts = value.accounts.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.searcher.GetTipAccountsResponse { 46 | const result = getDefaultValue(); 47 | result.accounts = value.accounts?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.searcher.GetTipAccountsResponse): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.accounts) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.searcher.GetTipAccountsResponse { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.accounts = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/NextScheduledLeaderRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.searcher { 12 | export interface NextScheduledLeaderRequest {} 13 | } 14 | export type Type = $.searcher.NextScheduledLeaderRequest; 15 | 16 | export function getDefaultValue(): $.searcher.NextScheduledLeaderRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.searcher.NextScheduledLeaderRequest>): $.searcher.NextScheduledLeaderRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.searcher.NextScheduledLeaderRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.searcher.NextScheduledLeaderRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.searcher.NextScheduledLeaderRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.searcher.NextScheduledLeaderRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/ProgramSubscriptionV0.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.searcher { 20 | export interface ProgramSubscriptionV0 { 21 | programs: string[]; 22 | } 23 | } 24 | export type Type = $.searcher.ProgramSubscriptionV0; 25 | 26 | export function getDefaultValue(): $.searcher.ProgramSubscriptionV0 { 27 | return { 28 | programs: [], 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.searcher.ProgramSubscriptionV0>): $.searcher.ProgramSubscriptionV0 { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.searcher.ProgramSubscriptionV0): unknown { 40 | const result: any = {}; 41 | result.programs = value.programs.map(value => tsValueToJsonValueFns.string(value)); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.searcher.ProgramSubscriptionV0 { 46 | const result = getDefaultValue(); 47 | result.programs = value.programs?.map((value: any) => jsonValueToTsValueFns.string(value)) ?? []; 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.searcher.ProgramSubscriptionV0): Uint8Array { 52 | const result: WireMessage = []; 53 | for (const tsValue of value.programs) { 54 | result.push( 55 | [1, tsValueToWireValueFns.string(tsValue)], 56 | ); 57 | } 58 | return serialize(result); 59 | } 60 | 61 | export function decodeBinary(binary: Uint8Array): $.searcher.ProgramSubscriptionV0 { 62 | const result = getDefaultValue(); 63 | const wireMessage = deserialize(binary); 64 | const wireFields = new Map(wireMessage); 65 | collection: { 66 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 67 | const value = wireValues.map((wireValue) => wireValueToTsValueFns.string(wireValue)).filter(x => x !== undefined); 68 | if (!value.length) break collection; 69 | result.programs = value as any; 70 | } 71 | return result; 72 | } 73 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/SendBundleResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.searcher { 20 | export interface SendBundleResponse { 21 | uuid: string; 22 | } 23 | } 24 | export type Type = $.searcher.SendBundleResponse; 25 | 26 | export function getDefaultValue(): $.searcher.SendBundleResponse { 27 | return { 28 | uuid: "", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.searcher.SendBundleResponse>): $.searcher.SendBundleResponse { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.searcher.SendBundleResponse): unknown { 40 | const result: any = {}; 41 | if (value.uuid !== undefined) result.uuid = tsValueToJsonValueFns.string(value.uuid); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.searcher.SendBundleResponse { 46 | const result = getDefaultValue(); 47 | if (value.uuid !== undefined) result.uuid = jsonValueToTsValueFns.string(value.uuid); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.searcher.SendBundleResponse): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.uuid !== undefined) { 54 | const tsValue = value.uuid; 55 | result.push( 56 | [1, tsValueToWireValueFns.string(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.searcher.SendBundleResponse { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.string(wireValue); 70 | if (value === undefined) break field; 71 | result.uuid = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/SlotList.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | unpackFns, 15 | } from "../../runtime/wire/scalar"; 16 | import { 17 | default as deserialize, 18 | } from "../../runtime/wire/deserialize"; 19 | 20 | export declare namespace $.searcher { 21 | export interface SlotList { 22 | slots: string[]; 23 | } 24 | } 25 | export type Type = $.searcher.SlotList; 26 | 27 | export function getDefaultValue(): $.searcher.SlotList { 28 | return { 29 | slots: [], 30 | }; 31 | } 32 | 33 | export function createValue(partialValue: Partial<$.searcher.SlotList>): $.searcher.SlotList { 34 | return { 35 | ...getDefaultValue(), 36 | ...partialValue, 37 | }; 38 | } 39 | 40 | export function encodeJson(value: $.searcher.SlotList): unknown { 41 | const result: any = {}; 42 | result.slots = value.slots.map(value => tsValueToJsonValueFns.uint64(value)); 43 | return result; 44 | } 45 | 46 | export function decodeJson(value: any): $.searcher.SlotList { 47 | const result = getDefaultValue(); 48 | result.slots = value.slots?.map((value: any) => jsonValueToTsValueFns.uint64(value)) ?? []; 49 | return result; 50 | } 51 | 52 | export function encodeBinary(value: $.searcher.SlotList): Uint8Array { 53 | const result: WireMessage = []; 54 | for (const tsValue of value.slots) { 55 | result.push( 56 | [1, tsValueToWireValueFns.uint64(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.searcher.SlotList { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | collection: { 67 | const wireValues = wireMessage.filter(([fieldNumber]) => fieldNumber === 1).map(([, wireValue]) => wireValue); 68 | const value = Array.from(unpackFns.uint64(wireValues)); 69 | if (!value.length) break collection; 70 | result.slots = value as any; 71 | } 72 | return result; 73 | } 74 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/SubscribeBundleResultsRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | WireMessage, 3 | } from "../../runtime/wire/index"; 4 | import { 5 | default as serialize, 6 | } from "../../runtime/wire/serialize"; 7 | import { 8 | default as deserialize, 9 | } from "../../runtime/wire/deserialize"; 10 | 11 | export declare namespace $.searcher { 12 | export interface SubscribeBundleResultsRequest {} 13 | } 14 | export type Type = $.searcher.SubscribeBundleResultsRequest; 15 | 16 | export function getDefaultValue(): $.searcher.SubscribeBundleResultsRequest { 17 | return { 18 | }; 19 | } 20 | 21 | export function createValue(partialValue: Partial<$.searcher.SubscribeBundleResultsRequest>): $.searcher.SubscribeBundleResultsRequest { 22 | return { 23 | ...getDefaultValue(), 24 | ...partialValue, 25 | }; 26 | } 27 | 28 | export function encodeJson(value: $.searcher.SubscribeBundleResultsRequest): unknown { 29 | const result: any = {}; 30 | return result; 31 | } 32 | 33 | export function decodeJson(value: any): $.searcher.SubscribeBundleResultsRequest { 34 | const result = getDefaultValue(); 35 | return result; 36 | } 37 | 38 | export function encodeBinary(value: $.searcher.SubscribeBundleResultsRequest): Uint8Array { 39 | const result: WireMessage = []; 40 | return serialize(result); 41 | } 42 | 43 | export function decodeBinary(binary: Uint8Array): $.searcher.SubscribeBundleResultsRequest { 44 | const result = getDefaultValue(); 45 | const wireMessage = deserialize(binary); 46 | const wireFields = new Map(wireMessage); 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/searcher/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as SlotList } from "./SlotList"; 2 | export type { Type as ConnectedLeadersResponse } from "./ConnectedLeadersResponse"; 3 | export type { Type as SendBundleRequest } from "./SendBundleRequest"; 4 | export type { Type as SendBundleResponse } from "./SendBundleResponse"; 5 | export type { Type as ProgramSubscriptionV0 } from "./ProgramSubscriptionV0"; 6 | export type { Type as WriteLockedAccountSubscriptionV0 } from "./WriteLockedAccountSubscriptionV0"; 7 | export type { Type as MempoolSubscription } from "./MempoolSubscription"; 8 | export type { Type as PendingTxNotification } from "./PendingTxNotification"; 9 | export type { Type as NextScheduledLeaderRequest } from "./NextScheduledLeaderRequest"; 10 | export type { Type as NextScheduledLeaderResponse } from "./NextScheduledLeaderResponse"; 11 | export type { Type as ConnectedLeadersRequest } from "./ConnectedLeadersRequest"; 12 | export type { Type as ConnectedLeadersRegionedRequest } from "./ConnectedLeadersRegionedRequest"; 13 | export type { Type as ConnectedLeadersRegionedResponse } from "./ConnectedLeadersRegionedResponse"; 14 | export type { Type as GetTipAccountsRequest } from "./GetTipAccountsRequest"; 15 | export type { Type as GetTipAccountsResponse } from "./GetTipAccountsResponse"; 16 | export type { Type as SubscribeBundleResultsRequest } from "./SubscribeBundleResultsRequest"; 17 | export type { Type as GetRegionsRequest } from "./GetRegionsRequest"; 18 | export type { Type as GetRegionsResponse } from "./GetRegionsResponse"; 19 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/shared/Header.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Type as Timestamp, 3 | encodeJson as encodeJson_1, 4 | decodeJson as decodeJson_1, 5 | encodeBinary as encodeBinary_1, 6 | decodeBinary as decodeBinary_1, 7 | } from "../google/protobuf/Timestamp"; 8 | import { 9 | jsonValueToTsValueFns, 10 | } from "../../runtime/json/scalar"; 11 | import { 12 | WireMessage, 13 | WireType, 14 | } from "../../runtime/wire/index"; 15 | import { 16 | default as serialize, 17 | } from "../../runtime/wire/serialize"; 18 | import { 19 | default as deserialize, 20 | } from "../../runtime/wire/deserialize"; 21 | 22 | export declare namespace $.shared { 23 | export interface Header { 24 | ts?: Timestamp; 25 | } 26 | } 27 | export type Type = $.shared.Header; 28 | 29 | export function getDefaultValue(): $.shared.Header { 30 | return { 31 | ts: undefined, 32 | }; 33 | } 34 | 35 | export function createValue(partialValue: Partial<$.shared.Header>): $.shared.Header { 36 | return { 37 | ...getDefaultValue(), 38 | ...partialValue, 39 | }; 40 | } 41 | 42 | export function encodeJson(value: $.shared.Header): unknown { 43 | const result: any = {}; 44 | if (value.ts !== undefined) result.ts = encodeJson_1(value.ts); 45 | return result; 46 | } 47 | 48 | export function decodeJson(value: any): $.shared.Header { 49 | const result = getDefaultValue(); 50 | if (value.ts !== undefined) result.ts = decodeJson_1(value.ts); 51 | return result; 52 | } 53 | 54 | export function encodeBinary(value: $.shared.Header): Uint8Array { 55 | const result: WireMessage = []; 56 | if (value.ts !== undefined) { 57 | const tsValue = value.ts; 58 | result.push( 59 | [1, { type: WireType.LengthDelimited as const, value: encodeBinary_1(tsValue) }], 60 | ); 61 | } 62 | return serialize(result); 63 | } 64 | 65 | export function decodeBinary(binary: Uint8Array): $.shared.Header { 66 | const result = getDefaultValue(); 67 | const wireMessage = deserialize(binary); 68 | const wireFields = new Map(wireMessage); 69 | field: { 70 | const wireValue = wireFields.get(1); 71 | if (wireValue === undefined) break field; 72 | const value = wireValue.type === WireType.LengthDelimited ? decodeBinary_1(wireValue.value) : undefined; 73 | if (value === undefined) break field; 74 | result.ts = value; 75 | } 76 | return result; 77 | } 78 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/shared/Heartbeat.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.shared { 20 | export interface Heartbeat { 21 | count: string; 22 | } 23 | } 24 | export type Type = $.shared.Heartbeat; 25 | 26 | export function getDefaultValue(): $.shared.Heartbeat { 27 | return { 28 | count: "0", 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.shared.Heartbeat>): $.shared.Heartbeat { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.shared.Heartbeat): unknown { 40 | const result: any = {}; 41 | if (value.count !== undefined) result.count = tsValueToJsonValueFns.uint64(value.count); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.shared.Heartbeat { 46 | const result = getDefaultValue(); 47 | if (value.count !== undefined) result.count = jsonValueToTsValueFns.uint64(value.count); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.shared.Heartbeat): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.count !== undefined) { 54 | const tsValue = value.count; 55 | result.push( 56 | [1, tsValueToWireValueFns.uint64(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.shared.Heartbeat { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.uint64(wireValue); 70 | if (value === undefined) break field; 71 | result.count = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/shared/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Header } from "./Header"; 2 | export type { Type as Heartbeat } from "./Heartbeat"; 3 | export type { Type as Socket } from "./Socket"; 4 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/shredstream/HeartbeatResponse.ts: -------------------------------------------------------------------------------- 1 | import { 2 | tsValueToJsonValueFns, 3 | jsonValueToTsValueFns, 4 | } from "../../runtime/json/scalar"; 5 | import { 6 | WireMessage, 7 | } from "../../runtime/wire/index"; 8 | import { 9 | default as serialize, 10 | } from "../../runtime/wire/serialize"; 11 | import { 12 | tsValueToWireValueFns, 13 | wireValueToTsValueFns, 14 | } from "../../runtime/wire/scalar"; 15 | import { 16 | default as deserialize, 17 | } from "../../runtime/wire/deserialize"; 18 | 19 | export declare namespace $.shredstream { 20 | export interface HeartbeatResponse { 21 | ttlMs: number; 22 | } 23 | } 24 | export type Type = $.shredstream.HeartbeatResponse; 25 | 26 | export function getDefaultValue(): $.shredstream.HeartbeatResponse { 27 | return { 28 | ttlMs: 0, 29 | }; 30 | } 31 | 32 | export function createValue(partialValue: Partial<$.shredstream.HeartbeatResponse>): $.shredstream.HeartbeatResponse { 33 | return { 34 | ...getDefaultValue(), 35 | ...partialValue, 36 | }; 37 | } 38 | 39 | export function encodeJson(value: $.shredstream.HeartbeatResponse): unknown { 40 | const result: any = {}; 41 | if (value.ttlMs !== undefined) result.ttlMs = tsValueToJsonValueFns.uint32(value.ttlMs); 42 | return result; 43 | } 44 | 45 | export function decodeJson(value: any): $.shredstream.HeartbeatResponse { 46 | const result = getDefaultValue(); 47 | if (value.ttlMs !== undefined) result.ttlMs = jsonValueToTsValueFns.uint32(value.ttlMs); 48 | return result; 49 | } 50 | 51 | export function encodeBinary(value: $.shredstream.HeartbeatResponse): Uint8Array { 52 | const result: WireMessage = []; 53 | if (value.ttlMs !== undefined) { 54 | const tsValue = value.ttlMs; 55 | result.push( 56 | [1, tsValueToWireValueFns.uint32(tsValue)], 57 | ); 58 | } 59 | return serialize(result); 60 | } 61 | 62 | export function decodeBinary(binary: Uint8Array): $.shredstream.HeartbeatResponse { 63 | const result = getDefaultValue(); 64 | const wireMessage = deserialize(binary); 65 | const wireFields = new Map(wireMessage); 66 | field: { 67 | const wireValue = wireFields.get(1); 68 | if (wireValue === undefined) break field; 69 | const value = wireValueToTsValueFns.uint32(wireValue); 70 | if (value === undefined) break field; 71 | result.ttlMs = value; 72 | } 73 | return result; 74 | } 75 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/shredstream/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as Heartbeat } from "./Heartbeat"; 2 | export type { Type as HeartbeatResponse } from "./HeartbeatResponse"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/messages/trace_shred/index.ts: -------------------------------------------------------------------------------- 1 | export type { Type as TraceShred } from "./TraceShred"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/array.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | export type PojoSet = { [key in T]: T }; 3 | export function toPojoSet( 4 | arr: readonly T[], 5 | ): PojoSet { 6 | const result: any = {}; 7 | for (const item of arr) result[item] = item; 8 | return result; 9 | } 10 | 11 | export function removeItem(arr: T[], item: T): T[] { 12 | const index = arr.indexOf(item); 13 | arr.splice(index, 1); 14 | return arr; 15 | } 16 | 17 | export function groupBy(arr: T[], by: U): Map { 18 | const result = new Map(); 19 | for (const item of arr) { 20 | const key = item[by]; 21 | if (result.has(key)) result.get(key)!.push(item); 22 | else result.set(key, [item]); 23 | } 24 | return result; 25 | } 26 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/async/async-generator.ts: -------------------------------------------------------------------------------- 1 | export async function* fromSingle(value: T): AsyncGenerator { 2 | yield value; 3 | } 4 | 5 | export async function first( 6 | generator: AsyncGenerator, 7 | ): Promise { 8 | const { done, value } = await generator.next(); 9 | if (done) throw Error("The generator should yield at least one value."); 10 | return value; 11 | } 12 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/async/event-buffer.ts: -------------------------------------------------------------------------------- 1 | import { defer, Deferred } from "./observer"; 2 | 3 | export interface EventBuffer { 4 | push(value: T): void; 5 | error(error: Error): void; 6 | finish(): void; 7 | drain(): AsyncGenerator; 8 | } 9 | export interface CreateEventBufferConfig { 10 | onDrainStart?: () => void; 11 | onDrainEnd?: () => void; 12 | } 13 | export function createEventBuffer( 14 | config?: CreateEventBufferConfig, 15 | ): EventBuffer { 16 | const queue: T[] = []; 17 | let _error: Error | undefined; 18 | let deferred: Deferred> | undefined; 19 | let finished = false; 20 | return { 21 | push(value) { 22 | if (finished) throw new Error("can't push after finish"); 23 | if (deferred) { 24 | deferred.resolve({ value, done: false }); 25 | deferred = undefined; 26 | } else { 27 | queue.push(value); 28 | } 29 | }, 30 | error(error) { 31 | if (deferred) deferred.reject(error); 32 | else _error = error; 33 | finished = true; 34 | }, 35 | finish() { 36 | deferred?.resolve({ value: undefined, done: true }); 37 | finished = true; 38 | }, 39 | drain() { 40 | config?.onDrainStart?.(); 41 | const result: AsyncGenerator = { 42 | [Symbol.asyncIterator]: () => result, 43 | next() { 44 | if (queue.length > 0) { 45 | return Promise.resolve({ 46 | value: queue.shift()!, 47 | done: false, 48 | }); 49 | } else { 50 | if (_error) return Promise.reject(_error); 51 | if (finished) { 52 | return Promise.resolve({ value: undefined, done: true }); 53 | } else { 54 | return deferred = defer(); 55 | } 56 | } 57 | }, 58 | return(value) { 59 | config?.onDrainEnd?.(); 60 | return Promise.resolve({ value, done: true }); 61 | }, 62 | throw(error) { 63 | config?.onDrainEnd?.(); 64 | return Promise.reject(error); 65 | }, 66 | }; 67 | return result; 68 | }, 69 | }; 70 | } 71 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/async/event-emitter.ts: -------------------------------------------------------------------------------- 1 | export interface EventEmitter> { 2 | emit(type: Type, event: Events[Type]): void; 3 | on( 4 | type: Type | "*", 5 | listener: Listener, 6 | ): Off; 7 | off(type: keyof Events): void; 8 | } 9 | export type Listener = (event: Event, type: string) => void; 10 | export type Off = () => void; 11 | 12 | export function createEventEmitter< 13 | Events extends Record, 14 | >(): EventEmitter { 15 | const listeners = {} as Record>>; 16 | const eventEmitter: EventEmitter = { 17 | emit(type, event) { 18 | listeners[type]?.forEach( 19 | (listener) => listener(event, type as string), 20 | ); 21 | (type !== "*") && listeners["*"]?.forEach( 22 | (listener) => listener(event, type as string), 23 | ); 24 | }, 25 | on(type, listener) { 26 | (listeners[type] ||= new Set()).add(listener); 27 | return () => listeners[type]?.delete(listener); 28 | }, 29 | off(type) { 30 | delete listeners[type]; 31 | }, 32 | }; 33 | return eventEmitter; 34 | } 35 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/async/observer.ts: -------------------------------------------------------------------------------- 1 | import { removeItem } from "../array"; 2 | 3 | export interface Observer { 4 | next(value: T): void; 5 | error(exception?: any): void; 6 | complete(): void; 7 | } 8 | export type SubscribeFn = (observer: Observer) => UnsubscribeFn; 9 | export type UnsubscribeFn = () => void; 10 | 11 | export interface Deferred extends Promise { 12 | resolve(value: T): void; 13 | reject(reason?: any): void; 14 | } 15 | export function defer(): Deferred { 16 | const transit: any = {}; 17 | const result = new Promise( 18 | (resolve, reject) => Object.assign(transit, { resolve, reject }), 19 | ); 20 | return Object.assign(result, transit); 21 | } 22 | 23 | export interface Next { 24 | (): Promise<[T, boolean]>; 25 | } 26 | export function createSubscribeFn( 27 | next: Next, 28 | wait = Promise.resolve(), 29 | ): SubscribeFn { 30 | const observers: Observer[] = []; 31 | (async () => { 32 | try { 33 | await wait; 34 | while (observers.length) { 35 | const [value, done] = await next(); 36 | for (const observer of observers) observer.next(value); 37 | if (done) break; 38 | } 39 | } catch (err) { 40 | for (const observer of observers) observer.error(err); 41 | } finally { 42 | for (const observer of observers) observer.complete(); 43 | } 44 | })(); 45 | return (observer) => { 46 | observers.push(observer); 47 | return () => { 48 | observer.complete(); 49 | removeItem(observers, observer); 50 | }; 51 | }; 52 | } 53 | export async function* subscribeFnToAsyncGenerator( 54 | subscribe: SubscribeFn, 55 | ): AsyncGenerator { 56 | let finished = false; 57 | let deferred = defer(); 58 | const observer: Observer = { 59 | next(value) { 60 | const result = deferred; 61 | deferred = defer(); 62 | result.resolve(value); 63 | }, 64 | error(exception) { 65 | const result = deferred; 66 | deferred = defer(); 67 | result.reject(exception); 68 | }, 69 | complete() { 70 | finished = true; 71 | deferred.resolve(null as any); 72 | }, 73 | }; 74 | const unsubscribe = subscribe(observer); 75 | try { 76 | while (true) { 77 | const value = await deferred; 78 | if (finished) break; 79 | yield value; 80 | } 81 | } finally { 82 | unsubscribe(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/async/wait.ts: -------------------------------------------------------------------------------- 1 | export default function wait(ms: number): Promise { 2 | return new Promise((resolve) => setTimeout(resolve, ms)); 3 | } 4 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/scalar.ts: -------------------------------------------------------------------------------- 1 | export type ScalarValueTypePath = `.${ScalarValueType}`; 2 | export type ScalarValueTypes = Writable; 3 | export type ScalarValueType = ScalarValueTypes[number]; 4 | export const _scalarValueTypes = [ 5 | "double", 6 | "float", 7 | "int32", 8 | "int64", 9 | "uint32", 10 | "uint64", 11 | "sint32", 12 | "sint64", 13 | "fixed32", 14 | "fixed64", 15 | "sfixed32", 16 | "sfixed64", 17 | "bool", 18 | "string", 19 | "bytes", 20 | ] as const; 21 | export const scalarValueTypes: ScalarValueTypes = 22 | _scalarValueTypes as ScalarValueTypes; 23 | 24 | type Writable = { 25 | -readonly [K in keyof T]: T[K]; 26 | }; 27 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/wire/deserialize.ts: -------------------------------------------------------------------------------- 1 | import Long from "../Long"; 2 | import { WireMessage, WireType } from "./index"; 3 | import { decode } from "./varint"; 4 | 5 | export default function deserialize(uint8array: Uint8Array): WireMessage { 6 | let idx = 0; 7 | const offset = uint8array.byteOffset; 8 | const result: WireMessage = []; 9 | const dataview = new DataView(uint8array.buffer, offset); 10 | while (idx < uint8array.length) { 11 | const decodeResult = decode(new DataView(uint8array.buffer, offset + idx)); 12 | const key = decodeResult[1][0]; 13 | idx += decodeResult[0]; 14 | const type = (key & 0b111) as WireType; 15 | const fieldNumber = key >>> 3; 16 | switch (type) { 17 | default: 18 | throw new Error(`Unknown wire type ${type}`); 19 | case WireType.Varint: { 20 | const [len, value] = decode( 21 | new DataView(uint8array.buffer, offset + idx), 22 | ); 23 | result.push([fieldNumber, { type, value }]); 24 | idx += len; 25 | break; 26 | } 27 | case WireType.Fixed64: 28 | const lo = dataview.getUint32(idx, true); 29 | const hi = dataview.getUint32(idx += 4, true); 30 | idx += 4; 31 | result.push([fieldNumber, { 32 | type, 33 | value: new Long(lo, hi), 34 | }]); 35 | break; 36 | case WireType.LengthDelimited: { 37 | const [len, value] = decode( 38 | new DataView(uint8array.buffer, offset + idx), 39 | ); 40 | result.push([fieldNumber, { 41 | type, 42 | value: uint8array.subarray(idx += len, idx += value[0]), 43 | }]); 44 | break; 45 | } 46 | case WireType.StartGroup: 47 | case WireType.EndGroup: 48 | result.push([fieldNumber, { type }]); 49 | break; 50 | case WireType.Fixed32: 51 | result.push([fieldNumber, { 52 | type, 53 | value: dataview.getUint32(idx, true), 54 | }]); 55 | idx += 4; 56 | break; 57 | } 58 | } 59 | return result; 60 | } 61 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/wire/index.ts: -------------------------------------------------------------------------------- 1 | import Long from "../Long"; 2 | 3 | export type WireMessage = [FieldNumber, Field][]; 4 | export type FieldNumber = number; 5 | export type Field = 6 | | Varint 7 | | Fixed64 8 | | LengthDelimited 9 | | StartGroup 10 | | EndGroup 11 | | Fixed32; 12 | 13 | export enum WireType { 14 | Varint = 0, 15 | Fixed64 = 1, 16 | LengthDelimited = 2, 17 | StartGroup = 3, 18 | EndGroup = 4, 19 | Fixed32 = 5, 20 | } 21 | 22 | interface FieldBase { 23 | type: T; 24 | } 25 | export interface Varint extends FieldBase { 26 | value: Long; 27 | } 28 | export interface Fixed64 extends FieldBase { 29 | value: Long; 30 | } 31 | export interface LengthDelimited extends FieldBase { 32 | value: Uint8Array; 33 | } 34 | export interface StartGroup extends FieldBase {} 35 | export interface EndGroup extends FieldBase {} 36 | export interface Fixed32 extends FieldBase { 37 | value: number; 38 | } 39 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/wire/serialize.ts: -------------------------------------------------------------------------------- 1 | import { WireMessage, WireType } from "./index"; 2 | import { encode } from "./varint"; 3 | 4 | export default function serialize(wireMessage: WireMessage): Uint8Array { 5 | const result: Uint8Array[] = []; 6 | wireMessage.forEach(([fieldNumber, field]) => { 7 | result.push(encode((fieldNumber << 3) | field.type)); 8 | switch (field.type) { 9 | case WireType.Varint: 10 | result.push(encode(field.value)); 11 | break; 12 | case WireType.Fixed64: { 13 | const arr = new Uint8Array(8); 14 | const dataview = new DataView(arr.buffer); 15 | dataview.setUint32(0, field.value[0], true); 16 | dataview.setUint32(4, field.value[1], true); 17 | result.push(arr); 18 | break; 19 | } 20 | case WireType.LengthDelimited: 21 | result.push(encode(field.value.byteLength)); 22 | result.push(field.value); 23 | break; 24 | case WireType.Fixed32: { 25 | const arr = new Uint8Array(4); 26 | const dataview = new DataView(arr.buffer); 27 | dataview.setUint32(0, field.value, true); 28 | result.push(arr); 29 | break; 30 | } 31 | } 32 | }); 33 | return concat(result); 34 | } 35 | 36 | export function concat(arrays: Uint8Array[]): Uint8Array { 37 | const totalLength = arrays.reduce((acc, value) => { 38 | return acc + value.byteLength; 39 | }, 0); 40 | const result = new Uint8Array(totalLength); 41 | arrays.reduce((acc, array) => { 42 | result.set(array, acc); 43 | return acc + array.byteLength; 44 | }, 0); 45 | return result; 46 | } 47 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/wire/varint.ts: -------------------------------------------------------------------------------- 1 | import Long from "../Long"; 2 | 3 | export function encode(value: number | Long): Uint8Array { 4 | const result: number[] = []; 5 | const mask = 0b1111111; 6 | const head = 1 << 7; 7 | let long = typeof value === "number" ? new Long(value) : value; 8 | while (long[0] || long[1]) { 9 | const [lo, hi] = long; 10 | const chunk = lo & mask; 11 | const nextHi = hi >>> 7; 12 | const nextLo = (lo >>> 7) | ((hi & mask) << (32 - 7)); 13 | long = new Long(nextLo, nextHi); 14 | const resultChunk = !(long[0] || long[1]) ? chunk : chunk | head; 15 | result.push(resultChunk); 16 | } 17 | if (result.length < 1) return new Uint8Array(1); 18 | return Uint8Array.from(result); 19 | } 20 | 21 | export type DecodeResult = [ 22 | number, // byte count 23 | Long, // value 24 | ]; 25 | export function decode(dataview: DataView): DecodeResult { 26 | let result = new Long(0); 27 | let i = 0; 28 | while (true) { 29 | const curr = dataview.getUint8(i); 30 | result = or( 31 | result, 32 | leftshift(new Long(curr & 0b1111111), i * 7), 33 | ); 34 | ++i; 35 | if (curr >>> 7) continue; 36 | return [i, result]; 37 | } 38 | } 39 | 40 | function or(a: Long, b: Long): Long { 41 | return new Long(a[0] | b[0], a[1] | b[1]); 42 | } 43 | 44 | function leftshift(a: Long, count: number): Long { 45 | if (count === 0) return a; 46 | if (count >= 32) return new Long(0, a[0] << (count - 32)); 47 | return new Long( 48 | a[0] << count, 49 | (a[1] << count) | (a[0] >>> (32 - count)), 50 | ); 51 | } 52 | -------------------------------------------------------------------------------- /bxsolana/proto/runtime/wire/zigzag.ts: -------------------------------------------------------------------------------- 1 | import Long from "../Long"; 2 | 3 | export function encode(value: T): T { 4 | if (value instanceof Long) { 5 | const l = new Long( 6 | value[0] << 1, 7 | (value[1] << 1) | (value[0] >>> 31), 8 | ); 9 | const r = value[1] >>> 31 ? new Long(0xFFFFFFFF, 0xFFFFFFFF) : new Long(); 10 | return new Long(l[0] ^ r[0], l[1] ^ r[1]) as T; 11 | } 12 | return (((value as number) * 2) ^ ((value as number) >> 31)) >>> 0 as T; 13 | } 14 | 15 | export function decode(value: T): T { 16 | if (value instanceof Long) { 17 | const l = new Long((value[0] >>> 1) | (value[1] << 31), (value[1]) >>> 1); 18 | const r = value[0] & 1 ? new Long(0xFFFFFFFF, 0xFFFFFFFF) : new Long(); 19 | return new Long(l[0] ^ r[0], l[1] ^ r[1]) as T; 20 | } 21 | return (((value as number) >>> 1) ^ -((value as number) & 1)) as T; 22 | } 23 | -------------------------------------------------------------------------------- /bxsolana/proto/services/api/index.ts: -------------------------------------------------------------------------------- 1 | export type { Service as Api } from "./Api"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/services/auth/index.ts: -------------------------------------------------------------------------------- 1 | export type { Service as AuthService } from "./AuthService"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/services/block_engine/index.ts: -------------------------------------------------------------------------------- 1 | export type { Service as BlockEngineValidator } from "./BlockEngineValidator"; 2 | export type { Service as BlockEngineRelayer } from "./BlockEngineRelayer"; 3 | -------------------------------------------------------------------------------- /bxsolana/proto/services/index.ts: -------------------------------------------------------------------------------- 1 | import * as api from "./api/index"; 2 | import * as shredstream from "./shredstream/index"; 3 | import * as searcher from "./searcher/index"; 4 | import * as relayer from "./relayer/index"; 5 | import * as block_engine from "./block_engine/index"; 6 | import * as auth from "./auth/index"; 7 | export type { 8 | api, 9 | shredstream, 10 | searcher, 11 | relayer, 12 | block_engine, 13 | auth, 14 | }; 15 | -------------------------------------------------------------------------------- /bxsolana/proto/services/relayer/index.ts: -------------------------------------------------------------------------------- 1 | export type { Service as Relayer } from "./Relayer"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/services/searcher/index.ts: -------------------------------------------------------------------------------- 1 | export type { Service as SearcherService } from "./SearcherService"; 2 | -------------------------------------------------------------------------------- /bxsolana/proto/services/shredstream/index.ts: -------------------------------------------------------------------------------- 1 | export type { Service as Shredstream } from "./Shredstream"; 2 | -------------------------------------------------------------------------------- /bxsolana/utils/blockingqueue.ts: -------------------------------------------------------------------------------- 1 | export class AsyncBlockingQueue { 2 | private _promises: Promise[] 3 | private _resolvers: ((t: T) => void)[] 4 | 5 | constructor() { 6 | this._resolvers = [] 7 | this._promises = [] 8 | } 9 | 10 | private _add() { 11 | this._promises.push( 12 | new Promise((resolve) => { 13 | this._resolvers.push(resolve) 14 | }) 15 | ) 16 | } 17 | 18 | enqueue(t: T) { 19 | if (!this._resolvers.length) this._add() 20 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 21 | const resolve = this._resolvers.shift()! 22 | resolve(t) 23 | } 24 | 25 | dequeue(): Promise { 26 | if (!this._promises.length) this._add() 27 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 28 | const promise = this._promises.shift()! 29 | return promise 30 | } 31 | 32 | isEmpty() { 33 | return !this._promises.length 34 | } 35 | 36 | isBlocked() { 37 | return !!this._resolvers.length 38 | } 39 | 40 | get length() { 41 | return this._promises.length - this._resolvers.length 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /bxsolana/utils/bundletip.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Keypair, 3 | PublicKey, 4 | Transaction, 5 | TransactionInstruction, 6 | MessageCompiledInstruction, 7 | VersionedTransaction, 8 | SystemProgram, 9 | } from "@solana/web3.js" 10 | // check documentation for latest tip wallet, and how to send tip transactions 11 | // https://docs.bloxroute.com/solana/trader-api-v2/front-running-protection-and-transaction-bundle 12 | const TRADER_API_TIP_WALLET = "HWEoBxYs7ssKuudEjzjmpfJVX7Dvi7wescFsVx2L5yoY" 13 | 14 | // createTraderAPIMemoInstruction generates a transaction instruction that places a memo in the transaction log 15 | // Having a memo instruction with signals Trader-API usage is required 16 | export function CreateTraderAPITipInstruction( 17 | senderAddress: PublicKey, 18 | tipAmount: number 19 | ): TransactionInstruction { 20 | const tipAddress = new PublicKey(TRADER_API_TIP_WALLET) 21 | 22 | return SystemProgram.transfer({ 23 | fromPubkey: senderAddress, 24 | toPubkey: tipAddress, 25 | lamports: tipAmount, 26 | }) 27 | } 28 | 29 | // createTraderAPIMemoInstruction generates a transaction instruction that places a memo in the transaction log 30 | // Having a memo instruction with signals Trader-API usage is required 31 | export function CreateTraderAPITipTransaction( 32 | senderAddress: PublicKey, 33 | tipAmount: number 34 | ): Transaction { 35 | const tipAddress = new PublicKey(TRADER_API_TIP_WALLET) 36 | 37 | return new Transaction().add( 38 | SystemProgram.transfer({ 39 | fromPubkey: senderAddress, 40 | toPubkey: tipAddress, 41 | lamports: tipAmount, 42 | }) 43 | ) 44 | } 45 | -------------------------------------------------------------------------------- /bxsolana/utils/config.ts: -------------------------------------------------------------------------------- 1 | import dotenv from "dotenv" 2 | 3 | export type Config = { 4 | privateKey: string 5 | publicKey: string 6 | authHeader: string 7 | } 8 | 9 | export function loadFromEnv(): Config { 10 | dotenv.config() 11 | 12 | const envAuthHeader = process.env.AUTH_HEADER || "" 13 | const envPrivateKey = process.env.PRIVATE_KEY || "" 14 | const envPublicKey: string = process.env.PUBLIC_KEY || "" 15 | return { 16 | privateKey: envPrivateKey, 17 | publicKey: envPublicKey, 18 | authHeader: envAuthHeader, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /bxsolana/utils/error.ts: -------------------------------------------------------------------------------- 1 | export interface RpcError { 2 | code: number 3 | message: string 4 | } 5 | 6 | // eslint-disable-next-line 7 | export function isRpcError(obj: any): boolean { 8 | return typeof obj.code == "number" && typeof obj.message == "string" 9 | } 10 | -------------------------------------------------------------------------------- /bxsolana/utils/timestamp.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Type as Timestamp 3 | } from "../proto/messages/google/protobuf/Timestamp"; 4 | 5 | /** 6 | * Creates and returns a Protocol Buffer Timestamp object based on the current time. 7 | * 8 | * This function captures the current time and converts it to a Protocol Buffer 9 | * Timestamp object with seconds since epoch and nanoseconds precision. 10 | * 11 | * @returns A Protocol Buffer Timestamp object representing the current time 12 | * with seconds and nanoseconds components. 13 | */ 14 | export function timestamp(): Timestamp { 15 | const now = new Date(); 16 | const seconds = Math.floor(now.getTime() / 1000); 17 | const nanos = now.getMilliseconds() * 1000000; 18 | return { 19 | seconds: seconds.toString(), 20 | nanos: nanos 21 | } 22 | } 23 | 24 | /** 25 | * Returns the current time as an RFC 3339 formatted string suitable for 26 | * Protocol Buffer Timestamp JSON serialization. 27 | * 28 | * Reference: https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp.html 29 | * 30 | * The format is: "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" 31 | * - All components except year are zero-padded to two digits 32 | * - Year is expressed using four digits 33 | * - Fractional seconds can go up to 9 digits (nanosecond precision) 34 | * - The "Z" suffix indicates UTC timezone 35 | * 36 | * @returns Current time in RFC 3339 format with UTC timezone (Z) 37 | */ 38 | export function timestampRfc3339(): string { 39 | const now = new Date(); 40 | const isoString = now.toISOString(); 41 | const formatted = isoString.replace(/\.\d{3}Z$/, (match) => { 42 | return match.slice(0, 4) + '000Z'; 43 | }); 44 | return formatted; 45 | } -------------------------------------------------------------------------------- /bxsolana/utils/transaction.ts: -------------------------------------------------------------------------------- 1 | import { Keypair, Transaction, VersionedTransaction } from "@solana/web3.js" 2 | import { TransactionMessage } from "../proto/messages/api" 3 | 4 | export function signTx( 5 | base64EncodedTx: string, 6 | privateKey: Keypair 7 | ): VersionedTransaction { 8 | const tx = txFromBase64(base64EncodedTx) 9 | tx.sign([privateKey]) 10 | return tx 11 | } 12 | 13 | export function signTxMessage( 14 | txMessage: TransactionMessage, 15 | privateKey: Keypair 16 | ): TransactionMessage { 17 | const signedTx = signTx(txMessage.content, privateKey) 18 | txMessage.content = txToBase64(signedTx) 19 | return txMessage 20 | } 21 | 22 | export type SubmitTransactionResponse = { 23 | signature: string 24 | openOrdersAccount: string 25 | } 26 | 27 | function txFromBase64(base64EncodedTx: string): VersionedTransaction { 28 | const decoded = Uint8Array.from(Buffer.from(base64EncodedTx, "base64")) 29 | const transaction = VersionedTransaction.deserialize(decoded) 30 | return transaction 31 | } 32 | 33 | export function txToBase64(transaction: VersionedTransaction): string { 34 | const serializedTransaztionBytes = transaction.serialize() 35 | const buff = Buffer.from(serializedTransaztionBytes) 36 | return buff.toString("base64") 37 | } 38 | -------------------------------------------------------------------------------- /bxsolana/utils/websocket-iterator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bloXroute-Labs/solana-trader-client-ts/387b2acfd0960e4115054bdc32a19277ad236cc3/bxsolana/utils/websocket-iterator.ts -------------------------------------------------------------------------------- /examples/examples.test.ts: -------------------------------------------------------------------------------- 1 | process.env.API_ENV = "mainnet" 2 | process.env.IS_UNIT_TEST = "true" 3 | 4 | import { 5 | callGetPumpFunAmmQuotes, 6 | callPostPumpFunAmmSwap, 7 | doAmmRequests, 8 | getGrpcProviders, 9 | grpc, 10 | } from "." 11 | 12 | test("example all grpc", async () => { 13 | await grpc() 14 | }) 15 | 16 | test("example AMM requests", async () => { 17 | const { provider, pumpProvider } = getGrpcProviders() 18 | await doAmmRequests(provider, pumpProvider) 19 | }, 30000) 20 | 21 | test("example Pump Fun AMM Quote", async () => { 22 | const { pumpProvider } = getGrpcProviders() 23 | await callGetPumpFunAmmQuotes(pumpProvider) 24 | }) 25 | 26 | test("example Pump Fun AMM Swap", async () => { 27 | const { pumpProvider } = getGrpcProviders() 28 | await callPostPumpFunAmmSwap(pumpProvider) 29 | }) 30 | -------------------------------------------------------------------------------- /jest.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testMatch: ['**/*.test.ts', '**/*.spec.ts'], 5 | }; -------------------------------------------------------------------------------- /tests/unit/grpc.test.ts: -------------------------------------------------------------------------------- 1 | import { 2 | loadFromEnv 3 | } from "../../bxsolana"; 4 | 5 | describe('loadFromEnv', () => { 6 | test('Assert values are loaded', () => { 7 | const config = loadFromEnv(); 8 | expect(config.authHeader && config.privateKey && config.publicKey) 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "esnext", 5 | "moduleResolution": "node", 6 | "declaration": true, 7 | "declarationMap": true, 8 | "allowJs": true, 9 | "checkJs": true, 10 | "outDir": "dist", 11 | "esModuleInterop": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "noFallthroughCasesInSwitch": true, 14 | "isolatedModules": false, 15 | "strict": true, 16 | "noImplicitAny": true, 17 | "useUnknownInCatchVariables": false, 18 | "inlineSourceMap": true, 19 | "skipLibCheck": true 20 | }, 21 | "ts-node": { 22 | "esm": true 23 | }, 24 | "include": ["./bxsolana/**/*"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["tslint:latest", "tslint-config-prettier"] 3 | } 4 | --------------------------------------------------------------------------------